@makaio/framework 1.0.0-dev-1785409369816 → 1.0.0-dev-1787670071418

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 (549) hide show
  1. package/README.md +2 -0
  2. package/dist/.makaio-build.json +4 -3
  3. package/dist/{account-identity-DFx8pwKL.mjs → account-identity-B3vLwm9O.mjs} +1 -1
  4. package/dist/adapter-Dz1fX5Wa.mjs +1 -0
  5. package/dist/adapter-subsystem/index.d.mts +194 -20
  6. package/dist/adapter-subsystem/index.mjs +1 -1
  7. package/dist/adapters/acp-client/index.d.mts +105 -7
  8. package/dist/adapters/acp-client/index.mjs +2 -2
  9. package/dist/adapters/claude/index.d.mts +5 -5
  10. package/dist/adapters/config/index.d.mts +1 -1
  11. package/dist/adapters/config/index.mjs +1 -1
  12. package/dist/adapters/index.d.mts +405 -824
  13. package/dist/adapters/index.mjs +6 -6
  14. package/dist/adapters/node.d.mts +1 -1
  15. package/dist/adapters/node.mjs +1 -1
  16. package/dist/adapters/stream-session/index.d.mts +28 -7
  17. package/dist/adapters/stream-session/index.mjs +1 -1
  18. package/dist/{ajv-DD3SIL2i.mjs → ajv-krzJXh1X.mjs} +2 -2
  19. package/dist/artifact-Btbuib48.mjs +1 -0
  20. package/dist/attach-error-Cb3GbeKe.mjs +1 -0
  21. package/dist/{auth-DGEdiHF6.mjs → auth-C6tVtaOX.mjs} +1 -1
  22. package/dist/authority-state-bootstrap-CLYus369.mjs +1 -0
  23. package/dist/automation-trigger-ByjNlClm.mjs +1 -0
  24. package/dist/await-trigger-Bkg2BQfg.mjs +1 -0
  25. package/dist/bus/index.d.mts +41 -9
  26. package/dist/bus/index.mjs +1 -1
  27. package/dist/bus-D6NoBhIV.mjs +2 -0
  28. package/dist/bus-UgFdHybD.mjs +1 -0
  29. package/dist/caller-owned-adapter-stub-C1M7FKrv.mjs +1 -0
  30. package/dist/{canonical-model-BAytQ4NV.mjs → canonical-model-DXOvCaVg.mjs} +1 -1
  31. package/dist/capabilities-BUwuA7XX.mjs +1 -0
  32. package/dist/capability-j3NekkIu.mjs +1 -0
  33. package/dist/{client-DbS847wW.mjs → client-BkznbdsO.mjs} +1 -1
  34. package/dist/clients/index.d.mts +2 -2
  35. package/dist/clients/index.mjs +1 -1
  36. package/dist/clients/managed-install.d.mts +1 -1
  37. package/dist/clients/managed-install.mjs +1 -1
  38. package/dist/code-execution/worker-entry.d.mts +21 -0
  39. package/dist/code-execution/worker-entry.mjs +1 -0
  40. package/dist/code-execution-Ckmn8OZu.mjs +1 -0
  41. package/dist/code-execution-CweDSWco.mjs +1 -0
  42. package/dist/code-execution-DqkQjKa1.mjs +1 -0
  43. package/dist/{compression-74fFeBha.mjs → compression-CtgeVLpP.mjs} +1 -1
  44. package/dist/{config-namespace-TVX-hG4I.mjs → config-namespace-CjWvw8ij.mjs} +1 -1
  45. package/dist/{context-resolution-DdyhpH4L.d.mts → context-resolution-841T7jBI.d.mts} +11 -11
  46. package/dist/contracts/adapter/index.d.mts +3 -3
  47. package/dist/contracts/adapter/index.mjs +1 -1
  48. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  49. package/dist/contracts/artifact/index.d.mts +3 -3
  50. package/dist/contracts/artifact/index.mjs +1 -1
  51. package/dist/contracts/auth/index.d.mts +2 -2
  52. package/dist/contracts/auth/index.mjs +1 -1
  53. package/dist/contracts/automation-trigger/index.d.mts +4 -0
  54. package/dist/contracts/automation-trigger/index.mjs +1 -0
  55. package/dist/contracts/canonical-model/index.d.mts +1 -1
  56. package/dist/contracts/canonical-model/index.mjs +1 -1
  57. package/dist/contracts/capabilities/index.d.mts +1 -1
  58. package/dist/contracts/capabilities/index.mjs +1 -1
  59. package/dist/contracts/client/index.d.mts +2 -2
  60. package/dist/contracts/client/index.mjs +1 -1
  61. package/dist/contracts/code-execution/index.d.mts +2 -0
  62. package/dist/contracts/code-execution/index.mjs +1 -0
  63. package/dist/contracts/common/index.d.mts +1 -1
  64. package/dist/contracts/config/index.d.mts +1 -1
  65. package/dist/contracts/config/index.mjs +1 -1
  66. package/dist/contracts/extension/index.d.mts +6 -5
  67. package/dist/contracts/extension/index.mjs +1 -1
  68. package/dist/contracts/facet/index.d.mts +1 -1
  69. package/dist/contracts/facet/index.mjs +1 -1
  70. package/dist/contracts/harness/index.d.mts +1 -1
  71. package/dist/contracts/harness/index.mjs +1 -1
  72. package/dist/contracts/host/index.d.mts +1 -1
  73. package/dist/contracts/host/index.mjs +1 -1
  74. package/dist/contracts/index.d.mts +171 -100
  75. package/dist/contracts/index.mjs +1 -1
  76. package/dist/contracts/materialization/index.d.mts +3 -3
  77. package/dist/contracts/materialization/index.mjs +1 -1
  78. package/dist/contracts/model-registry/index.d.mts +1 -1
  79. package/dist/contracts/model-registry/index.mjs +1 -1
  80. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  81. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  82. package/dist/contracts/platform/index.d.mts +1 -1
  83. package/dist/contracts/platform/index.mjs +1 -1
  84. package/dist/contracts/provider/index.d.mts +2 -2
  85. package/dist/contracts/provider/index.mjs +1 -1
  86. package/dist/contracts/reaction/index.d.mts +2 -0
  87. package/dist/contracts/reaction/index.mjs +1 -0
  88. package/dist/contracts/session/index.d.mts +3 -3
  89. package/dist/contracts/session/index.mjs +1 -1
  90. package/dist/contracts/shared/index.d.mts +3 -3
  91. package/dist/contracts/shared/index.mjs +1 -1
  92. package/dist/contracts/skill/index.d.mts +1 -1
  93. package/dist/contracts/skill/index.mjs +1 -1
  94. package/dist/contracts/telemetry/index.d.mts +1 -1
  95. package/dist/contracts/telemetry/index.mjs +1 -1
  96. package/dist/contracts/timeout/index.d.mts +1 -1
  97. package/dist/contracts/timeout/index.mjs +1 -1
  98. package/dist/contracts/toast/index.mjs +1 -1
  99. package/dist/contracts/variant/index.d.mts +1 -1
  100. package/dist/contracts/variant/index.mjs +1 -1
  101. package/dist/contracts/worker-node/index.d.mts +1 -1
  102. package/dist/contracts/worker-node/index.mjs +1 -1
  103. package/dist/contracts/workflow/index.d.mts +3 -3
  104. package/dist/contracts/workflow/index.mjs +1 -1
  105. package/dist/contribution-CUHLVLsT.d.mts +35 -0
  106. package/dist/core/index.d.mts +84 -2
  107. package/dist/core/index.mjs +1 -1
  108. package/dist/{definition-CJfiv8xm.mjs → definition-BH4QLGLI.mjs} +1 -1
  109. package/dist/definition-DyGImhyi.d.mts +375 -0
  110. package/dist/{detached-extension-handle-Ddfquy5_.mjs → detached-extension-handle-D0aI0pJA.mjs} +1 -1
  111. package/dist/drizzle/0031_adapter_session_currency.sql +66 -0
  112. package/dist/drizzle/0032_native_session_ownership.sql +77 -0
  113. package/dist/drizzle/0033_m_msf3hu2s.sql +1 -0
  114. package/dist/drizzle/0034_m_msha1388.sql +41 -0
  115. package/dist/drizzle/0035_m_mshgj6x7.sql +40 -0
  116. package/dist/drizzle/0036_m_msivwbgm.sql +1 -0
  117. package/dist/drizzle/0037_runtime_instance_incarnation_counter.sql +6 -0
  118. package/dist/drizzle/meta/_journal.json +49 -0
  119. package/dist/event-B8ELuk6k.mjs +1 -0
  120. package/dist/{execution-attempt-repository-DWXKY41_.d.mts → execution-attempt-repository-BJ2W6wwx.d.mts} +1 -1
  121. package/dist/{execution-target-Cf645pDj.mjs → execution-target-H0RWV7Py.mjs} +1 -1
  122. package/dist/extension-Bfkr2DBs.mjs +1 -0
  123. package/dist/extension-Cz39YNXy.mjs +1 -0
  124. package/dist/extension-context-QmFuHdq5.d.mts +295 -0
  125. package/dist/{extension-discovery-CQRdbVQ6.d.mts → extension-discovery-Dhu3WplO.d.mts} +11 -1
  126. package/dist/{extension-namespace-Yu41YepM.mjs → extension-namespace-QoTTwKPt.mjs} +1 -1
  127. package/dist/extension-package-provenance-aYrZuS4W.mjs +1 -0
  128. package/dist/{filesystem-service-DlP2HfDg.mjs → filesystem-service-CiUw0YN5.mjs} +1 -1
  129. package/dist/framework-packages-BHgul8Kl.mjs +1 -0
  130. package/dist/git/index.mjs +2 -2
  131. package/dist/{globby-1yCVCk8s.mjs → globby-QBDqstzq.mjs} +1 -1
  132. package/dist/handlers-BsHAFtye.mjs +57 -0
  133. package/dist/{harness-DpwsFsE7.mjs → harness-YQ2ewID9.mjs} +1 -1
  134. package/dist/{hook-responses-Dh1PWXqJ.d.mts → hook-responses-9Ywsqzzq.d.mts} +2 -293
  135. package/dist/identity-OjRlG6dZ.mjs +1 -0
  136. package/dist/{index-CMgLxw14.d.mts → index-8NdPPzUh2.d.mts} +2 -2
  137. package/dist/{index-Ds5_rDEJ.d.mts → index-8y4hT9WL.d.mts} +1 -12
  138. package/dist/{index-BVlXneHH.d.mts → index-B-3I98nw.d.mts} +14 -10
  139. package/dist/index-B0VO0rAl.d.mts +302 -0
  140. package/dist/{index-gUhidukN.d.mts → index-B0yMCJW8.d.mts} +324 -2
  141. package/dist/index-BM56936c.d.mts +165 -0
  142. package/dist/{index-CLvQsL6s2.d.mts → index-BNzUyVwV.d.mts} +2105 -320
  143. package/dist/{index-BaZeoZoS.d.mts → index-BTEJfzjE.d.mts} +1 -1
  144. package/dist/{index-B0Kf_OWi.d.mts → index-BfV8U4XX.d.mts} +1 -1
  145. package/dist/{index-DCZ8BX9S.d.mts → index-BkbnC65b.d.mts} +487 -85
  146. package/dist/{index-GHASUiem.d.mts → index-BmevAPME2.d.mts} +1 -1
  147. package/dist/index-Bqk0pJBQ2.d.mts +138 -0
  148. package/dist/{index-B9UW_vPM.d.mts → index-C146Eq_J.d.mts} +2465 -273
  149. package/dist/{index-BAXkicoQ.d.mts → index-CIEycZrt.d.mts} +1 -1
  150. package/dist/{index-DkiTJM5p.d.mts → index-CMekqu_D.d.mts} +44 -10
  151. package/dist/{index-SsBHjUqA.d.mts → index-CPRQ4dWX.d.mts} +0 -23
  152. package/dist/{index-EjsSBQXy2.d.mts → index-CPi0UpRh.d.mts} +1 -1
  153. package/dist/{index-DSBT83c0.d.mts → index-CYjgoYeX.d.mts} +24 -3
  154. package/dist/{index-DnG-QFpG.d.mts → index-CmwAJ8-5.d.mts} +18 -1
  155. package/dist/index-Cny5RvjO.d.mts +800 -0
  156. package/dist/{index-BNMnIe-j.d.mts → index-D-4jv_66.d.mts} +434 -863
  157. package/dist/{index-brqfk9JQ.d.mts → index-D8D-yibS2.d.mts} +4 -4
  158. package/dist/index-DHnSLGP4.d.mts +268 -0
  159. package/dist/{index-D5Nb7IEP.d.mts → index-DI2lS7VT.d.mts} +79 -41
  160. package/dist/{index-D_ODXsBv.d.mts → index-DJ2KgJDJ2.d.mts} +51 -95
  161. package/dist/{index-cqLS1eFV.d.mts → index-DNI6UF9h.d.mts} +133 -134
  162. package/dist/index-DQ8o3JGi.d.mts +132 -0
  163. package/dist/index-DWBkiiXH.d.mts +18 -0
  164. package/dist/{index-DlsHL9Jg.d.mts → index-DXtQRehh.d.mts} +12 -12
  165. package/dist/{index-4VfqCjl2.d.mts → index-D_4K3Tf_.d.mts} +79 -194
  166. package/dist/index-Dg11JxKZ.d.mts +496 -0
  167. package/dist/json-value-BBZ6uGwc.mjs +1 -0
  168. package/dist/json-value-DPqb-SJ8.d.mts +177 -0
  169. package/dist/kernel/cli/index.d.mts +2 -2
  170. package/dist/kernel/cli/index.mjs +1 -1
  171. package/dist/kernel/cli/register.d.mts +1 -1
  172. package/dist/kernel/cli/register.mjs +1 -1
  173. package/dist/kernel/cli/schemas.mjs +1 -1
  174. package/dist/kernel/extension/index.d.mts +1 -1
  175. package/dist/kernel/extension/index.mjs +1 -1
  176. package/dist/kernel/index.d.mts +9 -9
  177. package/dist/kernel/index.mjs +1 -1
  178. package/dist/kernel/namespace/index.d.mts +2 -2
  179. package/dist/kernel/namespace/index.mjs +1 -1
  180. package/dist/kernel/observability/index.d.mts +1 -1
  181. package/dist/kernel/observability/index.mjs +1 -1
  182. package/dist/kernel/providers/index.d.mts +1 -1
  183. package/dist/kernel/providers/index.mjs +1 -1
  184. package/dist/kernel/window/index.d.mts +1 -1
  185. package/dist/kernel/window/index.mjs +1 -1
  186. package/dist/{lib-DErgth_E.mjs → lib-BpGvHZye.mjs} +2 -2
  187. package/dist/{lib-C7-s68uf.mjs → lib-Cm-uEoC1.mjs} +1 -1
  188. package/dist/{load-extensions-BxsDB87B.d.mts → load-extensions-BQoXaHhR.d.mts} +17 -13
  189. package/dist/load-extensions-DG5LvPyM.mjs +1 -0
  190. package/dist/{materialization-Jd198K3y.mjs → materialization-lVd9_-jr.mjs} +1 -1
  191. package/dist/mcp-http-server/index.mjs +1 -1
  192. package/dist/model-DrzPt3ou.mjs +1 -0
  193. package/dist/{namespace-BqxtpNAn.mjs → namespace-BL7lHlmg.mjs} +1 -1
  194. package/dist/{namespace-CjjFvrIA2.d.mts → namespace-BNp7n_gu.d.mts} +25 -25
  195. package/dist/{namespace-g_mbIZq_.d.mts → namespace-BRuHzhPo.d.mts} +564 -28
  196. package/dist/{namespace-DV-Hr9sZ.d.mts → namespace-C06lJSuj.d.mts} +17 -7
  197. package/dist/{namespace-TseEI3Pu.d.mts → namespace-DOezqDti.d.mts} +18 -10
  198. package/dist/{namespace-CErHuXtb.d.mts → namespace-DknCutQZ.d.mts} +50 -0
  199. package/dist/{namespace-B8uKAzWJ.mjs → namespace-Du0accdE.mjs} +1 -1
  200. package/dist/{namespace-CWUDFGOy.mjs → namespace-NXm_zvL1.mjs} +1 -1
  201. package/dist/{namespace-CupOzbRv.d.mts → namespace-l-HG1rLF.d.mts} +24 -20
  202. package/dist/namespace-sCPb79-7.mjs +1 -0
  203. package/dist/{native-session-supervisor-DRx0MX-d.mjs → native-session-supervisor-LKio8XZn.mjs} +1 -1
  204. package/dist/node/bus-server/index.d.mts +1 -1
  205. package/dist/node/bus-server/index.mjs +1 -1
  206. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  207. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  208. package/dist/npm-package-name-DuTYVICk.mjs +1 -0
  209. package/dist/orchestrator-shared-BGlN-m-V.mjs +1 -0
  210. package/dist/{orchestrator-shared-BHCv-l2O.d.mts → orchestrator-shared-CNHSImNY.d.mts} +10 -10
  211. package/dist/ownership-memory-handler-BpGdR_uG.mjs +1 -0
  212. package/dist/ownership-recovery-guard-DyW5vGBr.mjs +1 -0
  213. package/dist/package-B01gmu75.mjs +7 -0
  214. package/dist/{package-DWMxGfzK.d.mts → package-BNFTUFLB.d.mts} +234 -84
  215. package/dist/package-DttKA9wN.mjs +1 -0
  216. package/dist/package-EGTn-Ng1.mjs +1 -0
  217. package/dist/package-JtjbO-Oi.mjs +1 -0
  218. package/dist/package.json +1 -1
  219. package/dist/{profile-BTAI31Nt.mjs → profile-N5qGUpF0.mjs} +1 -1
  220. package/dist/{provider-context-PZIQWcqQ.mjs → provider-context-CG42JlP9.mjs} +1 -1
  221. package/dist/{provider-context-Dq53Cgzz.mjs → provider-context-zTDSH2x9.mjs} +1 -1
  222. package/dist/reaction-D3TNwPK8.mjs +1 -0
  223. package/dist/{registry-wfF2uTty.mjs → registry-Dk12tAfv.mjs} +2 -2
  224. package/dist/{resolved-DZgqql2Z.mjs → resolved-sq8RXNDf.mjs} +1 -1
  225. package/dist/rules/index.d.mts +1 -1
  226. package/dist/rules/index.mjs +1 -1
  227. package/dist/rules/schemas.d.mts +1 -1
  228. package/dist/rules/schemas.mjs +1 -1
  229. package/dist/runtime-bun/index.mjs +1 -1
  230. package/dist/runtime-node/code-execution/index.d.mts +3 -0
  231. package/dist/runtime-node/code-execution/index.mjs +1 -0
  232. package/dist/runtime-node/extension-discovery.d.mts +2 -2
  233. package/dist/runtime-node/extension-discovery.mjs +1 -1
  234. package/dist/runtime-node/extension-validation.d.mts +1 -1
  235. package/dist/runtime-node/extension-validation.mjs +1 -1
  236. package/dist/runtime-node/index.d.mts +7 -5
  237. package/dist/runtime-node/index.mjs +24 -24
  238. package/dist/runtime-node/makaio-config.d.mts +1 -1
  239. package/dist/runtime-node/makaio-config.mjs +1 -1
  240. package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
  241. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  242. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  243. package/dist/{schema-DKUb4rkr.d.mts → schema-B3Pf7JP7.d.mts} +778 -21
  244. package/dist/{schema-Dd-e89MO.mjs → schema-Dq-7si8u.mjs} +1 -1
  245. package/dist/{schemas-B1NWNASS.d.mts → schemas-BXc9qOpl.d.mts} +2 -0
  246. package/dist/schemas-BfO5jkrL.mjs +1 -0
  247. package/dist/{schemas-CR8hSqTy.d.mts → schemas-C1mxTfd7.d.mts} +60 -4
  248. package/dist/schemas-C3kyQWGf.mjs +1 -0
  249. package/dist/{schemas-DnYiAvfz.d.mts → schemas-D7ScxLrf.d.mts} +24 -20
  250. package/dist/{schemas-BsVYZviy.d.mts → schemas-OWvBn7AH.d.mts} +4 -4
  251. package/dist/{schemas-DaHQzpgm.mjs → schemas-QWDnauKX.mjs} +1 -1
  252. package/dist/schemas-TK29KWx-.mjs +1 -0
  253. package/dist/schemas-_2Syo_01.mjs +1 -0
  254. package/dist/scoped-bus-DoPmCJeM.mjs +1 -0
  255. package/dist/{selection-BNwTKEVT.mjs → selection-DL3ric7K.mjs} +1 -1
  256. package/dist/services/adapter-runtime/index.d.mts +4 -4
  257. package/dist/services/adapter-runtime/index.mjs +1 -1
  258. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  259. package/dist/services/adapter-runtime/schemas.d.mts +2 -2
  260. package/dist/services/adapter-runtime/schemas.mjs +1 -1
  261. package/dist/services/adapter-subsystem/index.d.mts +4 -4
  262. package/dist/services/adapter-subsystem/index.mjs +1 -1
  263. package/dist/services/adapter-subsystem/namespace.d.mts +2 -2
  264. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  265. package/dist/services/agent-runtime/index.d.mts +2 -2
  266. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  267. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  268. package/dist/services/automation-trigger/index.d.mts +943 -0
  269. package/dist/services/automation-trigger/index.mjs +1 -0
  270. package/dist/services/capability/index.d.mts +3 -2
  271. package/dist/services/capability/index.mjs +1 -1
  272. package/dist/services/code-execution/index.d.mts +2 -0
  273. package/dist/services/code-execution/index.mjs +1 -0
  274. package/dist/services/codebase/index.d.mts +2 -2
  275. package/dist/services/codebase/namespace.d.mts +1 -1
  276. package/dist/services/codebase/schemas.d.mts +1 -1
  277. package/dist/services/compression/index.d.mts +2 -2
  278. package/dist/services/compression/namespace.d.mts +1 -1
  279. package/dist/services/compression/schemas.d.mts +1 -1
  280. package/dist/services/context-rules/index.d.mts +1 -1
  281. package/dist/services/context-rules/index.mjs +1 -1
  282. package/dist/services/execution-target/index.d.mts +3 -3
  283. package/dist/services/execution-target/index.mjs +1 -1
  284. package/dist/services/execution-target/namespace.d.mts +1 -1
  285. package/dist/services/execution-target/namespace.mjs +1 -1
  286. package/dist/services/execution-target/schemas.d.mts +1 -1
  287. package/dist/services/execution-target/schemas.mjs +1 -1
  288. package/dist/services/filesystem/index.d.mts +1 -1
  289. package/dist/services/filesystem/index.mjs +1 -1
  290. package/dist/services/filesystem/namespace.d.mts +6 -6
  291. package/dist/services/filesystem/schemas.d.mts +3 -3
  292. package/dist/services/git/namespace.d.mts +18 -0
  293. package/dist/services/git/namespace.mjs +1 -1
  294. package/dist/services/git/schemas.d.mts +10 -1
  295. package/dist/services/git/schemas.mjs +1 -1
  296. package/dist/services/harness/index.mjs +1 -1
  297. package/dist/services/index.d.mts +567 -101
  298. package/dist/services/index.mjs +1 -1
  299. package/dist/services/log-import/browser.d.mts +2 -2
  300. package/dist/services/log-import/index.d.mts +3 -3
  301. package/dist/services/log-import/log-import.d.mts +1 -1
  302. package/dist/services/log-import/log-import.mjs +1 -1
  303. package/dist/services/log-import/namespace.mjs +1 -1
  304. package/dist/services/log-import/schemas.mjs +1 -1
  305. package/dist/services/materialization/index.d.mts +1 -1
  306. package/dist/services/materialization/index.mjs +1 -1
  307. package/dist/services/model-registry/index.d.mts +1 -1
  308. package/dist/services/model-registry/index.mjs +1 -1
  309. package/dist/services/preferences/index.d.mts +2 -2
  310. package/dist/services/preferences/schemas.d.mts +1 -1
  311. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  312. package/dist/services/provider-context/index.d.mts +1 -1
  313. package/dist/services/provider-context/index.mjs +1 -1
  314. package/dist/services/provider-runtime/index.mjs +1 -1
  315. package/dist/services/session/handlers/index.d.mts +2 -2
  316. package/dist/services/session/handlers/index.mjs +1 -1
  317. package/dist/services/session/index.d.mts +10 -10
  318. package/dist/services/session/index.mjs +1 -1
  319. package/dist/services/session/messages/namespace.d.mts +1 -1
  320. package/dist/services/session/messages/namespace.mjs +1 -1
  321. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  322. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  323. package/dist/services/session/session-events/namespace.d.mts +1 -1
  324. package/dist/services/session/session-events/namespace.mjs +1 -1
  325. package/dist/services/session/storage/namespace.d.mts +1 -1
  326. package/dist/services/session/storage/schema.d.mts +2 -2
  327. package/dist/services/session/storage/schema.mjs +1 -1
  328. package/dist/services/session/testing/index.d.mts +33 -4
  329. package/dist/services/session/testing/index.mjs +68 -12
  330. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  331. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  332. package/dist/services/session/turns/namespace.d.mts +1 -1
  333. package/dist/services/session/turns/namespace.mjs +1 -1
  334. package/dist/services/session-editor/index.d.mts +1 -1
  335. package/dist/services/session-editor/index.mjs +1 -1
  336. package/dist/services/settings/index.d.mts +3 -3
  337. package/dist/services/settings/index.mjs +1 -1
  338. package/dist/services/settings/namespace.mjs +1 -1
  339. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  340. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  341. package/dist/services/settings/storage/index.d.mts +3 -3
  342. package/dist/services/settings/storage/index.mjs +1 -1
  343. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  344. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  345. package/dist/services/subagent/index.d.mts +1 -1
  346. package/dist/services/subagent/index.mjs +1 -1
  347. package/dist/services/subagent-template/index.d.mts +2 -2
  348. package/dist/services/subagent-template/namespace.d.mts +1 -1
  349. package/dist/services/subagent-template/schemas.d.mts +1 -1
  350. package/dist/services/tool-approval/index.d.mts +1 -1
  351. package/dist/services/tool-approval/index.mjs +1 -1
  352. package/dist/services/tools/index.d.mts +1 -1
  353. package/dist/services/tools/index.mjs +1 -1
  354. package/dist/services/tray-menu/index.d.mts +3 -3
  355. package/dist/services/tray-menu/index.mjs +1 -1
  356. package/dist/services/tray-menu/namespace.d.mts +1 -1
  357. package/dist/services/tray-menu/schemas.d.mts +1 -1
  358. package/dist/services/turn/index.d.mts +1 -1
  359. package/dist/services/turn/namespace.d.mts +1 -1
  360. package/dist/services/workflow-transitions/index.d.mts +1 -1
  361. package/dist/services/workflow-transitions/index.mjs +1 -1
  362. package/dist/session-BOpTI79g.mjs +1 -0
  363. package/dist/session-CXOPk3yg.mjs +95 -0
  364. package/dist/shared-B9AWRm9A.mjs +1 -0
  365. package/dist/{skill-BR6rkfLe.mjs → skill-DGNtc_ww.mjs} +1 -1
  366. package/dist/{src-DD0v-nIj.mjs → src-BmSQ3rlz.mjs} +1 -1
  367. package/dist/storage/drizzle/client.d.mts +1 -1
  368. package/dist/storage/drizzle/client.mjs +1 -1
  369. package/dist/storage/drizzle/index.d.mts +81 -2
  370. package/dist/storage/drizzle/index.mjs +1 -1
  371. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  372. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  373. package/dist/storage/handlers/index.d.mts +1 -1
  374. package/dist/storage/handlers/index.mjs +1 -1
  375. package/dist/tool-approval-service-BFDOFUGC.mjs +1 -0
  376. package/dist/{tools-PdG9fO1M.mjs → tools-DWKWX3eV.mjs} +1 -1
  377. package/dist/{transition-Du3MQzJV.d.mts → transition-D3zUBTPc.d.mts} +11 -38
  378. package/dist/{types-D7_kevBK.d.mts → types-BlB23n4f.d.mts} +1 -1
  379. package/dist/{types-DMLDHFR9.d.mts → types-CtDGkyLx2.d.mts} +1 -1
  380. package/dist/types-Cwza95hS.mjs +1 -0
  381. package/dist/{types-Dzrwa1GY.d.mts → types-DcxBYlPA.d.mts} +5834 -1436
  382. package/dist/types-DnK6Wa_Y.d.mts +260 -0
  383. package/dist/types-OKJCOjme.d.mts +2937 -0
  384. package/dist/ui-hooks/index.d.mts +29 -2
  385. package/dist/ui-hooks/index.mjs +1 -1
  386. package/dist/ui-kernel/index.d.mts +2 -2
  387. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  388. package/dist/ui-views/index.d.mts +1 -1
  389. package/dist/utils/index.d.mts +98 -1
  390. package/dist/utils/index.mjs +2 -2
  391. package/dist/utils/project-manifest.mjs +1 -1
  392. package/dist/{version-CoCeMxDT.mjs → version-BYeVh1pI.mjs} +1 -1
  393. package/dist/{view-builder-DeFd-k7C.d.mts → view-builder-B0j9p5C0.d.mts} +4 -4
  394. package/dist/{visibility-qhGWmpSJ.mjs → visibility-DtDLRBdr.mjs} +1 -1
  395. package/dist/worker-node-CjuQb9hl.mjs +1 -0
  396. package/dist/{worker-node-DZTuT1DS.mjs → worker-node-Dtf9ilsR.mjs} +1 -1
  397. package/dist/workflow-C4mck_NW.mjs +1 -0
  398. package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
  399. package/dist/workflow-engine/index.d.mts +237 -518
  400. package/dist/workflow-engine/index.mjs +1 -1
  401. package/dist/workflow-engine/package.d.mts +1 -1
  402. package/dist/workflow-engine/package.mjs +1 -1
  403. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  404. package/dist/workflow-engine/testing/index.d.mts +2 -2
  405. package/dist/workflow-engine/testing/index.mjs +1 -1
  406. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  407. package/dist/workflow-engine/testing/sqlite.mjs +27 -27
  408. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  409. package/dist/workflow-engine/workflow-trigger-binding-consumer.d.mts +46 -0
  410. package/dist/workflow-engine/workflow-trigger-binding-consumer.mjs +1 -0
  411. package/dist/{workflow-transitions-DSc45ixc.mjs → workflow-transitions-c_VQbyV0.mjs} +1 -1
  412. package/dist/workflow-worker-aNbdgqml.mjs +1 -0
  413. package/dist/zod-json-schema-Dixc-B1T.mjs +1 -0
  414. package/package.json +46 -1
  415. package/dist/adapter-D5c5LrPN.mjs +0 -1
  416. package/dist/artifact-DGiXqb11.mjs +0 -1
  417. package/dist/attach-error-C3tngg6J.mjs +0 -1
  418. package/dist/authority-state-bootstrap-GPL_tqaT.mjs +0 -1
  419. package/dist/await-trigger-I3lrepb8.mjs +0 -1
  420. package/dist/bus-B6SAjgOC.mjs +0 -2
  421. package/dist/bus-C2l3K74u.mjs +0 -1
  422. package/dist/capabilities-BQEp34ir.mjs +0 -1
  423. package/dist/capability-service-BqiLlRGA.mjs +0 -1
  424. package/dist/event-CmVjR6Ib.mjs +0 -1
  425. package/dist/extension-DCA4pYrY.mjs +0 -1
  426. package/dist/extension-hjOPs10e.mjs +0 -1
  427. package/dist/framework-packages-C3RWfJDk.mjs +0 -1
  428. package/dist/handlers-CfnLyLfE.mjs +0 -57
  429. package/dist/identity-D6guMtmi.mjs +0 -1
  430. package/dist/index-CRvpVIqA.d.mts +0 -89
  431. package/dist/json-value-Brslhqbm.d.mts +0 -57
  432. package/dist/json-value-DmU8ibo_.mjs +0 -1
  433. package/dist/load-extensions-D0DfjYLC.mjs +0 -1
  434. package/dist/model-BGgVmRnN.mjs +0 -1
  435. package/dist/namespace-DJfUADSV.mjs +0 -1
  436. package/dist/orchestrator-shared-BxmHCPvx.mjs +0 -1
  437. package/dist/package-CNUPPcU1.mjs +0 -7
  438. package/dist/package-Dft_RItb.mjs +0 -1
  439. package/dist/schemas-CRB2O5zo.mjs +0 -1
  440. package/dist/schemas-Cm09dXL4.mjs +0 -1
  441. package/dist/schemas-tDf_WiC8.mjs +0 -1
  442. package/dist/scoped-bus-C9BdNwfM.mjs +0 -1
  443. package/dist/session-BOGCd18q.mjs +0 -1
  444. package/dist/session-BTFiDoGz.mjs +0 -76
  445. package/dist/shared-BQ0CHIVy.mjs +0 -1
  446. package/dist/tool-approval-service-kBA0fRzm.mjs +0 -1
  447. package/dist/types-CJ_QZ1yW.d.mts +0 -1487
  448. package/dist/worker-node-Bl9_vqYi.mjs +0 -1
  449. package/dist/workflow-BfDbgtIQ.mjs +0 -1
  450. package/dist/workflow-worker-BN9XPxQO.mjs +0 -1
  451. package/dist/{adapter-auth-runtime-DO-FVTXg.mjs → adapter-auth-runtime-DHHppU4f.mjs} +0 -0
  452. package/dist/{adapter-binding-DQchUtrK.d.mts → adapter-binding-CATvmGuz.d.mts} +0 -0
  453. package/dist/{attempt-record-codec-CqO1_XnE.mjs → attempt-record-codec-BYfYkj4M.mjs} +0 -0
  454. package/dist/{base-orchestrator-BilsQNW1.d.mts → base-orchestrator-B4YW6z_Q.d.mts} +0 -0
  455. package/dist/{index-DN4NOCqN2.d.mts → capability-service-BW1-teFU.d.mts} +0 -0
  456. package/dist/{client-B--e2qcU.d.mts → client-BG0WX5Vz.d.mts} +0 -0
  457. package/dist/{client-binary-version-verifier-taewmKTY.mjs → client-binary-version-verifier-0lCKZOTg.mjs} +0 -0
  458. package/dist/{client-binary-version-verifier-CgjM_vGF.d.mts → client-binary-version-verifier-lcv83Hq3.d.mts} +0 -0
  459. package/dist/{clients-namespace-DfxjG2ZP.d.mts → clients-namespace-DLAjOTTb.d.mts} +0 -0
  460. package/dist/{config-namespace-BCqvufbD.d.mts → config-namespace-CH7sJZ4f.d.mts} +0 -0
  461. package/dist/{create-static-mount-bbQhTt6W.mjs → create-static-mount-DxuixuLZ.mjs} +0 -0
  462. package/dist/{cross-spawn-B57KZuns.mjs → cross-spawn-CZygZJMH.mjs} +0 -0
  463. package/dist/{cursor-storage-DIFK_9hg.mjs → cursor-storage-bsc9lZKk.mjs} +0 -0
  464. package/dist/{definition-gnKgXU91.d.mts → definition-BrgzUuFk.d.mts} +0 -0
  465. package/dist/{definitions-xrrY0wgz.mjs → definitions-CRpdnHYM.mjs} +0 -0
  466. package/dist/{descriptor-to-package-DvF08krT.mjs → descriptor-to-package-CcjdoWP4.mjs} +0 -0
  467. package/dist/{drizzle-z_0SiGY8.mjs → drizzle-Bzc-OGVI.mjs} +0 -0
  468. package/dist/{esm-CltRnX8_.mjs → esm-i-S5TW72.mjs} +0 -0
  469. package/dist/{facet-BCI00njh.mjs → facet-BnMh7Jyc.mjs} +0 -0
  470. package/dist/{filesystem-service-CQ9yVkSz.d.mts → filesystem-service-ZJ43SbBi.d.mts} +0 -0
  471. package/dist/{handler-Cbv9FqDO.mjs → handler-DF1fVDpf.mjs} +0 -0
  472. package/dist/{host-Caq6ZfSJ.mjs → host-B-_ntOMH.mjs} +0 -0
  473. package/dist/{index-ye0oklfU.d.mts → index-B2Y1Wvbh.d.mts} +0 -0
  474. package/dist/{index-Cv-o5Krs.d.mts → index-B4svZC6L.d.mts} +0 -0
  475. package/dist/{index-DZunhZec.d.mts → index-B5dP8rj6.d.mts} +0 -0
  476. package/dist/{index-jTaAHsul.d.mts → index-BC-6qNeo.d.mts} +0 -0
  477. package/dist/{index-ByKi34v5.d.mts → index-BFWvT0NG.d.mts} +0 -0
  478. package/dist/{index-vA--0lOM.d.mts → index-BMRB9yhF.d.mts} +0 -0
  479. package/dist/{index-BskPjMet.d.mts → index-BuMsrli0.d.mts} +0 -0
  480. package/dist/{index-DR40QWlw.d.mts → index-C4V8Pmi4.d.mts} +0 -0
  481. package/dist/{index-BIdsFcQs2.d.mts → index-CL0Jo1b92.d.mts} +0 -0
  482. package/dist/{index-CjdRdsd0.d.mts → index-CVpaGijY.d.mts} +0 -0
  483. package/dist/{index-vcSj12YQ.d.mts → index-CmbkCxj-.d.mts} +0 -0
  484. package/dist/{index-sS6KUlrx.d.mts → index-CqdMbYmR.d.mts} +0 -0
  485. package/dist/{index-CnMu8BQl.d.mts → index-D037TVsm.d.mts} +0 -0
  486. package/dist/{index-CGZQVTid.d.mts → index-DgspOUa72.d.mts} +0 -0
  487. package/dist/{index-dtsLKOID.d.mts → index-Ek4y8M9J2.d.mts} +0 -0
  488. package/dist/{index-DjgLchuQ.d.mts → index-VzLAV0Yt.d.mts} +0 -0
  489. package/dist/{index-DXN_L5D6.d.mts → index-jxPncqWZ2.d.mts} +0 -0
  490. package/dist/{index-BVRQEpAg.d.mts → index-kzIjbrS02.d.mts} +6 -6
  491. /package/dist/{index-Dm1nUxCF.d.mts → index-l01zsChf.d.mts} +0 -0
  492. /package/dist/{index-CWHfOz6d.d.mts → index-pvX-BIpr2.d.mts} +0 -0
  493. /package/dist/{jsonl-transport-bQl3JwIu.mjs → jsonl-transport-Cyyh5Wje.mjs} +0 -0
  494. /package/dist/{lib-DOBXZmYX.mjs → lib-BqV8hYtk.mjs} +0 -0
  495. /package/dist/{model-registry-xyBKSye-.mjs → model-registry-C9rFu3kV.mjs} +0 -0
  496. /package/dist/{model-registry-CmgcPDH3.mjs → model-registry-Cixxx2jv.mjs} +0 -0
  497. /package/dist/{modes-BheyN7SS.mjs → modes-DwsJ3yVl.mjs} +0 -0
  498. /package/dist/{namespace-BOkKoq34.d.mts → namespace-B0ftHlK3.d.mts} +0 -0
  499. /package/dist/{namespace-YytVKIgI.d.mts → namespace-BGRHcrmp.d.mts} +0 -0
  500. /package/dist/{namespace-jDhZjw-i.d.mts → namespace-BUYDmd0r.d.mts} +0 -0
  501. /package/dist/{namespace-YxU1xf-K.mjs → namespace-BW3Bfu9h.mjs} +0 -0
  502. /package/dist/{namespace-DWCEo-9M.d.mts → namespace-BdAK0lD8.d.mts} +0 -0
  503. /package/dist/{namespace-Cv1RFP7n.d.mts → namespace-CPG6u60N.d.mts} +0 -0
  504. /package/dist/{namespace-GPA7zots.d.mts → namespace-CVFaZv8x.d.mts} +0 -0
  505. /package/dist/{namespace-Blp4c8GK.d.mts → namespace-DBO1OzYB.d.mts} +0 -0
  506. /package/dist/{namespace-C-9si-fV.mjs → namespace-DiwqpB-c.mjs} +0 -0
  507. /package/dist/{namespace-tGRAod3o.d.mts → namespace-DqZweTbX.d.mts} +0 -0
  508. /package/dist/{namespace-HO2J9sO8.mjs → namespace-jVTsuZHX.mjs} +0 -0
  509. /package/dist/{namespace-CWGKCNZm.mjs → namespace-tjoxekmf.mjs} +0 -0
  510. /package/dist/{out-CvjtANXN.mjs → out-8bOYN6EF.mjs} +0 -0
  511. /package/dist/{packages-DtEEP0Vt.mjs → packages-Bp124-gx.mjs} +0 -0
  512. /package/dist/{packages-BZ6pzFIq.d.mts → packages-CxPMEg8D.d.mts} +0 -0
  513. /package/dist/{platform-Bv8llU9c.mjs → platform-CxyYPrkf.mjs} +0 -0
  514. /package/dist/{provider-operation-Cxoe2SUr.d.mts → provider-operation-DbdyFwNm.d.mts} +0 -0
  515. /package/dist/{providers-Co5UszRH.mjs → providers-C-eekMxD.mjs} +0 -0
  516. /package/dist/{providers-namespace-DjFkmvBR.d.mts → providers-namespace-CfZKp-C0.d.mts} +0 -0
  517. /package/dist/{quick-lru-CrOpWwrf.mjs → quick-lru-CCEnf7y6.mjs} +0 -0
  518. /package/dist/{schema-Db-y-09L.mjs → schema-C0opCPww.mjs} +0 -0
  519. /package/dist/{schema-introspection-DgWQCpwx.mjs → schema-introspection-6-r_KEJQ.mjs} +0 -0
  520. /package/dist/{schemas-N6x2z7Lf.d.mts → schemas-B50oWBuj.d.mts} +0 -0
  521. /package/dist/{schemas-BO7uOum6.d.mts → schemas-B6Q-qdmn.d.mts} +0 -0
  522. /package/dist/{schemas-BGExwp3j.mjs → schemas-B8hKbBwI.mjs} +0 -0
  523. /package/dist/{schemas-miYxK_Z1.d.mts → schemas-BGvkTiCx.d.mts} +0 -0
  524. /package/dist/{schemas-CqRm0i9a.mjs → schemas-BivbWRkG.mjs} +0 -0
  525. /package/dist/{schemas-CwbYk_kZ.d.mts → schemas-ChmQldVH.d.mts} +0 -0
  526. /package/dist/{schemas-DrVg4aQQ.d.mts → schemas-Dd13TMgU.d.mts} +0 -0
  527. /package/dist/{schemas-BtZqovRH.d.mts → schemas-Pe892GgN.d.mts} +0 -0
  528. /package/dist/{schemas-CQyRBqD6.d.mts → schemas-bfZNpl0B.d.mts} +0 -0
  529. /package/dist/{schemas-Bfxskx_2.mjs → schemas-scyC2tFF.mjs} +0 -0
  530. /package/dist/{semver-DlM8znk4.mjs → semver-BI7kTNsY.mjs} +0 -0
  531. /package/dist/{server-lifecycle-kmQ5PUDv.mjs → server-lifecycle-B_OZnoe-.mjs} +0 -0
  532. /package/dist/{server-lifecycle-Dsq56aqC.d.mts → server-lifecycle-L8zja8t8.d.mts} +0 -0
  533. /package/dist/{session-lineage-B_JW5LpF.d.mts → session-lineage-bUkd3fqx.d.mts} +0 -0
  534. /package/dist/{shared-schemas-DXwyMCwZ.mjs → shared-schemas-CQ6blrEW.mjs} +0 -0
  535. /package/dist/{src-CCu8TwL6.mjs → src-BacfeiI4.mjs} +0 -0
  536. /package/dist/{storage-namespace-BSrv0vXR.mjs → storage-namespace-BZce8kkW.mjs} +0 -0
  537. /package/dist/{storage-namespace-dfywhXR3.d.mts → storage-namespace-YmE8XCCL.d.mts} +0 -0
  538. /package/dist/{storage-namespace-definition-BvlX0QV_.d.mts → storage-namespace-definition-BsnYAPot.d.mts} +0 -0
  539. /package/dist/{storage-namespace-definition-CkMKt7-I.mjs → storage-namespace-definition-Cca-zwXU.mjs} +0 -0
  540. /package/dist/{supports-color-DUugCQsK.mjs → supports-color-SV_FgSN2.mjs} +0 -0
  541. /package/dist/{telemetry-Pr3oP2rk.mjs → telemetry-BqoC87F-.mjs} +0 -0
  542. /package/dist/{timeout-DWDhddRJ.mjs → timeout-DVlN2Zhy.mjs} +0 -0
  543. /package/dist/{tray-menu-service-BBLa-Rcv.mjs → tray-menu-service-eVVxgPLc.mjs} +0 -0
  544. /package/dist/{types-BrcjaNPZ.d.mts → types-DdpSEmTO.d.mts} +0 -0
  545. /package/dist/{types-b54n1o57.d.mts → types-tyv0B605.d.mts} +0 -0
  546. /package/dist/{ui-config-CyCdlns_.mjs → ui-config-B35GloSX.mjs} +0 -0
  547. /package/dist/{variant-krjlTdJt.mjs → variant-Dwnge3J_.mjs} +0 -0
  548. /package/dist/{window-registry-I-imZHV_.mjs → window-registry-CKiMJjId.mjs} +0 -0
  549. /package/dist/{window-registry-BDnZLPVx.d.mts → window-registry-Pcf35cac.d.mts} +0 -0
