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

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 (528) hide show
  1. package/README.md +2 -0
  2. package/dist/.makaio-build.json +2 -2
  3. package/dist/{account-identity-DGpXd8h_.mjs → account-identity-B3vLwm9O.mjs} +1 -1
  4. package/dist/adapter-Dz1fX5Wa.mjs +1 -0
  5. package/dist/adapter-subsystem/index.d.mts +118 -76
  6. package/dist/adapter-subsystem/index.mjs +1 -1
  7. package/dist/adapters/claude/index.d.mts +5 -5
  8. package/dist/adapters/config/index.d.mts +1 -1
  9. package/dist/adapters/config/index.mjs +1 -1
  10. package/dist/adapters/index.d.mts +73 -53
  11. package/dist/adapters/index.mjs +6 -6
  12. package/dist/adapters/node.d.mts +1 -1
  13. package/dist/adapters/node.mjs +1 -1
  14. package/dist/adapters/stream-session/index.mjs +1 -1
  15. package/dist/{artifact-k3veR4Yx.mjs → artifact-Btbuib48.mjs} +1 -1
  16. package/dist/attach-error-Cb3GbeKe.mjs +1 -0
  17. package/dist/{auth-A1K_7q-8.mjs → auth-C6tVtaOX.mjs} +1 -1
  18. package/dist/{authority-state-bootstrap-YwtEImIB.mjs → authority-state-bootstrap-CLYus369.mjs} +1 -1
  19. package/dist/{automation-trigger-CuSdQwir.mjs → automation-trigger-ByjNlClm.mjs} +1 -1
  20. package/dist/bus/index.d.mts +22 -4
  21. package/dist/bus/index.mjs +1 -1
  22. package/dist/{bus-CqgrphNE.mjs → bus-D6NoBhIV.mjs} +1 -1
  23. package/dist/bus-UgFdHybD.mjs +1 -0
  24. package/dist/caller-owned-adapter-stub-C1M7FKrv.mjs +1 -0
  25. package/dist/{canonical-model-DJASlL4m.mjs → canonical-model-DXOvCaVg.mjs} +1 -1
  26. package/dist/capabilities-BUwuA7XX.mjs +1 -0
  27. package/dist/capability-j3NekkIu.mjs +1 -0
  28. package/dist/{client-BL5__WT0.mjs → client-BkznbdsO.mjs} +1 -1
  29. package/dist/clients/index.d.mts +1 -1
  30. package/dist/clients/index.mjs +1 -1
  31. package/dist/clients/managed-install.d.mts +1 -1
  32. package/dist/clients/managed-install.mjs +1 -1
  33. package/dist/code-execution/worker-entry.d.mts +21 -0
  34. package/dist/code-execution/worker-entry.mjs +1 -0
  35. package/dist/code-execution-Ckmn8OZu.mjs +1 -0
  36. package/dist/code-execution-CweDSWco.mjs +1 -0
  37. package/dist/code-execution-DqkQjKa1.mjs +1 -0
  38. package/dist/{compression-BbttSqm8.mjs → compression-CtgeVLpP.mjs} +1 -1
  39. package/dist/{config-namespace-CyzeLWSg.mjs → config-namespace-CjWvw8ij.mjs} +1 -1
  40. package/dist/{context-resolution-ya9TXKg-.d.mts → context-resolution-CW4OtPrS.d.mts} +3 -3
  41. package/dist/contracts/adapter/index.d.mts +3 -3
  42. package/dist/contracts/adapter/index.mjs +1 -1
  43. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  44. package/dist/contracts/artifact/index.d.mts +2 -2
  45. package/dist/contracts/artifact/index.mjs +1 -1
  46. package/dist/contracts/auth/index.d.mts +2 -2
  47. package/dist/contracts/auth/index.mjs +1 -1
  48. package/dist/contracts/automation-trigger/index.d.mts +3 -3
  49. package/dist/contracts/automation-trigger/index.mjs +1 -1
  50. package/dist/contracts/canonical-model/index.d.mts +1 -1
  51. package/dist/contracts/canonical-model/index.mjs +1 -1
  52. package/dist/contracts/capabilities/index.d.mts +1 -1
  53. package/dist/contracts/capabilities/index.mjs +1 -1
  54. package/dist/contracts/client/index.d.mts +2 -2
  55. package/dist/contracts/client/index.mjs +1 -1
  56. package/dist/contracts/code-execution/index.d.mts +2 -0
  57. package/dist/contracts/code-execution/index.mjs +1 -0
  58. package/dist/contracts/common/index.d.mts +1 -1
  59. package/dist/contracts/config/index.d.mts +1 -1
  60. package/dist/contracts/config/index.mjs +1 -1
  61. package/dist/contracts/extension/index.d.mts +5 -5
  62. package/dist/contracts/extension/index.mjs +1 -1
  63. package/dist/contracts/facet/index.d.mts +1 -1
  64. package/dist/contracts/facet/index.mjs +1 -1
  65. package/dist/contracts/harness/index.d.mts +1 -1
  66. package/dist/contracts/harness/index.mjs +1 -1
  67. package/dist/contracts/host/index.d.mts +1 -1
  68. package/dist/contracts/host/index.mjs +1 -1
  69. package/dist/contracts/index.d.mts +57 -47
  70. package/dist/contracts/index.mjs +1 -1
  71. package/dist/contracts/materialization/index.d.mts +3 -3
  72. package/dist/contracts/materialization/index.mjs +1 -1
  73. package/dist/contracts/model-registry/index.d.mts +1 -1
  74. package/dist/contracts/model-registry/index.mjs +1 -1
  75. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  76. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  77. package/dist/contracts/platform/index.d.mts +1 -1
  78. package/dist/contracts/platform/index.mjs +1 -1
  79. package/dist/contracts/provider/index.d.mts +2 -2
  80. package/dist/contracts/provider/index.mjs +1 -1
  81. package/dist/contracts/reaction/index.d.mts +1 -1
  82. package/dist/contracts/reaction/index.mjs +1 -1
  83. package/dist/contracts/session/index.d.mts +3 -3
  84. package/dist/contracts/session/index.mjs +1 -1
  85. package/dist/contracts/shared/index.d.mts +3 -3
  86. package/dist/contracts/shared/index.mjs +1 -1
  87. package/dist/contracts/skill/index.d.mts +1 -1
  88. package/dist/contracts/skill/index.mjs +1 -1
  89. package/dist/contracts/telemetry/index.d.mts +1 -1
  90. package/dist/contracts/telemetry/index.mjs +1 -1
  91. package/dist/contracts/timeout/index.d.mts +1 -1
  92. package/dist/contracts/timeout/index.mjs +1 -1
  93. package/dist/contracts/toast/index.mjs +1 -1
  94. package/dist/contracts/variant/index.d.mts +1 -1
  95. package/dist/contracts/variant/index.mjs +1 -1
  96. package/dist/contracts/worker-node/index.d.mts +1 -1
  97. package/dist/contracts/worker-node/index.mjs +1 -1
  98. package/dist/contracts/workflow/index.d.mts +2 -2
  99. package/dist/contracts/workflow/index.mjs +1 -1
  100. package/dist/{contribution-BB5bjx3f.d.mts → contribution-CUHLVLsT.d.mts} +2 -2
  101. package/dist/core/index.d.mts +25 -2
  102. package/dist/{definition-CDg-Jq1T.mjs → definition-BH4QLGLI.mjs} +1 -1
  103. package/dist/{definition-BYgHlmMw.d.mts → definition-DyGImhyi.d.mts} +1 -1
  104. package/dist/{detached-extension-handle-DKd17UB6.mjs → detached-extension-handle-D0aI0pJA.mjs} +1 -1
  105. package/dist/drizzle/0034_m_msha1388.sql +41 -0
  106. package/dist/drizzle/0035_m_mshgj6x7.sql +40 -0
  107. package/dist/drizzle/0036_m_msivwbgm.sql +1 -0
  108. package/dist/drizzle/0037_runtime_instance_incarnation_counter.sql +6 -0
  109. package/dist/drizzle/meta/_journal.json +28 -0
  110. package/dist/event-B8ELuk6k.mjs +1 -0
  111. package/dist/{execution-attempt-repository-DFyAnchJ.d.mts → execution-attempt-repository-BJ2W6wwx.d.mts} +1 -1
  112. package/dist/{execution-target-ByNwZh5-.mjs → execution-target-H0RWV7Py.mjs} +1 -1
  113. package/dist/{extension-DUmibvMk.mjs → extension-Bfkr2DBs.mjs} +1 -1
  114. package/dist/{extension-DMdmj9gi.mjs → extension-Cz39YNXy.mjs} +1 -1
  115. package/dist/{extension-discovery-Fhps4icD.d.mts → extension-discovery-Dhu3WplO.d.mts} +9 -1
  116. package/dist/{filesystem-service-FAtd9gWH.mjs → filesystem-service-CiUw0YN5.mjs} +1 -1
  117. package/dist/framework-packages-BHgul8Kl.mjs +1 -0
  118. package/dist/git/index.mjs +2 -2
  119. package/dist/{globby-BBLuT_vy.mjs → globby-QBDqstzq.mjs} +1 -1
  120. package/dist/handlers-BsHAFtye.mjs +57 -0
  121. package/dist/{harness-KxbWGL4I.mjs → harness-YQ2ewID9.mjs} +1 -1
  122. package/dist/{hook-responses-uCXAICTU.d.mts → hook-responses-9Ywsqzzq.d.mts} +1 -1
  123. package/dist/identity-OjRlG6dZ.mjs +1 -0
  124. package/dist/{index-Bl7KWFod.d.mts → index-4KJ6IDE7.d.mts} +7 -7
  125. package/dist/{index-CfiCJPP6.d.mts → index-B0VO0rAl.d.mts} +1 -1
  126. package/dist/{index-DI7-tIL3.d.mts → index-B0yMCJW8.d.mts} +39 -14
  127. package/dist/{index-BQprJNA_.d.mts → index-B9V3T4EQ.d.mts} +4 -4
  128. package/dist/{index-CqQYgsbB.d.mts → index-BNzUyVwV.d.mts} +513 -170
  129. package/dist/{index-CM75k-Ff.d.mts → index-BkbnC65b.d.mts} +189 -17
  130. package/dist/index-Bqk0pJBQ2.d.mts +138 -0
  131. package/dist/{index-CER64zYO.d.mts → index-BqlCDBfc.d.mts} +15 -15
  132. package/dist/{index-C-JzEkqs.d.mts → index-C146Eq_J.d.mts} +535 -1801
  133. package/dist/{index-e4Txan9i.d.mts → index-C3lu_fy5.d.mts} +76 -76
  134. package/dist/{index-C__EQfKa.d.mts → index-CIEycZrt.d.mts} +1 -1
  135. package/dist/{index-DxYDRoDE2.d.mts → index-CMekqu_D.d.mts} +28 -8
  136. package/dist/{index-nydhGvXa.d.mts → index-CPRQ4dWX.d.mts} +0 -23
  137. package/dist/{index-BSQ30wYP.d.mts → index-CPi0UpRh.d.mts} +1 -1
  138. package/dist/{index-BMVZs6pm.d.mts → index-CYjgoYeX.d.mts} +3 -3
  139. package/dist/{index-CSN_0sCo.d.mts → index-CmwAJ8-5.d.mts} +1 -1
  140. package/dist/index-Cny5RvjO.d.mts +800 -0
  141. package/dist/index-DHnSLGP4.d.mts +268 -0
  142. package/dist/{index-cPqSpWQC.d.mts → index-DJ2KgJDJ2.d.mts} +12 -12
  143. package/dist/index-DQ8o3JGi.d.mts +132 -0
  144. package/dist/index-DWBkiiXH.d.mts +18 -0
  145. package/dist/{index-B0xJgTi-.d.mts → index-DWkFkvRn2.d.mts} +7 -7
  146. package/dist/{index-1UcQWrZy.d.mts → index-DXqG0r3o.d.mts} +155 -155
  147. package/dist/index-Dg11JxKZ.d.mts +496 -0
  148. package/dist/{index-BtdK8HeH.d.mts → index-OG402CBI.d.mts} +43 -168
  149. package/dist/json-value-BBZ6uGwc.mjs +1 -0
  150. package/dist/json-value-DPqb-SJ8.d.mts +177 -0
  151. package/dist/kernel/cli/index.d.mts +2 -2
  152. package/dist/kernel/cli/index.mjs +1 -1
  153. package/dist/kernel/cli/register.d.mts +1 -1
  154. package/dist/kernel/cli/register.mjs +1 -1
  155. package/dist/kernel/cli/schemas.mjs +1 -1
  156. package/dist/kernel/extension/index.d.mts +1 -1
  157. package/dist/kernel/extension/index.mjs +1 -1
  158. package/dist/kernel/index.d.mts +5 -5
  159. package/dist/kernel/index.mjs +1 -1
  160. package/dist/kernel/namespace/index.d.mts +1 -1
  161. package/dist/kernel/namespace/index.mjs +1 -1
  162. package/dist/kernel/observability/index.d.mts +1 -1
  163. package/dist/kernel/observability/index.mjs +1 -1
  164. package/dist/kernel/providers/index.d.mts +1 -1
  165. package/dist/kernel/providers/index.mjs +1 -1
  166. package/dist/kernel/window/index.d.mts +1 -1
  167. package/dist/kernel/window/index.mjs +1 -1
  168. package/dist/{lib-CnOAtohU.mjs → lib-BpGvHZye.mjs} +2 -2
  169. package/dist/{lib-B_rJ6r0T.mjs → lib-Cm-uEoC1.mjs} +1 -1
  170. package/dist/{load-extensions-DUpaMQ7G.d.mts → load-extensions-BQoXaHhR.d.mts} +1 -1
  171. package/dist/{load-extensions-CW9uzNR5.mjs → load-extensions-DG5LvPyM.mjs} +1 -1
  172. package/dist/{materialization-CcpCDhXh.mjs → materialization-lVd9_-jr.mjs} +1 -1
  173. package/dist/mcp-http-server/index.mjs +1 -1
  174. package/dist/model-DrzPt3ou.mjs +1 -0
  175. package/dist/{namespace-B7bntOB8.mjs → namespace-BL7lHlmg.mjs} +1 -1
  176. package/dist/{namespace-BgEiY7r1.d.mts → namespace-BNp7n_gu.d.mts} +3 -3
  177. package/dist/{namespace-DSlfFhB1.d.mts → namespace-BRuHzhPo.d.mts} +154 -2
  178. package/dist/{namespace-ChnRTUG4.d.mts → namespace-C06lJSuj.d.mts} +6 -6
  179. package/dist/{namespace-C6CVEGH8.d.mts → namespace-DknCutQZ.d.mts} +50 -0
  180. package/dist/namespace-sCPb79-7.mjs +1 -0
  181. package/dist/{native-session-supervisor-fZYPUk0-.mjs → native-session-supervisor-LKio8XZn.mjs} +1 -1
  182. package/dist/node/bus-server/index.d.mts +1 -1
  183. package/dist/node/bus-server/index.mjs +1 -1
  184. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  185. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  186. package/dist/npm-package-name-DuTYVICk.mjs +1 -0
  187. package/dist/orchestrator-shared-BGlN-m-V.mjs +1 -0
  188. package/dist/{orchestrator-shared-B-KRW1Z0.d.mts → orchestrator-shared-CNHSImNY.d.mts} +9 -10
  189. package/dist/ownership-memory-handler-BpGdR_uG.mjs +1 -0
  190. package/dist/ownership-recovery-guard-DyW5vGBr.mjs +1 -0
  191. package/dist/{package-ypz4rKvn.mjs → package-B01gmu75.mjs} +1 -1
  192. package/dist/{package-Bf3hyuzs.d.mts → package-BNFTUFLB.d.mts} +2 -2
  193. package/dist/package-DttKA9wN.mjs +1 -0
  194. package/dist/{package-CddkNbZI.mjs → package-JtjbO-Oi.mjs} +1 -1
  195. package/dist/package.json +1 -1
  196. package/dist/{profile-BtznZlq3.mjs → profile-N5qGUpF0.mjs} +1 -1
  197. package/dist/{provider-context-Dh-VOOYF.mjs → provider-context-CG42JlP9.mjs} +1 -1
  198. package/dist/{provider-context-BrLZYnDW.mjs → provider-context-zTDSH2x9.mjs} +1 -1
  199. package/dist/{reaction-BS0k4eNN.mjs → reaction-D3TNwPK8.mjs} +1 -1
  200. package/dist/{registry-BO_bOoky.mjs → registry-Dk12tAfv.mjs} +1 -1
  201. package/dist/{resolved-DMByz1_2.mjs → resolved-sq8RXNDf.mjs} +1 -1
  202. package/dist/rules/index.d.mts +1 -1
  203. package/dist/rules/index.mjs +1 -1
  204. package/dist/rules/schemas.d.mts +1 -1
  205. package/dist/rules/schemas.mjs +1 -1
  206. package/dist/runtime-bun/index.mjs +1 -1
  207. package/dist/runtime-node/code-execution/index.d.mts +3 -0
  208. package/dist/runtime-node/code-execution/index.mjs +1 -0
  209. package/dist/runtime-node/extension-discovery.d.mts +2 -2
  210. package/dist/runtime-node/extension-discovery.mjs +1 -1
  211. package/dist/runtime-node/extension-validation.d.mts +1 -1
  212. package/dist/runtime-node/extension-validation.mjs +1 -1
  213. package/dist/runtime-node/index.d.mts +6 -4
  214. package/dist/runtime-node/index.mjs +24 -24
  215. package/dist/runtime-node/makaio-config.d.mts +1 -1
  216. package/dist/runtime-node/makaio-config.mjs +1 -1
  217. package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
  218. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  219. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  220. package/dist/{schema-DKTzriEY.d.mts → schema-B3Pf7JP7.d.mts} +250 -3
  221. package/dist/{schema-DBG7Jq5_.mjs → schema-Dq-7si8u.mjs} +1 -1
  222. package/dist/{schemas-DSkBOdx_.mjs → schemas-BfO5jkrL.mjs} +1 -1
  223. package/dist/{schemas-B7zo7Zcx.d.mts → schemas-C1mxTfd7.d.mts} +60 -4
  224. package/dist/schemas-C3kyQWGf.mjs +1 -0
  225. package/dist/{schemas-B3bfVYcL.d.mts → schemas-CF8QwRqt.d.mts} +2 -0
  226. package/dist/{schemas-DZH9lpxs.d.mts → schemas-OWvBn7AH.d.mts} +4 -4
  227. package/dist/{schemas-CsjN7cmM.mjs → schemas-QWDnauKX.mjs} +1 -1
  228. package/dist/schemas-TK29KWx-.mjs +1 -0
  229. package/dist/schemas-_2Syo_01.mjs +1 -0
  230. package/dist/scoped-bus-DoPmCJeM.mjs +1 -0
  231. package/dist/{selection-7Ku8DBnh.mjs → selection-DL3ric7K.mjs} +1 -1
  232. package/dist/services/adapter-runtime/index.d.mts +4 -4
  233. package/dist/services/adapter-runtime/index.mjs +1 -1
  234. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  235. package/dist/services/adapter-runtime/schemas.d.mts +2 -2
  236. package/dist/services/adapter-runtime/schemas.mjs +1 -1
  237. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  238. package/dist/services/adapter-subsystem/index.mjs +1 -1
  239. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  240. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  241. package/dist/services/agent-runtime/index.d.mts +2 -2
  242. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  243. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  244. package/dist/services/automation-trigger/index.mjs +1 -1
  245. package/dist/services/capability/index.d.mts +3 -2
  246. package/dist/services/capability/index.mjs +1 -1
  247. package/dist/services/code-execution/index.d.mts +2 -0
  248. package/dist/services/code-execution/index.mjs +1 -0
  249. package/dist/services/codebase/index.d.mts +2 -2
  250. package/dist/services/codebase/namespace.d.mts +1 -1
  251. package/dist/services/codebase/schemas.d.mts +1 -1
  252. package/dist/services/compression/index.d.mts +2 -2
  253. package/dist/services/compression/namespace.d.mts +1 -1
  254. package/dist/services/compression/schemas.d.mts +1 -1
  255. package/dist/services/context-rules/index.d.mts +1 -1
  256. package/dist/services/context-rules/index.mjs +1 -1
  257. package/dist/services/execution-target/index.d.mts +3 -3
  258. package/dist/services/execution-target/index.mjs +1 -1
  259. package/dist/services/execution-target/namespace.d.mts +1 -1
  260. package/dist/services/execution-target/namespace.mjs +1 -1
  261. package/dist/services/execution-target/schemas.d.mts +1 -1
  262. package/dist/services/execution-target/schemas.mjs +1 -1
  263. package/dist/services/filesystem/index.d.mts +1 -1
  264. package/dist/services/filesystem/index.mjs +1 -1
  265. package/dist/services/filesystem/namespace.d.mts +6 -6
  266. package/dist/services/filesystem/schemas.d.mts +3 -3
  267. package/dist/services/git/namespace.d.mts +18 -0
  268. package/dist/services/git/namespace.mjs +1 -1
  269. package/dist/services/git/schemas.d.mts +10 -1
  270. package/dist/services/git/schemas.mjs +1 -1
  271. package/dist/services/harness/index.d.mts +3 -3
  272. package/dist/services/harness/index.mjs +1 -1
  273. package/dist/services/index.d.mts +159 -59
  274. package/dist/services/index.mjs +1 -1
  275. package/dist/services/log-import/browser.d.mts +2 -2
  276. package/dist/services/log-import/index.d.mts +2 -2
  277. package/dist/services/log-import/log-import.d.mts +1 -1
  278. package/dist/services/log-import/log-import.mjs +1 -1
  279. package/dist/services/log-import/namespace.mjs +1 -1
  280. package/dist/services/log-import/schemas.mjs +1 -1
  281. package/dist/services/materialization/index.d.mts +1 -1
  282. package/dist/services/materialization/index.mjs +1 -1
  283. package/dist/services/model-registry/index.d.mts +1 -1
  284. package/dist/services/model-registry/index.mjs +1 -1
  285. package/dist/services/preferences/index.d.mts +2 -2
  286. package/dist/services/preferences/schemas.d.mts +1 -1
  287. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  288. package/dist/services/provider-context/index.d.mts +1 -1
  289. package/dist/services/provider-context/index.mjs +1 -1
  290. package/dist/services/provider-runtime/index.mjs +1 -1
  291. package/dist/services/session/handlers/index.d.mts +1 -1
  292. package/dist/services/session/handlers/index.mjs +1 -1
  293. package/dist/services/session/index.d.mts +10 -10
  294. package/dist/services/session/index.mjs +1 -1
  295. package/dist/services/session/messages/namespace.d.mts +1 -1
  296. package/dist/services/session/messages/namespace.mjs +1 -1
  297. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  298. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  299. package/dist/services/session/session-events/namespace.d.mts +1 -1
  300. package/dist/services/session/session-events/namespace.mjs +1 -1
  301. package/dist/services/session/storage/namespace.d.mts +1 -1
  302. package/dist/services/session/storage/schema.d.mts +2 -2
  303. package/dist/services/session/storage/schema.mjs +1 -1
  304. package/dist/services/session/testing/index.d.mts +22 -1
  305. package/dist/services/session/testing/index.mjs +38 -14
  306. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  307. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  308. package/dist/services/session/turns/namespace.d.mts +1 -1
  309. package/dist/services/session/turns/namespace.mjs +1 -1
  310. package/dist/services/session-editor/index.d.mts +1 -1
  311. package/dist/services/session-editor/index.mjs +1 -1
  312. package/dist/services/settings/index.d.mts +3 -3
  313. package/dist/services/settings/index.mjs +1 -1
  314. package/dist/services/settings/namespace.mjs +1 -1
  315. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  316. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  317. package/dist/services/settings/storage/index.d.mts +3 -3
  318. package/dist/services/settings/storage/index.mjs +1 -1
  319. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  320. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  321. package/dist/services/subagent/index.d.mts +1 -1
  322. package/dist/services/subagent/index.mjs +1 -1
  323. package/dist/services/subagent-template/index.d.mts +2 -2
  324. package/dist/services/subagent-template/namespace.d.mts +1 -1
  325. package/dist/services/subagent-template/schemas.d.mts +1 -1
  326. package/dist/services/tool-approval/index.d.mts +1 -1
  327. package/dist/services/tool-approval/index.mjs +1 -1
  328. package/dist/services/tools/index.d.mts +1 -1
  329. package/dist/services/tools/index.mjs +1 -1
  330. package/dist/services/tray-menu/index.d.mts +3 -3
  331. package/dist/services/tray-menu/index.mjs +1 -1
  332. package/dist/services/tray-menu/namespace.d.mts +1 -1
  333. package/dist/services/tray-menu/schemas.d.mts +1 -1
  334. package/dist/services/turn/index.d.mts +1 -1
  335. package/dist/services/turn/namespace.d.mts +1 -1
  336. package/dist/services/workflow-transitions/index.d.mts +1 -1
  337. package/dist/services/workflow-transitions/index.mjs +1 -1
  338. package/dist/session-BOpTI79g.mjs +1 -0
  339. package/dist/session-CXOPk3yg.mjs +95 -0
  340. package/dist/{shared-BFVuCDPx.mjs → shared-B9AWRm9A.mjs} +1 -1
  341. package/dist/{skill-C1D51nhh.mjs → skill-DGNtc_ww.mjs} +1 -1
  342. package/dist/{src-xbmzokNe.mjs → src-BmSQ3rlz.mjs} +1 -1
  343. package/dist/storage/drizzle/client.d.mts +1 -1
  344. package/dist/storage/drizzle/client.mjs +1 -1
  345. package/dist/storage/drizzle/index.d.mts +41 -2
  346. package/dist/storage/drizzle/index.mjs +1 -1
  347. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  348. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  349. package/dist/storage/handlers/index.d.mts +1 -1
  350. package/dist/storage/handlers/index.mjs +1 -1
  351. package/dist/tool-approval-service-BFDOFUGC.mjs +1 -0
  352. package/dist/{tools-DxwHox1a.mjs → tools-DWKWX3eV.mjs} +1 -1
  353. package/dist/{transition-C_Ka6b0-.d.mts → transition-DXmCUq6w.d.mts} +6 -6
  354. package/dist/{types-BNjPhj_a.d.mts → types-CtDGkyLx2.d.mts} +1 -1
  355. package/dist/types-Cwza95hS.mjs +1 -0
  356. package/dist/{types-CwvN4uN2.d.mts → types-DcxBYlPA.d.mts} +3018 -38
  357. package/dist/types-DnK6Wa_Y.d.mts +260 -0
  358. package/dist/{types-ClpEaoAm.d.mts → types-OKJCOjme.d.mts} +24 -4
  359. package/dist/ui-components/index.d.mts +4 -4
  360. package/dist/ui-kernel/index.d.mts +1 -1
  361. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  362. package/dist/utils/index.d.mts +22 -1
  363. package/dist/utils/index.mjs +2 -2
  364. package/dist/utils/project-manifest.mjs +1 -1
  365. package/dist/{version-BfNnVAGr.mjs → version-BYeVh1pI.mjs} +1 -1
  366. package/dist/{view-builder-KYsPqV-5.d.mts → view-builder-k82f5KFd.d.mts} +4 -4
  367. package/dist/{visibility-Dl1o2I01.mjs → visibility-DtDLRBdr.mjs} +1 -1
  368. package/dist/worker-node-CjuQb9hl.mjs +1 -0
  369. package/dist/{worker-node-DJ41Tr-F.mjs → worker-node-Dtf9ilsR.mjs} +1 -1
  370. package/dist/workflow-C4mck_NW.mjs +1 -0
  371. package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
  372. package/dist/workflow-engine/index.d.mts +103 -103
  373. package/dist/workflow-engine/index.mjs +1 -1
  374. package/dist/workflow-engine/package.d.mts +1 -1
  375. package/dist/workflow-engine/package.mjs +1 -1
  376. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  377. package/dist/workflow-engine/testing/index.d.mts +2 -2
  378. package/dist/workflow-engine/testing/index.mjs +1 -1
  379. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  380. package/dist/workflow-engine/testing/sqlite.mjs +1 -1
  381. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  382. package/dist/{workflow-transitions-DM0fN_eP.mjs → workflow-transitions-c_VQbyV0.mjs} +1 -1
  383. package/dist/workflow-worker-aNbdgqml.mjs +1 -0
  384. package/package.json +18 -1
  385. package/dist/adapter-BkdJaOOG.mjs +0 -1
  386. package/dist/agent-namespace-D51PODFf.mjs +0 -1
  387. package/dist/attach-error-BSlc7JfL.mjs +0 -1
  388. package/dist/bus-BIj0_aG6.mjs +0 -1
  389. package/dist/capabilities-Bqckjh7G.mjs +0 -1
  390. package/dist/capability-service-CJHNkjvm.mjs +0 -1
  391. package/dist/event-DR8U9Efx.mjs +0 -1
  392. package/dist/framework-packages-D_2hBZ-p.mjs +0 -1
  393. package/dist/handlers-2yd00VEq.mjs +0 -57
  394. package/dist/identity-DC3Pk0ps.mjs +0 -1
  395. package/dist/index-OsbtyMgx2.d.mts +0 -98
  396. package/dist/json-value-C1RGgS0a.d.mts +0 -72
  397. package/dist/json-value-D57aJhVn.mjs +0 -1
  398. package/dist/model-ZH3L1dPW.mjs +0 -1
  399. package/dist/namespace-CxrOLeeP.mjs +0 -1
  400. package/dist/orchestrator-shared-CTCZc6Vl.mjs +0 -1
  401. package/dist/ownership-memory-handler-Bblp93YC.mjs +0 -1
  402. package/dist/schemas-BqD8LlQw.mjs +0 -1
  403. package/dist/schemas-CvHFbzdy.mjs +0 -1
  404. package/dist/schemas-DplrlAyR.mjs +0 -1
  405. package/dist/scoped-bus-ClwTWqX8.mjs +0 -1
  406. package/dist/session-BMy2kRpX.mjs +0 -90
  407. package/dist/session-Cipx34j6.mjs +0 -1
  408. package/dist/tool-approval-service-BVgN9Q1r.mjs +0 -1
  409. package/dist/worker-node-BDOYPEpi.mjs +0 -1
  410. package/dist/workflow-Hzc5jlnV.mjs +0 -1
  411. package/dist/workflow-worker-DARC7UZl.mjs +0 -1
  412. /package/dist/{adapter-auth-runtime-D9Lnl7cc.mjs → adapter-auth-runtime-DHHppU4f.mjs} +0 -0
  413. /package/dist/{adapter-binding-B-FBoCys.d.mts → adapter-binding-CATvmGuz.d.mts} +0 -0
  414. /package/dist/{ajv-L5fKxaia.mjs → ajv-krzJXh1X.mjs} +0 -0
  415. /package/dist/{attempt-record-codec-DaFLKR5C.mjs → attempt-record-codec-BYfYkj4M.mjs} +0 -0
  416. /package/dist/{await-trigger-ph1S0zVI.mjs → await-trigger-Bkg2BQfg.mjs} +0 -0
  417. /package/dist/{base-orchestrator-D9u4NyiM.d.mts → base-orchestrator-B4YW6z_Q.d.mts} +0 -0
  418. /package/dist/{index-Ol9RBB0W2.d.mts → capability-service-BW1-teFU.d.mts} +0 -0
  419. /package/dist/{client-4ihewPUm.d.mts → client-BG0WX5Vz.d.mts} +0 -0
  420. /package/dist/{client-binary-version-verifier-DJajc_Ff.mjs → client-binary-version-verifier-0lCKZOTg.mjs} +0 -0
  421. /package/dist/{client-binary-version-verifier-jDDZ64Ah.d.mts → client-binary-version-verifier-lcv83Hq3.d.mts} +0 -0
  422. /package/dist/{clients-namespace-DFWuUawf.d.mts → clients-namespace-DLAjOTTb.d.mts} +0 -0
  423. /package/dist/{config-namespace-D1kyZj0B.d.mts → config-namespace-CH7sJZ4f.d.mts} +0 -0
  424. /package/dist/{create-static-mount-9tnGpIeK.mjs → create-static-mount-DxuixuLZ.mjs} +0 -0
  425. /package/dist/{cross-spawn-BIgueAqr.mjs → cross-spawn-CZygZJMH.mjs} +0 -0
  426. /package/dist/{cursor-storage-ROWfiTh1.mjs → cursor-storage-bsc9lZKk.mjs} +0 -0
  427. /package/dist/{definition-DB-kKc0d.d.mts → definition-BrgzUuFk.d.mts} +0 -0
  428. /package/dist/{definitions-CF6YmEhL.mjs → definitions-CRpdnHYM.mjs} +0 -0
  429. /package/dist/{descriptor-to-package-BecVCopf.mjs → descriptor-to-package-CcjdoWP4.mjs} +0 -0
  430. /package/dist/{drizzle-CPv3vdTE.mjs → drizzle-Bzc-OGVI.mjs} +0 -0
  431. /package/dist/{esm-CBFWM8u_.mjs → esm-i-S5TW72.mjs} +0 -0
  432. /package/dist/{extension-context-DzB7ydM3.d.mts → extension-context-QmFuHdq5.d.mts} +0 -0
  433. /package/dist/{extension-namespace-B554RmCp.mjs → extension-namespace-QoTTwKPt.mjs} +0 -0
  434. /package/dist/{extension-package-provenance-Dh_-Z-tE.mjs → extension-package-provenance-aYrZuS4W.mjs} +0 -0
  435. /package/dist/{facet-DVsW12iF.mjs → facet-BnMh7Jyc.mjs} +0 -0
  436. /package/dist/{filesystem-service-Cm2RHKBa.d.mts → filesystem-service-ZJ43SbBi.d.mts} +0 -0
  437. /package/dist/{handler-Bqlk-6BY.mjs → handler-DF1fVDpf.mjs} +0 -0
  438. /package/dist/{host-k5yoyKHg.mjs → host-B-_ntOMH.mjs} +0 -0
  439. /package/dist/{index--atUpi5l2.d.mts → index-8NdPPzUh2.d.mts} +0 -0
  440. /package/dist/{index-DwLRZscE.d.mts → index-8y4hT9WL.d.mts} +0 -0
  441. /package/dist/{index-C7HcDpHE.d.mts → index-B-3I98nw.d.mts} +0 -0
  442. /package/dist/{index-BcvqDfcN.d.mts → index-B2Y1Wvbh.d.mts} +0 -0
  443. /package/dist/{index-BRCrFirq.d.mts → index-B4svZC6L.d.mts} +0 -0
  444. /package/dist/{index-CQuRTeRa.d.mts → index-B5dP8rj6.d.mts} +0 -0
  445. /package/dist/{index-CRmE88hi.d.mts → index-BC-6qNeo.d.mts} +0 -0
  446. /package/dist/{index-CxSSdIZz.d.mts → index-BFWvT0NG.d.mts} +0 -0
  447. /package/dist/{index-DP3o_13U.d.mts → index-BM56936c.d.mts} +0 -0
  448. /package/dist/{index-BVcQcphK.d.mts → index-BMRB9yhF.d.mts} +0 -0
  449. /package/dist/{index-bIe_57cL.d.mts → index-BTEJfzjE.d.mts} +0 -0
  450. /package/dist/{index-DgOfgjx3.d.mts → index-BfV8U4XX.d.mts} +0 -0
  451. /package/dist/{index-DBadVauL.d.mts → index-BmevAPME2.d.mts} +0 -0
  452. /package/dist/{index-OADt3xlS.d.mts → index-BuMsrli0.d.mts} +0 -0
  453. /package/dist/{index-BJAB-BW_.d.mts → index-C4V8Pmi4.d.mts} +0 -0
  454. /package/dist/{index-aoxdnhJ42.d.mts → index-CL0Jo1b92.d.mts} +0 -0
  455. /package/dist/{index-CvW9_SzR.d.mts → index-CVpaGijY.d.mts} +0 -0
  456. /package/dist/{index-E4SET1AA.d.mts → index-CmbkCxj-.d.mts} +0 -0
  457. /package/dist/{index-BgGe9WZz.d.mts → index-CqdMbYmR.d.mts} +0 -0
  458. /package/dist/{index-BeENojSx2.d.mts → index-DgspOUa72.d.mts} +0 -0
  459. /package/dist/{index-42UdYStR.d.mts → index-Ek4y8M9J2.d.mts} +0 -0
  460. /package/dist/{index-Beo_Ik8-.d.mts → index-VzLAV0Yt.d.mts} +0 -0
  461. /package/dist/{index-BSbGB23v.d.mts → index-jxPncqWZ2.d.mts} +0 -0
  462. /package/dist/{index-Bqm0ahTQ.d.mts → index-kzIjbrS02.d.mts} +0 -0
  463. /package/dist/{index-BJMezANn.d.mts → index-l01zsChf.d.mts} +0 -0
  464. /package/dist/{index-CK3f0bAL.d.mts → index-pvX-BIpr2.d.mts} +0 -0
  465. /package/dist/{jsonl-transport-Bp_6pB2a.mjs → jsonl-transport-Cyyh5Wje.mjs} +0 -0
  466. /package/dist/{lib-Bwdd2m81.mjs → lib-BqV8hYtk.mjs} +0 -0
  467. /package/dist/{model-registry-yURX738J.mjs → model-registry-C9rFu3kV.mjs} +0 -0
  468. /package/dist/{model-registry-Y854mUml.mjs → model-registry-Cixxx2jv.mjs} +0 -0
  469. /package/dist/{modes-DmUsjHdV.mjs → modes-DwsJ3yVl.mjs} +0 -0
  470. /package/dist/{namespace-ByP1Iipi.d.mts → namespace-B0ftHlK3.d.mts} +0 -0
  471. /package/dist/{namespace-C1D77w7U.d.mts → namespace-BGRHcrmp.d.mts} +0 -0
  472. /package/dist/{namespace-Bi3CmYQy.d.mts → namespace-BUYDmd0r.d.mts} +0 -0
  473. /package/dist/{namespace-CkBbNFSU.mjs → namespace-BW3Bfu9h.mjs} +0 -0
  474. /package/dist/{namespace-DX1Ec15L.d.mts → namespace-BdAK0lD8.d.mts} +0 -0
  475. /package/dist/{namespace-Dgg0uoe6.d.mts → namespace-CPG6u60N.d.mts} +0 -0
  476. /package/dist/{namespace-BusZERU8.d.mts → namespace-CVFaZv8x.d.mts} +0 -0
  477. /package/dist/{namespace-yREpGJgG.d.mts → namespace-DBO1OzYB.d.mts} +0 -0
  478. /package/dist/{namespace-CrDlawqu.d.mts → namespace-DOezqDti.d.mts} +0 -0
  479. /package/dist/{namespace-CfIW0hpQ.mjs → namespace-DiwqpB-c.mjs} +0 -0
  480. /package/dist/{namespace-s2y_NFKf.d.mts → namespace-DqZweTbX.d.mts} +0 -0
  481. /package/dist/{namespace-CFjdyNXG.mjs → namespace-Du0accdE.mjs} +0 -0
  482. /package/dist/{namespace-BFqkUTJp.mjs → namespace-NXm_zvL1.mjs} +0 -0
  483. /package/dist/{namespace-B9FEGuEu.mjs → namespace-jVTsuZHX.mjs} +0 -0
  484. /package/dist/{namespace-DwZwGXgF.d.mts → namespace-l-HG1rLF.d.mts} +0 -0
  485. /package/dist/{namespace-DbNWsPFY.mjs → namespace-tjoxekmf.mjs} +0 -0
  486. /package/dist/{out-DrhwCgqM.mjs → out-8bOYN6EF.mjs} +0 -0
  487. /package/dist/{package-CBdvjyyZ.mjs → package-EGTn-Ng1.mjs} +0 -0
  488. /package/dist/{packages-FBv3fAOR.mjs → packages-Bp124-gx.mjs} +0 -0
  489. /package/dist/{packages-N3-2Kl-Y.d.mts → packages-CxPMEg8D.d.mts} +0 -0
  490. /package/dist/{platform-BrsMv_S3.mjs → platform-CxyYPrkf.mjs} +0 -0
  491. /package/dist/{provider-operation-DJ_TLZFf.d.mts → provider-operation-DbdyFwNm.d.mts} +0 -0
  492. /package/dist/{providers-CCcn4Ndp.mjs → providers-C-eekMxD.mjs} +0 -0
  493. /package/dist/{providers-namespace-DeJBh6MP.d.mts → providers-namespace-CfZKp-C0.d.mts} +0 -0
  494. /package/dist/{quick-lru-uwB0hP-y.mjs → quick-lru-CCEnf7y6.mjs} +0 -0
  495. /package/dist/{schema-jIapW8Kb.mjs → schema-C0opCPww.mjs} +0 -0
  496. /package/dist/{schema-introspection-C1wvklj9.mjs → schema-introspection-6-r_KEJQ.mjs} +0 -0
  497. /package/dist/{schemas-CeUI2i5j.d.mts → schemas-B50oWBuj.d.mts} +0 -0
  498. /package/dist/{schemas-CD0wOQxx.d.mts → schemas-B6Q-qdmn.d.mts} +0 -0
  499. /package/dist/{schemas-DgwEVUt-.mjs → schemas-B8hKbBwI.mjs} +0 -0
  500. /package/dist/{schemas-sMoRnBdZ.d.mts → schemas-BGvkTiCx.d.mts} +0 -0
  501. /package/dist/{schemas-BNdiVBWh.mjs → schemas-BivbWRkG.mjs} +0 -0
  502. /package/dist/{schemas-Cg-Kwp8c.d.mts → schemas-ChmQldVH.d.mts} +0 -0
  503. /package/dist/{schemas-VbB1FTxx.d.mts → schemas-D7ScxLrf.d.mts} +0 -0
  504. /package/dist/{schemas-DvMbcABQ.d.mts → schemas-Dd0po67F.d.mts} +0 -0
  505. /package/dist/{schemas-Cv3rR9Sz.d.mts → schemas-Pe892GgN.d.mts} +0 -0
  506. /package/dist/{schemas-qA279_j_.d.mts → schemas-bfZNpl0B.d.mts} +0 -0
  507. /package/dist/{schemas-mLpOfMoN.mjs → schemas-scyC2tFF.mjs} +0 -0
  508. /package/dist/{semver-DTXuyLcK.mjs → semver-BI7kTNsY.mjs} +0 -0
  509. /package/dist/{server-lifecycle-DKx_fWlq.mjs → server-lifecycle-B_OZnoe-.mjs} +0 -0
  510. /package/dist/{server-lifecycle-C_8iKgat.d.mts → server-lifecycle-L8zja8t8.d.mts} +0 -0
  511. /package/dist/{session-lineage-D5E142LU.d.mts → session-lineage-bUkd3fqx.d.mts} +0 -0
  512. /package/dist/{shared-schemas-aahW97QW.mjs → shared-schemas-CQ6blrEW.mjs} +0 -0
  513. /package/dist/{src-DHqsl5Pg.mjs → src-BacfeiI4.mjs} +0 -0
  514. /package/dist/{storage-namespace-Dz2jsssp.mjs → storage-namespace-BZce8kkW.mjs} +0 -0
  515. /package/dist/{storage-namespace-Tf3P5yJ5.d.mts → storage-namespace-YmE8XCCL.d.mts} +0 -0
  516. /package/dist/{storage-namespace-definition-CDef0E20.mjs → storage-namespace-definition-Cca-zwXU.mjs} +0 -0
  517. /package/dist/{supports-color-i7OTnKcZ.mjs → supports-color-SV_FgSN2.mjs} +0 -0
  518. /package/dist/{telemetry-BvCBUjFg.mjs → telemetry-BqoC87F-.mjs} +0 -0
  519. /package/dist/{timeout-B0nYjLc8.mjs → timeout-DVlN2Zhy.mjs} +0 -0
  520. /package/dist/{tray-menu-service-Deo6yyP8.mjs → tray-menu-service-eVVxgPLc.mjs} +0 -0
  521. /package/dist/{types-xCdGghb2.d.mts → types-BlB23n4f.d.mts} +0 -0
  522. /package/dist/{types-CNS55jvt.d.mts → types-DdpSEmTO.d.mts} +0 -0
  523. /package/dist/{types-Ce6LL25v.d.mts → types-tyv0B605.d.mts} +0 -0
  524. /package/dist/{ui-config-BIyGzMNL.mjs → ui-config-B35GloSX.mjs} +0 -0
  525. /package/dist/{variant-B4uWdxW7.mjs → variant-Dwnge3J_.mjs} +0 -0
  526. /package/dist/{window-registry-CoBJq3u4.mjs → window-registry-CKiMJjId.mjs} +0 -0
  527. /package/dist/{window-registry-BLtVx3Iw.d.mts → window-registry-Pcf35cac.d.mts} +0 -0
  528. /package/dist/{zod-json-schema-BAGAFfCN.mjs → zod-json-schema-Dixc-B1T.mjs} +0 -0