@@ -0,0 +1,375 @@
1
+ import { l as JsonValue$1 } from "./json-value-DPqb-SJ8.mjs";
2
+ import { z } from "zod";
3
+ import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
4
+
5
+ //#region core/contracts/src/automation-trigger/schemas.d.ts
6
+ /** Dot-separated local portion of an automation trigger kind. */
7
+ declare const AutomationTriggerLocalNameSchema$1: z.ZodString;
8
+ declare const AutomationTriggerKindSchema: z.ZodString;
9
+ /**
10
+ * Serializable descriptor advertising a contributed automation trigger.
11
+ *
12
+ * Carries only discoverable metadata and derived JSON Schema representations of
13
+ * the parameter and event shapes. The live Zod schemas and activate function are
14
+ * never serialized — runtime truth is always the live {@link AutomationTriggerType}
15
+ * contributed by the owning extension.
16
+ */
17
+ declare const AutomationTriggerDescriptorSchema: z.ZodObject<{
18
+ kind: z.ZodString;
19
+ label: z.ZodString;
20
+ description: z.ZodString;
21
+ categories: z.ZodReadonly<z.ZodArray<z.ZodString>>;
22
+ parameterSchema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
23
+ eventSchema: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
24
+ workflowCompatible: z.ZodBoolean;
25
+ }, z.core.$strip>;
26
+ /** Serializable descriptor advertising a contributed automation trigger. */
27
+ type AutomationTriggerDescriptor$1 = z.infer<typeof AutomationTriggerDescriptorSchema>;
28
+ /**
29
+ * Serializable binding reference linking an active automation trigger to its
30
+ * configuration parameters.
31
+ *
32
+ * Validated as a JSON-safe record so bindings stay serializable and can be
33
+ * persisted in workflow definitions.
34
+ */
35
+ declare const AutomationTriggerBindingSchema: z.ZodObject<{
36
+ kind: z.ZodString;
37
+ params: z.ZodType<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>, z.core.$ZodTypeInternals<Record<string, _$_makaio_contracts0.JsonValue>, Record<string, _$_makaio_contracts0.JsonValue>>>;
38
+ }, z.core.$strip>;
39
+ //#endregion
40
+ //#region core/contracts/src/automation-trigger/definition.d.ts
41
+ /**
42
+ * JSON-compatible parameter map passed to a trigger's {@link AutomationTriggerType.activate}
43
+ * function.
44
+ */
45
+ type AutomationTriggerParams = Readonly<Record<string, JsonValue$1>>;
46
+ /**
47
+ * JSON-compatible payload produced by a trigger's live event schema and
48
+ * delivered to listeners after an {@link AutomationTriggerActivationContext.emit}
49
+ * call.
50
+ */
51
+ type AutomationTriggerPayload = JsonValue$1;
52
+ /**
53
+ * Cleanup function returned by {@link AutomationTriggerType.activate}.
54
+ *
55
+ * Called by the runtime when the trigger binding is detached or the runtime
56
+ * shuts down. May be synchronous or asynchronous.
57
+ *
58
+ * **Lifecycle ordering invariant:** the runtime aborts the activation
59
+ * {@link AutomationTriggerActivationContext.signal} and then awaits this
60
+ * cleanup. Implementations must be idempotent — the runtime calls this at most
61
+ * once, but implementations should tolerate a double-disposal without error to
62
+ * allow defensive guard callers. Use the returned cleanup as the primary
63
+ * teardown mechanism; use `signal` only for cancelling in-flight async work.
64
+ */
65
+ type AutomationTriggerCleanup$1 = () => void | Promise<void>;
66
+ /**
67
+ * Listener registered for automation trigger events.
68
+ *
69
+ * Called each time the active trigger emits via its activation context.
70
+ * @param event - Fully typed trigger event envelope.
71
+ * @returns `void` or a `Promise<void>` to allow async side-effects.
72
+ */
73
+ type AutomationTriggerListener$1 = (event: AutomationTriggerEvent) => void | Promise<void>;
74
+ /**
75
+ * Serializable reference to an active trigger binding.
76
+ *
77
+ * Stores the canonical trigger {@link kind} and the JSON-safe parameter input
78
+ * that the runtime parses before calling {@link AutomationTriggerType.activate}.
79
+ * Bindings are persisted in workflow definitions; runtime truth is always the
80
+ * live trigger.
81
+ */
82
+ interface AutomationTriggerBinding$1 {
83
+ /** Canonical trigger kind, optionally owned by an npm-scoped extension. */
84
+ readonly kind: string;
85
+ /** JSON-safe parameter schema input for this binding. */
86
+ readonly params: Readonly<Record<string, JsonValue$1>>;
87
+ }
88
+ /**
89
+ * Event envelope emitted by an active automation trigger.
90
+ *
91
+ * Produced by the trigger's activation context {@link AutomationTriggerActivationContext.emit}
92
+ * and delivered to registered {@link AutomationTriggerListener}s.
93
+ * @typeParam TPayload - JSON-compatible event payload shape.
94
+ */
95
+ interface AutomationTriggerEvent<TPayload extends JsonValue$1 = JsonValue$1> {
96
+ /** Canonical trigger kind that emitted this event. */
97
+ readonly kind: string;
98
+ /** Event payload validated by the trigger's live `eventSchema`. */
99
+ readonly payload: Readonly<TPayload>;
100
+ /**
101
+ * UNIX epoch milliseconds when the trigger observed the underlying event.
102
+ *
103
+ * Stamped by the binding runtime when it accepts the emitted value; used for
104
+ * ordering and diagnostics.
105
+ */
106
+ readonly observedAt: number;
107
+ /**
108
+ * Optional propagated correlation identifier.
109
+ *
110
+ * Present when the triggering source carries correlation context
111
+ * (e.g. a webhook request with a trace header).
112
+ */
113
+ readonly correlationId?: string;
114
+ }
115
+ /**
116
+ * Context supplied to a trigger's {@link AutomationTriggerType.activate} function.
117
+ *
118
+ * Provides the activation's identity, lifecycle management (via `signal`), and
119
+ * the typed emit channel for delivering events to the runtime's event bus.
120
+ * @typeParam TPayloadInput - Input accepted by the trigger's live `eventSchema`.
121
+ * The runtime parses this value before listeners receive its JSON-safe output.
122
+ */
123
+ interface AutomationTriggerActivationContext<TPayloadInput = JsonValue$1> {
124
+ /**
125
+ * Canonical sharing key of the activation this context belongs to.
126
+ *
127
+ * Supplied by the runtime, which derived it from `<kind>` and the parsed,
128
+ * canonicalized parameters — the same key that decides which bindings share this
129
+ * activation. A trigger that has to name its activation to a collaborator (a
130
+ * scheduler being handed a job, a log line attributing a failure) reports this
131
+ * value instead of re-deriving one, which is what keeps a trigger's notion of
132
+ * its own identity from drifting from the runtime's.
133
+ *
134
+ * **Not a unique index over time:** the runtime may briefly hold a retiring and
135
+ * a fresh activation of the same key, so a collaborator must key its own state
136
+ * on the activation it was handed, not on this string.
137
+ */
138
+ readonly bindingKey: string;
139
+ /**
140
+ * Abort signal that is aborted when the trigger binding is detached or the
141
+ * runtime shuts down.
142
+ *
143
+ * **Lifecycle ordering invariant:** the runtime aborts this signal first,
144
+ * then awaits the {@link AutomationTriggerCleanup} returned by
145
+ * {@link AutomationTriggerType.activate}. Implementations should use
146
+ * `signal` only for cancelling in-flight async work (e.g. passing it to
147
+ * `fetch`). Use the returned cleanup as the primary teardown mechanism for
148
+ * releasing subscriptions or handles.
149
+ */
150
+ readonly signal: AbortSignal;
151
+ /**
152
+ * Emits a trigger event to the runtime's event bus.
153
+ * @param payload - Event payload input validated and transformed by the
154
+ * trigger's live `eventSchema`.
155
+ * @param metadata - Optional envelope metadata to attach to the emitted event.
156
+ * @returns Resolves when the event has been accepted by the bus.
157
+ */
158
+ readonly emit: (payload: TPayloadInput, metadata?: {
159
+ readonly correlationId?: string;
160
+ }) => Promise<void>;
161
+ }
162
+ /**
163
+ * Handle representing a currently active trigger subscription.
164
+ *
165
+ * Returned by the trigger registry's `subscribe` method. Callers retain this
166
+ * to detach the subscription cleanly.
167
+ */
168
+ interface AutomationTriggerSubscription$1 {
169
+ /** Stable key identifying this binding instance. */
170
+ readonly bindingKey: string;
171
+ /**
172
+ * Detaches the subscription, stopping the trigger and releasing resources.
173
+ * @returns Resolves when the trigger cleanup is complete.
174
+ */
175
+ readonly detach: () => Promise<void>;
176
+ }
177
+ /**
178
+ * Type-erased automation trigger stored in the registry.
179
+ *
180
+ * This is the shape that contribution processors and the trigger registry
181
+ * consume after generic types are erased. Typed authoring happens through
182
+ * {@link DefinedAutomationTrigger} and {@link defineAutomationTrigger}.
183
+ *
184
+ * The live `paramsSchema`, `eventSchema`, and `activate` are function-carrying
185
+ * runtime values and must never be included in serializable descriptor
186
+ * metadata — {@link createAutomationTriggerDescriptor} produces the only
187
+ * serializable representation.
188
+ */
189
+ interface AutomationTriggerType$1 {
190
+ /** Canonical trigger kind, optionally owned by an npm-scoped extension. */
191
+ readonly kind: string;
192
+ /** Human-readable label shown in the Builder UI. */
193
+ readonly label: string;
194
+ /** Human-readable description of what this trigger emits and when. */
195
+ readonly description: string;
196
+ /** Categorization tags for grouping triggers in the Builder UI. */
197
+ readonly categories: readonly string[];
198
+ /**
199
+ * Live Zod schema for the trigger's activation parameters.
200
+ *
201
+ * The runtime validates binding params against this schema before calling
202
+ * {@link activate}.
203
+ */
204
+ readonly paramsSchema: z.ZodType<Record<string, JsonValue$1>>;
205
+ /**
206
+ * Live Zod schema for the trigger's emitted event payload.
207
+ *
208
+ * The activation context validates emitted payloads against this schema
209
+ * before delivering them to listeners.
210
+ *
211
+ * The activation context accepts the schema's input type. The runtime parses
212
+ * each emitted value exactly once and delivers the schema's JSON-compatible
213
+ * output to listeners, so transforms may change the payload shape.
214
+ */
215
+ readonly eventSchema: z.ZodType<JsonValue$1>;
216
+ /**
217
+ * Activates the trigger with the supplied binding parameters.
218
+ *
219
+ * Called by the runtime after validating `params` through {@link paramsSchema}.
220
+ * The implementation must return a cleanup function that stops the trigger
221
+ * when called.
222
+ * Declared as a readonly **property** rather than a method so that
223
+ * `strictFunctionTypes` checks its parameters contravariantly: a trigger that
224
+ * declares narrower `params` than the registry-boundary contract (for example
225
+ * `params: { repo: string }` alongside `paramsSchema: z.object({})`) must not
226
+ * type-check as an `AutomationTriggerType`. Method shorthand would make the
227
+ * parameters bivariant and silently admit that mismatch.
228
+ * @param context - Activation context with lifecycle signal and emit channel.
229
+ * @param params - Schema-validated binding parameters.
230
+ * @returns Cleanup function called on trigger deactivation.
231
+ */
232
+ readonly activate: (context: AutomationTriggerActivationContext<unknown>, params: AutomationTriggerParams) => Promise<AutomationTriggerCleanup$1>;
233
+ }
234
+ /**
235
+ * Typed automation trigger definition authored by an extension.
236
+ *
237
+ * Preserves typed `paramsSchema`, `eventSchema`, and `activate` through the
238
+ * authoring surface before generics are erased to {@link AutomationTriggerType}
239
+ * at the registry boundary. Extensions declare triggers using
240
+ * {@link defineAutomationTrigger}, which validates and caches the descriptor
241
+ * at definition time.
242
+ * @typeParam TParamsSchema - Live Zod schema for the parameter shape.
243
+ * @typeParam TEventSchema - Live Zod schema for the emitted event payload.
244
+ */
245
+ interface DefinedAutomationTrigger<TParamsSchema extends z.ZodType<AutomationTriggerParams>, TEventSchema extends z.ZodType<AutomationTriggerPayload>> extends Omit<AutomationTriggerType$1, 'paramsSchema' | 'eventSchema' | 'activate'> {
246
+ /** Live Zod schema for the trigger's activation parameters. */
247
+ readonly paramsSchema: TParamsSchema;
248
+ /**
249
+ * Live Zod schema for the trigger's emitted event payload.
250
+ *
251
+ * Schema input is accepted by the typed emit channel; schema output must be
252
+ * JSON-compatible for listener delivery.
253
+ */
254
+ readonly eventSchema: TEventSchema;
255
+ /**
256
+ * Activates the trigger with the supplied typed binding parameters.
257
+ * @param context - Activation context with typed emit channel.
258
+ * @param params - Schema-validated binding parameters matching `TParamsSchema`.
259
+ * @returns Cleanup function called on trigger deactivation.
260
+ */
261
+ readonly activate: (context: AutomationTriggerActivationContext<z.input<TEventSchema>>, params: z.output<TParamsSchema>) => Promise<AutomationTriggerCleanup$1>;
262
+ }
263
+ /**
264
+ * Minimal trigger-like shape required to produce an
265
+ * {@link AutomationTriggerDescriptor}.
266
+ *
267
+ * Both {@link AutomationTriggerType} and
268
+ * {@link DefinedAutomationTrigger} satisfy this interface because descriptor
269
+ * production only requires the presentation fields and the two live schemas —
270
+ * not the `activate` function.
271
+ */
272
+ interface AutomationTriggerDescriptorSource {
273
+ readonly kind: string;
274
+ readonly label: string;
275
+ readonly description: string;
276
+ readonly categories: readonly string[];
277
+ readonly paramsSchema: z.ZodType<AutomationTriggerParams>;
278
+ readonly eventSchema: z.ZodType<AutomationTriggerPayload>;
279
+ }
280
+ /**
281
+ * Creates a validated, serializable {@link AutomationTriggerDescriptor} from a
282
+ * trigger definition.
283
+ *
284
+ * This is the only supported path for producing serializable trigger
285
+ * metadata. Extensions do NOT implement a `toDescriptor()` method — the
286
+ * framework derives the descriptor from the live schemas to guarantee that
287
+ * Builder metadata cannot drift from runtime truth.
288
+ *
289
+ * Results are cached on the trigger object and returned as detached clones so
290
+ * mutations by callers never affect subsequent discovery.
291
+ * @param trigger - Trigger definition or type-erased registry entry.
292
+ * @returns A detached {@link AutomationTriggerDescriptor} snapshot.
293
+ * @throws When the trigger's `kind` fails {@link AutomationTriggerKindSchema}
294
+ * or either schema cannot be projected to JSON Schema.
295
+ */
296
+ declare function createAutomationTriggerDescriptor$1(trigger: AutomationTriggerDescriptorSource): AutomationTriggerDescriptor$1;
297
+ /**
298
+ * Defines a typed automation trigger and validates it at definition time.
299
+ *
300
+ * The returned definition is the typed authoring representation; it preserves
301
+ * typed `paramsSchema`, `eventSchema`, and `activate` until the caller erases
302
+ * generics to {@link AutomationTriggerType} at the registry boundary.
303
+ *
304
+ * Validation steps performed eagerly:
305
+ * 1. {@link AutomationTriggerKindSchema} rejects invalid kind formats.
306
+ * 2. {@link createAutomationTriggerDescriptor} validates that both schemas can
307
+ * be projected to JSON Schema and caches the result, so discovery never fails.
308
+ * @typeParam TParamsSchema - Live Zod schema for the parameter shape.
309
+ * @typeParam TEventSchema - Live Zod schema for the emitted event payload.
310
+ * @param definition - Full typed trigger definition authored by the extension.
311
+ * @returns The same `definition` object, frozen and type-preserved for the
312
+ * contribution surface. The returned object is shallowly frozen so that
313
+ * mutations to `label`, schemas, or other fields after definition time cannot
314
+ * silently diverge from the eagerly cached descriptor.
315
+ * @throws When `kind` is not a valid canonical trigger kind string, or when either
316
+ * schema cannot be projected to a JSON-safe JSON Schema record.
317
+ * @example
318
+ * ```ts
319
+ * export const profileChangedTrigger = defineAutomationTrigger({
320
+ * kind: 'makaio.profile-changed',
321
+ * label: 'Profile Changed',
322
+ * description: 'Fires when the authenticated user profile changes.',
323
+ * categories: ['Identity'],
324
+ * paramsSchema: z.object({}),
325
+ * eventSchema: z.object({ userId: z.string() }),
326
+ * activate: async (ctx) => {
327
+ * // Prefer returning a cleanup function as the primary teardown mechanism.
328
+ * // Use ctx.signal only for cancelling in-flight async work.
329
+ * const off = bus.on('profile.changed', (e) => {
330
+ * void ctx.emit({ userId: e.userId });
331
+ * });
332
+ * // Return the cleanup — the runtime awaits it after aborting ctx.signal.
333
+ * return off;
334
+ * },
335
+ * });
336
+ * ```
337
+ */
338
+ declare function defineAutomationTrigger$1<TParamsSchema extends z.ZodType<AutomationTriggerParams>, TEventSchema extends z.ZodType<AutomationTriggerPayload>>(definition: DefinedAutomationTrigger<TParamsSchema, TEventSchema>): DefinedAutomationTrigger<TParamsSchema, TEventSchema>;
339
+ /**
340
+ * Erases the typed generics on a {@link DefinedAutomationTrigger} to the
341
+ * registry-boundary {@link AutomationTriggerType}.
342
+ *
343
+ * **How the erasure compiles.** `DefinedAutomationTrigger.activate` accepts the
344
+ * narrow `z.output<TParamsSchema>` while `AutomationTriggerType.activate`
345
+ * accepts the wide `AutomationTriggerParams`. Both are readonly properties, so
346
+ * `strictFunctionTypes` compares them contravariantly and correctly rejects the
347
+ * narrow signature as a direct assignment — that strictness is deliberate: it
348
+ * is what stops a hand-written trigger from declaring narrower `params` than its
349
+ * own `paramsSchema` produces. The erasure is therefore expressed as an
350
+ * overload: this public signature accepts the typed definition, while the
351
+ * implementation signature below is the wide {@link AutomationTriggerType}, so
352
+ * the widening happens in the signature relation rather than through a type
353
+ * assertion. Keeping the erasure here means no extension author casts — or even
354
+ * mentions the erased type — at their own call site.
355
+ *
356
+ * **Why the erasure is safe at runtime.** The binding runtime parses binding
357
+ * parameters through `paramsSchema` (and projects them through the shared JSON
358
+ * schemas) before calling `activate`, and parses every emitted payload through
359
+ * `eventSchema` before fanning it out to listeners. The narrow typed signature
360
+ * is therefore only ever invoked with values its own schema produced.
361
+ *
362
+ * **Object identity is preserved:** the returned value IS the same object
363
+ * reference. The {@link descriptorCache} WeakMap in
364
+ * {@link createAutomationTriggerDescriptor} is keyed on object identity; a
365
+ * spread copy would defeat the definition-time descriptor caching and break the
366
+ * fail-fast guarantee that discovery can never throw.
367
+ * @typeParam TParamsSchema - Live Zod schema for the parameter shape.
368
+ * @typeParam TEventSchema - Live Zod schema for the emitted event payload.
369
+ * @param definition - A typed trigger definition produced by
370
+ * {@link defineAutomationTrigger}.
371
+ * @returns The same object reference, widened to {@link AutomationTriggerType}.
372
+ */
373
+ declare function toAutomationTriggerType$1<TParamsSchema extends z.ZodType<AutomationTriggerParams>, TEventSchema extends z.ZodType<AutomationTriggerPayload>>(definition: DefinedAutomationTrigger<TParamsSchema, TEventSchema>): AutomationTriggerType$1;
374
+ //#endregion
375
+ export { AutomationTriggerKindSchema as _, AutomationTriggerListener$1 as a, AutomationTriggerSubscription$1 as c, createAutomationTriggerDescriptor$1 as d, defineAutomationTrigger$1 as f, AutomationTriggerDescriptorSchema as g, AutomationTriggerDescriptor$1 as h, AutomationTriggerEvent as i, AutomationTriggerType$1 as l, AutomationTriggerBindingSchema as m, AutomationTriggerBinding$1 as n, AutomationTriggerParams as o, toAutomationTriggerType$1 as p, AutomationTriggerCleanup$1 as r, AutomationTriggerPayload as s, AutomationTriggerActivationContext as t, DefinedAutomationTrigger as u, AutomationTriggerLocalNameSchema$1 as v };
@@ -1 +1 @@
1
- import{t as e}from"./descriptor-to-package-DvF08krT.mjs";import{t}from"./jsonl-transport-bQl3JwIu.mjs";import{z as n}from"zod";import{createBusNamespace as r}from"@makaio/framework/core";const i={idle:[`starting`],starting:[`running`,`crashed`,`stopping`],running:[`stopping`,`crashed`],stopping:[`stopped`],stopped:[`starting`],crashed:[`starting`,`stopped`]};function a(e,t){if(!i[e].includes(t))throw Error(`Invalid state transition: ${e} → ${t}`)}function o(e){return new Promise(t=>{if(e.exitCode!==null||e.signalCode!==null){t(!0);return}e.once(`exit`,()=>t(!0))})}function s(e){let{spawn:n,healthTimeoutMs:r=3e4,shutdownTimeoutMs:i=5e3,restartPolicy:s=`none`,onReady:c,onExit:l,onStateChange:u}=e,d=`idle`,f;function p(e){a(d,e),d=e,u?.(d)}function m(e){let t=f;if(f=void 0,t?.close(),d===`stopping`){p(`stopped`),l?.(e);return}if(d===`running`){if(e!==0){p(`crashed`),l?.(e),(s===`on-crash`||s===`always`)&&h().catch(e=>{console.error(`[ProcessLifecycle:${n.processName??n.command}] Restart failed:`,e instanceof Error?e.message:e)});return}p(`stopping`),p(`stopped`),l?.(e),s===`always`&&h().catch(e=>{console.error(`[ProcessLifecycle:${n.processName??n.command}] Restart failed:`,e instanceof Error?e.message:e)})}}async function h(){p(`starting`);let e=t(n);f=e;let i=e.process;await new Promise((t,a)=>{let o=!1;function s(e){o||(o=!0,clearTimeout(u),d(),i.off(`exit`,h),e())}let u=setTimeout(()=>{s(()=>{e.close(),f=void 0;try{p(`crashed`)}catch{}a(Error(`Process health timeout after ${r}ms: ${n.processName??n.command}`))})},r),d=e.onMessage(()=>{s(()=>{try{p(`running`)}catch(e){a(e);return}c?.(),i.once(`exit`,m),t()})});function h(e){s(()=>{f=void 0;try{p(`crashed`)}catch{}l?.(e),a(Error(`Process exited with code ${String(e)} before signaling readiness`))})}i.once(`exit`,h)})}async function g(){if(d===`stopped`||d===`idle`)return;if(d===`crashed`){f?.close(),f=void 0,p(`stopped`);return}if(d!==`stopping`&&p(`stopping`),!f){d===`stopping`&&p(`stopped`);return}let e=f,t=e.process;if(t.exitCode!==null){e.close(),f===e&&(f=void 0),d===`stopping`&&p(`stopped`);return}t.kill(`SIGTERM`);let n;await Promise.race([o(t).then(()=>(clearTimeout(n),!0)),new Promise(e=>{n=setTimeout(()=>e(!1),i)})])||(t.kill(`SIGKILL`),await o(t)),d===`stopping`&&p(`stopped`),e.close(),f===e&&(f=void 0)}return{get transport(){return f},get state(){return d},start:h,stop:g}}const c=n.object({dataDir:n.string().optional(),machineId:n.string().optional(),makaioHome:n.string().optional(),platform:n.string().optional(),username:n.string().optional()}),l={init:{request:n.object({config:n.unknown().optional(),context:c.optional()}),response:n.object({ready:n.boolean()})},ready:n.object({ready:n.boolean(),config:n.unknown().optional(),context:c.optional()}).passthrough(),destroy:{request:n.object({reason:n.string().optional()}),response:n.object({stopped:n.boolean()})},stopped:n.object({stopped:n.boolean()}).passthrough()};function u(e,t){return e.bus.registerNamespace(r(`extension.${t}`,l)).subjects}function d(e,t){let n;return()=>(n??=u(e,t),n)}function f(e){return{dataDir:e.dataDir,machineId:e.machineId,makaioHome:e.makaioHome,platform:e.platform,username:e.username}}var p=class{descriptor;ctx;extensionPath;getLifecycleSubjects;transport=null;unregister=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n,this.getLifecycleSubjects=d(t,e.name)}async init(){let{StdioServerTransport:e}=await import(`./src-DD0v-nIj.mjs`),{transport:t}=this.descriptor,n=this.getLifecycleSubjects(),r=new e({name:this.descriptor.name,spawn:{command:t.command,args:t.args,cwd:this.extensionPath,env:t.env,processName:this.descriptor.name}}),i=null;try{let e=this.ctx.bus.registerTransport(r);i=e.unregister,await r.connect(),await r.ready,await e.ready,this.transport=r,this.unregister=i,await this.ctx.bus.request(n.init,{config:this.ctx.config??this.descriptor.config?.defaults,context:f(this.ctx)},{timeout:t.healthTimeoutMs})}catch(e){throw i?.(),await r.disconnect(),this.transport=null,this.unregister=null,e}}async destroy(){if(this.transport!==null){let e=this.getLifecycleSubjects();try{await this.ctx.bus.request(e.destroy,{reason:`runtime-shutdown`},{timeout:this.descriptor.transport.shutdownTimeoutMs})}catch(e){console.warn(`[extensions] ${this.descriptor.name}: detached destroy lifecycle request did not complete before disconnect:`,e instanceof Error?e.message:e)}}this.unregister?.(),this.unregister=null,await this.transport?.disconnect(),this.transport=null}},m=class{descriptor;ctx;extensionPath;getLifecycleSubjects;lifecycle=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n,this.getLifecycleSubjects=d(t,e.name)}async init(){let{transport:e}=this.descriptor;if(!this.ctx.busUrl)throw Error(`[extensions] ${this.descriptor.name}: bus-websocket transport requires NodeExtensionContext.busUrl`);let t=this.getLifecycleSubjects();this.lifecycle=s({spawn:{command:e.command,args:e.args,cwd:this.extensionPath,env:{...e.env,MAKAIO_BUS_TRANSPORT:`websocket`,MAKAIO_BUS_URL:this.ctx.busUrl,MAKAIO_EXTENSION_NAME:this.descriptor.name},processName:this.descriptor.name},healthTimeoutMs:e.healthTimeoutMs,shutdownTimeoutMs:e.shutdownTimeoutMs,restartPolicy:`restartPolicy`in e?e.restartPolicy:void 0});try{await this.lifecycle.start(),await this.ctx.bus.request(t.init,{config:this.ctx.config??this.descriptor.config?.defaults,context:f(this.ctx)},{timeout:e.healthTimeoutMs})}catch(e){throw await this.lifecycle.stop(),this.lifecycle=null,e}}async destroy(){if(this.lifecycle!==null){let e=this.getLifecycleSubjects();try{await this.ctx.bus.request(e.destroy,{reason:`runtime-shutdown`},{timeout:this.descriptor.transport.shutdownTimeoutMs})}catch(e){console.warn(`[extensions] ${this.descriptor.name}: detached destroy lifecycle request did not complete before process stop:`,e instanceof Error?e.message:e)}await this.lifecycle.stop(),this.lifecycle=null}}},h=class{descriptor;ctx;extensionPath;bridge=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n}async init(){let{startMcpClientBridge:e}=await import(`@makaio/framework/mcp-http-server`),{transport:t}=this.descriptor;this.bridge=await e({command:t.command,args:t.args,env:t.env,cwd:this.extensionPath,extensionName:this.descriptor.name,bus:this.ctx.bus})}async destroy(){this.bridge!==null&&(await this.bridge.close(),this.bridge=null)}};function g(t,n){return{...e(t),create(e){return t.transport.type===`bus-stdio`?new p(t,e,n):t.transport.type===`mcp-stdio`?new h(t,e,n):new m(t,e,n)}}}export{g as createDetachedExtensionPackage};
1
+ import{t as e}from"./descriptor-to-package-CcjdoWP4.mjs";import{t}from"./jsonl-transport-Cyyh5Wje.mjs";import{z as n}from"zod";import{createBusNamespace as r}from"@makaio/framework/core";const i={idle:[`starting`],starting:[`running`,`crashed`,`stopping`],running:[`stopping`,`crashed`],stopping:[`stopped`],stopped:[`starting`],crashed:[`starting`,`stopped`]};function a(e,t){if(!i[e].includes(t))throw Error(`Invalid state transition: ${e} → ${t}`)}function o(e){return new Promise(t=>{if(e.exitCode!==null||e.signalCode!==null){t(!0);return}e.once(`exit`,()=>t(!0))})}function s(e){let{spawn:n,healthTimeoutMs:r=3e4,shutdownTimeoutMs:i=5e3,restartPolicy:s=`none`,onReady:c,onExit:l,onStateChange:u}=e,d=`idle`,f;function p(e){a(d,e),d=e,u?.(d)}function m(e){let t=f;if(f=void 0,t?.close(),d===`stopping`){p(`stopped`),l?.(e);return}if(d===`running`){if(e!==0){p(`crashed`),l?.(e),(s===`on-crash`||s===`always`)&&h().catch(e=>{console.error(`[ProcessLifecycle:${n.processName??n.command}] Restart failed:`,e instanceof Error?e.message:e)});return}p(`stopping`),p(`stopped`),l?.(e),s===`always`&&h().catch(e=>{console.error(`[ProcessLifecycle:${n.processName??n.command}] Restart failed:`,e instanceof Error?e.message:e)})}}async function h(){p(`starting`);let e=t(n);f=e;let i=e.process;await new Promise((t,a)=>{let o=!1;function s(e){o||(o=!0,clearTimeout(u),d(),i.off(`exit`,h),e())}let u=setTimeout(()=>{s(()=>{e.close(),f=void 0;try{p(`crashed`)}catch{}a(Error(`Process health timeout after ${r}ms: ${n.processName??n.command}`))})},r),d=e.onMessage(()=>{s(()=>{try{p(`running`)}catch(e){a(e);return}c?.(),i.once(`exit`,m),t()})});function h(e){s(()=>{f=void 0;try{p(`crashed`)}catch{}l?.(e),a(Error(`Process exited with code ${String(e)} before signaling readiness`))})}i.once(`exit`,h)})}async function g(){if(d===`stopped`||d===`idle`)return;if(d===`crashed`){f?.close(),f=void 0,p(`stopped`);return}if(d!==`stopping`&&p(`stopping`),!f){d===`stopping`&&p(`stopped`);return}let e=f,t=e.process;if(t.exitCode!==null){e.close(),f===e&&(f=void 0),d===`stopping`&&p(`stopped`);return}t.kill(`SIGTERM`);let n;await Promise.race([o(t).then(()=>(clearTimeout(n),!0)),new Promise(e=>{n=setTimeout(()=>e(!1),i)})])||(t.kill(`SIGKILL`),await o(t)),d===`stopping`&&p(`stopped`),e.close(),f===e&&(f=void 0)}return{get transport(){return f},get state(){return d},start:h,stop:g}}const c=n.object({dataDir:n.string().optional(),machineId:n.string().optional(),makaioHome:n.string().optional(),platform:n.string().optional(),username:n.string().optional()}),l={init:{request:n.object({config:n.unknown().optional(),context:c.optional()}),response:n.object({ready:n.boolean()})},ready:n.object({ready:n.boolean(),config:n.unknown().optional(),context:c.optional()}).passthrough(),destroy:{request:n.object({reason:n.string().optional()}),response:n.object({stopped:n.boolean()})},stopped:n.object({stopped:n.boolean()}).passthrough()};function u(e,t){return e.bus.registerNamespace(r(`extension.${t}`,l)).subjects}function d(e,t){let n;return()=>(n??=u(e,t),n)}function f(e){return{dataDir:e.dataDir,machineId:e.machineId,makaioHome:e.makaioHome,platform:e.platform,username:e.username}}var p=class{descriptor;ctx;extensionPath;getLifecycleSubjects;transport=null;unregister=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n,this.getLifecycleSubjects=d(t,e.name)}async init(){let{StdioServerTransport:e}=await import(`./src-BmSQ3rlz.mjs`),{transport:t}=this.descriptor,n=this.getLifecycleSubjects(),r=new e({name:this.descriptor.name,spawn:{command:t.command,args:t.args,cwd:this.extensionPath,env:t.env,processName:this.descriptor.name}}),i=null;try{let e=this.ctx.bus.registerTransport(r);i=e.unregister,await r.connect(),await r.ready,await e.ready,this.transport=r,this.unregister=i,await this.ctx.bus.request(n.init,{config:this.ctx.config??this.descriptor.config?.defaults,context:f(this.ctx)},{timeout:t.healthTimeoutMs})}catch(e){throw i?.(),await r.disconnect(),this.transport=null,this.unregister=null,e}}async destroy(){if(this.transport!==null){let e=this.getLifecycleSubjects();try{await this.ctx.bus.request(e.destroy,{reason:`runtime-shutdown`},{timeout:this.descriptor.transport.shutdownTimeoutMs})}catch(e){console.warn(`[extensions] ${this.descriptor.name}: detached destroy lifecycle request did not complete before disconnect:`,e instanceof Error?e.message:e)}}this.unregister?.(),this.unregister=null,await this.transport?.disconnect(),this.transport=null}},m=class{descriptor;ctx;extensionPath;getLifecycleSubjects;lifecycle=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n,this.getLifecycleSubjects=d(t,e.name)}async init(){let{transport:e}=this.descriptor;if(!this.ctx.busUrl)throw Error(`[extensions] ${this.descriptor.name}: bus-websocket transport requires NodeExtensionContext.busUrl`);let t=this.getLifecycleSubjects();this.lifecycle=s({spawn:{command:e.command,args:e.args,cwd:this.extensionPath,env:{...e.env,MAKAIO_BUS_TRANSPORT:`websocket`,MAKAIO_BUS_URL:this.ctx.busUrl,MAKAIO_EXTENSION_NAME:this.descriptor.name},processName:this.descriptor.name},healthTimeoutMs:e.healthTimeoutMs,shutdownTimeoutMs:e.shutdownTimeoutMs,restartPolicy:`restartPolicy`in e?e.restartPolicy:void 0});try{await this.lifecycle.start(),await this.ctx.bus.request(t.init,{config:this.ctx.config??this.descriptor.config?.defaults,context:f(this.ctx)},{timeout:e.healthTimeoutMs})}catch(e){throw await this.lifecycle.stop(),this.lifecycle=null,e}}async destroy(){if(this.lifecycle!==null){let e=this.getLifecycleSubjects();try{await this.ctx.bus.request(e.destroy,{reason:`runtime-shutdown`},{timeout:this.descriptor.transport.shutdownTimeoutMs})}catch(e){console.warn(`[extensions] ${this.descriptor.name}: detached destroy lifecycle request did not complete before process stop:`,e instanceof Error?e.message:e)}await this.lifecycle.stop(),this.lifecycle=null}}},h=class{descriptor;ctx;extensionPath;bridge=null;constructor(e,t,n){this.descriptor=e,this.ctx=t,this.extensionPath=n}async init(){let{startMcpClientBridge:e}=await import(`@makaio/framework/mcp-http-server`),{transport:t}=this.descriptor;this.bridge=await e({command:t.command,args:t.args,env:t.env,cwd:this.extensionPath,extensionName:this.descriptor.name,bus:this.ctx.bus})}async destroy(){this.bridge!==null&&(await this.bridge.close(),this.bridge=null)}};function g(t,n){return{...e(t),create(e){return t.transport.type===`bus-stdio`?new p(t,e,n):t.transport.type===`mcp-stdio`?new h(t,e,n):new m(t,e,n)}}}export{g as createDetachedExtensionPackage};
@@ -0,0 +1,66 @@
1
+ -- Hand-corrected after generation: drizzle-kit's SQLite table rebuild listed the
2
+ -- two newly added columns (`current_adapter_session_id`,
3
+ -- `current_adapter_session_id_state`) in the copy SELECT as well, which reads them
4
+ -- from the pre-migration table where they do not exist yet. They are omitted from
5
+ -- both the INSERT and SELECT lists so existing rows adopt NULL plus the
6
+ -- 'inherited' default, which is the intended migration semantics. The rebuild
7
+ -- itself is required: SQLite cannot ALTER TABLE ADD CONSTRAINT for the new
8
+ -- currency check. The generated CHECK constraints qualified their column
9
+ -- references with the temporary table name ("__new_sessions"."col"); SQLite
10
+ -- versions before 3.53.0 do not rewrite table-qualified CHECK references on
11
+ -- ALTER TABLE ... RENAME, so the rename fails with "no such column". The
12
+ -- references are unqualified ("col") to stay valid across the rename on every
13
+ -- supported SQLite. Paired with drizzle-postgres/0021_adapter_session_currency.sql.
14
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
15
+ CREATE TABLE `__new_sessions` (
16
+ `session_id` text PRIMARY KEY NOT NULL,
17
+ `created_at` integer NOT NULL,
18
+ `last_activity_at` integer NOT NULL,
19
+ `status` text NOT NULL,
20
+ `lead_agent_id` text,
21
+ `parent_session_id` text,
22
+ `context_inheritance` text,
23
+ `root_session_id` text,
24
+ `fork_point_message_id` text,
25
+ `branch_kind` text,
26
+ `adapter_name` text,
27
+ `adapter_session_id` text,
28
+ `current_adapter_session_id` text,
29
+ `current_adapter_session_id_state` text DEFAULT 'inherited' NOT NULL,
30
+ `adapter_id` text,
31
+ `client_id` text,
32
+ `client_account_id` text,
33
+ `last_client_identity_observation` text,
34
+ `is_orchestrated` integer DEFAULT false,
35
+ `title` text,
36
+ `summary` text,
37
+ `summary_updated_at` integer,
38
+ `is_imported` integer DEFAULT false,
39
+ `fork_transforms` text,
40
+ `target_working_directory` text,
41
+ `execution_target_id` text,
42
+ `approval_policy_override` text,
43
+ `metadata` text,
44
+ `spawning_tool_call_id` text,
45
+ `source` text,
46
+ `parent_external_session_id` text,
47
+ `log_file_path` text,
48
+ `discovered_at` integer,
49
+ `import_status` text,
50
+ `is_sidechain` integer,
51
+ `machine_id` text,
52
+ CONSTRAINT "sessions_import_status_check" CHECK("import_status" IS NULL OR "import_status" IN ('discovered', 'imported', 'tracking')),
53
+ CONSTRAINT "sessions_context_inheritance_check" CHECK("context_inheritance" IS NULL OR "context_inheritance" IN ('parent-history', 'none')),
54
+ CONSTRAINT "sessions_current_adapter_session_id_currency_check" CHECK("current_adapter_session_id_state" IN ('inherited', 'moved', 'confirmed') AND ("current_adapter_session_id_state" <> 'confirmed' OR "current_adapter_session_id" IS NOT NULL) AND ("current_adapter_session_id_state" = 'confirmed' OR "current_adapter_session_id" IS NULL))
55
+ );
56
+ --> statement-breakpoint
57
+ INSERT INTO `__new_sessions`("session_id", "created_at", "last_activity_at", "status", "lead_agent_id", "parent_session_id", "context_inheritance", "root_session_id", "fork_point_message_id", "branch_kind", "adapter_name", "adapter_session_id", "adapter_id", "client_id", "client_account_id", "last_client_identity_observation", "is_orchestrated", "title", "summary", "summary_updated_at", "is_imported", "fork_transforms", "target_working_directory", "execution_target_id", "approval_policy_override", "metadata", "spawning_tool_call_id", "source", "parent_external_session_id", "log_file_path", "discovered_at", "import_status", "is_sidechain", "machine_id") SELECT "session_id", "created_at", "last_activity_at", "status", "lead_agent_id", "parent_session_id", "context_inheritance", "root_session_id", "fork_point_message_id", "branch_kind", "adapter_name", "adapter_session_id", "adapter_id", "client_id", "client_account_id", "last_client_identity_observation", "is_orchestrated", "title", "summary", "summary_updated_at", "is_imported", "fork_transforms", "target_working_directory", "execution_target_id", "approval_policy_override", "metadata", "spawning_tool_call_id", "source", "parent_external_session_id", "log_file_path", "discovered_at", "import_status", "is_sidechain", "machine_id" FROM `sessions`;--> statement-breakpoint
58
+ DROP TABLE `sessions`;--> statement-breakpoint
59
+ ALTER TABLE `__new_sessions` RENAME TO `sessions`;--> statement-breakpoint
60
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
61
+ CREATE UNIQUE INDEX `uniq_sessions_source_adapter_session_id` ON `sessions` (`source`,`adapter_session_id`);--> statement-breakpoint
62
+ CREATE UNIQUE INDEX `uniq_sessions_log_file_path` ON `sessions` (`log_file_path`);--> statement-breakpoint
63
+ CREATE INDEX `sessions_adapter_session_id_idx` ON `sessions` (`adapter_session_id`);--> statement-breakpoint
64
+ CREATE INDEX `idx_sessions_import_status` ON `sessions` (`import_status`);--> statement-breakpoint
65
+ CREATE INDEX `sessions_execution_target_id_idx` ON `sessions` (`execution_target_id`);--> statement-breakpoint
66
+ CREATE INDEX `idx_sessions_parent_session_id` ON `sessions` (`parent_session_id`);
@@ -0,0 +1,77 @@
1
+ -- Hand-corrected after generation, for the same reason as
2
+ -- 0031_adapter_session_currency.sql: drizzle-kit's SQLite table rebuild listed
3
+ -- the four newly added `agents` columns (`current_adapter_session_id`,
4
+ -- `current_adapter_session_id_state`, `revision`, `currency_fence`) in the copy
5
+ -- SELECT as well, which reads them from the pre-migration table where they do
6
+ -- not exist yet. They are omitted from both the INSERT and SELECT lists so
7
+ -- existing rows adopt NULL / 'inherited' / 0, which is the intended migration
8
+ -- semantics. The rebuild itself is required: SQLite cannot ALTER TABLE ADD
9
+ -- CONSTRAINT for the new currency and counter checks. As in 0031, the rebuild's
10
+ -- CHECK constraints are unqualified ("col", not "__new_agents"."col") because
11
+ -- SQLite versions before 3.53.0 do not rewrite table-qualified CHECK references
12
+ -- on ALTER TABLE ... RENAME.
13
+ --
14
+ -- The `adapter_session_claims` creation is also moved after the rebuild, so its
15
+ -- foreign key never points at a table that the same migration is about to drop.
16
+ -- Paired with drizzle-postgres/0022_native_session_ownership.sql.
17
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
18
+ CREATE TABLE `__new_agents` (
19
+ `agent_id` text PRIMARY KEY NOT NULL,
20
+ `adapter_id` text NOT NULL,
21
+ `adapter_name` text NOT NULL,
22
+ `session_id` text NOT NULL,
23
+ `adapter_session_id` text,
24
+ `current_adapter_session_id` text,
25
+ `current_adapter_session_id_state` text DEFAULT 'inherited' NOT NULL,
26
+ `revision` integer DEFAULT 0 NOT NULL,
27
+ `currency_fence` integer DEFAULT 0 NOT NULL,
28
+ `model` text,
29
+ `cwd` text,
30
+ `allowed_directories` text,
31
+ `provider_config_id` text,
32
+ `persona_id` text,
33
+ `profile_id` text,
34
+ `harness_id` text,
35
+ `client_id` text,
36
+ `compression_mode` text,
37
+ `role` text NOT NULL,
38
+ `status` text NOT NULL,
39
+ `created_at` integer NOT NULL,
40
+ `last_activity_at` integer NOT NULL,
41
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`session_id`) ON UPDATE no action ON DELETE cascade,
42
+ CONSTRAINT "agents_current_adapter_session_id_currency_check" CHECK("current_adapter_session_id_state" IN ('inherited', 'moved', 'confirmed') AND ("current_adapter_session_id_state" <> 'confirmed' OR "current_adapter_session_id" IS NOT NULL) AND ("current_adapter_session_id_state" = 'confirmed' OR "current_adapter_session_id" IS NULL)),
43
+ CONSTRAINT "agents_ownership_counters_check" CHECK("revision" >= 0 AND "currency_fence" >= 0)
44
+ );
45
+ --> statement-breakpoint
46
+ INSERT INTO `__new_agents`("agent_id", "adapter_id", "adapter_name", "session_id", "adapter_session_id", "model", "cwd", "allowed_directories", "provider_config_id", "persona_id", "profile_id", "harness_id", "client_id", "compression_mode", "role", "status", "created_at", "last_activity_at") SELECT "agent_id", "adapter_id", "adapter_name", "session_id", "adapter_session_id", "model", "cwd", "allowed_directories", "provider_config_id", "persona_id", "profile_id", "harness_id", "client_id", "compression_mode", "role", "status", "created_at", "last_activity_at" FROM `agents`;--> statement-breakpoint
47
+ DROP TABLE `agents`;--> statement-breakpoint
48
+ ALTER TABLE `__new_agents` RENAME TO `agents`;--> statement-breakpoint
49
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
50
+ CREATE INDEX `agents_session_id_idx` ON `agents` (`session_id`);--> statement-breakpoint
51
+ CREATE INDEX `agents_adapter_name_idx` ON `agents` (`adapter_name`);--> statement-breakpoint
52
+ CREATE INDEX `agents_status_idx` ON `agents` (`status`);--> statement-breakpoint
53
+ CREATE INDEX `agents_client_id_idx` ON `agents` (`client_id`);--> statement-breakpoint
54
+ CREATE TABLE `adapter_session_claims` (
55
+ `claim_id` text PRIMARY KEY NOT NULL,
56
+ `machine_id` text NOT NULL,
57
+ `adapter_id` text NOT NULL,
58
+ `adapter_name` text NOT NULL,
59
+ `provider_session_id` text NOT NULL,
60
+ `session_id` text NOT NULL,
61
+ `agent_id` text NOT NULL,
62
+ `claim_token` text NOT NULL,
63
+ `fence` integer NOT NULL,
64
+ `status` text DEFAULT 'held' NOT NULL,
65
+ `claimed_at` integer NOT NULL,
66
+ `updated_at` integer NOT NULL,
67
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`session_id`) ON UPDATE no action ON DELETE cascade,
68
+ FOREIGN KEY (`agent_id`) REFERENCES `agents`(`agent_id`) ON UPDATE no action ON DELETE cascade,
69
+ CONSTRAINT "adapter_session_claims_status_check" CHECK("adapter_session_claims"."status" IN ('held', 'releasing', 'abandoned')),
70
+ CONSTRAINT "adapter_session_claims_fence_check" CHECK("adapter_session_claims"."fence" >= 1)
71
+ );
72
+ --> statement-breakpoint
73
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_owner` ON `adapter_session_claims` (`machine_id`,`adapter_id`,`provider_session_id`);--> statement-breakpoint
74
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_token` ON `adapter_session_claims` (`claim_token`);--> statement-breakpoint
75
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_agent_fence` ON `adapter_session_claims` (`agent_id`,`fence`);--> statement-breakpoint
76
+ CREATE INDEX `adapter_session_claims_agent_id_idx` ON `adapter_session_claims` (`agent_id`);--> statement-breakpoint
77
+ CREATE INDEX `adapter_session_claims_session_id_idx` ON `adapter_session_claims` (`session_id`);
@@ -0,0 +1 @@
1
+ ALTER TABLE `workflow_run_contexts` ADD `trigger_mode` text DEFAULT 'immediate' NOT NULL;
@@ -0,0 +1,41 @@
1
+ CREATE TABLE `runtime_instances` (
2
+ `instance_id` text NOT NULL,
3
+ `machine_id` text NOT NULL,
4
+ `incarnation` integer NOT NULL,
5
+ `started_at` integer NOT NULL,
6
+ `retired_at` integer,
7
+ PRIMARY KEY(`instance_id`, `machine_id`)
8
+ );
9
+ --> statement-breakpoint
10
+ CREATE UNIQUE INDEX `uniq_runtime_instances_incarnation` ON `runtime_instances` (`machine_id`,`incarnation`);--> statement-breakpoint
11
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
12
+ CREATE TABLE `__new_adapter_session_claims` (
13
+ `claim_id` text PRIMARY KEY NOT NULL,
14
+ `machine_id` text NOT NULL,
15
+ `adapter_id` text NOT NULL,
16
+ `adapter_name` text NOT NULL,
17
+ `provider_session_id` text NOT NULL,
18
+ `session_id` text NOT NULL,
19
+ `agent_id` text NOT NULL,
20
+ `owner_instance_id` text,
21
+ `claim_token` text NOT NULL,
22
+ `fence` integer NOT NULL,
23
+ `status` text DEFAULT 'held' NOT NULL,
24
+ `claimed_at` integer NOT NULL,
25
+ `updated_at` integer NOT NULL,
26
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`session_id`) ON UPDATE no action ON DELETE cascade,
27
+ FOREIGN KEY (`agent_id`) REFERENCES `agents`(`agent_id`) ON UPDATE no action ON DELETE cascade,
28
+ FOREIGN KEY (`owner_instance_id`,`machine_id`) REFERENCES `runtime_instances`(`instance_id`,`machine_id`) ON UPDATE no action ON DELETE restrict,
29
+ CONSTRAINT "adapter_session_claims_status_check" CHECK("status" IN ('held', 'releasing', 'abandoned')),
30
+ CONSTRAINT "adapter_session_claims_fence_check" CHECK("fence" >= 1)
31
+ );
32
+ --> statement-breakpoint
33
+ INSERT INTO `__new_adapter_session_claims`("claim_id", "machine_id", "adapter_id", "adapter_name", "provider_session_id", "session_id", "agent_id", "claim_token", "fence", "status", "claimed_at", "updated_at") SELECT "claim_id", "machine_id", "adapter_id", "adapter_name", "provider_session_id", "session_id", "agent_id", "claim_token", "fence", "status", "claimed_at", "updated_at" FROM `adapter_session_claims`;--> statement-breakpoint
34
+ DROP TABLE `adapter_session_claims`;--> statement-breakpoint
35
+ ALTER TABLE `__new_adapter_session_claims` RENAME TO `adapter_session_claims`;--> statement-breakpoint
36
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
37
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_owner` ON `adapter_session_claims` (`machine_id`,`adapter_id`,`provider_session_id`);--> statement-breakpoint
38
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_token` ON `adapter_session_claims` (`claim_token`);--> statement-breakpoint
39
+ CREATE UNIQUE INDEX `uniq_adapter_session_claims_agent_fence` ON `adapter_session_claims` (`agent_id`,`fence`);--> statement-breakpoint
40
+ CREATE INDEX `adapter_session_claims_agent_id_idx` ON `adapter_session_claims` (`agent_id`);--> statement-breakpoint
41
+ CREATE INDEX `adapter_session_claims_session_id_idx` ON `adapter_session_claims` (`session_id`);
@@ -0,0 +1,40 @@
1
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
2
+ CREATE TABLE `__new_agents` (
3
+ `agent_id` text PRIMARY KEY NOT NULL,
4
+ `adapter_id` text NOT NULL,
5
+ `adapter_name` text NOT NULL,
6
+ `session_id` text NOT NULL,
7
+ `owner_machine_id` text,
8
+ `owner_instance_id` text,
9
+ `adapter_session_id` text,
10
+ `current_adapter_session_id` text,
11
+ `current_adapter_session_id_state` text DEFAULT 'inherited' NOT NULL,
12
+ `revision` integer DEFAULT 0 NOT NULL,
13
+ `currency_fence` integer DEFAULT 0 NOT NULL,
14
+ `model` text,
15
+ `cwd` text,
16
+ `allowed_directories` text,
17
+ `provider_config_id` text,
18
+ `persona_id` text,
19
+ `profile_id` text,
20
+ `harness_id` text,
21
+ `client_id` text,
22
+ `compression_mode` text,
23
+ `role` text NOT NULL,
24
+ `status` text NOT NULL,
25
+ `created_at` integer NOT NULL,
26
+ `last_activity_at` integer NOT NULL,
27
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`session_id`) ON UPDATE no action ON DELETE cascade,
28
+ CONSTRAINT "agents_current_adapter_session_id_currency_check" CHECK("current_adapter_session_id_state" IN ('inherited', 'moved', 'confirmed') AND ("current_adapter_session_id_state" <> 'confirmed' OR "current_adapter_session_id" IS NOT NULL) AND ("current_adapter_session_id_state" = 'confirmed' OR "current_adapter_session_id" IS NULL)),
29
+ CONSTRAINT "agents_ownership_counters_check" CHECK("revision" >= 0 AND "currency_fence" >= 0),
30
+ CONSTRAINT "agents_runtime_owner_pair_check" CHECK(("owner_machine_id" IS NULL) = ("owner_instance_id" IS NULL))
31
+ );
32
+ --> statement-breakpoint
33
+ INSERT INTO `__new_agents`("agent_id", "adapter_id", "adapter_name", "session_id", "owner_machine_id", "owner_instance_id", "adapter_session_id", "current_adapter_session_id", "current_adapter_session_id_state", "revision", "currency_fence", "model", "cwd", "allowed_directories", "provider_config_id", "persona_id", "profile_id", "harness_id", "client_id", "compression_mode", "role", "status", "created_at", "last_activity_at") SELECT "agent_id", "adapter_id", "adapter_name", "session_id", NULL, NULL, "adapter_session_id", "current_adapter_session_id", "current_adapter_session_id_state", "revision", "currency_fence", "model", "cwd", "allowed_directories", "provider_config_id", "persona_id", "profile_id", "harness_id", "client_id", "compression_mode", "role", "status", "created_at", "last_activity_at" FROM `agents`;--> statement-breakpoint
34
+ DROP TABLE `agents`;--> statement-breakpoint
35
+ ALTER TABLE `__new_agents` RENAME TO `agents`;--> statement-breakpoint
36
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
37
+ CREATE INDEX `agents_session_id_idx` ON `agents` (`session_id`);--> statement-breakpoint
38
+ CREATE INDEX `agents_adapter_name_idx` ON `agents` (`adapter_name`);--> statement-breakpoint
39
+ CREATE INDEX `agents_status_idx` ON `agents` (`status`);--> statement-breakpoint
40
+ CREATE INDEX `agents_client_id_idx` ON `agents` (`client_id`);
@@ -0,0 +1 @@
1
+ ALTER TABLE `agents` ADD `recovery_attempt_id` text;