@@ -1,5 +1,6 @@
1
- import { a as JsonValue$1 } from "./json-value-C1RGgS0a.mjs";
2
- import { s as MessageBlock$1 } from "./index-CSN_0sCo.mjs";
1
+ import { l as JsonValue$1 } from "./json-value-DPqb-SJ8.mjs";
2
+ import { s as MessageBlock$1 } from "./index-CmwAJ8-5.mjs";
3
+ import { t as ContractStorageNamespaceDefinition } from "./storage-namespace-definition-BsnYAPot.mjs";
3
4
  import * as _$zod from "zod";
4
5
  import { z } from "zod";
5
6
  import * as _$_makaio_core0 from "@makaio/framework/core";
@@ -106,6 +107,11 @@ declare const MakaioSessionAgentSchema$1: z.ZodObject<{
106
107
  adapterId: z.ZodString;
107
108
  adapterName: z.ZodString;
108
109
  sessionId: z.ZodString;
110
+ runtimeOwner: z.ZodOptional<z.ZodObject<{
111
+ machineId: z.ZodString;
112
+ instanceId: z.ZodString;
113
+ }, z.core.$strip>>;
114
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
109
115
  adapterSessionId: z.ZodOptional<z.ZodString>;
110
116
  currentAdapterSessionId: z.ZodOptional<z.ZodString>;
111
117
  currentAdapterSessionIdState: z.ZodOptional<z.ZodEnum<{
@@ -162,6 +168,11 @@ declare const MakaioSessionSchema: z.ZodObject<{
162
168
  adapterId: z.ZodString;
163
169
  adapterName: z.ZodString;
164
170
  sessionId: z.ZodString;
171
+ runtimeOwner: z.ZodOptional<z.ZodObject<{
172
+ machineId: z.ZodString;
173
+ instanceId: z.ZodString;
174
+ }, z.core.$strip>>;
175
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
165
176
  adapterSessionId: z.ZodOptional<z.ZodString>;
166
177
  currentAdapterSessionId: z.ZodOptional<z.ZodString>;
167
178
  currentAdapterSessionIdState: z.ZodOptional<z.ZodEnum<{
@@ -305,6 +316,11 @@ declare const SessionWithPreviewSchema: z.ZodObject<{
305
316
  adapterId: z.ZodString;
306
317
  adapterName: z.ZodString;
307
318
  sessionId: z.ZodString;
319
+ runtimeOwner: z.ZodOptional<z.ZodObject<{
320
+ machineId: z.ZodString;
321
+ instanceId: z.ZodString;
322
+ }, z.core.$strip>>;
323
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
308
324
  adapterSessionId: z.ZodOptional<z.ZodString>;
309
325
  currentAdapterSessionId: z.ZodOptional<z.ZodString>;
310
326
  currentAdapterSessionIdState: z.ZodOptional<z.ZodEnum<{
@@ -522,6 +538,11 @@ declare const SessionSnapshotSchema: z.ZodObject<{
522
538
  adapterId: z.ZodString;
523
539
  adapterName: z.ZodString;
524
540
  sessionId: z.ZodString;
541
+ runtimeOwner: z.ZodOptional<z.ZodObject<{
542
+ machineId: z.ZodString;
543
+ instanceId: z.ZodString;
544
+ }, z.core.$strip>>;
545
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
525
546
  adapterSessionId: z.ZodOptional<z.ZodString>;
526
547
  currentAdapterSessionId: z.ZodOptional<z.ZodString>;
527
548
  currentAdapterSessionIdState: z.ZodOptional<z.ZodEnum<{
@@ -650,6 +671,11 @@ declare const SessionSnapshotSchema: z.ZodObject<{
650
671
  adapterId: z.ZodString;
651
672
  adapterName: z.ZodString;
652
673
  sessionId: z.ZodString;
674
+ runtimeOwner: z.ZodOptional<z.ZodObject<{
675
+ machineId: z.ZodString;
676
+ instanceId: z.ZodString;
677
+ }, z.core.$strip>>;
678
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
653
679
  adapterSessionId: z.ZodOptional<z.ZodString>;
654
680
  currentAdapterSessionId: z.ZodOptional<z.ZodString>;
655
681
  currentAdapterSessionIdState: z.ZodOptional<z.ZodEnum<{
@@ -1526,8 +1552,8 @@ type Turn$1 = z.infer<typeof TurnSchema$1>;
1526
1552
  */
1527
1553
  declare const MessageRoutingStatusSchema: z.ZodEnum<{
1528
1554
  completed: "completed";
1529
- sent: "sent";
1530
1555
  acknowledged: "acknowledged";
1556
+ sent: "sent";
1531
1557
  }>;
1532
1558
  type MessageRoutingStatus = z.infer<typeof MessageRoutingStatusSchema>;
1533
1559
  /**
@@ -1538,8 +1564,8 @@ declare const MessageRoutingSchema$1: z.ZodObject<{
1538
1564
  agentId: z.ZodString;
1539
1565
  status: z.ZodEnum<{
1540
1566
  completed: "completed";
1541
- sent: "sent";
1542
1567
  acknowledged: "acknowledged";
1568
+ sent: "sent";
1543
1569
  }>;
1544
1570
  timestamp: z.ZodNumber;
1545
1571
  error: z.ZodOptional<z.ZodString>;
@@ -2522,7 +2548,7 @@ declare const OrchestratorSchemas: {
2522
2548
  systemPrompt: "systemPrompt";
2523
2549
  fullPrefix: "fullPrefix";
2524
2550
  }>>;
2525
- turnContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
2551
+ turnContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue>>>>;
2526
2552
  requestCorrelation: z.ZodOptional<z.ZodObject<{
2527
2553
  sessionId: z.ZodOptional<z.ZodString>;
2528
2554
  turnId: z.ZodOptional<z.ZodString>;
@@ -4556,21 +4582,2578 @@ declare const SessionUpdatedEventSchema: z.ZodObject<{
4556
4582
  type SessionCreated = z.infer<typeof SessionCreatedEventSchema>;
4557
4583
  type SessionUpdatedEvent = z.infer<typeof SessionUpdatedEventSchema>;
4558
4584
  //#endregion
4585
+ //#region core/contracts/src/session/session-ownership-claim-status.d.ts
4586
+ /** Lifecycle state of a durable adapter-session ownership claim. */
4587
+ declare const AdapterSessionClaimStatusSchema: z.ZodEnum<{
4588
+ abandoned: "abandoned";
4589
+ held: "held";
4590
+ releasing: "releasing";
4591
+ }>;
4592
+ /** {@inheritDoc AdapterSessionClaimStatusSchema} */
4593
+ type AdapterSessionClaimStatus = z.infer<typeof AdapterSessionClaimStatusSchema>;
4594
+ //#endregion
4595
+ //#region core/contracts/src/session/session-ownership-recovery.d.ts
4596
+ /** Exact runtime binding a recovery transfers to its replacement connector. */
4597
+ declare const RuntimeBindingSchema: z.ZodObject<{
4598
+ adapterId: z.ZodString;
4599
+ ownerMachineId: z.ZodString;
4600
+ ownerInstanceId: z.ZodString;
4601
+ }, z.core.$strip>;
4602
+ /** {@inheritDoc RuntimeBindingSchema} */
4603
+ type RuntimeBinding = z.infer<typeof RuntimeBindingSchema>;
4604
+ /** Durable row image restored when a recovery is refused before dispatch. */
4605
+ declare const SessionOwnershipRecoveryPreimageSchema: z.ZodObject<{
4606
+ status: z.ZodEnum<{
4607
+ idle: "idle";
4608
+ active: "active";
4609
+ starting: "starting";
4610
+ dead: "dead";
4611
+ disposed: "disposed";
4612
+ }>;
4613
+ adapterId: z.ZodString;
4614
+ binding: z.ZodOptional<z.ZodObject<{
4615
+ adapterId: z.ZodString;
4616
+ ownerMachineId: z.ZodString;
4617
+ ownerInstanceId: z.ZodString;
4618
+ }, z.core.$strip>>;
4619
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4620
+ }, z.core.$strip>;
4621
+ /** {@inheritDoc SessionOwnershipRecoveryPreimageSchema} */
4622
+ type SessionOwnershipRecoveryPreimage = z.infer<typeof SessionOwnershipRecoveryPreimageSchema>;
4623
+ /** Attempt and preimage created by one successful guarded reservation. */
4624
+ declare const SessionOwnershipRecoveryReservationSchema: z.ZodObject<{
4625
+ attemptId: z.ZodString;
4626
+ preimage: z.ZodObject<{
4627
+ status: z.ZodEnum<{
4628
+ idle: "idle";
4629
+ active: "active";
4630
+ starting: "starting";
4631
+ dead: "dead";
4632
+ disposed: "disposed";
4633
+ }>;
4634
+ adapterId: z.ZodString;
4635
+ binding: z.ZodOptional<z.ZodObject<{
4636
+ adapterId: z.ZodString;
4637
+ ownerMachineId: z.ZodString;
4638
+ ownerInstanceId: z.ZodString;
4639
+ }, z.core.$strip>>;
4640
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4641
+ }, z.core.$strip>;
4642
+ }, z.core.$strip>;
4643
+ /** {@inheritDoc SessionOwnershipRecoveryReservationSchema} */
4644
+ type SessionOwnershipRecoveryReservation = z.infer<typeof SessionOwnershipRecoveryReservationSchema>;
4645
+ /** Terminal action for an attempt-fenced recovery lifecycle. */
4646
+ declare const SessionOwnershipRecoveryTerminalActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4647
+ kind: z.ZodLiteral<"rollback">;
4648
+ preimage: z.ZodObject<{
4649
+ status: z.ZodEnum<{
4650
+ idle: "idle";
4651
+ active: "active";
4652
+ starting: "starting";
4653
+ dead: "dead";
4654
+ disposed: "disposed";
4655
+ }>;
4656
+ adapterId: z.ZodString;
4657
+ binding: z.ZodOptional<z.ZodObject<{
4658
+ adapterId: z.ZodString;
4659
+ ownerMachineId: z.ZodString;
4660
+ ownerInstanceId: z.ZodString;
4661
+ }, z.core.$strip>>;
4662
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4663
+ }, z.core.$strip>;
4664
+ }, z.core.$strip>, z.ZodObject<{
4665
+ kind: z.ZodLiteral<"succeeded">;
4666
+ }, z.core.$strip>, z.ZodObject<{
4667
+ kind: z.ZodLiteral<"failed">;
4668
+ }, z.core.$strip>], "kind">;
4669
+ /** {@inheritDoc SessionOwnershipRecoveryTerminalActionSchema} */
4670
+ type SessionOwnershipRecoveryTerminalAction = z.infer<typeof SessionOwnershipRecoveryTerminalActionSchema>;
4671
+ /** Atomically terminalize a recovery only while its exact attempt still owns the row. */
4672
+ declare const SessionOwnershipFinalizeRecoveryRequestSchema: z.ZodObject<{
4673
+ agentId: z.ZodString;
4674
+ attemptId: z.ZodString;
4675
+ binding: z.ZodObject<{
4676
+ adapterId: z.ZodString;
4677
+ ownerMachineId: z.ZodString;
4678
+ ownerInstanceId: z.ZodString;
4679
+ }, z.core.$strip>;
4680
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
4681
+ kind: z.ZodLiteral<"rollback">;
4682
+ preimage: z.ZodObject<{
4683
+ status: z.ZodEnum<{
4684
+ idle: "idle";
4685
+ active: "active";
4686
+ starting: "starting";
4687
+ dead: "dead";
4688
+ disposed: "disposed";
4689
+ }>;
4690
+ adapterId: z.ZodString;
4691
+ binding: z.ZodOptional<z.ZodObject<{
4692
+ adapterId: z.ZodString;
4693
+ ownerMachineId: z.ZodString;
4694
+ ownerInstanceId: z.ZodString;
4695
+ }, z.core.$strip>>;
4696
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4697
+ }, z.core.$strip>;
4698
+ }, z.core.$strip>, z.ZodObject<{
4699
+ kind: z.ZodLiteral<"succeeded">;
4700
+ }, z.core.$strip>, z.ZodObject<{
4701
+ kind: z.ZodLiteral<"failed">;
4702
+ }, z.core.$strip>], "kind">;
4703
+ }, z.core.$strip>;
4704
+ /** {@inheritDoc SessionOwnershipFinalizeRecoveryRequestSchema} */
4705
+ type SessionOwnershipFinalizeRecoveryRequest = z.infer<typeof SessionOwnershipFinalizeRecoveryRequestSchema>;
4706
+ /** Result of an attempt-fenced recovery terminal transition. */
4707
+ declare const SessionOwnershipFinalizeRecoveryResponseSchema: z.ZodObject<{
4708
+ applied: z.ZodBoolean;
4709
+ }, z.core.$strip>;
4710
+ /** {@inheritDoc SessionOwnershipFinalizeRecoveryResponseSchema} */
4711
+ type SessionOwnershipFinalizeRecoveryResult = z.infer<typeof SessionOwnershipFinalizeRecoveryResponseSchema>;
4712
+ /** Exact generation observed on a key while recovery was planned. */
4713
+ declare const SessionOwnershipRecoveryOwnerGenerationSchema: z.ZodObject<{
4714
+ claimId: z.ZodString;
4715
+ claimToken: z.ZodString;
4716
+ fence: z.ZodNumber;
4717
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4718
+ status: z.ZodEnum<{
4719
+ abandoned: "abandoned";
4720
+ held: "held";
4721
+ releasing: "releasing";
4722
+ }>;
4723
+ }, z.core.$strip>;
4724
+ /** {@inheritDoc SessionOwnershipRecoveryOwnerGenerationSchema} */
4725
+ type SessionOwnershipRecoveryOwnerGeneration = z.infer<typeof SessionOwnershipRecoveryOwnerGenerationSchema>;
4726
+ /** Snapshot a recovery reservation must replace atomically. */
4727
+ declare const SessionOwnershipRecoveryGuardSchema: z.ZodObject<{
4728
+ expectedStatus: z.ZodEnum<{
4729
+ idle: "idle";
4730
+ active: "active";
4731
+ starting: "starting";
4732
+ dead: "dead";
4733
+ disposed: "disposed";
4734
+ }>;
4735
+ expectedPreimage: z.ZodObject<{
4736
+ status: z.ZodEnum<{
4737
+ idle: "idle";
4738
+ active: "active";
4739
+ starting: "starting";
4740
+ dead: "dead";
4741
+ disposed: "disposed";
4742
+ }>;
4743
+ adapterId: z.ZodString;
4744
+ binding: z.ZodOptional<z.ZodObject<{
4745
+ adapterId: z.ZodString;
4746
+ ownerMachineId: z.ZodString;
4747
+ ownerInstanceId: z.ZodString;
4748
+ }, z.core.$strip>>;
4749
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4750
+ }, z.core.$strip>;
4751
+ expectedRevision: z.ZodNumber;
4752
+ expectedCurrencyFence: z.ZodNumber;
4753
+ expectedCurrency: z.ZodObject<{
4754
+ adapterSessionId: z.ZodNullable<z.ZodString>;
4755
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
4756
+ currentAdapterSessionIdState: z.ZodEnum<{
4757
+ confirmed: "confirmed";
4758
+ moved: "moved";
4759
+ inherited: "inherited";
4760
+ }>;
4761
+ }, z.core.$strip>;
4762
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
4763
+ claimId: z.ZodString;
4764
+ claimToken: z.ZodString;
4765
+ fence: z.ZodNumber;
4766
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4767
+ status: z.ZodEnum<{
4768
+ abandoned: "abandoned";
4769
+ held: "held";
4770
+ releasing: "releasing";
4771
+ }>;
4772
+ }, z.core.$strip>>;
4773
+ }, z.core.$strip>;
4774
+ /** {@inheritDoc SessionOwnershipRecoveryGuardSchema} */
4775
+ type SessionOwnershipRecoveryGuard$1 = z.infer<typeof SessionOwnershipRecoveryGuardSchema>;
4776
+ //#endregion
4777
+ //#region core/contracts/src/session/session-ownership-storage-namespace.d.ts
4778
+ /**
4779
+ * Identity of the namespace a provider session is owned within.
4780
+ *
4781
+ * A provider session ID is only unique inside the runtime that stores it: the
4782
+ * same ID may exist on another machine, or under another adapter runtime on the
4783
+ * same machine, and those are different conversations. This triple is therefore
4784
+ * the ownership key, and the claim table's unique index over it is what makes
4785
+ * "exactly one winner" a property of the schema rather than of handler code.
4786
+ */
4787
+ declare const AdapterSessionClaimKeySchema: z.ZodObject<{
4788
+ machineId: z.ZodString;
4789
+ adapterId: z.ZodString;
4790
+ providerSessionId: z.ZodString;
4791
+ }, z.core.$strip>;
4792
+ /** {@inheritDoc AdapterSessionClaimKeySchema} */
4793
+ type AdapterSessionClaimKey = z.infer<typeof AdapterSessionClaimKeySchema>;
4794
+ /**
4795
+ * A durable ownership claim on one provider-native session.
4796
+ *
4797
+ * `claimToken` identifies the claim generation opaquely; `fence` orders
4798
+ * generations. The two always change together — a takeover mints a new token
4799
+ * and a higher fence — so a stale owner can be rejected by comparison
4800
+ * (`fence`) rather than by recognition (`claimToken`), which is what lets a
4801
+ * write arriving from a previous process be refused rather than applied.
4802
+ */
4803
+ declare const AdapterSessionClaimRecordSchema: z.ZodObject<{
4804
+ machineId: z.ZodString;
4805
+ adapterId: z.ZodString;
4806
+ providerSessionId: z.ZodString;
4807
+ claimId: z.ZodString;
4808
+ adapterName: z.ZodString;
4809
+ sessionId: z.ZodString;
4810
+ agentId: z.ZodString;
4811
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4812
+ claimToken: z.ZodString;
4813
+ fence: z.ZodNumber;
4814
+ status: z.ZodEnum<{
4815
+ abandoned: "abandoned";
4816
+ held: "held";
4817
+ releasing: "releasing";
4818
+ }>;
4819
+ claimedAt: z.ZodNumber;
4820
+ updatedAt: z.ZodNumber;
4821
+ }, z.core.$strip>;
4822
+ /** {@inheritDoc AdapterSessionClaimRecordSchema} */
4823
+ type AdapterSessionClaimRecord$1 = z.infer<typeof AdapterSessionClaimRecordSchema>;
4824
+ /**
4825
+ * One runtime process acting for one machine that has taken an ownership
4826
+ * generation. Instance rows are durable diagnostics and are never deleted.
4827
+ */
4828
+ declare const RuntimeInstanceRecordSchema: z.ZodObject<{
4829
+ instanceId: z.ZodString;
4830
+ machineId: z.ZodString;
4831
+ incarnation: z.ZodNumber;
4832
+ startedAt: z.ZodNumber;
4833
+ retiredAt: z.ZodNullable<z.ZodNumber>;
4834
+ }, z.core.$strip>;
4835
+ /** {@inheritDoc RuntimeInstanceRecordSchema} */
4836
+ type RuntimeInstanceRecord$1 = z.infer<typeof RuntimeInstanceRecordSchema>;
4837
+ /** Runtime process on whose behalf an ownership generation is taken. */
4838
+ declare const OwnershipOwnerInstanceSchema: z.ZodObject<{
4839
+ instanceId: z.ZodString;
4840
+ }, z.core.$strip>;
4841
+ /** {@inheritDoc OwnershipOwnerInstanceSchema} */
4842
+ type OwnershipOwnerInstance = z.infer<typeof OwnershipOwnerInstanceSchema>;
4843
+ /** How many runtime processes may own claims on one machine. */
4844
+ declare const OwnershipTopologySchema: z.ZodEnum<{
4845
+ "machine-exclusive": "machine-exclusive";
4846
+ "shared-machine": "shared-machine";
4847
+ }>;
4848
+ /**
4849
+ * Durable ownership state of one agent.
4850
+ *
4851
+ * `revision` and `currencyFence` are the two orderings a currency write is
4852
+ * checked against, and they answer different questions:
4853
+ * - `currencyFence` — *which generation* last wrote this currency. A write from
4854
+ * a lower fence is a stale owner and is refused outright.
4855
+ * - `revision` — *which write* the caller read before computing its target. A
4856
+ * mismatch means the row moved under the caller within the same generation.
4857
+ *
4858
+ * `revision` is bumped exclusively by the ownership seam. Any other writer
4859
+ * bumping it would make the compare-and-swap fail for reasons unrelated to
4860
+ * currency, which is the same as not having it.
4861
+ */
4862
+ declare const AgentSessionOwnershipRecordSchema: z.ZodObject<{
4863
+ agentId: z.ZodString;
4864
+ sessionId: z.ZodString;
4865
+ currency: z.ZodObject<{
4866
+ adapterSessionId: z.ZodNullable<z.ZodString>;
4867
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
4868
+ currentAdapterSessionIdState: z.ZodEnum<{
4869
+ confirmed: "confirmed";
4870
+ moved: "moved";
4871
+ inherited: "inherited";
4872
+ }>;
4873
+ }, z.core.$strip>;
4874
+ revision: z.ZodNumber;
4875
+ currencyFence: z.ZodNumber;
4876
+ claims: z.ZodArray<z.ZodObject<{
4877
+ machineId: z.ZodString;
4878
+ adapterId: z.ZodString;
4879
+ providerSessionId: z.ZodString;
4880
+ claimId: z.ZodString;
4881
+ adapterName: z.ZodString;
4882
+ sessionId: z.ZodString;
4883
+ agentId: z.ZodString;
4884
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4885
+ claimToken: z.ZodString;
4886
+ fence: z.ZodNumber;
4887
+ status: z.ZodEnum<{
4888
+ abandoned: "abandoned";
4889
+ held: "held";
4890
+ releasing: "releasing";
4891
+ }>;
4892
+ claimedAt: z.ZodNumber;
4893
+ updatedAt: z.ZodNumber;
4894
+ }, z.core.$strip>>;
4895
+ }, z.core.$strip>;
4896
+ /** {@inheritDoc AgentSessionOwnershipRecordSchema} */
4897
+ type AgentSessionOwnershipRecord = z.infer<typeof AgentSessionOwnershipRecordSchema>;
4898
+ /**
4899
+ * Request payload for `storage:sessionOwnership.claim`.
4900
+ *
4901
+ * One call is the whole reservation: it takes the claim and — when
4902
+ * `designateLead` is supplied — designates the session's lead agent in the same
4903
+ * transaction. Splitting those into two calls is what leaves the window where a
4904
+ * provider session is owned by an agent the session does not yet call its lead,
4905
+ * and a movement announced in that window has no legitimate writer.
4906
+ */
4907
+ declare const SessionOwnershipClaimRequestSchema: z.ZodObject<{
4908
+ machineId: z.ZodString;
4909
+ adapterId: z.ZodString;
4910
+ providerSessionId: z.ZodNullable<z.ZodString>;
4911
+ adapterName: z.ZodString;
4912
+ ownerInstance: z.ZodOptional<z.ZodObject<{
4913
+ instanceId: z.ZodString;
4914
+ }, z.core.$strip>>;
4915
+ topology: z.ZodDefault<z.ZodEnum<{
4916
+ "machine-exclusive": "machine-exclusive";
4917
+ "shared-machine": "shared-machine";
4918
+ }>>;
4919
+ recoveryGuard: z.ZodOptional<z.ZodObject<{
4920
+ expectedStatus: z.ZodEnum<{
4921
+ idle: "idle";
4922
+ active: "active";
4923
+ starting: "starting";
4924
+ dead: "dead";
4925
+ disposed: "disposed";
4926
+ }>;
4927
+ expectedPreimage: z.ZodObject<{
4928
+ status: z.ZodEnum<{
4929
+ idle: "idle";
4930
+ active: "active";
4931
+ starting: "starting";
4932
+ dead: "dead";
4933
+ disposed: "disposed";
4934
+ }>;
4935
+ adapterId: z.ZodString;
4936
+ binding: z.ZodOptional<z.ZodObject<{
4937
+ adapterId: z.ZodString;
4938
+ ownerMachineId: z.ZodString;
4939
+ ownerInstanceId: z.ZodString;
4940
+ }, z.core.$strip>>;
4941
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4942
+ }, z.core.$strip>;
4943
+ expectedRevision: z.ZodNumber;
4944
+ expectedCurrencyFence: z.ZodNumber;
4945
+ expectedCurrency: z.ZodObject<{
4946
+ adapterSessionId: z.ZodNullable<z.ZodString>;
4947
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
4948
+ currentAdapterSessionIdState: z.ZodEnum<{
4949
+ confirmed: "confirmed";
4950
+ moved: "moved";
4951
+ inherited: "inherited";
4952
+ }>;
4953
+ }, z.core.$strip>;
4954
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
4955
+ claimId: z.ZodString;
4956
+ claimToken: z.ZodString;
4957
+ fence: z.ZodNumber;
4958
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4959
+ status: z.ZodEnum<{
4960
+ abandoned: "abandoned";
4961
+ held: "held";
4962
+ releasing: "releasing";
4963
+ }>;
4964
+ }, z.core.$strip>>;
4965
+ }, z.core.$strip>>;
4966
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4967
+ sessionId: z.ZodString;
4968
+ agentId: z.ZodString;
4969
+ claimToken: z.ZodString;
4970
+ supersedes: z.ZodOptional<z.ZodObject<{
4971
+ claimToken: z.ZodString;
4972
+ }, z.core.$strip>>;
4973
+ designateLead: z.ZodOptional<z.ZodObject<{
4974
+ expectedLeadAgentId: z.ZodNullable<z.ZodString>;
4975
+ clear: z.ZodOptional<z.ZodLiteral<true>>;
4976
+ restore: z.ZodOptional<z.ZodLiteral<true>>;
4977
+ }, z.core.$strip>>;
4978
+ }, z.core.$strip>;
4979
+ /** {@inheritDoc SessionOwnershipClaimRequestSchema} */
4980
+ type SessionOwnershipClaimRequest = z.infer<typeof SessionOwnershipClaimRequestSchema>;
4981
+ /**
4982
+ * Validate and normalize an ownership claim at the storage trust boundary.
4983
+ *
4984
+ * Storage handlers call this even when bus validation is disabled so schema
4985
+ * defaults and cross-field refinements remain part of the durable invariant.
4986
+ * @param value - Untrusted claim request received by a storage handler.
4987
+ * @returns The fully validated claim request with schema defaults applied.
4988
+ */
4989
+ declare function normalizeSessionOwnershipClaimRequest$1(value: unknown): SessionOwnershipClaimRequest;
4990
+ declare const SessionOwnershipClaimResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4991
+ outcome: z.ZodLiteral<"claimed">;
4992
+ claim: z.ZodNullable<z.ZodObject<{
4993
+ machineId: z.ZodString;
4994
+ adapterId: z.ZodString;
4995
+ providerSessionId: z.ZodString;
4996
+ claimId: z.ZodString;
4997
+ adapterName: z.ZodString;
4998
+ sessionId: z.ZodString;
4999
+ agentId: z.ZodString;
5000
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5001
+ claimToken: z.ZodString;
5002
+ fence: z.ZodNumber;
5003
+ status: z.ZodEnum<{
5004
+ abandoned: "abandoned";
5005
+ held: "held";
5006
+ releasing: "releasing";
5007
+ }>;
5008
+ claimedAt: z.ZodNumber;
5009
+ updatedAt: z.ZodNumber;
5010
+ }, z.core.$strip>>;
5011
+ recovery: z.ZodOptional<z.ZodObject<{
5012
+ attemptId: z.ZodString;
5013
+ preimage: z.ZodObject<{
5014
+ status: z.ZodEnum<{
5015
+ idle: "idle";
5016
+ active: "active";
5017
+ starting: "starting";
5018
+ dead: "dead";
5019
+ disposed: "disposed";
5020
+ }>;
5021
+ adapterId: z.ZodString;
5022
+ binding: z.ZodOptional<z.ZodObject<{
5023
+ adapterId: z.ZodString;
5024
+ ownerMachineId: z.ZodString;
5025
+ ownerInstanceId: z.ZodString;
5026
+ }, z.core.$strip>>;
5027
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5028
+ }, z.core.$strip>;
5029
+ }, z.core.$strip>>;
5030
+ leadDesignated: z.ZodBoolean;
5031
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
5032
+ }, z.core.$strip>, z.ZodObject<{
5033
+ outcome: z.ZodLiteral<"idempotent">;
5034
+ claim: z.ZodNullable<z.ZodObject<{
5035
+ machineId: z.ZodString;
5036
+ adapterId: z.ZodString;
5037
+ providerSessionId: z.ZodString;
5038
+ claimId: z.ZodString;
5039
+ adapterName: z.ZodString;
5040
+ sessionId: z.ZodString;
5041
+ agentId: z.ZodString;
5042
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5043
+ claimToken: z.ZodString;
5044
+ fence: z.ZodNumber;
5045
+ status: z.ZodEnum<{
5046
+ abandoned: "abandoned";
5047
+ held: "held";
5048
+ releasing: "releasing";
5049
+ }>;
5050
+ claimedAt: z.ZodNumber;
5051
+ updatedAt: z.ZodNumber;
5052
+ }, z.core.$strip>>;
5053
+ recovery: z.ZodOptional<z.ZodObject<{
5054
+ attemptId: z.ZodString;
5055
+ preimage: z.ZodObject<{
5056
+ status: z.ZodEnum<{
5057
+ idle: "idle";
5058
+ active: "active";
5059
+ starting: "starting";
5060
+ dead: "dead";
5061
+ disposed: "disposed";
5062
+ }>;
5063
+ adapterId: z.ZodString;
5064
+ binding: z.ZodOptional<z.ZodObject<{
5065
+ adapterId: z.ZodString;
5066
+ ownerMachineId: z.ZodString;
5067
+ ownerInstanceId: z.ZodString;
5068
+ }, z.core.$strip>>;
5069
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5070
+ }, z.core.$strip>;
5071
+ }, z.core.$strip>>;
5072
+ leadDesignated: z.ZodBoolean;
5073
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
5074
+ }, z.core.$strip>, z.ZodObject<{
5075
+ outcome: z.ZodLiteral<"already-claimed">;
5076
+ holder: z.ZodObject<{
5077
+ machineId: z.ZodString;
5078
+ adapterId: z.ZodString;
5079
+ providerSessionId: z.ZodString;
5080
+ claimId: z.ZodString;
5081
+ adapterName: z.ZodString;
5082
+ sessionId: z.ZodString;
5083
+ agentId: z.ZodString;
5084
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5085
+ claimToken: z.ZodString;
5086
+ fence: z.ZodNumber;
5087
+ status: z.ZodEnum<{
5088
+ abandoned: "abandoned";
5089
+ held: "held";
5090
+ releasing: "releasing";
5091
+ }>;
5092
+ claimedAt: z.ZodNumber;
5093
+ updatedAt: z.ZodNumber;
5094
+ }, z.core.$strip>;
5095
+ }, z.core.$strip>, z.ZodObject<{
5096
+ outcome: z.ZodLiteral<"agent-disposed">;
5097
+ }, z.core.$strip>, z.ZodObject<{
5098
+ outcome: z.ZodLiteral<"session-not-active">;
5099
+ status: z.ZodEnum<{
5100
+ closed: "closed";
5101
+ discovered: "discovered";
5102
+ archived: "archived";
5103
+ }>;
5104
+ }, z.core.$strip>, z.ZodObject<{
5105
+ outcome: z.ZodLiteral<"lead-conflict">;
5106
+ currentLeadAgentId: z.ZodNullable<z.ZodString>;
5107
+ }, z.core.$strip>, z.ZodObject<{
5108
+ outcome: z.ZodLiteral<"not-found">;
5109
+ missing: z.ZodEnum<{
5110
+ agent: "agent";
5111
+ session: "session";
5112
+ }>;
5113
+ }, z.core.$strip>, z.ZodObject<{
5114
+ outcome: z.ZodLiteral<"currency-changed">;
5115
+ revision: z.ZodNumber;
5116
+ currencyFence: z.ZodNumber;
5117
+ currency: z.ZodObject<{
5118
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5119
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5120
+ currentAdapterSessionIdState: z.ZodEnum<{
5121
+ confirmed: "confirmed";
5122
+ moved: "moved";
5123
+ inherited: "inherited";
5124
+ }>;
5125
+ }, z.core.$strip>;
5126
+ }, z.core.$strip>, z.ZodObject<{
5127
+ outcome: z.ZodLiteral<"recovery-conflict">;
5128
+ status: z.ZodEnum<{
5129
+ idle: "idle";
5130
+ active: "active";
5131
+ starting: "starting";
5132
+ dead: "dead";
5133
+ disposed: "disposed";
5134
+ }>;
5135
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
5136
+ claimId: z.ZodString;
5137
+ claimToken: z.ZodString;
5138
+ fence: z.ZodNumber;
5139
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5140
+ status: z.ZodEnum<{
5141
+ abandoned: "abandoned";
5142
+ held: "held";
5143
+ releasing: "releasing";
5144
+ }>;
5145
+ }, z.core.$strip>>;
5146
+ }, z.core.$strip>], "outcome">;
5147
+ /** {@inheritDoc SessionOwnershipClaimResponseSchema} */
5148
+ type SessionOwnershipClaimResult = z.infer<typeof SessionOwnershipClaimResponseSchema>;
5149
+ /**
5150
+ * Request payload for `storage:sessionOwnership.settleCurrency`.
5151
+ *
5152
+ * The write is guarded twice, because two different things can be wrong. The
5153
+ * `claimToken` + `fence` pair answers "may this caller write at all"; the
5154
+ * `expectedRevision` answers "did the caller compute its target from the state
5155
+ * it is overwriting". A settle that passes the first and fails the second is a
5156
+ * lost race inside one generation, not a stale owner, and the caller's recovery
5157
+ * differs accordingly.
5158
+ */
5159
+ declare const SessionOwnershipSettleCurrencyRequestSchema: z.ZodObject<{
5160
+ agentId: z.ZodString;
5161
+ claimToken: z.ZodString;
5162
+ fence: z.ZodNumber;
5163
+ expectedRevision: z.ZodNumber;
5164
+ target: z.ZodObject<{
5165
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5166
+ currentAdapterSessionIdState: z.ZodEnum<{
5167
+ confirmed: "confirmed";
5168
+ moved: "moved";
5169
+ inherited: "inherited";
5170
+ }>;
5171
+ }, z.core.$strip>;
5172
+ }, z.core.$strip>;
5173
+ /** {@inheritDoc SessionOwnershipSettleCurrencyRequestSchema} */
5174
+ type SessionOwnershipSettleCurrencyRequest = z.infer<typeof SessionOwnershipSettleCurrencyRequestSchema>;
5175
+ /**
5176
+ * Result of `storage:sessionOwnership.settleCurrency`.
5177
+ *
5178
+ * `sessionSnapshotUpdated` reports whether the session row's currency was
5179
+ * refreshed alongside the agent's. Storage decides that by reading the session's
5180
+ * lead designation inside the same transaction as the write — a caller that
5181
+ * checked lead-ness first and passed a flag would be acting on a read that the
5182
+ * write no longer agrees with.
5183
+ *
5184
+ * That refresh publishes the settled currency **resolved onto the session row's
5185
+ * own terms, not copied from `target`**, exactly as a lead designation does (see
5186
+ * {@link SessionOwnershipClaimRequestSchema}'s `designateLead`): `inherited`
5187
+ * points at the reading row's own `adapterSessionId`, and a lead's origin is
5188
+ * generally not its session's, so a verbatim copy would leave the session
5189
+ * resolving to its own origin while the lead resolves elsewhere. What the
5190
+ * session row ends up carrying is what `resolveResumableAdapterSessionId` yields
5191
+ * for the settled lead — so a settle of `inherited` can legitimately leave the
5192
+ * session row reading `confirmed` or `moved`.
5193
+ *
5194
+ * A missing claim is `not-owner`, not `not-found`: the agent exists, the caller
5195
+ * simply has no authority over it. Callers that need to report *who* owns it
5196
+ * instead read the claim through `listClaims`.
5197
+ *
5198
+ * Authority is decided before order: a caller whose claim row is gone is
5199
+ * `not-owner` even when its fence is also stale, because `superseded` names the
5200
+ * generation that outranked it and there is no such generation to name. The
5201
+ * authority a caller presents is the *pair* `claimToken` + `fence`, so a live
5202
+ * claim carrying a different fence than the caller named is `not-owner` too —
5203
+ * that pair never existed, and reporting `superseded` would have to name a
5204
+ * `currentFence` that outranks nothing (it may even be below the caller's own).
5205
+ *
5206
+ * A claim is an ownership of an agent *in a session*, so a claim filed under a
5207
+ * session the agent has since left is `not-owner` as well. Whole-record writes
5208
+ * can move an agent between sessions; a generation taken while it was in the old
5209
+ * one no longer represents any ownership of it, and settling under it would
5210
+ * publish its currency into a session its holder was never part of.
5211
+ * `release` deliberately does **not** apply that rule — see
5212
+ * {@link SessionOwnershipReleaseRequestSchema}.
5213
+ */
5214
+ declare const SessionOwnershipSettleCurrencyResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5215
+ outcome: z.ZodLiteral<"settled">;
5216
+ revision: z.ZodNumber;
5217
+ currency: z.ZodObject<{
5218
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5219
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5220
+ currentAdapterSessionIdState: z.ZodEnum<{
5221
+ confirmed: "confirmed";
5222
+ moved: "moved";
5223
+ inherited: "inherited";
5224
+ }>;
5225
+ }, z.core.$strip>;
5226
+ sessionSnapshotUpdated: z.ZodBoolean;
5227
+ }, z.core.$strip>, z.ZodObject<{
5228
+ outcome: z.ZodLiteral<"idempotent">;
5229
+ revision: z.ZodNumber;
5230
+ currency: z.ZodObject<{
5231
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5232
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5233
+ currentAdapterSessionIdState: z.ZodEnum<{
5234
+ confirmed: "confirmed";
5235
+ moved: "moved";
5236
+ inherited: "inherited";
5237
+ }>;
5238
+ }, z.core.$strip>;
5239
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
5240
+ }, z.core.$strip>, z.ZodObject<{
5241
+ outcome: z.ZodLiteral<"superseded">;
5242
+ currentFence: z.ZodNumber;
5243
+ }, z.core.$strip>, z.ZodObject<{
5244
+ outcome: z.ZodLiteral<"currency-changed">;
5245
+ revision: z.ZodNumber;
5246
+ currency: z.ZodObject<{
5247
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5248
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5249
+ currentAdapterSessionIdState: z.ZodEnum<{
5250
+ confirmed: "confirmed";
5251
+ moved: "moved";
5252
+ inherited: "inherited";
5253
+ }>;
5254
+ }, z.core.$strip>;
5255
+ }, z.core.$strip>, z.ZodObject<{
5256
+ outcome: z.ZodLiteral<"not-owner">;
5257
+ }, z.core.$strip>, z.ZodObject<{
5258
+ outcome: z.ZodLiteral<"agent-disposed">;
5259
+ }, z.core.$strip>, z.ZodObject<{
5260
+ outcome: z.ZodLiteral<"not-found">;
5261
+ }, z.core.$strip>], "outcome">;
5262
+ /** {@inheritDoc SessionOwnershipSettleCurrencyResponseSchema} */
5263
+ type SessionOwnershipSettleCurrencyResult = z.infer<typeof SessionOwnershipSettleCurrencyResponseSchema>;
5264
+ /**
5265
+ * What the provider did with an agent's conversation.
5266
+ *
5267
+ * The two members differ in what they *know*, not in how far they got, and the
5268
+ * difference decides whether a key may be freed. `confirmed` names a successor
5269
+ * the provider acknowledged, so the generations the agent held before it are
5270
+ * genuinely retired. `demote` says only that the conversation left, with no
5271
+ * acknowledged successor — the provider may still be live under the ID being
5272
+ * voided, so its claim is taken (or kept) rather than released.
5273
+ */
5274
+ declare const OwnershipMovementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5275
+ kind: z.ZodLiteral<"confirmed">;
5276
+ providerSessionId: z.ZodString;
5277
+ claimToken: z.ZodString;
5278
+ }, z.core.$strip>, z.ZodObject<{
5279
+ kind: z.ZodLiteral<"demote">;
5280
+ claimToken: z.ZodString;
5281
+ }, z.core.$strip>], "kind">;
5282
+ /** {@inheritDoc OwnershipMovementSchema} */
5283
+ type OwnershipMovement = z.infer<typeof OwnershipMovementSchema>;
5284
+ /**
5285
+ * Request payload for `storage:sessionOwnership.settleMovement`.
5286
+ *
5287
+ * One call is the whole movement: acquire (or recognize) the successor
5288
+ * generation, settle the agent's currency under it, retire the predecessors it
5289
+ * replaces and refresh the session snapshot — in one transaction. Composed from
5290
+ * `claim` + `settleCurrency` + `release` by a caller, the same act is three
5291
+ * transactions with two windows in which a crash strands a key or publishes a
5292
+ * currency no generation owns.
5293
+ */
5294
+ declare const SessionOwnershipSettleMovementRequestSchema$1: z.ZodObject<{
5295
+ machineId: z.ZodString;
5296
+ adapterId: z.ZodString;
5297
+ adapterName: z.ZodString;
5298
+ ownerInstance: z.ZodOptional<z.ZodObject<{
5299
+ instanceId: z.ZodString;
5300
+ }, z.core.$strip>>;
5301
+ topology: z.ZodDefault<z.ZodEnum<{
5302
+ "machine-exclusive": "machine-exclusive";
5303
+ "shared-machine": "shared-machine";
5304
+ }>>;
5305
+ sessionId: z.ZodString;
5306
+ agentId: z.ZodString;
5307
+ expectedRevision: z.ZodNumber;
5308
+ movement: z.ZodDiscriminatedUnion<[z.ZodObject<{
5309
+ kind: z.ZodLiteral<"confirmed">;
5310
+ providerSessionId: z.ZodString;
5311
+ claimToken: z.ZodString;
5312
+ }, z.core.$strip>, z.ZodObject<{
5313
+ kind: z.ZodLiteral<"demote">;
5314
+ claimToken: z.ZodString;
5315
+ }, z.core.$strip>], "kind">;
5316
+ }, z.core.$strip>;
5317
+ /** {@inheritDoc SessionOwnershipSettleMovementRequestSchema} */
5318
+ type SessionOwnershipSettleMovementRequest = z.infer<typeof SessionOwnershipSettleMovementRequestSchema$1>;
5319
+ /**
5320
+ * Result of `storage:sessionOwnership.settleMovement`.
5321
+ *
5322
+ * Every outcome other than `settled` leaves the store exactly as it was: the
5323
+ * claims phase runs inside the same transaction as the settle, so a refusal
5324
+ * reached after a generation was allocated rolls that allocation back with it.
5325
+ *
5326
+ * **The generation the response names is the one the settle wrote through**, not
5327
+ * the one the caller sent. An agent that already held the target key is settled
5328
+ * under the claim it already has, and the request's token names no row at all —
5329
+ * so a caller that carried its own token into a later release would retire a
5330
+ * generation that never existed and leave the real one blocking the key.
5331
+ */
5332
+ declare const SessionOwnershipSettleMovementResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5333
+ outcome: z.ZodLiteral<"settled">;
5334
+ revision: z.ZodNumber;
5335
+ currency: z.ZodObject<{
5336
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5337
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5338
+ currentAdapterSessionIdState: z.ZodEnum<{
5339
+ confirmed: "confirmed";
5340
+ moved: "moved";
5341
+ inherited: "inherited";
5342
+ }>;
5343
+ }, z.core.$strip>;
5344
+ sessionSnapshotUpdated: z.ZodBoolean;
5345
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
5346
+ claim: z.ZodObject<{
5347
+ machineId: z.ZodString;
5348
+ adapterId: z.ZodString;
5349
+ providerSessionId: z.ZodString;
5350
+ claimId: z.ZodString;
5351
+ adapterName: z.ZodString;
5352
+ sessionId: z.ZodString;
5353
+ agentId: z.ZodString;
5354
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5355
+ claimToken: z.ZodString;
5356
+ fence: z.ZodNumber;
5357
+ status: z.ZodEnum<{
5358
+ abandoned: "abandoned";
5359
+ held: "held";
5360
+ releasing: "releasing";
5361
+ }>;
5362
+ claimedAt: z.ZodNumber;
5363
+ updatedAt: z.ZodNumber;
5364
+ }, z.core.$strip>;
5365
+ }, z.core.$strip>, z.ZodObject<{
5366
+ outcome: z.ZodLiteral<"idempotent">;
5367
+ revision: z.ZodNumber;
5368
+ currency: z.ZodObject<{
5369
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5370
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5371
+ currentAdapterSessionIdState: z.ZodEnum<{
5372
+ confirmed: "confirmed";
5373
+ moved: "moved";
5374
+ inherited: "inherited";
5375
+ }>;
5376
+ }, z.core.$strip>;
5377
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
5378
+ claim: z.ZodNullable<z.ZodObject<{
5379
+ machineId: z.ZodString;
5380
+ adapterId: z.ZodString;
5381
+ providerSessionId: z.ZodString;
5382
+ claimId: z.ZodString;
5383
+ adapterName: z.ZodString;
5384
+ sessionId: z.ZodString;
5385
+ agentId: z.ZodString;
5386
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5387
+ claimToken: z.ZodString;
5388
+ fence: z.ZodNumber;
5389
+ status: z.ZodEnum<{
5390
+ abandoned: "abandoned";
5391
+ held: "held";
5392
+ releasing: "releasing";
5393
+ }>;
5394
+ claimedAt: z.ZodNumber;
5395
+ updatedAt: z.ZodNumber;
5396
+ }, z.core.$strip>>;
5397
+ }, z.core.$strip>, z.ZodObject<{
5398
+ outcome: z.ZodLiteral<"already-claimed">;
5399
+ holder: z.ZodObject<{
5400
+ machineId: z.ZodString;
5401
+ adapterId: z.ZodString;
5402
+ providerSessionId: z.ZodString;
5403
+ claimId: z.ZodString;
5404
+ adapterName: z.ZodString;
5405
+ sessionId: z.ZodString;
5406
+ agentId: z.ZodString;
5407
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5408
+ claimToken: z.ZodString;
5409
+ fence: z.ZodNumber;
5410
+ status: z.ZodEnum<{
5411
+ abandoned: "abandoned";
5412
+ held: "held";
5413
+ releasing: "releasing";
5414
+ }>;
5415
+ claimedAt: z.ZodNumber;
5416
+ updatedAt: z.ZodNumber;
5417
+ }, z.core.$strip>;
5418
+ }, z.core.$strip>, z.ZodObject<{
5419
+ outcome: z.ZodLiteral<"superseded">;
5420
+ currentFence: z.ZodNumber;
5421
+ }, z.core.$strip>, z.ZodObject<{
5422
+ outcome: z.ZodLiteral<"currency-changed">;
5423
+ revision: z.ZodNumber;
5424
+ currency: z.ZodObject<{
5425
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5426
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5427
+ currentAdapterSessionIdState: z.ZodEnum<{
5428
+ confirmed: "confirmed";
5429
+ moved: "moved";
5430
+ inherited: "inherited";
5431
+ }>;
5432
+ }, z.core.$strip>;
5433
+ }, z.core.$strip>, z.ZodObject<{
5434
+ outcome: z.ZodLiteral<"not-owner">;
5435
+ }, z.core.$strip>, z.ZodObject<{
5436
+ outcome: z.ZodLiteral<"agent-disposed">;
5437
+ }, z.core.$strip>, z.ZodObject<{
5438
+ outcome: z.ZodLiteral<"not-found">;
5439
+ }, z.core.$strip>], "outcome">;
5440
+ /** {@inheritDoc SessionOwnershipSettleMovementResponseSchema} */
5441
+ type SessionOwnershipSettleMovementResult = z.infer<typeof SessionOwnershipSettleMovementResponseSchema>;
5442
+ /**
5443
+ * How a claim is given up.
5444
+ *
5445
+ * - `released` — the provider session is provably done with; the row is removed
5446
+ * and the key becomes claimable again.
5447
+ * - `releasing` — teardown started but is not confirmed; the row stays and keeps
5448
+ * blocking.
5449
+ * - `abandoned` — the owner failed after dispatching to the provider; the row
5450
+ * stays and keeps blocking until an explicit takeover names its token, or
5451
+ * until that same generation later confirms teardown with a `released` of its
5452
+ * own (see {@link AdapterSessionClaimStatusSchema}). Storage does not judge
5453
+ * whether that takeover is legitimate.
5454
+ *
5455
+ * Only the first frees the key. A failure after dispatch must never take that
5456
+ * path: the provider process may still be alive, and a second owner attaching
5457
+ * to a live conversation is the exact outcome this aggregate exists to prevent.
5458
+ */
5459
+ declare const AdapterSessionClaimDispositionSchema: z.ZodEnum<{
5460
+ released: "released";
5461
+ abandoned: "abandoned";
5462
+ releasing: "releasing";
5463
+ }>;
5464
+ /** {@inheritDoc AdapterSessionClaimDispositionSchema} */
5465
+ type AdapterSessionClaimDisposition = z.infer<typeof AdapterSessionClaimDispositionSchema>;
5466
+ /**
5467
+ * Request payload for `storage:sessionOwnership.release`.
5468
+ *
5469
+ * The token and the agent are the whole of the authority, deliberately less than
5470
+ * `settleCurrency` asks for: that op additionally requires the claim to be filed
5471
+ * under the agent's *current* session, because it exercises the claim as
5472
+ * authority over that agent's currency. Giving a claim up needs no authority
5473
+ * beyond having been the one who took it. Demanding session membership here
5474
+ * would strand exactly the claims that most need retiring — an agent moved to
5475
+ * another session would leave its old generation unreleasable, blocking the
5476
+ * ownership key against everyone, forever.
5477
+ */
5478
+ declare const SessionOwnershipReleaseRequestSchema: z.ZodObject<{
5479
+ agentId: z.ZodString;
5480
+ claimToken: z.ZodString;
5481
+ disposition: z.ZodEnum<{
5482
+ released: "released";
5483
+ abandoned: "abandoned";
5484
+ releasing: "releasing";
5485
+ }>;
5486
+ }, z.core.$strip>;
5487
+ /** {@inheritDoc SessionOwnershipReleaseRequestSchema} */
5488
+ type SessionOwnershipReleaseRequest = z.infer<typeof SessionOwnershipReleaseRequestSchema>;
5489
+ /** Result of `storage:sessionOwnership.release`. */
5490
+ declare const SessionOwnershipReleaseResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5491
+ outcome: z.ZodLiteral<"released">;
5492
+ }, z.core.$strip>, z.ZodObject<{
5493
+ outcome: z.ZodLiteral<"marked">;
5494
+ claim: z.ZodObject<{
5495
+ machineId: z.ZodString;
5496
+ adapterId: z.ZodString;
5497
+ providerSessionId: z.ZodString;
5498
+ claimId: z.ZodString;
5499
+ adapterName: z.ZodString;
5500
+ sessionId: z.ZodString;
5501
+ agentId: z.ZodString;
5502
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5503
+ claimToken: z.ZodString;
5504
+ fence: z.ZodNumber;
5505
+ status: z.ZodEnum<{
5506
+ abandoned: "abandoned";
5507
+ held: "held";
5508
+ releasing: "releasing";
5509
+ }>;
5510
+ claimedAt: z.ZodNumber;
5511
+ updatedAt: z.ZodNumber;
5512
+ }, z.core.$strip>;
5513
+ }, z.core.$strip>, z.ZodObject<{
5514
+ outcome: z.ZodLiteral<"not-owner">;
5515
+ holder: z.ZodObject<{
5516
+ machineId: z.ZodString;
5517
+ adapterId: z.ZodString;
5518
+ providerSessionId: z.ZodString;
5519
+ claimId: z.ZodString;
5520
+ adapterName: z.ZodString;
5521
+ sessionId: z.ZodString;
5522
+ agentId: z.ZodString;
5523
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5524
+ claimToken: z.ZodString;
5525
+ fence: z.ZodNumber;
5526
+ status: z.ZodEnum<{
5527
+ abandoned: "abandoned";
5528
+ held: "held";
5529
+ releasing: "releasing";
5530
+ }>;
5531
+ claimedAt: z.ZodNumber;
5532
+ updatedAt: z.ZodNumber;
5533
+ }, z.core.$strip>;
5534
+ }, z.core.$strip>, z.ZodObject<{
5535
+ outcome: z.ZodLiteral<"not-found">;
5536
+ }, z.core.$strip>], "outcome">;
5537
+ /** {@inheritDoc SessionOwnershipReleaseResponseSchema} */
5538
+ type SessionOwnershipReleaseResult = z.infer<typeof SessionOwnershipReleaseResponseSchema>;
5539
+ /**
5540
+ * Request payload for `storage:sessionOwnership.releaseAgentClaims`.
5541
+ *
5542
+ * The plural of `release`, and not a convenience: **omitting `claimToken` is the
5543
+ * teardown fan-out**, which exists because reading an agent's claims and
5544
+ * releasing them one by one cannot see a claim taken in between — and an agent
5545
+ * legitimately holds two mid-movement. One predicate over `agent_id` retires
5546
+ * whatever is there at the instant the statement runs, which is the only shape
5547
+ * that can be complete.
5548
+ *
5549
+ * Naming a token scopes the act to exactly one generation, which is the rollback
5550
+ * form: a start that failed before dispatch must give up the generation it took
5551
+ * and nothing else, because the agent may hold a second one from an unrelated
5552
+ * in-flight movement.
5553
+ *
5554
+ * **Not `disposed`-guarded**, unlike every other ownership operation. Giving a
5555
+ * claim up is the one act a removed agent must still perform; guarding it would
5556
+ * strand exactly the claims that most need retiring.
5557
+ */
5558
+ declare const SessionOwnershipReleaseAgentClaimsRequestSchema: z.ZodObject<{
5559
+ agentId: z.ZodString;
5560
+ claimToken: z.ZodOptional<z.ZodString>;
5561
+ disposition: z.ZodEnum<{
5562
+ released: "released";
5563
+ abandoned: "abandoned";
5564
+ releasing: "releasing";
5565
+ }>;
5566
+ }, z.core.$strip>;
5567
+ /** {@inheritDoc SessionOwnershipReleaseAgentClaimsRequestSchema} */
5568
+ type SessionOwnershipReleaseAgentClaimsRequest = z.infer<typeof SessionOwnershipReleaseAgentClaimsRequestSchema>;
5569
+ /**
5570
+ * Result of `storage:sessionOwnership.releaseAgentClaims`.
5571
+ *
5572
+ * Not a discriminated union, because there is no failure to model: an agent with
5573
+ * no claims — including one whose row is gone entirely — yields empty lists
5574
+ * rather than an error, which is what makes teardown idempotent.
5575
+ */
5576
+ declare const SessionOwnershipReleaseAgentClaimsResponseSchema: z.ZodObject<{
5577
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
5578
+ markedClaims: z.ZodArray<z.ZodObject<{
5579
+ machineId: z.ZodString;
5580
+ adapterId: z.ZodString;
5581
+ providerSessionId: z.ZodString;
5582
+ claimId: z.ZodString;
5583
+ adapterName: z.ZodString;
5584
+ sessionId: z.ZodString;
5585
+ agentId: z.ZodString;
5586
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5587
+ claimToken: z.ZodString;
5588
+ fence: z.ZodNumber;
5589
+ status: z.ZodEnum<{
5590
+ abandoned: "abandoned";
5591
+ held: "held";
5592
+ releasing: "releasing";
5593
+ }>;
5594
+ claimedAt: z.ZodNumber;
5595
+ updatedAt: z.ZodNumber;
5596
+ }, z.core.$strip>>;
5597
+ claimTokenNotFound: z.ZodBoolean;
5598
+ }, z.core.$strip>;
5599
+ /** {@inheritDoc SessionOwnershipReleaseAgentClaimsResponseSchema} */
5600
+ type SessionOwnershipReleaseAgentClaimsResult = z.infer<typeof SessionOwnershipReleaseAgentClaimsResponseSchema>;
5601
+ /**
5602
+ * Request payload for `storage:sessionOwnership.listClaims`.
5603
+ *
5604
+ * `machineId` is mandatory because reconciliation is a per-machine act: a
5605
+ * runtime may only reason about liveness of owners on its own machine, and a
5606
+ * query that could span machines invites a takeover decision that has no
5607
+ * evidence behind it.
5608
+ */
5609
+ declare const SessionOwnershipListClaimsRequestSchema: z.ZodObject<{
5610
+ machineId: z.ZodString;
5611
+ adapterId: z.ZodOptional<z.ZodString>;
5612
+ providerSessionId: z.ZodOptional<z.ZodString>;
5613
+ statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
5614
+ abandoned: "abandoned";
5615
+ held: "held";
5616
+ releasing: "releasing";
5617
+ }>>>;
5618
+ }, z.core.$strip>;
5619
+ /** {@inheritDoc SessionOwnershipListClaimsRequestSchema} */
5620
+ type SessionOwnershipListClaimsRequest = z.infer<typeof SessionOwnershipListClaimsRequestSchema>;
5621
+ /**
5622
+ * Session ownership storage namespace.
5623
+ *
5624
+ * The durable seam of the session-ownership aggregate. Its invariant:
5625
+ *
5626
+ * A provider-native session has exactly one durable runtime owner within its
5627
+ * machine/adapter namespace. Agent currency may only be changed by the current
5628
+ * claim generation. Session currency is a persisted snapshot of the designated
5629
+ * lead's currency.
5630
+ *
5631
+ * **Why a dedicated namespace.** `storage:session.update` is a partial-update
5632
+ * surface with no notion of who is allowed to write. Widening it with
5633
+ * compare-and-swap semantics would put a versioned-write contract on every
5634
+ * existing caller, turning one seam's concurrency problem into a storage-wide
5635
+ * one. The operations here are the narrow alternative: every one of them states
5636
+ * its authority up front, and they are the only writers of the agent currency
5637
+ * columns and of the claim table.
5638
+ *
5639
+ * **No second writer, including for the session snapshot.** The currency pair
5640
+ * is on neither `storage:session.update` nor `storage:session.set`, so a
5641
+ * snapshot written here can only be superseded by another write through this
5642
+ * seam — one that had to present a claim generation to get in. That is what
5643
+ * makes the snapshot's freshness derivable rather than hoped for.
5644
+ *
5645
+ * **Transactionality.** These handlers run multi-row writes inside
5646
+ * `executeTransaction` from `@makaio/storage-drizzle`, which is a deliberate
5647
+ * exception to the single-statement rule the other session storage handlers
5648
+ * follow. That rule exists because a bare `db.transaction()` holds a write lock
5649
+ * across await boundaries and deadlocks against concurrent handlers on the same
5650
+ * connection; `executeTransaction` closes exactly that hole by serializing
5651
+ * transaction callbacks per database handle before opening one, so a second
5652
+ * transaction queues instead of colliding at `BEGIN`. The serialization is
5653
+ * process-local by construction, which is why cross-process exclusivity is NOT
5654
+ * derived from it: "exactly one winner" comes from the claim table's unique
5655
+ * index over the ownership key, and the acquiring statement is an insert against
5656
+ * that index rather than a read-then-write. The transaction supplies atomicity
5657
+ * across the claim, agent and session rows; the index supplies exclusivity.
5658
+ * @example
5659
+ * ```typescript
5660
+ * import { SessionOwnershipStorageSubjects } from '@makaio/framework/contracts';
5661
+ *
5662
+ * const result = await bus.request(SessionOwnershipStorageSubjects.claim, {
5663
+ * machineId, adapterId, adapterName, providerSessionId,
5664
+ * sessionId, agentId, claimToken,
5665
+ * designateLead: { expectedLeadAgentId: null },
5666
+ * });
5667
+ * // 'already-claimed' means another runtime owns the thread: degrade, never resume.
5668
+ * ```
5669
+ */
5670
+ declare const SessionOwnershipStorageNamespace: ContractStorageNamespaceDefinition<"sessionOwnership", {
5671
+ /**
5672
+ * Read one agent's durable ownership state.
5673
+ *
5674
+ * **Not a consistent snapshot**, in either direction: the agent row and its
5675
+ * claims are read as two statements, so a concurrent claim or release can
5676
+ * show up in one and not the other. A reader may therefore observe a claim
5677
+ * whose fence the agent's `currencyFence` does not yet account for, or a
5678
+ * `currencyFence` whose authoring claim has already been released. Both are
5679
+ * legitimate instants of the aggregate; a reader that needs authority must
5680
+ * ask for it (`settleCurrency`) rather than infer it from this read.
5681
+ *
5682
+ * Subject: `storage:sessionOwnership.read`
5683
+ * Type: Request (RPC)
5684
+ */
5685
+ read: {
5686
+ request: z.ZodObject<{
5687
+ agentId: z.ZodString;
5688
+ }, z.core.$strip>;
5689
+ response: z.ZodObject<{
5690
+ ownership: z.ZodNullable<z.ZodObject<{
5691
+ agentId: z.ZodString;
5692
+ sessionId: z.ZodString;
5693
+ currency: z.ZodObject<{
5694
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5695
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5696
+ currentAdapterSessionIdState: z.ZodEnum<{
5697
+ confirmed: "confirmed";
5698
+ moved: "moved";
5699
+ inherited: "inherited";
5700
+ }>;
5701
+ }, z.core.$strip>;
5702
+ revision: z.ZodNumber;
5703
+ currencyFence: z.ZodNumber;
5704
+ claims: z.ZodArray<z.ZodObject<{
5705
+ machineId: z.ZodString;
5706
+ adapterId: z.ZodString;
5707
+ providerSessionId: z.ZodString;
5708
+ claimId: z.ZodString;
5709
+ adapterName: z.ZodString;
5710
+ sessionId: z.ZodString;
5711
+ agentId: z.ZodString;
5712
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5713
+ claimToken: z.ZodString;
5714
+ fence: z.ZodNumber;
5715
+ status: z.ZodEnum<{
5716
+ abandoned: "abandoned";
5717
+ held: "held";
5718
+ releasing: "releasing";
5719
+ }>;
5720
+ claimedAt: z.ZodNumber;
5721
+ updatedAt: z.ZodNumber;
5722
+ }, z.core.$strip>>;
5723
+ }, z.core.$strip>>;
5724
+ }, z.core.$strip>;
5725
+ };
5726
+ /**
5727
+ * Take or take over the ownership claim on a provider session, optionally
5728
+ * designating the claiming agent as the session's lead in the same
5729
+ * transaction.
5730
+ *
5731
+ * With `providerSessionId: null` it is the **keyless reservation**: no claim
5732
+ * row at all, and the designation plus its currency mirror are the whole
5733
+ * effect. That is the fresh-start shape — there is no provider identity to
5734
+ * own yet, and the designation still has to be atomic and compare-and-swap.
5735
+ *
5736
+ * Subject: `storage:sessionOwnership.claim`
5737
+ * Type: Request (RPC)
5738
+ */
5739
+ claim: {
5740
+ request: z.ZodObject<{
5741
+ machineId: z.ZodString;
5742
+ adapterId: z.ZodString;
5743
+ providerSessionId: z.ZodNullable<z.ZodString>;
5744
+ adapterName: z.ZodString;
5745
+ ownerInstance: z.ZodOptional<z.ZodObject<{
5746
+ instanceId: z.ZodString;
5747
+ }, z.core.$strip>>;
5748
+ topology: z.ZodDefault<z.ZodEnum<{
5749
+ "machine-exclusive": "machine-exclusive";
5750
+ "shared-machine": "shared-machine";
5751
+ }>>;
5752
+ recoveryGuard: z.ZodOptional<z.ZodObject<{
5753
+ expectedStatus: z.ZodEnum<{
5754
+ idle: "idle";
5755
+ active: "active";
5756
+ starting: "starting";
5757
+ dead: "dead";
5758
+ disposed: "disposed";
5759
+ }>;
5760
+ expectedPreimage: z.ZodObject<{
5761
+ status: z.ZodEnum<{
5762
+ idle: "idle";
5763
+ active: "active";
5764
+ starting: "starting";
5765
+ dead: "dead";
5766
+ disposed: "disposed";
5767
+ }>;
5768
+ adapterId: z.ZodString;
5769
+ binding: z.ZodOptional<z.ZodObject<{
5770
+ adapterId: z.ZodString;
5771
+ ownerMachineId: z.ZodString;
5772
+ ownerInstanceId: z.ZodString;
5773
+ }, z.core.$strip>>;
5774
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5775
+ }, z.core.$strip>;
5776
+ expectedRevision: z.ZodNumber;
5777
+ expectedCurrencyFence: z.ZodNumber;
5778
+ expectedCurrency: z.ZodObject<{
5779
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5780
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5781
+ currentAdapterSessionIdState: z.ZodEnum<{
5782
+ confirmed: "confirmed";
5783
+ moved: "moved";
5784
+ inherited: "inherited";
5785
+ }>;
5786
+ }, z.core.$strip>;
5787
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
5788
+ claimId: z.ZodString;
5789
+ claimToken: z.ZodString;
5790
+ fence: z.ZodNumber;
5791
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5792
+ status: z.ZodEnum<{
5793
+ abandoned: "abandoned";
5794
+ held: "held";
5795
+ releasing: "releasing";
5796
+ }>;
5797
+ }, z.core.$strip>>;
5798
+ }, z.core.$strip>>;
5799
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5800
+ sessionId: z.ZodString;
5801
+ agentId: z.ZodString;
5802
+ claimToken: z.ZodString;
5803
+ supersedes: z.ZodOptional<z.ZodObject<{
5804
+ claimToken: z.ZodString;
5805
+ }, z.core.$strip>>;
5806
+ designateLead: z.ZodOptional<z.ZodObject<{
5807
+ expectedLeadAgentId: z.ZodNullable<z.ZodString>;
5808
+ clear: z.ZodOptional<z.ZodLiteral<true>>;
5809
+ restore: z.ZodOptional<z.ZodLiteral<true>>;
5810
+ }, z.core.$strip>>;
5811
+ }, z.core.$strip>;
5812
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
5813
+ outcome: z.ZodLiteral<"claimed">;
5814
+ claim: z.ZodNullable<z.ZodObject<{
5815
+ machineId: z.ZodString;
5816
+ adapterId: z.ZodString;
5817
+ providerSessionId: z.ZodString;
5818
+ claimId: z.ZodString;
5819
+ adapterName: z.ZodString;
5820
+ sessionId: z.ZodString;
5821
+ agentId: z.ZodString;
5822
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5823
+ claimToken: z.ZodString;
5824
+ fence: z.ZodNumber;
5825
+ status: z.ZodEnum<{
5826
+ abandoned: "abandoned";
5827
+ held: "held";
5828
+ releasing: "releasing";
5829
+ }>;
5830
+ claimedAt: z.ZodNumber;
5831
+ updatedAt: z.ZodNumber;
5832
+ }, z.core.$strip>>;
5833
+ recovery: z.ZodOptional<z.ZodObject<{
5834
+ attemptId: z.ZodString;
5835
+ preimage: z.ZodObject<{
5836
+ status: z.ZodEnum<{
5837
+ idle: "idle";
5838
+ active: "active";
5839
+ starting: "starting";
5840
+ dead: "dead";
5841
+ disposed: "disposed";
5842
+ }>;
5843
+ adapterId: z.ZodString;
5844
+ binding: z.ZodOptional<z.ZodObject<{
5845
+ adapterId: z.ZodString;
5846
+ ownerMachineId: z.ZodString;
5847
+ ownerInstanceId: z.ZodString;
5848
+ }, z.core.$strip>>;
5849
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5850
+ }, z.core.$strip>;
5851
+ }, z.core.$strip>>;
5852
+ leadDesignated: z.ZodBoolean;
5853
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
5854
+ }, z.core.$strip>, z.ZodObject<{
5855
+ outcome: z.ZodLiteral<"idempotent">;
5856
+ claim: z.ZodNullable<z.ZodObject<{
5857
+ machineId: z.ZodString;
5858
+ adapterId: z.ZodString;
5859
+ providerSessionId: z.ZodString;
5860
+ claimId: z.ZodString;
5861
+ adapterName: z.ZodString;
5862
+ sessionId: z.ZodString;
5863
+ agentId: z.ZodString;
5864
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5865
+ claimToken: z.ZodString;
5866
+ fence: z.ZodNumber;
5867
+ status: z.ZodEnum<{
5868
+ abandoned: "abandoned";
5869
+ held: "held";
5870
+ releasing: "releasing";
5871
+ }>;
5872
+ claimedAt: z.ZodNumber;
5873
+ updatedAt: z.ZodNumber;
5874
+ }, z.core.$strip>>;
5875
+ recovery: z.ZodOptional<z.ZodObject<{
5876
+ attemptId: z.ZodString;
5877
+ preimage: z.ZodObject<{
5878
+ status: z.ZodEnum<{
5879
+ idle: "idle";
5880
+ active: "active";
5881
+ starting: "starting";
5882
+ dead: "dead";
5883
+ disposed: "disposed";
5884
+ }>;
5885
+ adapterId: z.ZodString;
5886
+ binding: z.ZodOptional<z.ZodObject<{
5887
+ adapterId: z.ZodString;
5888
+ ownerMachineId: z.ZodString;
5889
+ ownerInstanceId: z.ZodString;
5890
+ }, z.core.$strip>>;
5891
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5892
+ }, z.core.$strip>;
5893
+ }, z.core.$strip>>;
5894
+ leadDesignated: z.ZodBoolean;
5895
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
5896
+ }, z.core.$strip>, z.ZodObject<{
5897
+ outcome: z.ZodLiteral<"already-claimed">;
5898
+ holder: z.ZodObject<{
5899
+ machineId: z.ZodString;
5900
+ adapterId: z.ZodString;
5901
+ providerSessionId: z.ZodString;
5902
+ claimId: z.ZodString;
5903
+ adapterName: z.ZodString;
5904
+ sessionId: z.ZodString;
5905
+ agentId: z.ZodString;
5906
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5907
+ claimToken: z.ZodString;
5908
+ fence: z.ZodNumber;
5909
+ status: z.ZodEnum<{
5910
+ abandoned: "abandoned";
5911
+ held: "held";
5912
+ releasing: "releasing";
5913
+ }>;
5914
+ claimedAt: z.ZodNumber;
5915
+ updatedAt: z.ZodNumber;
5916
+ }, z.core.$strip>;
5917
+ }, z.core.$strip>, z.ZodObject<{
5918
+ outcome: z.ZodLiteral<"agent-disposed">;
5919
+ }, z.core.$strip>, z.ZodObject<{
5920
+ outcome: z.ZodLiteral<"session-not-active">;
5921
+ status: z.ZodEnum<{
5922
+ closed: "closed";
5923
+ discovered: "discovered";
5924
+ archived: "archived";
5925
+ }>;
5926
+ }, z.core.$strip>, z.ZodObject<{
5927
+ outcome: z.ZodLiteral<"lead-conflict">;
5928
+ currentLeadAgentId: z.ZodNullable<z.ZodString>;
5929
+ }, z.core.$strip>, z.ZodObject<{
5930
+ outcome: z.ZodLiteral<"not-found">;
5931
+ missing: z.ZodEnum<{
5932
+ agent: "agent";
5933
+ session: "session";
5934
+ }>;
5935
+ }, z.core.$strip>, z.ZodObject<{
5936
+ outcome: z.ZodLiteral<"currency-changed">;
5937
+ revision: z.ZodNumber;
5938
+ currencyFence: z.ZodNumber;
5939
+ currency: z.ZodObject<{
5940
+ adapterSessionId: z.ZodNullable<z.ZodString>;
5941
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
5942
+ currentAdapterSessionIdState: z.ZodEnum<{
5943
+ confirmed: "confirmed";
5944
+ moved: "moved";
5945
+ inherited: "inherited";
5946
+ }>;
5947
+ }, z.core.$strip>;
5948
+ }, z.core.$strip>, z.ZodObject<{
5949
+ outcome: z.ZodLiteral<"recovery-conflict">;
5950
+ status: z.ZodEnum<{
5951
+ idle: "idle";
5952
+ active: "active";
5953
+ starting: "starting";
5954
+ dead: "dead";
5955
+ disposed: "disposed";
5956
+ }>;
5957
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
5958
+ claimId: z.ZodString;
5959
+ claimToken: z.ZodString;
5960
+ fence: z.ZodNumber;
5961
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
5962
+ status: z.ZodEnum<{
5963
+ abandoned: "abandoned";
5964
+ held: "held";
5965
+ releasing: "releasing";
5966
+ }>;
5967
+ }, z.core.$strip>>;
5968
+ }, z.core.$strip>], "outcome">;
5969
+ }; /** Terminalize a recovery attempt under its opaque attempt fence. */
5970
+ finalizeRecovery: {
5971
+ request: z.ZodObject<{
5972
+ agentId: z.ZodString;
5973
+ attemptId: z.ZodString;
5974
+ binding: z.ZodObject<{
5975
+ adapterId: z.ZodString;
5976
+ ownerMachineId: z.ZodString;
5977
+ ownerInstanceId: z.ZodString;
5978
+ }, z.core.$strip>;
5979
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
5980
+ kind: z.ZodLiteral<"rollback">;
5981
+ preimage: z.ZodObject<{
5982
+ status: z.ZodEnum<{
5983
+ idle: "idle";
5984
+ active: "active";
5985
+ starting: "starting";
5986
+ dead: "dead";
5987
+ disposed: "disposed";
5988
+ }>;
5989
+ adapterId: z.ZodString;
5990
+ binding: z.ZodOptional<z.ZodObject<{
5991
+ adapterId: z.ZodString;
5992
+ ownerMachineId: z.ZodString;
5993
+ ownerInstanceId: z.ZodString;
5994
+ }, z.core.$strip>>;
5995
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
5996
+ }, z.core.$strip>;
5997
+ }, z.core.$strip>, z.ZodObject<{
5998
+ kind: z.ZodLiteral<"succeeded">;
5999
+ }, z.core.$strip>, z.ZodObject<{
6000
+ kind: z.ZodLiteral<"failed">;
6001
+ }, z.core.$strip>], "kind">;
6002
+ }, z.core.$strip>;
6003
+ response: z.ZodObject<{
6004
+ applied: z.ZodBoolean;
6005
+ }, z.core.$strip>;
6006
+ };
6007
+ /**
6008
+ * Write an agent's adapter-session currency under a claim generation, and
6009
+ * mirror it onto the session row when the agent is the designated lead.
6010
+ *
6011
+ * What is settled here is what a restart resumes: the resume-identity path
6012
+ * resolves an agent's currency from this row whenever it has been settled,
6013
+ * and falls back to the session row only for rows written before the agent
6014
+ * row could carry currency at all.
6015
+ *
6016
+ * Subject: `storage:sessionOwnership.settleCurrency`
6017
+ * Type: Request (RPC)
6018
+ */
6019
+ settleCurrency: {
6020
+ request: z.ZodObject<{
6021
+ agentId: z.ZodString;
6022
+ claimToken: z.ZodString;
6023
+ fence: z.ZodNumber;
6024
+ expectedRevision: z.ZodNumber;
6025
+ target: z.ZodObject<{
6026
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6027
+ currentAdapterSessionIdState: z.ZodEnum<{
6028
+ confirmed: "confirmed";
6029
+ moved: "moved";
6030
+ inherited: "inherited";
6031
+ }>;
6032
+ }, z.core.$strip>;
6033
+ }, z.core.$strip>;
6034
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6035
+ outcome: z.ZodLiteral<"settled">;
6036
+ revision: z.ZodNumber;
6037
+ currency: z.ZodObject<{
6038
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6039
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6040
+ currentAdapterSessionIdState: z.ZodEnum<{
6041
+ confirmed: "confirmed";
6042
+ moved: "moved";
6043
+ inherited: "inherited";
6044
+ }>;
6045
+ }, z.core.$strip>;
6046
+ sessionSnapshotUpdated: z.ZodBoolean;
6047
+ }, z.core.$strip>, z.ZodObject<{
6048
+ outcome: z.ZodLiteral<"idempotent">;
6049
+ revision: z.ZodNumber;
6050
+ currency: z.ZodObject<{
6051
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6052
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6053
+ currentAdapterSessionIdState: z.ZodEnum<{
6054
+ confirmed: "confirmed";
6055
+ moved: "moved";
6056
+ inherited: "inherited";
6057
+ }>;
6058
+ }, z.core.$strip>;
6059
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
6060
+ }, z.core.$strip>, z.ZodObject<{
6061
+ outcome: z.ZodLiteral<"superseded">;
6062
+ currentFence: z.ZodNumber;
6063
+ }, z.core.$strip>, z.ZodObject<{
6064
+ outcome: z.ZodLiteral<"currency-changed">;
6065
+ revision: z.ZodNumber;
6066
+ currency: z.ZodObject<{
6067
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6068
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6069
+ currentAdapterSessionIdState: z.ZodEnum<{
6070
+ confirmed: "confirmed";
6071
+ moved: "moved";
6072
+ inherited: "inherited";
6073
+ }>;
6074
+ }, z.core.$strip>;
6075
+ }, z.core.$strip>, z.ZodObject<{
6076
+ outcome: z.ZodLiteral<"not-owner">;
6077
+ }, z.core.$strip>, z.ZodObject<{
6078
+ outcome: z.ZodLiteral<"agent-disposed">;
6079
+ }, z.core.$strip>, z.ZodObject<{
6080
+ outcome: z.ZodLiteral<"not-found">;
6081
+ }, z.core.$strip>], "outcome">;
6082
+ };
6083
+ /**
6084
+ * Record a provider-session movement in full: acquire or recognize the
6085
+ * successor generation, settle the agent's currency under it, retire the
6086
+ * predecessors it replaces, and mirror the result onto the session row —
6087
+ * all in one transaction.
6088
+ *
6089
+ * The composite `settleCurrency` exists inside. Callers use this one;
6090
+ * `settleCurrency` remains the single-step primitive the claim/settle
6091
+ * interleavings are exercised through.
6092
+ *
6093
+ * Subject: `storage:sessionOwnership.settleMovement`
6094
+ * Type: Request (RPC)
6095
+ */
6096
+ settleMovement: {
6097
+ request: z.ZodObject<{
6098
+ machineId: z.ZodString;
6099
+ adapterId: z.ZodString;
6100
+ adapterName: z.ZodString;
6101
+ ownerInstance: z.ZodOptional<z.ZodObject<{
6102
+ instanceId: z.ZodString;
6103
+ }, z.core.$strip>>;
6104
+ topology: z.ZodDefault<z.ZodEnum<{
6105
+ "machine-exclusive": "machine-exclusive";
6106
+ "shared-machine": "shared-machine";
6107
+ }>>;
6108
+ sessionId: z.ZodString;
6109
+ agentId: z.ZodString;
6110
+ expectedRevision: z.ZodNumber;
6111
+ movement: z.ZodDiscriminatedUnion<[z.ZodObject<{
6112
+ kind: z.ZodLiteral<"confirmed">;
6113
+ providerSessionId: z.ZodString;
6114
+ claimToken: z.ZodString;
6115
+ }, z.core.$strip>, z.ZodObject<{
6116
+ kind: z.ZodLiteral<"demote">;
6117
+ claimToken: z.ZodString;
6118
+ }, z.core.$strip>], "kind">;
6119
+ }, z.core.$strip>;
6120
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6121
+ outcome: z.ZodLiteral<"settled">;
6122
+ revision: z.ZodNumber;
6123
+ currency: z.ZodObject<{
6124
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6125
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6126
+ currentAdapterSessionIdState: z.ZodEnum<{
6127
+ confirmed: "confirmed";
6128
+ moved: "moved";
6129
+ inherited: "inherited";
6130
+ }>;
6131
+ }, z.core.$strip>;
6132
+ sessionSnapshotUpdated: z.ZodBoolean;
6133
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
6134
+ claim: z.ZodObject<{
6135
+ machineId: z.ZodString;
6136
+ adapterId: z.ZodString;
6137
+ providerSessionId: z.ZodString;
6138
+ claimId: z.ZodString;
6139
+ adapterName: z.ZodString;
6140
+ sessionId: z.ZodString;
6141
+ agentId: z.ZodString;
6142
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6143
+ claimToken: z.ZodString;
6144
+ fence: z.ZodNumber;
6145
+ status: z.ZodEnum<{
6146
+ abandoned: "abandoned";
6147
+ held: "held";
6148
+ releasing: "releasing";
6149
+ }>;
6150
+ claimedAt: z.ZodNumber;
6151
+ updatedAt: z.ZodNumber;
6152
+ }, z.core.$strip>;
6153
+ }, z.core.$strip>, z.ZodObject<{
6154
+ outcome: z.ZodLiteral<"idempotent">;
6155
+ revision: z.ZodNumber;
6156
+ currency: z.ZodObject<{
6157
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6158
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6159
+ currentAdapterSessionIdState: z.ZodEnum<{
6160
+ confirmed: "confirmed";
6161
+ moved: "moved";
6162
+ inherited: "inherited";
6163
+ }>;
6164
+ }, z.core.$strip>;
6165
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
6166
+ claim: z.ZodNullable<z.ZodObject<{
6167
+ machineId: z.ZodString;
6168
+ adapterId: z.ZodString;
6169
+ providerSessionId: z.ZodString;
6170
+ claimId: z.ZodString;
6171
+ adapterName: z.ZodString;
6172
+ sessionId: z.ZodString;
6173
+ agentId: z.ZodString;
6174
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6175
+ claimToken: z.ZodString;
6176
+ fence: z.ZodNumber;
6177
+ status: z.ZodEnum<{
6178
+ abandoned: "abandoned";
6179
+ held: "held";
6180
+ releasing: "releasing";
6181
+ }>;
6182
+ claimedAt: z.ZodNumber;
6183
+ updatedAt: z.ZodNumber;
6184
+ }, z.core.$strip>>;
6185
+ }, z.core.$strip>, z.ZodObject<{
6186
+ outcome: z.ZodLiteral<"already-claimed">;
6187
+ holder: z.ZodObject<{
6188
+ machineId: z.ZodString;
6189
+ adapterId: z.ZodString;
6190
+ providerSessionId: z.ZodString;
6191
+ claimId: z.ZodString;
6192
+ adapterName: z.ZodString;
6193
+ sessionId: z.ZodString;
6194
+ agentId: z.ZodString;
6195
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6196
+ claimToken: z.ZodString;
6197
+ fence: z.ZodNumber;
6198
+ status: z.ZodEnum<{
6199
+ abandoned: "abandoned";
6200
+ held: "held";
6201
+ releasing: "releasing";
6202
+ }>;
6203
+ claimedAt: z.ZodNumber;
6204
+ updatedAt: z.ZodNumber;
6205
+ }, z.core.$strip>;
6206
+ }, z.core.$strip>, z.ZodObject<{
6207
+ outcome: z.ZodLiteral<"superseded">;
6208
+ currentFence: z.ZodNumber;
6209
+ }, z.core.$strip>, z.ZodObject<{
6210
+ outcome: z.ZodLiteral<"currency-changed">;
6211
+ revision: z.ZodNumber;
6212
+ currency: z.ZodObject<{
6213
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6214
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6215
+ currentAdapterSessionIdState: z.ZodEnum<{
6216
+ confirmed: "confirmed";
6217
+ moved: "moved";
6218
+ inherited: "inherited";
6219
+ }>;
6220
+ }, z.core.$strip>;
6221
+ }, z.core.$strip>, z.ZodObject<{
6222
+ outcome: z.ZodLiteral<"not-owner">;
6223
+ }, z.core.$strip>, z.ZodObject<{
6224
+ outcome: z.ZodLiteral<"agent-disposed">;
6225
+ }, z.core.$strip>, z.ZodObject<{
6226
+ outcome: z.ZodLiteral<"not-found">;
6227
+ }, z.core.$strip>], "outcome">;
6228
+ };
6229
+ /**
6230
+ * Give up a claim — freeing the ownership key only on a clean release.
6231
+ *
6232
+ * Subject: `storage:sessionOwnership.release`
6233
+ * Type: Request (RPC)
6234
+ */
6235
+ release: {
6236
+ request: z.ZodObject<{
6237
+ agentId: z.ZodString;
6238
+ claimToken: z.ZodString;
6239
+ disposition: z.ZodEnum<{
6240
+ released: "released";
6241
+ abandoned: "abandoned";
6242
+ releasing: "releasing";
6243
+ }>;
6244
+ }, z.core.$strip>;
6245
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6246
+ outcome: z.ZodLiteral<"released">;
6247
+ }, z.core.$strip>, z.ZodObject<{
6248
+ outcome: z.ZodLiteral<"marked">;
6249
+ claim: z.ZodObject<{
6250
+ machineId: z.ZodString;
6251
+ adapterId: z.ZodString;
6252
+ providerSessionId: z.ZodString;
6253
+ claimId: z.ZodString;
6254
+ adapterName: z.ZodString;
6255
+ sessionId: z.ZodString;
6256
+ agentId: z.ZodString;
6257
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6258
+ claimToken: z.ZodString;
6259
+ fence: z.ZodNumber;
6260
+ status: z.ZodEnum<{
6261
+ abandoned: "abandoned";
6262
+ held: "held";
6263
+ releasing: "releasing";
6264
+ }>;
6265
+ claimedAt: z.ZodNumber;
6266
+ updatedAt: z.ZodNumber;
6267
+ }, z.core.$strip>;
6268
+ }, z.core.$strip>, z.ZodObject<{
6269
+ outcome: z.ZodLiteral<"not-owner">;
6270
+ holder: z.ZodObject<{
6271
+ machineId: z.ZodString;
6272
+ adapterId: z.ZodString;
6273
+ providerSessionId: z.ZodString;
6274
+ claimId: z.ZodString;
6275
+ adapterName: z.ZodString;
6276
+ sessionId: z.ZodString;
6277
+ agentId: z.ZodString;
6278
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6279
+ claimToken: z.ZodString;
6280
+ fence: z.ZodNumber;
6281
+ status: z.ZodEnum<{
6282
+ abandoned: "abandoned";
6283
+ held: "held";
6284
+ releasing: "releasing";
6285
+ }>;
6286
+ claimedAt: z.ZodNumber;
6287
+ updatedAt: z.ZodNumber;
6288
+ }, z.core.$strip>;
6289
+ }, z.core.$strip>, z.ZodObject<{
6290
+ outcome: z.ZodLiteral<"not-found">;
6291
+ }, z.core.$strip>], "outcome">;
6292
+ };
6293
+ /**
6294
+ * Give up every claim an agent holds, or exactly one of them, in a single
6295
+ * statement — the teardown fan-out and the reservation rollback.
6296
+ *
6297
+ * Subject: `storage:sessionOwnership.releaseAgentClaims`
6298
+ * Type: Request (RPC)
6299
+ */
6300
+ releaseAgentClaims: {
6301
+ request: z.ZodObject<{
6302
+ agentId: z.ZodString;
6303
+ claimToken: z.ZodOptional<z.ZodString>;
6304
+ disposition: z.ZodEnum<{
6305
+ released: "released";
6306
+ abandoned: "abandoned";
6307
+ releasing: "releasing";
6308
+ }>;
6309
+ }, z.core.$strip>;
6310
+ response: z.ZodObject<{
6311
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
6312
+ markedClaims: z.ZodArray<z.ZodObject<{
6313
+ machineId: z.ZodString;
6314
+ adapterId: z.ZodString;
6315
+ providerSessionId: z.ZodString;
6316
+ claimId: z.ZodString;
6317
+ adapterName: z.ZodString;
6318
+ sessionId: z.ZodString;
6319
+ agentId: z.ZodString;
6320
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6321
+ claimToken: z.ZodString;
6322
+ fence: z.ZodNumber;
6323
+ status: z.ZodEnum<{
6324
+ abandoned: "abandoned";
6325
+ held: "held";
6326
+ releasing: "releasing";
6327
+ }>;
6328
+ claimedAt: z.ZodNumber;
6329
+ updatedAt: z.ZodNumber;
6330
+ }, z.core.$strip>>;
6331
+ claimTokenNotFound: z.ZodBoolean;
6332
+ }, z.core.$strip>;
6333
+ };
6334
+ /**
6335
+ * List the claims recorded for a machine — the read reconciliation and
6336
+ * ownership diagnostics run on.
6337
+ *
6338
+ * Subject: `storage:sessionOwnership.listClaims`
6339
+ * Type: Request (RPC)
6340
+ */
6341
+ listClaims: {
6342
+ request: z.ZodObject<{
6343
+ machineId: z.ZodString;
6344
+ adapterId: z.ZodOptional<z.ZodString>;
6345
+ providerSessionId: z.ZodOptional<z.ZodString>;
6346
+ statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
6347
+ abandoned: "abandoned";
6348
+ held: "held";
6349
+ releasing: "releasing";
6350
+ }>>>;
6351
+ }, z.core.$strip>;
6352
+ response: z.ZodObject<{
6353
+ claims: z.ZodArray<z.ZodObject<{
6354
+ machineId: z.ZodString;
6355
+ adapterId: z.ZodString;
6356
+ providerSessionId: z.ZodString;
6357
+ claimId: z.ZodString;
6358
+ adapterName: z.ZodString;
6359
+ sessionId: z.ZodString;
6360
+ agentId: z.ZodString;
6361
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6362
+ claimToken: z.ZodString;
6363
+ fence: z.ZodNumber;
6364
+ status: z.ZodEnum<{
6365
+ abandoned: "abandoned";
6366
+ held: "held";
6367
+ releasing: "releasing";
6368
+ }>;
6369
+ claimedAt: z.ZodNumber;
6370
+ updatedAt: z.ZodNumber;
6371
+ }, z.core.$strip>>;
6372
+ }, z.core.$strip>;
6373
+ };
6374
+ /**
6375
+ * Stamp every row for a runtime process as retired without releasing its
6376
+ * claims. Repeating the operation is idempotent.
6377
+ *
6378
+ * Subject: `storage:sessionOwnership.retireInstance`
6379
+ * Type: Request (RPC)
6380
+ */
6381
+ retireInstance: {
6382
+ request: z.ZodObject<{
6383
+ instanceId: z.ZodString;
6384
+ }, z.core.$strip>;
6385
+ response: z.ZodObject<{
6386
+ retiredMachines: z.ZodNumber;
6387
+ }, z.core.$strip>;
6388
+ };
6389
+ /**
6390
+ * Read one runtime-instance row for diagnostics only.
6391
+ *
6392
+ * Subject: `storage:sessionOwnership.getRuntimeInstance`
6393
+ * Type: Request (RPC)
6394
+ */
6395
+ getRuntimeInstance: {
6396
+ request: z.ZodObject<{
6397
+ instanceId: z.ZodString;
6398
+ machineId: z.ZodString;
6399
+ }, z.core.$strip>;
6400
+ response: z.ZodObject<{
6401
+ instance: z.ZodNullable<z.ZodObject<{
6402
+ instanceId: z.ZodString;
6403
+ machineId: z.ZodString;
6404
+ incarnation: z.ZodNumber;
6405
+ startedAt: z.ZodNumber;
6406
+ retiredAt: z.ZodNullable<z.ZodNumber>;
6407
+ }, z.core.$strip>>;
6408
+ }, z.core.$strip>;
6409
+ };
6410
+ }, Record<string, never>>;
6411
+ /**
6412
+ * Typed subjects for session ownership storage operations.
6413
+ */
6414
+ declare const SessionOwnershipStorageSubjects$1: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjectDefinitions<"storage:sessionOwnership", {
6415
+ /**
6416
+ * Read one agent's durable ownership state.
6417
+ *
6418
+ * **Not a consistent snapshot**, in either direction: the agent row and its
6419
+ * claims are read as two statements, so a concurrent claim or release can
6420
+ * show up in one and not the other. A reader may therefore observe a claim
6421
+ * whose fence the agent's `currencyFence` does not yet account for, or a
6422
+ * `currencyFence` whose authoring claim has already been released. Both are
6423
+ * legitimate instants of the aggregate; a reader that needs authority must
6424
+ * ask for it (`settleCurrency`) rather than infer it from this read.
6425
+ *
6426
+ * Subject: `storage:sessionOwnership.read`
6427
+ * Type: Request (RPC)
6428
+ */
6429
+ read: {
6430
+ request: z.ZodObject<{
6431
+ agentId: z.ZodString;
6432
+ }, z.core.$strip>;
6433
+ response: z.ZodObject<{
6434
+ ownership: z.ZodNullable<z.ZodObject<{
6435
+ agentId: z.ZodString;
6436
+ sessionId: z.ZodString;
6437
+ currency: z.ZodObject<{
6438
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6439
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6440
+ currentAdapterSessionIdState: z.ZodEnum<{
6441
+ confirmed: "confirmed";
6442
+ moved: "moved";
6443
+ inherited: "inherited";
6444
+ }>;
6445
+ }, z.core.$strip>;
6446
+ revision: z.ZodNumber;
6447
+ currencyFence: z.ZodNumber;
6448
+ claims: z.ZodArray<z.ZodObject<{
6449
+ machineId: z.ZodString;
6450
+ adapterId: z.ZodString;
6451
+ providerSessionId: z.ZodString;
6452
+ claimId: z.ZodString;
6453
+ adapterName: z.ZodString;
6454
+ sessionId: z.ZodString;
6455
+ agentId: z.ZodString;
6456
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6457
+ claimToken: z.ZodString;
6458
+ fence: z.ZodNumber;
6459
+ status: z.ZodEnum<{
6460
+ abandoned: "abandoned";
6461
+ held: "held";
6462
+ releasing: "releasing";
6463
+ }>;
6464
+ claimedAt: z.ZodNumber;
6465
+ updatedAt: z.ZodNumber;
6466
+ }, z.core.$strip>>;
6467
+ }, z.core.$strip>>;
6468
+ }, z.core.$strip>;
6469
+ };
6470
+ /**
6471
+ * Take or take over the ownership claim on a provider session, optionally
6472
+ * designating the claiming agent as the session's lead in the same
6473
+ * transaction.
6474
+ *
6475
+ * With `providerSessionId: null` it is the **keyless reservation**: no claim
6476
+ * row at all, and the designation plus its currency mirror are the whole
6477
+ * effect. That is the fresh-start shape — there is no provider identity to
6478
+ * own yet, and the designation still has to be atomic and compare-and-swap.
6479
+ *
6480
+ * Subject: `storage:sessionOwnership.claim`
6481
+ * Type: Request (RPC)
6482
+ */
6483
+ claim: {
6484
+ request: z.ZodObject<{
6485
+ machineId: z.ZodString;
6486
+ adapterId: z.ZodString;
6487
+ providerSessionId: z.ZodNullable<z.ZodString>;
6488
+ adapterName: z.ZodString;
6489
+ ownerInstance: z.ZodOptional<z.ZodObject<{
6490
+ instanceId: z.ZodString;
6491
+ }, z.core.$strip>>;
6492
+ topology: z.ZodDefault<z.ZodEnum<{
6493
+ "machine-exclusive": "machine-exclusive";
6494
+ "shared-machine": "shared-machine";
6495
+ }>>;
6496
+ recoveryGuard: z.ZodOptional<z.ZodObject<{
6497
+ expectedStatus: z.ZodEnum<{
6498
+ idle: "idle";
6499
+ active: "active";
6500
+ starting: "starting";
6501
+ dead: "dead";
6502
+ disposed: "disposed";
6503
+ }>;
6504
+ expectedPreimage: z.ZodObject<{
6505
+ status: z.ZodEnum<{
6506
+ idle: "idle";
6507
+ active: "active";
6508
+ starting: "starting";
6509
+ dead: "dead";
6510
+ disposed: "disposed";
6511
+ }>;
6512
+ adapterId: z.ZodString;
6513
+ binding: z.ZodOptional<z.ZodObject<{
6514
+ adapterId: z.ZodString;
6515
+ ownerMachineId: z.ZodString;
6516
+ ownerInstanceId: z.ZodString;
6517
+ }, z.core.$strip>>;
6518
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
6519
+ }, z.core.$strip>;
6520
+ expectedRevision: z.ZodNumber;
6521
+ expectedCurrencyFence: z.ZodNumber;
6522
+ expectedCurrency: z.ZodObject<{
6523
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6524
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6525
+ currentAdapterSessionIdState: z.ZodEnum<{
6526
+ confirmed: "confirmed";
6527
+ moved: "moved";
6528
+ inherited: "inherited";
6529
+ }>;
6530
+ }, z.core.$strip>;
6531
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
6532
+ claimId: z.ZodString;
6533
+ claimToken: z.ZodString;
6534
+ fence: z.ZodNumber;
6535
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6536
+ status: z.ZodEnum<{
6537
+ abandoned: "abandoned";
6538
+ held: "held";
6539
+ releasing: "releasing";
6540
+ }>;
6541
+ }, z.core.$strip>>;
6542
+ }, z.core.$strip>>;
6543
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
6544
+ sessionId: z.ZodString;
6545
+ agentId: z.ZodString;
6546
+ claimToken: z.ZodString;
6547
+ supersedes: z.ZodOptional<z.ZodObject<{
6548
+ claimToken: z.ZodString;
6549
+ }, z.core.$strip>>;
6550
+ designateLead: z.ZodOptional<z.ZodObject<{
6551
+ expectedLeadAgentId: z.ZodNullable<z.ZodString>;
6552
+ clear: z.ZodOptional<z.ZodLiteral<true>>;
6553
+ restore: z.ZodOptional<z.ZodLiteral<true>>;
6554
+ }, z.core.$strip>>;
6555
+ }, z.core.$strip>;
6556
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6557
+ outcome: z.ZodLiteral<"claimed">;
6558
+ claim: z.ZodNullable<z.ZodObject<{
6559
+ machineId: z.ZodString;
6560
+ adapterId: z.ZodString;
6561
+ providerSessionId: z.ZodString;
6562
+ claimId: z.ZodString;
6563
+ adapterName: z.ZodString;
6564
+ sessionId: z.ZodString;
6565
+ agentId: z.ZodString;
6566
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6567
+ claimToken: z.ZodString;
6568
+ fence: z.ZodNumber;
6569
+ status: z.ZodEnum<{
6570
+ abandoned: "abandoned";
6571
+ held: "held";
6572
+ releasing: "releasing";
6573
+ }>;
6574
+ claimedAt: z.ZodNumber;
6575
+ updatedAt: z.ZodNumber;
6576
+ }, z.core.$strip>>;
6577
+ recovery: z.ZodOptional<z.ZodObject<{
6578
+ attemptId: z.ZodString;
6579
+ preimage: z.ZodObject<{
6580
+ status: z.ZodEnum<{
6581
+ idle: "idle";
6582
+ active: "active";
6583
+ starting: "starting";
6584
+ dead: "dead";
6585
+ disposed: "disposed";
6586
+ }>;
6587
+ adapterId: z.ZodString;
6588
+ binding: z.ZodOptional<z.ZodObject<{
6589
+ adapterId: z.ZodString;
6590
+ ownerMachineId: z.ZodString;
6591
+ ownerInstanceId: z.ZodString;
6592
+ }, z.core.$strip>>;
6593
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
6594
+ }, z.core.$strip>;
6595
+ }, z.core.$strip>>;
6596
+ leadDesignated: z.ZodBoolean;
6597
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
6598
+ }, z.core.$strip>, z.ZodObject<{
6599
+ outcome: z.ZodLiteral<"idempotent">;
6600
+ claim: z.ZodNullable<z.ZodObject<{
6601
+ machineId: z.ZodString;
6602
+ adapterId: z.ZodString;
6603
+ providerSessionId: z.ZodString;
6604
+ claimId: z.ZodString;
6605
+ adapterName: z.ZodString;
6606
+ sessionId: z.ZodString;
6607
+ agentId: z.ZodString;
6608
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6609
+ claimToken: z.ZodString;
6610
+ fence: z.ZodNumber;
6611
+ status: z.ZodEnum<{
6612
+ abandoned: "abandoned";
6613
+ held: "held";
6614
+ releasing: "releasing";
6615
+ }>;
6616
+ claimedAt: z.ZodNumber;
6617
+ updatedAt: z.ZodNumber;
6618
+ }, z.core.$strip>>;
6619
+ recovery: z.ZodOptional<z.ZodObject<{
6620
+ attemptId: z.ZodString;
6621
+ preimage: z.ZodObject<{
6622
+ status: z.ZodEnum<{
6623
+ idle: "idle";
6624
+ active: "active";
6625
+ starting: "starting";
6626
+ dead: "dead";
6627
+ disposed: "disposed";
6628
+ }>;
6629
+ adapterId: z.ZodString;
6630
+ binding: z.ZodOptional<z.ZodObject<{
6631
+ adapterId: z.ZodString;
6632
+ ownerMachineId: z.ZodString;
6633
+ ownerInstanceId: z.ZodString;
6634
+ }, z.core.$strip>>;
6635
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
6636
+ }, z.core.$strip>;
6637
+ }, z.core.$strip>>;
6638
+ leadDesignated: z.ZodBoolean;
6639
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
6640
+ }, z.core.$strip>, z.ZodObject<{
6641
+ outcome: z.ZodLiteral<"already-claimed">;
6642
+ holder: z.ZodObject<{
6643
+ machineId: z.ZodString;
6644
+ adapterId: z.ZodString;
6645
+ providerSessionId: z.ZodString;
6646
+ claimId: z.ZodString;
6647
+ adapterName: z.ZodString;
6648
+ sessionId: z.ZodString;
6649
+ agentId: z.ZodString;
6650
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6651
+ claimToken: z.ZodString;
6652
+ fence: z.ZodNumber;
6653
+ status: z.ZodEnum<{
6654
+ abandoned: "abandoned";
6655
+ held: "held";
6656
+ releasing: "releasing";
6657
+ }>;
6658
+ claimedAt: z.ZodNumber;
6659
+ updatedAt: z.ZodNumber;
6660
+ }, z.core.$strip>;
6661
+ }, z.core.$strip>, z.ZodObject<{
6662
+ outcome: z.ZodLiteral<"agent-disposed">;
6663
+ }, z.core.$strip>, z.ZodObject<{
6664
+ outcome: z.ZodLiteral<"session-not-active">;
6665
+ status: z.ZodEnum<{
6666
+ closed: "closed";
6667
+ discovered: "discovered";
6668
+ archived: "archived";
6669
+ }>;
6670
+ }, z.core.$strip>, z.ZodObject<{
6671
+ outcome: z.ZodLiteral<"lead-conflict">;
6672
+ currentLeadAgentId: z.ZodNullable<z.ZodString>;
6673
+ }, z.core.$strip>, z.ZodObject<{
6674
+ outcome: z.ZodLiteral<"not-found">;
6675
+ missing: z.ZodEnum<{
6676
+ agent: "agent";
6677
+ session: "session";
6678
+ }>;
6679
+ }, z.core.$strip>, z.ZodObject<{
6680
+ outcome: z.ZodLiteral<"currency-changed">;
6681
+ revision: z.ZodNumber;
6682
+ currencyFence: z.ZodNumber;
6683
+ currency: z.ZodObject<{
6684
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6685
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6686
+ currentAdapterSessionIdState: z.ZodEnum<{
6687
+ confirmed: "confirmed";
6688
+ moved: "moved";
6689
+ inherited: "inherited";
6690
+ }>;
6691
+ }, z.core.$strip>;
6692
+ }, z.core.$strip>, z.ZodObject<{
6693
+ outcome: z.ZodLiteral<"recovery-conflict">;
6694
+ status: z.ZodEnum<{
6695
+ idle: "idle";
6696
+ active: "active";
6697
+ starting: "starting";
6698
+ dead: "dead";
6699
+ disposed: "disposed";
6700
+ }>;
6701
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
6702
+ claimId: z.ZodString;
6703
+ claimToken: z.ZodString;
6704
+ fence: z.ZodNumber;
6705
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6706
+ status: z.ZodEnum<{
6707
+ abandoned: "abandoned";
6708
+ held: "held";
6709
+ releasing: "releasing";
6710
+ }>;
6711
+ }, z.core.$strip>>;
6712
+ }, z.core.$strip>], "outcome">;
6713
+ }; /** Terminalize a recovery attempt under its opaque attempt fence. */
6714
+ finalizeRecovery: {
6715
+ request: z.ZodObject<{
6716
+ agentId: z.ZodString;
6717
+ attemptId: z.ZodString;
6718
+ binding: z.ZodObject<{
6719
+ adapterId: z.ZodString;
6720
+ ownerMachineId: z.ZodString;
6721
+ ownerInstanceId: z.ZodString;
6722
+ }, z.core.$strip>;
6723
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
6724
+ kind: z.ZodLiteral<"rollback">;
6725
+ preimage: z.ZodObject<{
6726
+ status: z.ZodEnum<{
6727
+ idle: "idle";
6728
+ active: "active";
6729
+ starting: "starting";
6730
+ dead: "dead";
6731
+ disposed: "disposed";
6732
+ }>;
6733
+ adapterId: z.ZodString;
6734
+ binding: z.ZodOptional<z.ZodObject<{
6735
+ adapterId: z.ZodString;
6736
+ ownerMachineId: z.ZodString;
6737
+ ownerInstanceId: z.ZodString;
6738
+ }, z.core.$strip>>;
6739
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
6740
+ }, z.core.$strip>;
6741
+ }, z.core.$strip>, z.ZodObject<{
6742
+ kind: z.ZodLiteral<"succeeded">;
6743
+ }, z.core.$strip>, z.ZodObject<{
6744
+ kind: z.ZodLiteral<"failed">;
6745
+ }, z.core.$strip>], "kind">;
6746
+ }, z.core.$strip>;
6747
+ response: z.ZodObject<{
6748
+ applied: z.ZodBoolean;
6749
+ }, z.core.$strip>;
6750
+ };
6751
+ /**
6752
+ * Write an agent's adapter-session currency under a claim generation, and
6753
+ * mirror it onto the session row when the agent is the designated lead.
6754
+ *
6755
+ * What is settled here is what a restart resumes: the resume-identity path
6756
+ * resolves an agent's currency from this row whenever it has been settled,
6757
+ * and falls back to the session row only for rows written before the agent
6758
+ * row could carry currency at all.
6759
+ *
6760
+ * Subject: `storage:sessionOwnership.settleCurrency`
6761
+ * Type: Request (RPC)
6762
+ */
6763
+ settleCurrency: {
6764
+ request: z.ZodObject<{
6765
+ agentId: z.ZodString;
6766
+ claimToken: z.ZodString;
6767
+ fence: z.ZodNumber;
6768
+ expectedRevision: z.ZodNumber;
6769
+ target: z.ZodObject<{
6770
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6771
+ currentAdapterSessionIdState: z.ZodEnum<{
6772
+ confirmed: "confirmed";
6773
+ moved: "moved";
6774
+ inherited: "inherited";
6775
+ }>;
6776
+ }, z.core.$strip>;
6777
+ }, z.core.$strip>;
6778
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6779
+ outcome: z.ZodLiteral<"settled">;
6780
+ revision: z.ZodNumber;
6781
+ currency: z.ZodObject<{
6782
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6783
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6784
+ currentAdapterSessionIdState: z.ZodEnum<{
6785
+ confirmed: "confirmed";
6786
+ moved: "moved";
6787
+ inherited: "inherited";
6788
+ }>;
6789
+ }, z.core.$strip>;
6790
+ sessionSnapshotUpdated: z.ZodBoolean;
6791
+ }, z.core.$strip>, z.ZodObject<{
6792
+ outcome: z.ZodLiteral<"idempotent">;
6793
+ revision: z.ZodNumber;
6794
+ currency: z.ZodObject<{
6795
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6796
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6797
+ currentAdapterSessionIdState: z.ZodEnum<{
6798
+ confirmed: "confirmed";
6799
+ moved: "moved";
6800
+ inherited: "inherited";
6801
+ }>;
6802
+ }, z.core.$strip>;
6803
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
6804
+ }, z.core.$strip>, z.ZodObject<{
6805
+ outcome: z.ZodLiteral<"superseded">;
6806
+ currentFence: z.ZodNumber;
6807
+ }, z.core.$strip>, z.ZodObject<{
6808
+ outcome: z.ZodLiteral<"currency-changed">;
6809
+ revision: z.ZodNumber;
6810
+ currency: z.ZodObject<{
6811
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6812
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6813
+ currentAdapterSessionIdState: z.ZodEnum<{
6814
+ confirmed: "confirmed";
6815
+ moved: "moved";
6816
+ inherited: "inherited";
6817
+ }>;
6818
+ }, z.core.$strip>;
6819
+ }, z.core.$strip>, z.ZodObject<{
6820
+ outcome: z.ZodLiteral<"not-owner">;
6821
+ }, z.core.$strip>, z.ZodObject<{
6822
+ outcome: z.ZodLiteral<"agent-disposed">;
6823
+ }, z.core.$strip>, z.ZodObject<{
6824
+ outcome: z.ZodLiteral<"not-found">;
6825
+ }, z.core.$strip>], "outcome">;
6826
+ };
6827
+ /**
6828
+ * Record a provider-session movement in full: acquire or recognize the
6829
+ * successor generation, settle the agent's currency under it, retire the
6830
+ * predecessors it replaces, and mirror the result onto the session row —
6831
+ * all in one transaction.
6832
+ *
6833
+ * The composite `settleCurrency` exists inside. Callers use this one;
6834
+ * `settleCurrency` remains the single-step primitive the claim/settle
6835
+ * interleavings are exercised through.
6836
+ *
6837
+ * Subject: `storage:sessionOwnership.settleMovement`
6838
+ * Type: Request (RPC)
6839
+ */
6840
+ settleMovement: {
6841
+ request: z.ZodObject<{
6842
+ machineId: z.ZodString;
6843
+ adapterId: z.ZodString;
6844
+ adapterName: z.ZodString;
6845
+ ownerInstance: z.ZodOptional<z.ZodObject<{
6846
+ instanceId: z.ZodString;
6847
+ }, z.core.$strip>>;
6848
+ topology: z.ZodDefault<z.ZodEnum<{
6849
+ "machine-exclusive": "machine-exclusive";
6850
+ "shared-machine": "shared-machine";
6851
+ }>>;
6852
+ sessionId: z.ZodString;
6853
+ agentId: z.ZodString;
6854
+ expectedRevision: z.ZodNumber;
6855
+ movement: z.ZodDiscriminatedUnion<[z.ZodObject<{
6856
+ kind: z.ZodLiteral<"confirmed">;
6857
+ providerSessionId: z.ZodString;
6858
+ claimToken: z.ZodString;
6859
+ }, z.core.$strip>, z.ZodObject<{
6860
+ kind: z.ZodLiteral<"demote">;
6861
+ claimToken: z.ZodString;
6862
+ }, z.core.$strip>], "kind">;
6863
+ }, z.core.$strip>;
6864
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6865
+ outcome: z.ZodLiteral<"settled">;
6866
+ revision: z.ZodNumber;
6867
+ currency: z.ZodObject<{
6868
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6869
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6870
+ currentAdapterSessionIdState: z.ZodEnum<{
6871
+ confirmed: "confirmed";
6872
+ moved: "moved";
6873
+ inherited: "inherited";
6874
+ }>;
6875
+ }, z.core.$strip>;
6876
+ sessionSnapshotUpdated: z.ZodBoolean;
6877
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
6878
+ claim: z.ZodObject<{
6879
+ machineId: z.ZodString;
6880
+ adapterId: z.ZodString;
6881
+ providerSessionId: z.ZodString;
6882
+ claimId: z.ZodString;
6883
+ adapterName: z.ZodString;
6884
+ sessionId: z.ZodString;
6885
+ agentId: z.ZodString;
6886
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6887
+ claimToken: z.ZodString;
6888
+ fence: z.ZodNumber;
6889
+ status: z.ZodEnum<{
6890
+ abandoned: "abandoned";
6891
+ held: "held";
6892
+ releasing: "releasing";
6893
+ }>;
6894
+ claimedAt: z.ZodNumber;
6895
+ updatedAt: z.ZodNumber;
6896
+ }, z.core.$strip>;
6897
+ }, z.core.$strip>, z.ZodObject<{
6898
+ outcome: z.ZodLiteral<"idempotent">;
6899
+ revision: z.ZodNumber;
6900
+ currency: z.ZodObject<{
6901
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6902
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6903
+ currentAdapterSessionIdState: z.ZodEnum<{
6904
+ confirmed: "confirmed";
6905
+ moved: "moved";
6906
+ inherited: "inherited";
6907
+ }>;
6908
+ }, z.core.$strip>;
6909
+ sessionSnapshotUpdated: z.ZodLiteral<false>;
6910
+ claim: z.ZodNullable<z.ZodObject<{
6911
+ machineId: z.ZodString;
6912
+ adapterId: z.ZodString;
6913
+ providerSessionId: z.ZodString;
6914
+ claimId: z.ZodString;
6915
+ adapterName: z.ZodString;
6916
+ sessionId: z.ZodString;
6917
+ agentId: z.ZodString;
6918
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6919
+ claimToken: z.ZodString;
6920
+ fence: z.ZodNumber;
6921
+ status: z.ZodEnum<{
6922
+ abandoned: "abandoned";
6923
+ held: "held";
6924
+ releasing: "releasing";
6925
+ }>;
6926
+ claimedAt: z.ZodNumber;
6927
+ updatedAt: z.ZodNumber;
6928
+ }, z.core.$strip>>;
6929
+ }, z.core.$strip>, z.ZodObject<{
6930
+ outcome: z.ZodLiteral<"already-claimed">;
6931
+ holder: z.ZodObject<{
6932
+ machineId: z.ZodString;
6933
+ adapterId: z.ZodString;
6934
+ providerSessionId: z.ZodString;
6935
+ claimId: z.ZodString;
6936
+ adapterName: z.ZodString;
6937
+ sessionId: z.ZodString;
6938
+ agentId: z.ZodString;
6939
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
6940
+ claimToken: z.ZodString;
6941
+ fence: z.ZodNumber;
6942
+ status: z.ZodEnum<{
6943
+ abandoned: "abandoned";
6944
+ held: "held";
6945
+ releasing: "releasing";
6946
+ }>;
6947
+ claimedAt: z.ZodNumber;
6948
+ updatedAt: z.ZodNumber;
6949
+ }, z.core.$strip>;
6950
+ }, z.core.$strip>, z.ZodObject<{
6951
+ outcome: z.ZodLiteral<"superseded">;
6952
+ currentFence: z.ZodNumber;
6953
+ }, z.core.$strip>, z.ZodObject<{
6954
+ outcome: z.ZodLiteral<"currency-changed">;
6955
+ revision: z.ZodNumber;
6956
+ currency: z.ZodObject<{
6957
+ adapterSessionId: z.ZodNullable<z.ZodString>;
6958
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
6959
+ currentAdapterSessionIdState: z.ZodEnum<{
6960
+ confirmed: "confirmed";
6961
+ moved: "moved";
6962
+ inherited: "inherited";
6963
+ }>;
6964
+ }, z.core.$strip>;
6965
+ }, z.core.$strip>, z.ZodObject<{
6966
+ outcome: z.ZodLiteral<"not-owner">;
6967
+ }, z.core.$strip>, z.ZodObject<{
6968
+ outcome: z.ZodLiteral<"agent-disposed">;
6969
+ }, z.core.$strip>, z.ZodObject<{
6970
+ outcome: z.ZodLiteral<"not-found">;
6971
+ }, z.core.$strip>], "outcome">;
6972
+ };
6973
+ /**
6974
+ * Give up a claim — freeing the ownership key only on a clean release.
6975
+ *
6976
+ * Subject: `storage:sessionOwnership.release`
6977
+ * Type: Request (RPC)
6978
+ */
6979
+ release: {
6980
+ request: z.ZodObject<{
6981
+ agentId: z.ZodString;
6982
+ claimToken: z.ZodString;
6983
+ disposition: z.ZodEnum<{
6984
+ released: "released";
6985
+ abandoned: "abandoned";
6986
+ releasing: "releasing";
6987
+ }>;
6988
+ }, z.core.$strip>;
6989
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
6990
+ outcome: z.ZodLiteral<"released">;
6991
+ }, z.core.$strip>, z.ZodObject<{
6992
+ outcome: z.ZodLiteral<"marked">;
6993
+ claim: z.ZodObject<{
6994
+ machineId: z.ZodString;
6995
+ adapterId: z.ZodString;
6996
+ providerSessionId: z.ZodString;
6997
+ claimId: z.ZodString;
6998
+ adapterName: z.ZodString;
6999
+ sessionId: z.ZodString;
7000
+ agentId: z.ZodString;
7001
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7002
+ claimToken: z.ZodString;
7003
+ fence: z.ZodNumber;
7004
+ status: z.ZodEnum<{
7005
+ abandoned: "abandoned";
7006
+ held: "held";
7007
+ releasing: "releasing";
7008
+ }>;
7009
+ claimedAt: z.ZodNumber;
7010
+ updatedAt: z.ZodNumber;
7011
+ }, z.core.$strip>;
7012
+ }, z.core.$strip>, z.ZodObject<{
7013
+ outcome: z.ZodLiteral<"not-owner">;
7014
+ holder: z.ZodObject<{
7015
+ machineId: z.ZodString;
7016
+ adapterId: z.ZodString;
7017
+ providerSessionId: z.ZodString;
7018
+ claimId: z.ZodString;
7019
+ adapterName: z.ZodString;
7020
+ sessionId: z.ZodString;
7021
+ agentId: z.ZodString;
7022
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7023
+ claimToken: z.ZodString;
7024
+ fence: z.ZodNumber;
7025
+ status: z.ZodEnum<{
7026
+ abandoned: "abandoned";
7027
+ held: "held";
7028
+ releasing: "releasing";
7029
+ }>;
7030
+ claimedAt: z.ZodNumber;
7031
+ updatedAt: z.ZodNumber;
7032
+ }, z.core.$strip>;
7033
+ }, z.core.$strip>, z.ZodObject<{
7034
+ outcome: z.ZodLiteral<"not-found">;
7035
+ }, z.core.$strip>], "outcome">;
7036
+ };
7037
+ /**
7038
+ * Give up every claim an agent holds, or exactly one of them, in a single
7039
+ * statement — the teardown fan-out and the reservation rollback.
7040
+ *
7041
+ * Subject: `storage:sessionOwnership.releaseAgentClaims`
7042
+ * Type: Request (RPC)
7043
+ */
7044
+ releaseAgentClaims: {
7045
+ request: z.ZodObject<{
7046
+ agentId: z.ZodString;
7047
+ claimToken: z.ZodOptional<z.ZodString>;
7048
+ disposition: z.ZodEnum<{
7049
+ released: "released";
7050
+ abandoned: "abandoned";
7051
+ releasing: "releasing";
7052
+ }>;
7053
+ }, z.core.$strip>;
7054
+ response: z.ZodObject<{
7055
+ releasedProviderSessionIds: z.ZodArray<z.ZodString>;
7056
+ markedClaims: z.ZodArray<z.ZodObject<{
7057
+ machineId: z.ZodString;
7058
+ adapterId: z.ZodString;
7059
+ providerSessionId: z.ZodString;
7060
+ claimId: z.ZodString;
7061
+ adapterName: z.ZodString;
7062
+ sessionId: z.ZodString;
7063
+ agentId: z.ZodString;
7064
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7065
+ claimToken: z.ZodString;
7066
+ fence: z.ZodNumber;
7067
+ status: z.ZodEnum<{
7068
+ abandoned: "abandoned";
7069
+ held: "held";
7070
+ releasing: "releasing";
7071
+ }>;
7072
+ claimedAt: z.ZodNumber;
7073
+ updatedAt: z.ZodNumber;
7074
+ }, z.core.$strip>>;
7075
+ claimTokenNotFound: z.ZodBoolean;
7076
+ }, z.core.$strip>;
7077
+ };
7078
+ /**
7079
+ * List the claims recorded for a machine — the read reconciliation and
7080
+ * ownership diagnostics run on.
7081
+ *
7082
+ * Subject: `storage:sessionOwnership.listClaims`
7083
+ * Type: Request (RPC)
7084
+ */
7085
+ listClaims: {
7086
+ request: z.ZodObject<{
7087
+ machineId: z.ZodString;
7088
+ adapterId: z.ZodOptional<z.ZodString>;
7089
+ providerSessionId: z.ZodOptional<z.ZodString>;
7090
+ statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
7091
+ abandoned: "abandoned";
7092
+ held: "held";
7093
+ releasing: "releasing";
7094
+ }>>>;
7095
+ }, z.core.$strip>;
7096
+ response: z.ZodObject<{
7097
+ claims: z.ZodArray<z.ZodObject<{
7098
+ machineId: z.ZodString;
7099
+ adapterId: z.ZodString;
7100
+ providerSessionId: z.ZodString;
7101
+ claimId: z.ZodString;
7102
+ adapterName: z.ZodString;
7103
+ sessionId: z.ZodString;
7104
+ agentId: z.ZodString;
7105
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7106
+ claimToken: z.ZodString;
7107
+ fence: z.ZodNumber;
7108
+ status: z.ZodEnum<{
7109
+ abandoned: "abandoned";
7110
+ held: "held";
7111
+ releasing: "releasing";
7112
+ }>;
7113
+ claimedAt: z.ZodNumber;
7114
+ updatedAt: z.ZodNumber;
7115
+ }, z.core.$strip>>;
7116
+ }, z.core.$strip>;
7117
+ };
7118
+ /**
7119
+ * Stamp every row for a runtime process as retired without releasing its
7120
+ * claims. Repeating the operation is idempotent.
7121
+ *
7122
+ * Subject: `storage:sessionOwnership.retireInstance`
7123
+ * Type: Request (RPC)
7124
+ */
7125
+ retireInstance: {
7126
+ request: z.ZodObject<{
7127
+ instanceId: z.ZodString;
7128
+ }, z.core.$strip>;
7129
+ response: z.ZodObject<{
7130
+ retiredMachines: z.ZodNumber;
7131
+ }, z.core.$strip>;
7132
+ };
7133
+ /**
7134
+ * Read one runtime-instance row for diagnostics only.
7135
+ *
7136
+ * Subject: `storage:sessionOwnership.getRuntimeInstance`
7137
+ * Type: Request (RPC)
7138
+ */
7139
+ getRuntimeInstance: {
7140
+ request: z.ZodObject<{
7141
+ instanceId: z.ZodString;
7142
+ machineId: z.ZodString;
7143
+ }, z.core.$strip>;
7144
+ response: z.ZodObject<{
7145
+ instance: z.ZodNullable<z.ZodObject<{
7146
+ instanceId: z.ZodString;
7147
+ machineId: z.ZodString;
7148
+ incarnation: z.ZodNumber;
7149
+ startedAt: z.ZodNumber;
7150
+ retiredAt: z.ZodNullable<z.ZodNumber>;
7151
+ }, z.core.$strip>>;
7152
+ }, z.core.$strip>;
7153
+ };
7154
+ }>, "storage:sessionOwnership">;
7155
+ //#endregion
4559
7156
  //#region core/contracts/src/session/schemas/ownership.d.ts
4560
- /**
4561
- * How many runtime processes may own claims on one machine.
4562
- *
4563
- * Only `machine-exclusive` licenses "no adapter answers for this instance" as
4564
- * evidence that an owner is gone: with peers on the same machine, an
4565
- * unanswered probe means "not mine", never "nobody's". The default is
4566
- * `shared-machine` everywhere, because neither the desktop runtime nor the
4567
- * isolated workflow runtime can prove exclusivity while workflow workers and
4568
- * relay peers may host adapters of their own.
4569
- */
4570
- declare const OwnershipTopologySchema: z.ZodEnum<{
4571
- "machine-exclusive": "machine-exclusive";
4572
- "shared-machine": "shared-machine";
4573
- }>;
4574
7157
  /** {@inheritDoc OwnershipTopologySchema} */
4575
7158
  type OwnershipTopology$1 = z.infer<typeof OwnershipTopologySchema>;
4576
7159
  /**
@@ -4586,6 +7169,7 @@ declare const SessionOwnershipPrincipalSchema: z.ZodObject<{
4586
7169
  agentId: z.ZodString;
4587
7170
  adapterId: z.ZodString;
4588
7171
  adapterName: z.ZodString;
7172
+ ownerInstanceId: z.ZodString;
4589
7173
  machineId: z.ZodOptional<z.ZodString>;
4590
7174
  }, z.core.$strip>;
4591
7175
  /** {@inheritDoc SessionOwnershipPrincipalSchema} */
@@ -4605,25 +7189,108 @@ declare const SessionOwnershipReserveStartServiceRequestSchema: z.ZodObject<{
4605
7189
  agentId: z.ZodString;
4606
7190
  adapterId: z.ZodString;
4607
7191
  adapterName: z.ZodString;
7192
+ ownerInstanceId: z.ZodString;
4608
7193
  machineId: z.ZodOptional<z.ZodString>;
4609
7194
  role: z.ZodEnum<{
4610
7195
  lead: "lead";
4611
7196
  member: "member";
4612
7197
  }>;
4613
7198
  resumeProviderSessionId: z.ZodNullable<z.ZodString>;
7199
+ claimToken: z.ZodString;
7200
+ recoveryGuard: z.ZodOptional<z.ZodObject<{
7201
+ expectedStatus: z.ZodEnum<{
7202
+ idle: "idle";
7203
+ active: "active";
7204
+ starting: "starting";
7205
+ dead: "dead";
7206
+ disposed: "disposed";
7207
+ }>;
7208
+ expectedPreimage: z.ZodObject<{
7209
+ status: z.ZodEnum<{
7210
+ idle: "idle";
7211
+ active: "active";
7212
+ starting: "starting";
7213
+ dead: "dead";
7214
+ disposed: "disposed";
7215
+ }>;
7216
+ adapterId: z.ZodString;
7217
+ binding: z.ZodOptional<z.ZodObject<{
7218
+ adapterId: z.ZodString;
7219
+ ownerMachineId: z.ZodString;
7220
+ ownerInstanceId: z.ZodString;
7221
+ }, z.core.$strip>>;
7222
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
7223
+ }, z.core.$strip>;
7224
+ expectedRevision: z.ZodNumber;
7225
+ expectedCurrencyFence: z.ZodNumber;
7226
+ expectedCurrency: z.ZodObject<{
7227
+ adapterSessionId: z.ZodNullable<z.ZodString>;
7228
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
7229
+ currentAdapterSessionIdState: z.ZodEnum<{
7230
+ confirmed: "confirmed";
7231
+ moved: "moved";
7232
+ inherited: "inherited";
7233
+ }>;
7234
+ }, z.core.$strip>;
7235
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
7236
+ claimId: z.ZodString;
7237
+ claimToken: z.ZodString;
7238
+ fence: z.ZodNumber;
7239
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7240
+ status: z.ZodEnum<{
7241
+ abandoned: "abandoned";
7242
+ held: "held";
7243
+ releasing: "releasing";
7244
+ }>;
7245
+ }, z.core.$strip>>;
7246
+ }, z.core.$strip>>;
7247
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
4614
7248
  expectedLeadAgentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4615
7249
  }, z.core.$strip>;
4616
7250
  /** {@inheritDoc SessionOwnershipReserveStartServiceRequestSchema} */
4617
7251
  type SessionOwnershipReserveStartServiceRequest = z.infer<typeof SessionOwnershipReserveStartServiceRequestSchema>;
7252
+ /**
7253
+ * Validate and normalize a start reservation at the service trust boundary.
7254
+ * @param value - Untrusted reservation request received by the authority.
7255
+ * @returns The fully validated reservation request.
7256
+ */
7257
+ declare function normalizeSessionOwnershipReserveStartServiceRequest$1(value: unknown): SessionOwnershipReserveStartServiceRequest;
4618
7258
  /**
4619
7259
  * What a committed reservation gives the caller to act — and to roll back — on.
7260
+ *
7261
+ * A provider-session claim always carries the resolved machine identity that
7262
+ * names its key. A designation-only reservation may not: its storage request
7263
+ * uses an inert schema filler, which is not a runtime identity and must never
7264
+ * be forwarded to a settlement or persisted as a runtime owner.
4620
7265
  */
4621
- declare const SessionOwnershipReservationSchema: z.ZodObject<{
7266
+ declare const SessionOwnershipReservationSchema: z.ZodUnion<readonly [z.ZodObject<{
4622
7267
  agentId: z.ZodString;
4623
7268
  sessionId: z.ZodString;
4624
- machineId: z.ZodString;
4625
7269
  adapterId: z.ZodString;
4626
- claim: z.ZodNullable<z.ZodObject<{
7270
+ ownerInstanceId: z.ZodString;
7271
+ leadDesignated: z.ZodBoolean;
7272
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
7273
+ recovery: z.ZodOptional<z.ZodObject<{
7274
+ attemptId: z.ZodString;
7275
+ preimage: z.ZodObject<{
7276
+ status: z.ZodEnum<{
7277
+ idle: "idle";
7278
+ active: "active";
7279
+ starting: "starting";
7280
+ dead: "dead";
7281
+ disposed: "disposed";
7282
+ }>;
7283
+ adapterId: z.ZodString;
7284
+ binding: z.ZodOptional<z.ZodObject<{
7285
+ adapterId: z.ZodString;
7286
+ ownerMachineId: z.ZodString;
7287
+ ownerInstanceId: z.ZodString;
7288
+ }, z.core.$strip>>;
7289
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
7290
+ }, z.core.$strip>;
7291
+ }, z.core.$strip>>;
7292
+ machineId: z.ZodString;
7293
+ claim: z.ZodObject<{
4627
7294
  machineId: z.ZodString;
4628
7295
  adapterId: z.ZodString;
4629
7296
  providerSessionId: z.ZodString;
@@ -4631,6 +7298,7 @@ declare const SessionOwnershipReservationSchema: z.ZodObject<{
4631
7298
  adapterName: z.ZodString;
4632
7299
  sessionId: z.ZodString;
4633
7300
  agentId: z.ZodString;
7301
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4634
7302
  claimToken: z.ZodString;
4635
7303
  fence: z.ZodNumber;
4636
7304
  status: z.ZodEnum<{
@@ -4640,10 +7308,36 @@ declare const SessionOwnershipReservationSchema: z.ZodObject<{
4640
7308
  }>;
4641
7309
  claimedAt: z.ZodNumber;
4642
7310
  updatedAt: z.ZodNumber;
4643
- }, z.core.$strip>>;
7311
+ }, z.core.$strip>;
7312
+ }, z.core.$strip>, z.ZodObject<{
7313
+ agentId: z.ZodString;
7314
+ sessionId: z.ZodString;
7315
+ adapterId: z.ZodString;
7316
+ ownerInstanceId: z.ZodString;
4644
7317
  leadDesignated: z.ZodBoolean;
4645
7318
  previousLeadAgentId: z.ZodNullable<z.ZodString>;
4646
- }, z.core.$strip>;
7319
+ recovery: z.ZodOptional<z.ZodObject<{
7320
+ attemptId: z.ZodString;
7321
+ preimage: z.ZodObject<{
7322
+ status: z.ZodEnum<{
7323
+ idle: "idle";
7324
+ active: "active";
7325
+ starting: "starting";
7326
+ dead: "dead";
7327
+ disposed: "disposed";
7328
+ }>;
7329
+ adapterId: z.ZodString;
7330
+ binding: z.ZodOptional<z.ZodObject<{
7331
+ adapterId: z.ZodString;
7332
+ ownerMachineId: z.ZodString;
7333
+ ownerInstanceId: z.ZodString;
7334
+ }, z.core.$strip>>;
7335
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
7336
+ }, z.core.$strip>;
7337
+ }, z.core.$strip>>;
7338
+ machineId: z.ZodOptional<z.ZodString>;
7339
+ claim: z.ZodNull;
7340
+ }, z.core.$strip>]>;
4647
7341
  /** {@inheritDoc SessionOwnershipReservationSchema} */
4648
7342
  type SessionOwnershipReservation = z.infer<typeof SessionOwnershipReservationSchema>;
4649
7343
  /**
@@ -4656,12 +7350,34 @@ type SessionOwnershipReservation = z.infer<typeof SessionOwnershipReservationSch
4656
7350
  */
4657
7351
  declare const SessionOwnershipReserveStartServiceResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4658
7352
  outcome: z.ZodLiteral<"reserved">;
4659
- reservation: z.ZodObject<{
7353
+ reservation: z.ZodUnion<readonly [z.ZodObject<{
4660
7354
  agentId: z.ZodString;
4661
7355
  sessionId: z.ZodString;
4662
- machineId: z.ZodString;
4663
7356
  adapterId: z.ZodString;
4664
- claim: z.ZodNullable<z.ZodObject<{
7357
+ ownerInstanceId: z.ZodString;
7358
+ leadDesignated: z.ZodBoolean;
7359
+ previousLeadAgentId: z.ZodNullable<z.ZodString>;
7360
+ recovery: z.ZodOptional<z.ZodObject<{
7361
+ attemptId: z.ZodString;
7362
+ preimage: z.ZodObject<{
7363
+ status: z.ZodEnum<{
7364
+ idle: "idle";
7365
+ active: "active";
7366
+ starting: "starting";
7367
+ dead: "dead";
7368
+ disposed: "disposed";
7369
+ }>;
7370
+ adapterId: z.ZodString;
7371
+ binding: z.ZodOptional<z.ZodObject<{
7372
+ adapterId: z.ZodString;
7373
+ ownerMachineId: z.ZodString;
7374
+ ownerInstanceId: z.ZodString;
7375
+ }, z.core.$strip>>;
7376
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
7377
+ }, z.core.$strip>;
7378
+ }, z.core.$strip>>;
7379
+ machineId: z.ZodString;
7380
+ claim: z.ZodObject<{
4665
7381
  machineId: z.ZodString;
4666
7382
  adapterId: z.ZodString;
4667
7383
  providerSessionId: z.ZodString;
@@ -4669,6 +7385,7 @@ declare const SessionOwnershipReserveStartServiceResponseSchema: z.ZodDiscrimina
4669
7385
  adapterName: z.ZodString;
4670
7386
  sessionId: z.ZodString;
4671
7387
  agentId: z.ZodString;
7388
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4672
7389
  claimToken: z.ZodString;
4673
7390
  fence: z.ZodNumber;
4674
7391
  status: z.ZodEnum<{
@@ -4678,10 +7395,36 @@ declare const SessionOwnershipReserveStartServiceResponseSchema: z.ZodDiscrimina
4678
7395
  }>;
4679
7396
  claimedAt: z.ZodNumber;
4680
7397
  updatedAt: z.ZodNumber;
4681
- }, z.core.$strip>>;
7398
+ }, z.core.$strip>;
7399
+ }, z.core.$strip>, z.ZodObject<{
7400
+ agentId: z.ZodString;
7401
+ sessionId: z.ZodString;
7402
+ adapterId: z.ZodString;
7403
+ ownerInstanceId: z.ZodString;
4682
7404
  leadDesignated: z.ZodBoolean;
4683
7405
  previousLeadAgentId: z.ZodNullable<z.ZodString>;
4684
- }, z.core.$strip>;
7406
+ recovery: z.ZodOptional<z.ZodObject<{
7407
+ attemptId: z.ZodString;
7408
+ preimage: z.ZodObject<{
7409
+ status: z.ZodEnum<{
7410
+ idle: "idle";
7411
+ active: "active";
7412
+ starting: "starting";
7413
+ dead: "dead";
7414
+ disposed: "disposed";
7415
+ }>;
7416
+ adapterId: z.ZodString;
7417
+ binding: z.ZodOptional<z.ZodObject<{
7418
+ adapterId: z.ZodString;
7419
+ ownerMachineId: z.ZodString;
7420
+ ownerInstanceId: z.ZodString;
7421
+ }, z.core.$strip>>;
7422
+ recoveryAttemptId: z.ZodOptional<z.ZodString>;
7423
+ }, z.core.$strip>;
7424
+ }, z.core.$strip>>;
7425
+ machineId: z.ZodOptional<z.ZodString>;
7426
+ claim: z.ZodNull;
7427
+ }, z.core.$strip>]>;
4685
7428
  }, z.core.$strip>, z.ZodObject<{
4686
7429
  outcome: z.ZodLiteral<"occupied">;
4687
7430
  holder: z.ZodObject<{
@@ -4692,6 +7435,7 @@ declare const SessionOwnershipReserveStartServiceResponseSchema: z.ZodDiscrimina
4692
7435
  adapterName: z.ZodString;
4693
7436
  sessionId: z.ZodString;
4694
7437
  agentId: z.ZodString;
7438
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4695
7439
  claimToken: z.ZodString;
4696
7440
  fence: z.ZodNumber;
4697
7441
  status: z.ZodEnum<{
@@ -4707,14 +7451,54 @@ declare const SessionOwnershipReserveStartServiceResponseSchema: z.ZodDiscrimina
4707
7451
  currentLeadAgentId: z.ZodNullable<z.ZodString>;
4708
7452
  }, z.core.$strip>, z.ZodObject<{
4709
7453
  outcome: z.ZodLiteral<"agent-disposed">;
7454
+ }, z.core.$strip>, z.ZodObject<{
7455
+ outcome: z.ZodLiteral<"session-not-active">;
7456
+ status: z.ZodEnum<{
7457
+ closed: "closed";
7458
+ discovered: "discovered";
7459
+ archived: "archived";
7460
+ }>;
4710
7461
  }, z.core.$strip>, z.ZodObject<{
4711
7462
  outcome: z.ZodLiteral<"not-found">;
4712
7463
  missing: z.ZodEnum<{
4713
- session: "session";
4714
7464
  agent: "agent";
7465
+ session: "session";
4715
7466
  }>;
4716
7467
  }, z.core.$strip>, z.ZodObject<{
4717
7468
  outcome: z.ZodLiteral<"machine-identity-unavailable">;
7469
+ }, z.core.$strip>, z.ZodObject<{
7470
+ outcome: z.ZodLiteral<"currency-changed">;
7471
+ revision: z.ZodNumber;
7472
+ currencyFence: z.ZodNumber;
7473
+ currency: z.ZodObject<{
7474
+ adapterSessionId: z.ZodNullable<z.ZodString>;
7475
+ currentAdapterSessionId: z.ZodNullable<z.ZodString>;
7476
+ currentAdapterSessionIdState: z.ZodEnum<{
7477
+ confirmed: "confirmed";
7478
+ moved: "moved";
7479
+ inherited: "inherited";
7480
+ }>;
7481
+ }, z.core.$strip>;
7482
+ }, z.core.$strip>, z.ZodObject<{
7483
+ outcome: z.ZodLiteral<"recovery-conflict">;
7484
+ status: z.ZodEnum<{
7485
+ idle: "idle";
7486
+ active: "active";
7487
+ starting: "starting";
7488
+ dead: "dead";
7489
+ disposed: "disposed";
7490
+ }>;
7491
+ ownerGeneration: z.ZodNullable<z.ZodObject<{
7492
+ claimId: z.ZodString;
7493
+ claimToken: z.ZodString;
7494
+ fence: z.ZodNumber;
7495
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
7496
+ status: z.ZodEnum<{
7497
+ abandoned: "abandoned";
7498
+ held: "held";
7499
+ releasing: "releasing";
7500
+ }>;
7501
+ }, z.core.$strip>>;
4718
7502
  }, z.core.$strip>], "outcome">;
4719
7503
  /** {@inheritDoc SessionOwnershipReserveStartServiceResponseSchema} */
4720
7504
  type SessionOwnershipReserveStartServiceResult$1 = z.infer<typeof SessionOwnershipReserveStartServiceResponseSchema>;
@@ -4747,6 +7531,7 @@ declare const SessionOwnershipSettleMovementServiceRequestSchema: z.ZodObject<{
4747
7531
  agentId: z.ZodString;
4748
7532
  adapterId: z.ZodString;
4749
7533
  adapterName: z.ZodString;
7534
+ ownerInstanceId: z.ZodString;
4750
7535
  machineId: z.ZodOptional<z.ZodString>;
4751
7536
  movement: z.ZodDiscriminatedUnion<[z.ZodObject<{
4752
7537
  confirmed: z.ZodLiteral<true>;
@@ -4787,6 +7572,7 @@ declare const SessionOwnershipSettleMovementServiceResponseSchema: z.ZodDiscrimi
4787
7572
  adapterName: z.ZodString;
4788
7573
  sessionId: z.ZodString;
4789
7574
  agentId: z.ZodString;
7575
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4790
7576
  claimToken: z.ZodString;
4791
7577
  fence: z.ZodNumber;
4792
7578
  status: z.ZodEnum<{
@@ -4818,6 +7604,7 @@ declare const SessionOwnershipSettleMovementServiceResponseSchema: z.ZodDiscrimi
4818
7604
  adapterName: z.ZodString;
4819
7605
  sessionId: z.ZodString;
4820
7606
  agentId: z.ZodString;
7607
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4821
7608
  claimToken: z.ZodString;
4822
7609
  fence: z.ZodNumber;
4823
7610
  status: z.ZodEnum<{
@@ -4838,6 +7625,7 @@ declare const SessionOwnershipSettleMovementServiceResponseSchema: z.ZodDiscrimi
4838
7625
  adapterName: z.ZodString;
4839
7626
  sessionId: z.ZodString;
4840
7627
  agentId: z.ZodString;
7628
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4841
7629
  claimToken: z.ZodString;
4842
7630
  fence: z.ZodNumber;
4843
7631
  status: z.ZodEnum<{
@@ -4908,6 +7696,7 @@ declare const SessionOwnershipReclaimReasonSchema: z.ZodEnum<{
4908
7696
  "agent-disposed": "agent-disposed";
4909
7697
  "agent-gone": "agent-gone";
4910
7698
  "adapter-instance-gone": "adapter-instance-gone";
7699
+ "owner-instance-retired": "owner-instance-retired";
4911
7700
  }>;
4912
7701
  /** {@inheritDoc SessionOwnershipReclaimReasonSchema} */
4913
7702
  type SessionOwnershipReclaimReason$1 = z.infer<typeof SessionOwnershipReclaimReasonSchema>;
@@ -4921,6 +7710,7 @@ declare const SessionOwnershipReconciledClaimSchema: z.ZodObject<{
4921
7710
  adapterName: z.ZodString;
4922
7711
  sessionId: z.ZodString;
4923
7712
  agentId: z.ZodString;
7713
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4924
7714
  claimToken: z.ZodString;
4925
7715
  fence: z.ZodNumber;
4926
7716
  status: z.ZodEnum<{
@@ -4940,6 +7730,7 @@ declare const SessionOwnershipReconciledClaimSchema: z.ZodObject<{
4940
7730
  "agent-disposed": "agent-disposed";
4941
7731
  "agent-gone": "agent-gone";
4942
7732
  "adapter-instance-gone": "adapter-instance-gone";
7733
+ "owner-instance-retired": "owner-instance-retired";
4943
7734
  }>>;
4944
7735
  }, z.core.$strip>;
4945
7736
  /** {@inheritDoc SessionOwnershipReconciledClaimSchema} */
@@ -4963,6 +7754,7 @@ declare const SessionOwnershipReconcileServiceResponseSchema: z.ZodDiscriminated
4963
7754
  adapterName: z.ZodString;
4964
7755
  sessionId: z.ZodString;
4965
7756
  agentId: z.ZodString;
7757
+ ownerInstanceId: z.ZodNullable<z.ZodString>;
4966
7758
  claimToken: z.ZodString;
4967
7759
  fence: z.ZodNumber;
4968
7760
  status: z.ZodEnum<{
@@ -4982,6 +7774,7 @@ declare const SessionOwnershipReconcileServiceResponseSchema: z.ZodDiscriminated
4982
7774
  "agent-disposed": "agent-disposed";
4983
7775
  "agent-gone": "agent-gone";
4984
7776
  "adapter-instance-gone": "adapter-instance-gone";
7777
+ "owner-instance-retired": "owner-instance-retired";
4985
7778
  }>>;
4986
7779
  }, z.core.$strip>>;
4987
7780
  }, z.core.$strip>, z.ZodObject<{
@@ -5056,22 +7849,94 @@ declare const SessionSchemas: {
5056
7849
  agentId: _$zod.ZodString;
5057
7850
  adapterId: _$zod.ZodString;
5058
7851
  adapterName: _$zod.ZodString;
7852
+ ownerInstanceId: _$zod.ZodString;
5059
7853
  machineId: _$zod.ZodOptional<_$zod.ZodString>;
5060
7854
  role: _$zod.ZodEnum<{
5061
7855
  lead: "lead";
5062
7856
  member: "member";
5063
7857
  }>;
5064
7858
  resumeProviderSessionId: _$zod.ZodNullable<_$zod.ZodString>;
7859
+ claimToken: _$zod.ZodString;
7860
+ recoveryGuard: _$zod.ZodOptional<_$zod.ZodObject<{
7861
+ expectedStatus: _$zod.ZodEnum<{
7862
+ idle: "idle";
7863
+ active: "active";
7864
+ starting: "starting";
7865
+ dead: "dead";
7866
+ disposed: "disposed";
7867
+ }>;
7868
+ expectedPreimage: _$zod.ZodObject<{
7869
+ status: _$zod.ZodEnum<{
7870
+ idle: "idle";
7871
+ active: "active";
7872
+ starting: "starting";
7873
+ dead: "dead";
7874
+ disposed: "disposed";
7875
+ }>;
7876
+ adapterId: _$zod.ZodString;
7877
+ binding: _$zod.ZodOptional<_$zod.ZodObject<{
7878
+ adapterId: _$zod.ZodString;
7879
+ ownerMachineId: _$zod.ZodString;
7880
+ ownerInstanceId: _$zod.ZodString;
7881
+ }, _$zod_v4_core0.$strip>>;
7882
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
7883
+ }, _$zod_v4_core0.$strip>;
7884
+ expectedRevision: _$zod.ZodNumber;
7885
+ expectedCurrencyFence: _$zod.ZodNumber;
7886
+ expectedCurrency: _$zod.ZodObject<{
7887
+ adapterSessionId: _$zod.ZodNullable<_$zod.ZodString>;
7888
+ currentAdapterSessionId: _$zod.ZodNullable<_$zod.ZodString>;
7889
+ currentAdapterSessionIdState: _$zod.ZodEnum<{
7890
+ confirmed: "confirmed";
7891
+ moved: "moved";
7892
+ inherited: "inherited";
7893
+ }>;
7894
+ }, _$zod_v4_core0.$strip>;
7895
+ ownerGeneration: _$zod.ZodNullable<_$zod.ZodObject<{
7896
+ claimId: _$zod.ZodString;
7897
+ claimToken: _$zod.ZodString;
7898
+ fence: _$zod.ZodNumber;
7899
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
7900
+ status: _$zod.ZodEnum<{
7901
+ abandoned: "abandoned";
7902
+ held: "held";
7903
+ releasing: "releasing";
7904
+ }>;
7905
+ }, _$zod_v4_core0.$strip>>;
7906
+ }, _$zod_v4_core0.$strip>>;
7907
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
5065
7908
  expectedLeadAgentId: _$zod.ZodOptional<_$zod.ZodNullable<_$zod.ZodString>>;
5066
7909
  }, _$zod_v4_core0.$strip>;
5067
7910
  response: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
5068
7911
  outcome: _$zod.ZodLiteral<"reserved">;
5069
- reservation: _$zod.ZodObject<{
7912
+ reservation: _$zod.ZodUnion<readonly [_$zod.ZodObject<{
5070
7913
  agentId: _$zod.ZodString;
5071
7914
  sessionId: _$zod.ZodString;
5072
- machineId: _$zod.ZodString;
5073
7915
  adapterId: _$zod.ZodString;
5074
- claim: _$zod.ZodNullable<_$zod.ZodObject<{
7916
+ ownerInstanceId: _$zod.ZodString;
7917
+ leadDesignated: _$zod.ZodBoolean;
7918
+ previousLeadAgentId: _$zod.ZodNullable<_$zod.ZodString>;
7919
+ recovery: _$zod.ZodOptional<_$zod.ZodObject<{
7920
+ attemptId: _$zod.ZodString;
7921
+ preimage: _$zod.ZodObject<{
7922
+ status: _$zod.ZodEnum<{
7923
+ idle: "idle";
7924
+ active: "active";
7925
+ starting: "starting";
7926
+ dead: "dead";
7927
+ disposed: "disposed";
7928
+ }>;
7929
+ adapterId: _$zod.ZodString;
7930
+ binding: _$zod.ZodOptional<_$zod.ZodObject<{
7931
+ adapterId: _$zod.ZodString;
7932
+ ownerMachineId: _$zod.ZodString;
7933
+ ownerInstanceId: _$zod.ZodString;
7934
+ }, _$zod_v4_core0.$strip>>;
7935
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
7936
+ }, _$zod_v4_core0.$strip>;
7937
+ }, _$zod_v4_core0.$strip>>;
7938
+ machineId: _$zod.ZodString;
7939
+ claim: _$zod.ZodObject<{
5075
7940
  machineId: _$zod.ZodString;
5076
7941
  adapterId: _$zod.ZodString;
5077
7942
  providerSessionId: _$zod.ZodString;
@@ -5079,6 +7944,7 @@ declare const SessionSchemas: {
5079
7944
  adapterName: _$zod.ZodString;
5080
7945
  sessionId: _$zod.ZodString;
5081
7946
  agentId: _$zod.ZodString;
7947
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5082
7948
  claimToken: _$zod.ZodString;
5083
7949
  fence: _$zod.ZodNumber;
5084
7950
  status: _$zod.ZodEnum<{
@@ -5088,10 +7954,36 @@ declare const SessionSchemas: {
5088
7954
  }>;
5089
7955
  claimedAt: _$zod.ZodNumber;
5090
7956
  updatedAt: _$zod.ZodNumber;
5091
- }, _$zod_v4_core0.$strip>>;
7957
+ }, _$zod_v4_core0.$strip>;
7958
+ }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
7959
+ agentId: _$zod.ZodString;
7960
+ sessionId: _$zod.ZodString;
7961
+ adapterId: _$zod.ZodString;
7962
+ ownerInstanceId: _$zod.ZodString;
5092
7963
  leadDesignated: _$zod.ZodBoolean;
5093
7964
  previousLeadAgentId: _$zod.ZodNullable<_$zod.ZodString>;
5094
- }, _$zod_v4_core0.$strip>;
7965
+ recovery: _$zod.ZodOptional<_$zod.ZodObject<{
7966
+ attemptId: _$zod.ZodString;
7967
+ preimage: _$zod.ZodObject<{
7968
+ status: _$zod.ZodEnum<{
7969
+ idle: "idle";
7970
+ active: "active";
7971
+ starting: "starting";
7972
+ dead: "dead";
7973
+ disposed: "disposed";
7974
+ }>;
7975
+ adapterId: _$zod.ZodString;
7976
+ binding: _$zod.ZodOptional<_$zod.ZodObject<{
7977
+ adapterId: _$zod.ZodString;
7978
+ ownerMachineId: _$zod.ZodString;
7979
+ ownerInstanceId: _$zod.ZodString;
7980
+ }, _$zod_v4_core0.$strip>>;
7981
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
7982
+ }, _$zod_v4_core0.$strip>;
7983
+ }, _$zod_v4_core0.$strip>>;
7984
+ machineId: _$zod.ZodOptional<_$zod.ZodString>;
7985
+ claim: _$zod.ZodNull;
7986
+ }, _$zod_v4_core0.$strip>]>;
5095
7987
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
5096
7988
  outcome: _$zod.ZodLiteral<"occupied">;
5097
7989
  holder: _$zod.ZodObject<{
@@ -5102,6 +7994,7 @@ declare const SessionSchemas: {
5102
7994
  adapterName: _$zod.ZodString;
5103
7995
  sessionId: _$zod.ZodString;
5104
7996
  agentId: _$zod.ZodString;
7997
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5105
7998
  claimToken: _$zod.ZodString;
5106
7999
  fence: _$zod.ZodNumber;
5107
8000
  status: _$zod.ZodEnum<{
@@ -5117,14 +8010,54 @@ declare const SessionSchemas: {
5117
8010
  currentLeadAgentId: _$zod.ZodNullable<_$zod.ZodString>;
5118
8011
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
5119
8012
  outcome: _$zod.ZodLiteral<"agent-disposed">;
8013
+ }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
8014
+ outcome: _$zod.ZodLiteral<"session-not-active">;
8015
+ status: _$zod.ZodEnum<{
8016
+ closed: "closed";
8017
+ discovered: "discovered";
8018
+ archived: "archived";
8019
+ }>;
5120
8020
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
5121
8021
  outcome: _$zod.ZodLiteral<"not-found">;
5122
8022
  missing: _$zod.ZodEnum<{
5123
- session: "session";
5124
8023
  agent: "agent";
8024
+ session: "session";
5125
8025
  }>;
5126
8026
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
5127
8027
  outcome: _$zod.ZodLiteral<"machine-identity-unavailable">;
8028
+ }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
8029
+ outcome: _$zod.ZodLiteral<"currency-changed">;
8030
+ revision: _$zod.ZodNumber;
8031
+ currencyFence: _$zod.ZodNumber;
8032
+ currency: _$zod.ZodObject<{
8033
+ adapterSessionId: _$zod.ZodNullable<_$zod.ZodString>;
8034
+ currentAdapterSessionId: _$zod.ZodNullable<_$zod.ZodString>;
8035
+ currentAdapterSessionIdState: _$zod.ZodEnum<{
8036
+ confirmed: "confirmed";
8037
+ moved: "moved";
8038
+ inherited: "inherited";
8039
+ }>;
8040
+ }, _$zod_v4_core0.$strip>;
8041
+ }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
8042
+ outcome: _$zod.ZodLiteral<"recovery-conflict">;
8043
+ status: _$zod.ZodEnum<{
8044
+ idle: "idle";
8045
+ active: "active";
8046
+ starting: "starting";
8047
+ dead: "dead";
8048
+ disposed: "disposed";
8049
+ }>;
8050
+ ownerGeneration: _$zod.ZodNullable<_$zod.ZodObject<{
8051
+ claimId: _$zod.ZodString;
8052
+ claimToken: _$zod.ZodString;
8053
+ fence: _$zod.ZodNumber;
8054
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
8055
+ status: _$zod.ZodEnum<{
8056
+ abandoned: "abandoned";
8057
+ held: "held";
8058
+ releasing: "releasing";
8059
+ }>;
8060
+ }, _$zod_v4_core0.$strip>>;
5128
8061
  }, _$zod_v4_core0.$strip>], "outcome">;
5129
8062
  };
5130
8063
  'ownership.settleMovement': {
@@ -5133,6 +8066,7 @@ declare const SessionSchemas: {
5133
8066
  agentId: _$zod.ZodString;
5134
8067
  adapterId: _$zod.ZodString;
5135
8068
  adapterName: _$zod.ZodString;
8069
+ ownerInstanceId: _$zod.ZodString;
5136
8070
  machineId: _$zod.ZodOptional<_$zod.ZodString>;
5137
8071
  movement: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
5138
8072
  confirmed: _$zod.ZodLiteral<true>;
@@ -5164,6 +8098,7 @@ declare const SessionSchemas: {
5164
8098
  adapterName: _$zod.ZodString;
5165
8099
  sessionId: _$zod.ZodString;
5166
8100
  agentId: _$zod.ZodString;
8101
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5167
8102
  claimToken: _$zod.ZodString;
5168
8103
  fence: _$zod.ZodNumber;
5169
8104
  status: _$zod.ZodEnum<{
@@ -5195,6 +8130,7 @@ declare const SessionSchemas: {
5195
8130
  adapterName: _$zod.ZodString;
5196
8131
  sessionId: _$zod.ZodString;
5197
8132
  agentId: _$zod.ZodString;
8133
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5198
8134
  claimToken: _$zod.ZodString;
5199
8135
  fence: _$zod.ZodNumber;
5200
8136
  status: _$zod.ZodEnum<{
@@ -5215,6 +8151,7 @@ declare const SessionSchemas: {
5215
8151
  adapterName: _$zod.ZodString;
5216
8152
  sessionId: _$zod.ZodString;
5217
8153
  agentId: _$zod.ZodString;
8154
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5218
8155
  claimToken: _$zod.ZodString;
5219
8156
  fence: _$zod.ZodNumber;
5220
8157
  status: _$zod.ZodEnum<{
@@ -5270,6 +8207,7 @@ declare const SessionSchemas: {
5270
8207
  adapterName: _$zod.ZodString;
5271
8208
  sessionId: _$zod.ZodString;
5272
8209
  agentId: _$zod.ZodString;
8210
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5273
8211
  claimToken: _$zod.ZodString;
5274
8212
  fence: _$zod.ZodNumber;
5275
8213
  status: _$zod.ZodEnum<{
@@ -5297,6 +8235,7 @@ declare const SessionSchemas: {
5297
8235
  adapterName: _$zod.ZodString;
5298
8236
  sessionId: _$zod.ZodString;
5299
8237
  agentId: _$zod.ZodString;
8238
+ ownerInstanceId: _$zod.ZodNullable<_$zod.ZodString>;
5300
8239
  claimToken: _$zod.ZodString;
5301
8240
  fence: _$zod.ZodNumber;
5302
8241
  status: _$zod.ZodEnum<{
@@ -5316,6 +8255,7 @@ declare const SessionSchemas: {
5316
8255
  "agent-disposed": "agent-disposed";
5317
8256
  "agent-gone": "agent-gone";
5318
8257
  "adapter-instance-gone": "adapter-instance-gone";
8258
+ "owner-instance-retired": "owner-instance-retired";
5319
8259
  }>>;
5320
8260
  }, _$zod_v4_core0.$strip>>;
5321
8261
  }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
@@ -6069,7 +9009,7 @@ declare const SessionSchemas: {
6069
9009
  systemPrompt: "systemPrompt";
6070
9010
  fullPrefix: "fullPrefix";
6071
9011
  }>>;
6072
- turnContext: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodType<_$_makaio_contracts0.JsonValue, unknown, _$zod_v4_core0.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
9012
+ turnContext: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodType<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue, _$zod_v4_core0.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue>>>>;
6073
9013
  requestCorrelation: _$zod.ZodOptional<_$zod.ZodObject<{
6074
9014
  sessionId: _$zod.ZodOptional<_$zod.ZodString>;
6075
9015
  turnId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -7441,6 +10381,11 @@ declare const SessionSchemas: {
7441
10381
  adapterId: _$zod.ZodString;
7442
10382
  adapterName: _$zod.ZodString;
7443
10383
  sessionId: _$zod.ZodString;
10384
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
10385
+ machineId: _$zod.ZodString;
10386
+ instanceId: _$zod.ZodString;
10387
+ }, _$zod_v4_core0.$strip>>;
10388
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
7444
10389
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
7445
10390
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
7446
10391
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -7569,6 +10514,11 @@ declare const SessionSchemas: {
7569
10514
  adapterId: _$zod.ZodString;
7570
10515
  adapterName: _$zod.ZodString;
7571
10516
  sessionId: _$zod.ZodString;
10517
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
10518
+ machineId: _$zod.ZodString;
10519
+ instanceId: _$zod.ZodString;
10520
+ }, _$zod_v4_core0.$strip>>;
10521
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
7572
10522
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
7573
10523
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
7574
10524
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -8103,6 +11053,11 @@ declare const SessionSchemas: {
8103
11053
  adapterId: _$zod.ZodString;
8104
11054
  adapterName: _$zod.ZodString;
8105
11055
  sessionId: _$zod.ZodString;
11056
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
11057
+ machineId: _$zod.ZodString;
11058
+ instanceId: _$zod.ZodString;
11059
+ }, _$zod_v4_core0.$strip>>;
11060
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
8106
11061
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
8107
11062
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
8108
11063
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -8231,6 +11186,11 @@ declare const SessionSchemas: {
8231
11186
  adapterId: _$zod.ZodString;
8232
11187
  adapterName: _$zod.ZodString;
8233
11188
  sessionId: _$zod.ZodString;
11189
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
11190
+ machineId: _$zod.ZodString;
11191
+ instanceId: _$zod.ZodString;
11192
+ }, _$zod_v4_core0.$strip>>;
11193
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
8234
11194
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
8235
11195
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
8236
11196
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -9282,6 +12242,11 @@ declare const SessionSchemas: {
9282
12242
  adapterId: _$zod.ZodString;
9283
12243
  adapterName: _$zod.ZodString;
9284
12244
  sessionId: _$zod.ZodString;
12245
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
12246
+ machineId: _$zod.ZodString;
12247
+ instanceId: _$zod.ZodString;
12248
+ }, _$zod_v4_core0.$strip>>;
12249
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
9285
12250
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9286
12251
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9287
12252
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -9435,6 +12400,11 @@ declare const SessionSchemas: {
9435
12400
  adapterId: _$zod.ZodString;
9436
12401
  adapterName: _$zod.ZodString;
9437
12402
  sessionId: _$zod.ZodString;
12403
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
12404
+ machineId: _$zod.ZodString;
12405
+ instanceId: _$zod.ZodString;
12406
+ }, _$zod_v4_core0.$strip>>;
12407
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
9438
12408
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9439
12409
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9440
12410
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -9579,6 +12549,11 @@ declare const SessionSchemas: {
9579
12549
  adapterId: _$zod.ZodString;
9580
12550
  adapterName: _$zod.ZodString;
9581
12551
  sessionId: _$zod.ZodString;
12552
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
12553
+ machineId: _$zod.ZodString;
12554
+ instanceId: _$zod.ZodString;
12555
+ }, _$zod_v4_core0.$strip>>;
12556
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
9582
12557
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9583
12558
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9584
12559
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -9837,6 +12812,11 @@ declare const SessionSchemas: {
9837
12812
  adapterId: _$zod.ZodString;
9838
12813
  adapterName: _$zod.ZodString;
9839
12814
  sessionId: _$zod.ZodString;
12815
+ runtimeOwner: _$zod.ZodOptional<_$zod.ZodObject<{
12816
+ machineId: _$zod.ZodString;
12817
+ instanceId: _$zod.ZodString;
12818
+ }, _$zod_v4_core0.$strip>>;
12819
+ recoveryAttemptId: _$zod.ZodOptional<_$zod.ZodString>;
9840
12820
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9841
12821
  currentAdapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
9842
12822
  currentAdapterSessionIdState: _$zod.ZodOptional<_$zod.ZodEnum<{
@@ -10075,4 +13055,4 @@ type KnownSessionEvent = { [K in RuntimeKnownSessionEventType]: SessionEventBase
10075
13055
  */
10076
13056
  declare function isKnownSessionEvent(event: MakaioSessionEvent$1): event is KnownSessionEvent;
10077
13057
  //#endregion
10078
- export { NativeForkDirective$1 as $, SessionRecordMetadata as $t, SessionOwnershipReserveStartServiceResult$1 as A, TurnUsage$1 as At, SegmentPolicySchema as B, ImportStatus as Bt, SessionOwnershipReleaseServiceRequest as C, SessionMessageSchema$1 as Ct, SessionOwnershipReserveStartServiceRequest as D, TurnSchema$1 as Dt, SessionOwnershipReservationSchema as E, TurnInitiatorSchema$1 as Et, SessionOwnershipSettleMovementServiceResponseSchema as F, AdapterSessionCurrencyStateSchema as Ft, ForkChildInfo as G, SnapshotExportOptions as Gt, SessionCreatedEventSchema as H, SNAPSHOT_VERSION as Ht, SessionOwnershipSettleMovementServiceResult as I, AgentRole$1 as It, SESSION_EVENT_TYPES as J, SnapshotPreviewData as Jt, ForkChildInfoSchema as K, SnapshotExportOptionsSchema as Kt, ForkTransforms$1 as L, AgentRoleSchema as Lt, SessionOwnershipServiceMovementSchema as M, UsageMetrics as Mt, SessionOwnershipSettleMovementServiceRequest as N, UsageMetricsSchema as Nt, SessionOwnershipReserveStartServiceRequestSchema as O, TurnStatus as Ot, SessionOwnershipSettleMovementServiceRequestSchema as P, AdapterSessionCurrencyState as Pt, SessionEventTypeSchema as Q, SessionPreviewDataSchema as Qt, ForkTransformsSchema$1 as R, BranchKind$1 as Rt, SessionOwnershipReconciledClaimSchema as S, SessionMessageRoleSchema as St, SessionOwnershipReservation as T, TurnInitiator$2 as Tt, SessionUpdatedEvent as U, SessionSnapshot as Ut, SessionCreated as V, ImportStatusSchema as Vt, SessionUpdatedEventSchema as W, SessionSnapshotSchema as Wt, SessionEventType$1 as X, validateSnapshot as Xt, SessionEventPayload as Y, safeValidateSnapshot as Yt, SessionEventTypeMap as Z, MakaioSessionSchema as Zt, SessionOwnershipReclaimReason$1 as _, SessionMessageBlock$1 as _t, SessionPreviewData as a, SessionCreateBase as an, AgentAttachResolvedRequest as at, SessionOwnershipReconcileServiceResult as b, SessionMessageOriginSchema as bt, SessionSchemas as c, TurnCompleted as ct, SessionOwnershipContinuationServiceRequest as d, TurnStarted as dt, SessionRecordMetadataSchema$1 as en, NativeForkDirectiveSchema as et, SessionOwnershipContinuationServiceRequestSchema as f, MessageRouting as ft, SessionOwnershipPrincipalSchema as g, SessionMessage$1 as gt, SessionOwnershipPrincipal as h, MessageRoutingStatusSchema as ht, MakaioSessionEvent$1 as i, MakaioSessionAgentSchema$1 as in, NativeLocalityVerdictSchema as it, SessionOwnershipServiceMovement as j, TurnUsageSchema$1 as jt, SessionOwnershipReserveStartServiceResponseSchema as k, TurnStatusSchema$1 as kt, OwnershipTopology$1 as l, TurnIngestionMarker$1 as lt, SessionOwnershipContinuationServiceResult as m, MessageRoutingStatus as mt, KnownSessionEvent as n, AgentStatus as nn, NativeLocalityReasonSchema as nt, SessionWithPreview as o, SessionCreateBaseSchema as on, SendMessageRequest as ot, SessionOwnershipContinuationServiceResponseSchema as p, MessageRoutingSchema$1 as pt, MakaioSessionEventSchema as q, SnapshotImportConflictErrorData as qt, MakaioSessionAgent$1 as r, AgentStatusSchema$1 as rn, NativeLocalityVerdict$1 as rt, isKnownSessionEvent as s, SendMessageResponse as st, IMakaioSession$1 as t, SessionWithPreviewSchema as tn, NativeLocalityReason as tt, OwnershipTopologySchema as u, TurnIngestionMarkerSchema$1 as ut, SessionOwnershipReclaimReasonSchema as v, SessionMessageBlockSchema as vt, SessionOwnershipReleaseServiceRequestSchema as w, Turn$1 as wt, SessionOwnershipReconciledClaim as x, SessionMessageRole as xt, SessionOwnershipReconcileServiceResponseSchema as y, SessionMessageOrigin$1 as yt, SegmentPolicy as z, BranchKindSchema as zt };
13058
+ export { SessionOwnershipClaimRequestSchema as $, safeValidateSnapshot as $n, SessionEventPayload as $t, SessionOwnershipServiceMovement as A, TurnInitiatorSchema$1 as An, SessionOwnershipRecoveryGuardSchema as At, AdapterSessionClaimKeySchema as B, AgentRole$1 as Bn, AdapterSessionClaimStatusSchema as Bt, SessionOwnershipReleaseServiceRequestSchema as C, SessionMessageOrigin$1 as Cn, RuntimeBinding as Ct, SessionOwnershipReserveStartServiceRequestSchema as D, SessionMessageSchema$1 as Dn, SessionOwnershipFinalizeRecoveryResponseSchema as Dt, SessionOwnershipReserveStartServiceRequest as E, SessionMessageRoleSchema as En, SessionOwnershipFinalizeRecoveryRequestSchema as Et, SessionOwnershipSettleMovementServiceResult as F, TurnUsageSchema$1 as Fn, SessionOwnershipRecoveryReservation as Ft, OwnershipMovement as G, ImportStatusSchema as Gn, SessionCreated as Gt, AdapterSessionClaimRecordSchema as H, BranchKind$1 as Hn, ForkTransformsSchema$1 as Ht, normalizeSessionOwnershipReserveStartServiceRequest$1 as I, UsageMetrics as In, SessionOwnershipRecoveryReservationSchema as It, OwnershipOwnerInstanceSchema as J, SessionSnapshotSchema as Jn, SessionUpdatedEventSchema as Jt, OwnershipMovementSchema as K, SNAPSHOT_VERSION as Kn, SessionCreatedEventSchema as Kt, AdapterSessionClaimDisposition as L, UsageMetricsSchema as Ln, SessionOwnershipRecoveryTerminalAction as Lt, SessionOwnershipSettleMovementServiceRequest as M, TurnStatus as Mn, SessionOwnershipRecoveryOwnerGenerationSchema as Mt, SessionOwnershipSettleMovementServiceRequestSchema as N, TurnStatusSchema$1 as Nn, SessionOwnershipRecoveryPreimage as Nt, SessionOwnershipReserveStartServiceResponseSchema as O, Turn$1 as On, SessionOwnershipFinalizeRecoveryResult as Ot, SessionOwnershipSettleMovementServiceResponseSchema as P, TurnUsage$1 as Pn, SessionOwnershipRecoveryPreimageSchema as Pt, SessionOwnershipClaimRequest as Q, SnapshotPreviewData as Qn, SESSION_EVENT_TYPES as Qt, AdapterSessionClaimDispositionSchema as R, AdapterSessionCurrencyState as Rn, SessionOwnershipRecoveryTerminalActionSchema as Rt, SessionOwnershipReleaseServiceRequest as S, SessionMessageBlockSchema as Sn, normalizeSessionOwnershipClaimRequest$1 as St, SessionOwnershipReservationSchema as T, SessionMessageRole as Tn, SessionOwnershipFinalizeRecoveryRequest as Tt, AgentSessionOwnershipRecord as U, BranchKindSchema as Un, SegmentPolicy as Ut, AdapterSessionClaimRecord$1 as V, AgentRoleSchema as Vn, ForkTransforms$1 as Vt, AgentSessionOwnershipRecordSchema as W, ImportStatus as Wn, SegmentPolicySchema as Wt, RuntimeInstanceRecord$1 as X, SnapshotExportOptionsSchema as Xn, ForkChildInfoSchema as Xt, OwnershipTopologySchema as Y, SnapshotExportOptions as Yn, ForkChildInfo as Yt, RuntimeInstanceRecordSchema as Z, SnapshotImportConflictErrorData as Zn, MakaioSessionEventSchema as Zt, SessionOwnershipReclaimReasonSchema as _, MessageRoutingSchema$1 as _n, SessionOwnershipSettleMovementRequestSchema$1 as _t, SessionPreviewData as a, NativeLocalityReason as an, SessionWithPreviewSchema as ar, SessionOwnershipReleaseAgentClaimsRequestSchema as at, SessionOwnershipReconciledClaim as b, SessionMessage$1 as bn, SessionOwnershipStorageNamespace as bt, SessionSchemas as c, NativeLocalityVerdictSchema as cn, MakaioSessionAgentSchema$1 as cr, SessionOwnershipReleaseRequest as ct, SessionOwnershipContinuationServiceRequestSchema as d, SendMessageResponse as dn, SessionOwnershipReleaseResult as dt, SessionEventType$1 as en, validateSnapshot as er, SessionOwnershipClaimResponseSchema as et, SessionOwnershipContinuationServiceResponseSchema as f, TurnCompleted as fn, SessionOwnershipSettleCurrencyRequest as ft, SessionOwnershipReclaimReason$1 as g, MessageRouting as gn, SessionOwnershipSettleMovementRequest as gt, SessionOwnershipPrincipalSchema as h, TurnStarted as hn, SessionOwnershipSettleCurrencyResult as ht, MakaioSessionEvent$1 as i, NativeForkDirectiveSchema as in, SessionRecordMetadataSchema$1 as ir, SessionOwnershipReleaseAgentClaimsRequest as it, SessionOwnershipServiceMovementSchema as j, TurnSchema$1 as jn, SessionOwnershipRecoveryOwnerGeneration as jt, SessionOwnershipReserveStartServiceResult$1 as k, TurnInitiator$2 as kn, SessionOwnershipRecoveryGuard$1 as kt, OwnershipTopology$1 as l, AgentAttachResolvedRequest as ln, SessionCreateBase as lr, SessionOwnershipReleaseRequestSchema as lt, SessionOwnershipPrincipal as m, TurnIngestionMarkerSchema$1 as mn, SessionOwnershipSettleCurrencyResponseSchema as mt, KnownSessionEvent as n, SessionEventTypeSchema as nn, SessionPreviewDataSchema as nr, SessionOwnershipListClaimsRequest as nt, SessionWithPreview as o, NativeLocalityReasonSchema as on, AgentStatus as or, SessionOwnershipReleaseAgentClaimsResponseSchema as ot, SessionOwnershipContinuationServiceResult as p, TurnIngestionMarker$1 as pn, SessionOwnershipSettleCurrencyRequestSchema as pt, OwnershipOwnerInstance as q, SessionSnapshot as qn, SessionUpdatedEvent as qt, MakaioSessionAgent$1 as r, NativeForkDirective$1 as rn, SessionRecordMetadata as rr, SessionOwnershipListClaimsRequestSchema as rt, isKnownSessionEvent as s, NativeLocalityVerdict$1 as sn, AgentStatusSchema$1 as sr, SessionOwnershipReleaseAgentClaimsResult as st, IMakaioSession$1 as t, SessionEventTypeMap as tn, MakaioSessionSchema as tr, SessionOwnershipClaimResult as tt, SessionOwnershipContinuationServiceRequest as u, SendMessageRequest as un, SessionCreateBaseSchema as ur, SessionOwnershipReleaseResponseSchema as ut, SessionOwnershipReconcileServiceResponseSchema as v, MessageRoutingStatus as vn, SessionOwnershipSettleMovementResponseSchema as vt, SessionOwnershipReservation as w, SessionMessageOriginSchema as wn, RuntimeBindingSchema as wt, SessionOwnershipReconciledClaimSchema as x, SessionMessageBlock$1 as xn, SessionOwnershipStorageSubjects$1 as xt, SessionOwnershipReconcileServiceResult as y, MessageRoutingStatusSchema as yn, SessionOwnershipSettleMovementResult as yt, AdapterSessionClaimKey as z, AdapterSessionCurrencyStateSchema as zn, AdapterSessionClaimStatus as zt };