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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/dist/.makaio-build.json +3 -2
  2. package/dist/{account-identity-CP4DC0DL.mjs → account-identity-DFx8pwKL.mjs} +1 -1
  3. package/dist/{adapter-CYobxqN_.mjs → adapter-D5c5LrPN.mjs} +1 -1
  4. package/dist/adapters/claude/index.d.mts +204 -27
  5. package/dist/adapters/claude/index.mjs +3 -3
  6. package/dist/adapters/config/index.d.mts +2 -2
  7. package/dist/adapters/config/index.mjs +1 -1
  8. package/dist/adapters/index.d.mts +49 -4
  9. package/dist/adapters/index.mjs +3 -3
  10. package/dist/adapters/node.d.mts +1 -1
  11. package/dist/adapters/node.mjs +1 -1
  12. package/dist/{artifact-DCkizHkS.mjs → artifact-DGiXqb11.mjs} +1 -1
  13. package/dist/attempt-record-codec-CqO1_XnE.mjs +1 -0
  14. package/dist/{auth-C3NOWqTU.mjs → auth-DGEdiHF6.mjs} +1 -1
  15. package/dist/authority-state-bootstrap-GPL_tqaT.mjs +1 -0
  16. package/dist/bus/index.mjs +1 -1
  17. package/dist/{canonical-model-EMRYCVjX.mjs → canonical-model-BAytQ4NV.mjs} +1 -1
  18. package/dist/capabilities-BQEp34ir.mjs +1 -0
  19. package/dist/{client-OYk0Ttck.mjs → client-DbS847wW.mjs} +1 -1
  20. package/dist/clients/index.d.mts +5 -3
  21. package/dist/clients/index.mjs +1 -1
  22. package/dist/clients/managed-install.d.mts +1 -1
  23. package/dist/clients/managed-install.mjs +1 -1
  24. package/dist/{compression-CZ_6fYq8.mjs → compression-74fFeBha.mjs} +1 -1
  25. package/dist/{config-namespace-DTA6EQL8.mjs → config-namespace-TVX-hG4I.mjs} +1 -1
  26. package/dist/{context-resolution-B9ANWbG0.d.mts → context-resolution-BQBk4Ish.d.mts} +6 -4
  27. package/dist/contracts/adapter/index.d.mts +2 -2
  28. package/dist/contracts/adapter/index.mjs +1 -1
  29. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  30. package/dist/contracts/artifact/index.d.mts +2 -2
  31. package/dist/contracts/artifact/index.mjs +1 -1
  32. package/dist/contracts/auth/index.d.mts +2 -2
  33. package/dist/contracts/auth/index.mjs +1 -1
  34. package/dist/contracts/canonical-model/index.d.mts +1 -1
  35. package/dist/contracts/canonical-model/index.mjs +1 -1
  36. package/dist/contracts/capabilities/index.d.mts +2 -0
  37. package/dist/contracts/capabilities/index.mjs +1 -0
  38. package/dist/contracts/client/index.d.mts +2 -2
  39. package/dist/contracts/client/index.mjs +1 -1
  40. package/dist/contracts/common/index.d.mts +1 -1
  41. package/dist/contracts/config/index.d.mts +24 -2
  42. package/dist/contracts/config/index.mjs +1 -1
  43. package/dist/contracts/extension/index.d.mts +4 -4
  44. package/dist/contracts/extension/index.mjs +1 -1
  45. package/dist/contracts/facet/index.d.mts +1 -1
  46. package/dist/contracts/facet/index.mjs +1 -1
  47. package/dist/contracts/harness/index.d.mts +1 -1
  48. package/dist/contracts/harness/index.mjs +1 -1
  49. package/dist/contracts/host/index.d.mts +1 -1
  50. package/dist/contracts/host/index.mjs +1 -1
  51. package/dist/contracts/index.d.mts +1682 -9431
  52. package/dist/contracts/index.mjs +1 -1
  53. package/dist/contracts/materialization/index.d.mts +3 -3
  54. package/dist/contracts/materialization/index.mjs +1 -1
  55. package/dist/contracts/model-registry/index.d.mts +1 -1
  56. package/dist/contracts/model-registry/index.mjs +1 -1
  57. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  58. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  59. package/dist/contracts/platform/index.d.mts +1 -1
  60. package/dist/contracts/platform/index.mjs +1 -1
  61. package/dist/contracts/provider/index.d.mts +2 -2
  62. package/dist/contracts/provider/index.mjs +1 -1
  63. package/dist/contracts/session/index.d.mts +2 -2
  64. package/dist/contracts/session/index.mjs +1 -1
  65. package/dist/contracts/shared/index.d.mts +2 -2
  66. package/dist/contracts/shared/index.mjs +1 -1
  67. package/dist/contracts/skill/index.d.mts +1 -1
  68. package/dist/contracts/skill/index.mjs +1 -1
  69. package/dist/contracts/telemetry/index.d.mts +1 -1
  70. package/dist/contracts/telemetry/index.mjs +1 -1
  71. package/dist/contracts/timeout/index.d.mts +1 -1
  72. package/dist/contracts/timeout/index.mjs +1 -1
  73. package/dist/contracts/toast/index.mjs +1 -1
  74. package/dist/contracts/variant/index.d.mts +1 -1
  75. package/dist/contracts/variant/index.mjs +1 -1
  76. package/dist/contracts/worker-node/index.d.mts +2 -0
  77. package/dist/contracts/worker-node/index.mjs +1 -0
  78. package/dist/contracts/workflow/index.d.mts +3 -3
  79. package/dist/contracts/workflow/index.mjs +1 -1
  80. package/dist/{definition-K3m51lgO.mjs → definition-CJfiv8xm.mjs} +1 -1
  81. package/dist/{detached-extension-handle-BsywhHfk.mjs → detached-extension-handle-Ddfquy5_.mjs} +1 -1
  82. package/dist/drizzle/0030_remote-worker-execution.sql +6 -0
  83. package/dist/drizzle/meta/_journal.json +7 -0
  84. package/dist/execution-attempt-repository-DWXKY41_.d.mts +1056 -0
  85. package/dist/execution-target-Cf645pDj.mjs +1 -0
  86. package/dist/{extension-Cgg45Xk1.mjs → extension-DCA4pYrY.mjs} +1 -1
  87. package/dist/extension-hjOPs10e.mjs +1 -0
  88. package/dist/{filesystem-service-Cupz_Z7S.mjs → filesystem-service-DlP2HfDg.mjs} +1 -1
  89. package/dist/framework-packages-C3RWfJDk.mjs +1 -0
  90. package/dist/git/index.mjs +1 -1
  91. package/dist/{globby-DWp7V-P2.mjs → globby-1yCVCk8s.mjs} +1 -1
  92. package/dist/{handlers-cMBmexF4.mjs → handlers-CfnLyLfE.mjs} +1 -1
  93. package/dist/{harness-DflvHAGV.mjs → harness-DpwsFsE7.mjs} +1 -1
  94. package/dist/{index-BhXCCgJV2.d.mts → index-4fE_hUP02.d.mts} +1 -1
  95. package/dist/{index-BMx59xb7.d.mts → index-8gKx-OVP.d.mts} +13 -7
  96. package/dist/index-B0Kf_OWi.d.mts +267 -0
  97. package/dist/{index-DRiTICBU.d.mts → index-BAXkicoQ.d.mts} +1 -1
  98. package/dist/{index-CnXXq6sW.d.mts → index-BC79QrGC.d.mts} +10 -10
  99. package/dist/{index-CvmWRumB.d.mts → index-BQLUVXIB.d.mts} +1024 -888
  100. package/dist/{index-CKO9S6oo.d.mts → index-BXD3kEs_.d.mts} +28 -10
  101. package/dist/{index-DUf47Jn_.d.mts → index-BskPjMet.d.mts} +8 -8
  102. package/dist/{index-CjyfQ_vQ.d.mts → index-CL-0NeQW.d.mts} +8 -5
  103. package/dist/{index-Cw7_69gV.d.mts → index-CRvpVIqA.d.mts} +1 -1
  104. package/dist/{index-7FjcxGlK.d.mts → index-CUvNKYkV.d.mts} +1 -1
  105. package/dist/{index-CtUTCAJ6.d.mts → index-CVaRZoiu.d.mts} +4 -4
  106. package/dist/{index-Cw84_Dqi.d.mts → index-CnMu8BQl.d.mts} +4 -4
  107. package/dist/{index-DaMfTvfz.d.mts → index-DA9g2A5P.d.mts} +1 -1
  108. package/dist/{index-Bi5jFT9S.d.mts → index-DJAmSnuh.d.mts} +12 -12
  109. package/dist/{index-pjATMrvJ.d.mts → index-DkiTJM5p.d.mts} +693 -31
  110. package/dist/{index-jbgHR5J2.d.mts → index-GHASUiem.d.mts} +1 -1
  111. package/dist/{index-BDDbcWNI.d.mts → index-HsTxm-R3.d.mts} +3 -3
  112. package/dist/{index-Bs3CXR232.d.mts → index-I5YG-qrb2.d.mts} +6 -6
  113. package/dist/{index-0Ju2i8gV.d.mts → index-SsBHjUqA.d.mts} +204 -165
  114. package/dist/index-XZyMxxnU.d.mts +1602 -0
  115. package/dist/{index-dkvGHN10.d.mts → index-brqfk9JQ.d.mts} +6 -6
  116. package/dist/{index-D43lQCHs.d.mts → index-q0Tiqems.d.mts} +131 -131
  117. package/dist/index-w_FmghjT.d.mts +7295 -0
  118. package/dist/kernel/cli/index.d.mts +2 -2
  119. package/dist/kernel/cli/index.mjs +1 -1
  120. package/dist/kernel/cli/register.d.mts +1 -1
  121. package/dist/kernel/cli/register.mjs +1 -1
  122. package/dist/kernel/cli/schemas.mjs +1 -1
  123. package/dist/kernel/extension/index.d.mts +1 -1
  124. package/dist/kernel/extension/index.mjs +1 -1
  125. package/dist/kernel/index.d.mts +14 -8
  126. package/dist/kernel/index.mjs +1 -1
  127. package/dist/kernel/namespace/index.d.mts +1 -1
  128. package/dist/kernel/namespace/index.mjs +1 -1
  129. package/dist/kernel/observability/index.d.mts +1 -1
  130. package/dist/kernel/observability/index.mjs +1 -1
  131. package/dist/kernel/providers/index.d.mts +1 -1
  132. package/dist/kernel/providers/index.mjs +1 -1
  133. package/dist/kernel/window/index.d.mts +1 -1
  134. package/dist/kernel/window/index.mjs +1 -1
  135. package/dist/{lib-BeMM738r.mjs → lib-C7-s68uf.mjs} +1 -1
  136. package/dist/{lib-B7TpTzkG.mjs → lib-DErgth_E.mjs} +2 -2
  137. package/dist/{load-extensions-BLdG90Zi.d.mts → load-extensions-BxsDB87B.d.mts} +1 -1
  138. package/dist/{load-extensions-CUmFCcYi.mjs → load-extensions-D0DfjYLC.mjs} +1 -1
  139. package/dist/{materialization-s8eR1eQ4.mjs → materialization-Jd198K3y.mjs} +1 -1
  140. package/dist/mcp-http-server/index.d.mts +305 -79
  141. package/dist/mcp-http-server/index.mjs +4 -4
  142. package/dist/model-BGgVmRnN.mjs +1 -0
  143. package/dist/modes-BheyN7SS.mjs +1 -0
  144. package/dist/{namespace-DwQtzlY-.mjs → namespace-BqxtpNAn.mjs} +1 -1
  145. package/dist/{namespace-BHliaabz.d.mts → namespace-DBm9K23m.d.mts} +6 -6
  146. package/dist/{namespace-zOfq1Uhn.d.mts → namespace-DI4Yx_xu.d.mts} +27 -27
  147. package/dist/namespace-DJfUADSV.mjs +1 -0
  148. package/dist/{namespace-BphMM6S82.d.mts → namespace-DPgxPa8m2.d.mts} +1 -1
  149. package/dist/{namespace-Bd49QmzS.d.mts → namespace-DWCEo-9M.d.mts} +0 -60
  150. package/dist/{namespace-CriPb5wY.d.mts → namespace-jPUGV-b2.d.mts} +42 -42
  151. package/dist/{native-session-supervisor-Bgz-Q1WH.mjs → native-session-supervisor-DRx0MX-d.mjs} +1 -1
  152. package/dist/node/bus-server/index.d.mts +1 -1
  153. package/dist/node/bus-server/index.mjs +1 -1
  154. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  155. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  156. package/dist/node/transports/index.d.mts +81 -9
  157. package/dist/node/transports/index.mjs +2 -2
  158. package/dist/{orchestrator-shared-CY7Tu7kZ.mjs → orchestrator-shared-BxmHCPvx.mjs} +1 -1
  159. package/dist/package-CNUPPcU1.mjs +7 -0
  160. package/dist/package-DWMxGfzK.d.mts +827 -0
  161. package/dist/{package-DKnzOvoR.mjs → package-Dft_RItb.mjs} +1 -1
  162. package/dist/package.json +1 -1
  163. package/dist/{packages-zDnokBpl.mjs → packages-DtEEP0Vt.mjs} +1 -1
  164. package/dist/{profile-BRi6K6am.mjs → profile-BTAI31Nt.mjs} +1 -1
  165. package/dist/{provider-context-DOsjOjiR.mjs → provider-context-Dq53Cgzz.mjs} +1 -1
  166. package/dist/{provider-context-BYkMl--1.mjs → provider-context-PZIQWcqQ.mjs} +1 -1
  167. package/dist/provider-operation-Cxoe2SUr.d.mts +207 -0
  168. package/dist/providers/index.mjs +1 -1
  169. package/dist/{registry-Dw6l7k3e.mjs → registry-wfF2uTty.mjs} +29 -29
  170. package/dist/{resolved-O2XXjTeu.mjs → resolved-DZgqql2Z.mjs} +1 -1
  171. package/dist/rules/index.d.mts +1 -1
  172. package/dist/rules/index.mjs +1 -1
  173. package/dist/rules/schemas.d.mts +1 -1
  174. package/dist/runtime-bun/index.mjs +1 -1
  175. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  176. package/dist/runtime-node/extension-validation.d.mts +1 -1
  177. package/dist/runtime-node/extension-validation.mjs +1 -1
  178. package/dist/runtime-node/index.d.mts +4 -4
  179. package/dist/runtime-node/index.mjs +24 -24
  180. package/dist/runtime-node/makaio-config.d.mts +1 -1
  181. package/dist/runtime-node/makaio-config.mjs +1 -1
  182. package/dist/runtime-node/static/model-registry.yaml +348 -0
  183. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  184. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  185. package/dist/runtime-node/workflow-worker/worker-entry.d.mts +7 -4
  186. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  187. package/dist/{schema-BO9TgmOs.d.mts → schema-Bwr_NrOS.d.mts} +2 -2
  188. package/dist/{schema-BI0aCHvV.mjs → schema-Dd-e89MO.mjs} +1 -1
  189. package/dist/{schemas-B5tMYfhC.d.mts → schemas-C4yUXs4G.d.mts} +4 -4
  190. package/dist/schemas-CRB2O5zo.mjs +1 -0
  191. package/dist/{schemas-Dgj3WaOI.mjs → schemas-Cm09dXL4.mjs} +1 -1
  192. package/dist/{schemas-BJ8VMXhO.mjs → schemas-DaHQzpgm.mjs} +1 -1
  193. package/dist/{schemas-BDC2Nqj1.d.mts → schemas-ENwK6jmV.d.mts} +14 -14
  194. package/dist/{schemas-ChF2z4RB.d.mts → schemas-N6x2z7Lf.d.mts} +0 -45
  195. package/dist/schemas-tDf_WiC8.mjs +1 -0
  196. package/dist/selection-BNwTKEVT.mjs +1 -0
  197. package/dist/service-base/index.d.mts +47 -2
  198. package/dist/service-base/index.mjs +1 -1
  199. package/dist/services/adapter-runtime/index.d.mts +3 -3
  200. package/dist/services/adapter-runtime/index.mjs +1 -1
  201. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  202. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  203. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  204. package/dist/services/adapter-subsystem/index.mjs +1 -1
  205. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  206. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  207. package/dist/services/agent-runtime/index.d.mts +2 -2
  208. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  209. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  210. package/dist/services/capability/index.d.mts +1 -1
  211. package/dist/services/capability/index.mjs +1 -1
  212. package/dist/services/codebase/index.d.mts +2 -2
  213. package/dist/services/codebase/namespace.d.mts +1 -1
  214. package/dist/services/codebase/schemas.d.mts +1 -1
  215. package/dist/services/compression/index.d.mts +2 -2
  216. package/dist/services/compression/namespace.d.mts +1 -1
  217. package/dist/services/compression/schemas.d.mts +1 -1
  218. package/dist/services/context-rules/index.d.mts +7 -7
  219. package/dist/services/context-rules/index.mjs +1 -1
  220. package/dist/services/execution-target/index.d.mts +4 -4
  221. package/dist/services/execution-target/index.mjs +1 -1
  222. package/dist/services/execution-target/namespace.d.mts +1 -1
  223. package/dist/services/execution-target/namespace.mjs +1 -1
  224. package/dist/services/execution-target/schemas.d.mts +1 -1
  225. package/dist/services/execution-target/schemas.mjs +1 -1
  226. package/dist/services/filesystem/index.d.mts +1 -1
  227. package/dist/services/filesystem/index.mjs +1 -1
  228. package/dist/services/git/namespace.d.mts +2 -2
  229. package/dist/services/git/namespace.mjs +1 -1
  230. package/dist/services/git/schemas.d.mts +2 -2
  231. package/dist/services/git/schemas.mjs +1 -1
  232. package/dist/services/harness/index.d.mts +3 -3
  233. package/dist/services/harness/index.mjs +1 -1
  234. package/dist/services/index.d.mts +86 -371
  235. package/dist/services/index.mjs +1 -1
  236. package/dist/services/log-import/browser.d.mts +2 -2
  237. package/dist/services/log-import/index.d.mts +2 -2
  238. package/dist/services/log-import/log-import.d.mts +1 -1
  239. package/dist/services/log-import/log-import.mjs +1 -1
  240. package/dist/services/log-import/namespace.d.mts +2 -2
  241. package/dist/services/log-import/namespace.mjs +1 -1
  242. package/dist/services/log-import/schemas.d.mts +1 -1
  243. package/dist/services/log-import/schemas.mjs +1 -1
  244. package/dist/services/materialization/index.d.mts +1 -1
  245. package/dist/services/materialization/index.mjs +1 -1
  246. package/dist/services/model-registry/index.d.mts +1 -1
  247. package/dist/services/model-registry/index.mjs +1 -1
  248. package/dist/services/preferences/index.d.mts +2 -2
  249. package/dist/services/preferences/schemas.d.mts +1 -1
  250. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  251. package/dist/services/provider-context/index.d.mts +1 -1
  252. package/dist/services/provider-context/index.mjs +1 -1
  253. package/dist/services/provider-runtime/index.mjs +1 -1
  254. package/dist/services/session/handlers/index.d.mts +1 -1
  255. package/dist/services/session/handlers/index.mjs +1 -1
  256. package/dist/services/session/index.d.mts +9 -9
  257. package/dist/services/session/index.mjs +1 -1
  258. package/dist/services/session/messages/namespace.d.mts +1 -1
  259. package/dist/services/session/messages/namespace.mjs +1 -1
  260. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  261. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  262. package/dist/services/session/session-events/namespace.d.mts +1 -1
  263. package/dist/services/session/session-events/namespace.mjs +1 -1
  264. package/dist/services/session/storage/namespace.d.mts +1 -1
  265. package/dist/services/session/storage/schema.d.mts +1 -1
  266. package/dist/services/session/testing/index.mjs +1 -1
  267. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  268. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  269. package/dist/services/session/turns/namespace.d.mts +1 -1
  270. package/dist/services/session/turns/namespace.mjs +1 -1
  271. package/dist/services/session-editor/index.d.mts +1 -1
  272. package/dist/services/session-editor/index.mjs +1 -1
  273. package/dist/services/settings/index.d.mts +3 -3
  274. package/dist/services/settings/index.mjs +1 -1
  275. package/dist/services/settings/namespace.d.mts +14 -14
  276. package/dist/services/settings/namespace.mjs +1 -1
  277. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  278. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  279. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  280. package/dist/services/settings/storage/index.d.mts +3 -3
  281. package/dist/services/settings/storage/index.mjs +1 -1
  282. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  283. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  284. package/dist/services/subagent/index.d.mts +1 -1
  285. package/dist/services/subagent/index.mjs +1 -1
  286. package/dist/services/subagent-template/index.d.mts +2 -2
  287. package/dist/services/subagent-template/namespace.d.mts +1 -1
  288. package/dist/services/subagent-template/schemas.d.mts +1 -1
  289. package/dist/services/tool-approval/index.d.mts +1 -1
  290. package/dist/services/tool-approval/index.mjs +1 -1
  291. package/dist/services/tools/index.d.mts +1 -1
  292. package/dist/services/tools/index.mjs +1 -1
  293. package/dist/services/tray-menu/index.d.mts +3 -3
  294. package/dist/services/tray-menu/index.mjs +1 -1
  295. package/dist/services/tray-menu/namespace.d.mts +1 -1
  296. package/dist/services/tray-menu/schemas.d.mts +1 -1
  297. package/dist/services/turn/index.d.mts +1 -1
  298. package/dist/services/turn/namespace.d.mts +1 -1
  299. package/dist/services/workflow-transitions/index.d.mts +2 -0
  300. package/dist/services/workflow-transitions/index.mjs +1 -0
  301. package/dist/{session-Carng3Yk.mjs → session-BOGCd18q.mjs} +1 -1
  302. package/dist/{session-idI1jk5X.mjs → session-BTFiDoGz.mjs} +1 -1
  303. package/dist/{session-lineage-Cte63dGx.d.mts → session-lineage-B_JW5LpF.d.mts} +1 -1
  304. package/dist/{shared-RP_KARKF.mjs → shared-BQ0CHIVy.mjs} +1 -1
  305. package/dist/{skill-CpNjWFuE.mjs → skill-BR6rkfLe.mjs} +1 -1
  306. package/dist/{src-XihJcAQS.mjs → src-DD0v-nIj.mjs} +1 -1
  307. package/dist/storage/drizzle/client.d.mts +1 -1
  308. package/dist/storage/drizzle/client.mjs +1 -1
  309. package/dist/storage/drizzle/index.d.mts +50 -2
  310. package/dist/storage/drizzle/index.mjs +1 -1
  311. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  312. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  313. package/dist/storage/handlers/index.d.mts +1 -1
  314. package/dist/storage/handlers/index.mjs +1 -1
  315. package/dist/testing/drizzle-harness.d.mts +44 -3
  316. package/dist/testing/drizzle-harness.mjs +1 -1
  317. package/dist/{tool-approval-service-fIZ9x0kL.mjs → tool-approval-service-kBA0fRzm.mjs} +1 -1
  318. package/dist/tools-PdG9fO1M.mjs +1 -0
  319. package/dist/{transition-BodgGLZx.d.mts → transition-DuVzKt8-.d.mts} +3 -42
  320. package/dist/{types-LspCUW09.d.mts → types-B1MNcwgH.d.mts} +1 -1
  321. package/dist/{types-Bzxo7ATi.d.mts → types-BqVAOzJP.d.mts} +48 -48
  322. package/dist/{types-DBb5jY4Z.d.mts → types-CJ_QZ1yW.d.mts} +47 -3
  323. package/dist/ui-kernel/index.d.mts +1 -1
  324. package/dist/ui-kernel/index.mjs +1 -1
  325. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  326. package/dist/utils/index.d.mts +18 -4
  327. package/dist/utils/index.mjs +1 -1
  328. package/dist/{version-BbWrAPld.mjs → version-CoCeMxDT.mjs} +1 -1
  329. package/dist/{view-builder-tU7iaxrk.d.mts → view-builder-CvoSL2oL.d.mts} +2 -1
  330. package/dist/visibility-qhGWmpSJ.mjs +1 -0
  331. package/dist/worker-node-Bl9_vqYi.mjs +1 -0
  332. package/dist/worker-node-DZTuT1DS.mjs +1 -0
  333. package/dist/workflow-BfDbgtIQ.mjs +1 -0
  334. package/dist/workflow-engine/execution-attempt-repository.d.mts +2 -0
  335. package/dist/workflow-engine/execution-attempt-repository.mjs +1 -0
  336. package/dist/workflow-engine/index.d.mts +619 -685
  337. package/dist/workflow-engine/index.mjs +1 -1
  338. package/dist/workflow-engine/package.d.mts +1 -1
  339. package/dist/workflow-engine/package.mjs +1 -1
  340. package/dist/workflow-engine/provider-operation.d.mts +2 -0
  341. package/dist/workflow-engine/provider-operation.mjs +1 -0
  342. package/dist/workflow-engine/testing/index.d.mts +146 -0
  343. package/dist/workflow-engine/testing/index.mjs +1 -0
  344. package/dist/workflow-engine/testing/sqlite.d.mts +22 -0
  345. package/dist/workflow-engine/testing/sqlite.mjs +130 -0
  346. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  347. package/dist/workflow-transitions-DSc45ixc.mjs +1 -0
  348. package/dist/workflow-worker-BN9XPxQO.mjs +1 -0
  349. package/package.json +20 -3
  350. package/dist/authority-state-bootstrap-C_-F_dtq.mjs +0 -1
  351. package/dist/execution-target-CsZXIvli.mjs +0 -1
  352. package/dist/extension-CjTu6mzW.mjs +0 -1
  353. package/dist/model-uE5IyUFJ.mjs +0 -1
  354. package/dist/namespace-C05pkLbN.mjs +0 -1
  355. package/dist/package-BSG1681x.d.mts +0 -427
  356. package/dist/package-DW1Upu8E.mjs +0 -7
  357. package/dist/schemas-BRxU_oqL.mjs +0 -1
  358. package/dist/schemas-C-J4W1ID.mjs +0 -1
  359. package/dist/selection-YRuVSdck.mjs +0 -1
  360. package/dist/tools-Cs2DwjCC.mjs +0 -1
  361. package/dist/visibility-Cb62p9bv.mjs +0 -1
  362. package/dist/workflow-BX-FxDb0.mjs +0 -1
  363. package/dist/workflow-worker-DR9qYOFc.mjs +0 -1
  364. /package/dist/{adapter-auth-runtime-DFBLXD5K.mjs → adapter-auth-runtime-DO-FVTXg.mjs} +0 -0
  365. /package/dist/{adapter-binding-Dfk_g-lP.d.mts → adapter-binding-DQchUtrK.d.mts} +0 -0
  366. /package/dist/{ajv-C8r45sFs.mjs → ajv-DD3SIL2i.mjs} +0 -0
  367. /package/dist/{attach-error-DCnzW-Yz.mjs → attach-error-C3tngg6J.mjs} +0 -0
  368. /package/dist/{await-trigger-UceeyCyi.mjs → await-trigger-I3lrepb8.mjs} +0 -0
  369. /package/dist/{base-orchestrator-5yH3l39s.d.mts → base-orchestrator-BilsQNW1.d.mts} +0 -0
  370. /package/dist/{capability-service-BzKBK0n2.mjs → capability-service-BqiLlRGA.mjs} +0 -0
  371. /package/dist/{client-DYEHDiJN.d.mts → client-B--e2qcU.d.mts} +0 -0
  372. /package/dist/{client-binary-version-verifier-C12PvQmz.d.mts → client-binary-version-verifier-CgjM_vGF.d.mts} +0 -0
  373. /package/dist/{client-binary-version-verifier-Dv7TGFxh.mjs → client-binary-version-verifier-taewmKTY.mjs} +0 -0
  374. /package/dist/{clients-namespace-DcFmhtLv.d.mts → clients-namespace-DfxjG2ZP.d.mts} +0 -0
  375. /package/dist/{config-namespace-DmP7NVju.d.mts → config-namespace-BCqvufbD.d.mts} +0 -0
  376. /package/dist/{create-static-mount-BLbqGmva.mjs → create-static-mount-bbQhTt6W.mjs} +0 -0
  377. /package/dist/{cross-spawn-BXxQUsPS.mjs → cross-spawn-B57KZuns.mjs} +0 -0
  378. /package/dist/{cursor-storage-DCj4uUxr.mjs → cursor-storage-DIFK_9hg.mjs} +0 -0
  379. /package/dist/{definition-BEvV7tbD.d.mts → definition-gnKgXU91.d.mts} +0 -0
  380. /package/dist/{definitions-C1pgx0Nq.mjs → definitions-xrrY0wgz.mjs} +0 -0
  381. /package/dist/{descriptor-to-package-VfB8lK5w.mjs → descriptor-to-package-DvF08krT.mjs} +0 -0
  382. /package/dist/{drizzle-oCH9H53q.mjs → drizzle-z_0SiGY8.mjs} +0 -0
  383. /package/dist/{esm-ClQELElL.mjs → esm-CltRnX8_.mjs} +0 -0
  384. /package/dist/{event-BOLVCfhH.mjs → event-CmVjR6Ib.mjs} +0 -0
  385. /package/dist/{extension-discovery-B6p3iZaV.d.mts → extension-discovery-CQRdbVQ6.d.mts} +0 -0
  386. /package/dist/{extension-namespace-vrh4ERXR.mjs → extension-namespace-Yu41YepM.mjs} +0 -0
  387. /package/dist/{facet-DqPBpqkl.mjs → facet-BCI00njh.mjs} +0 -0
  388. /package/dist/{filesystem-service-CGdboor3.d.mts → filesystem-service-CQ9yVkSz.d.mts} +0 -0
  389. /package/dist/{handler-GGOD_ofd.mjs → handler-Cbv9FqDO.mjs} +0 -0
  390. /package/dist/{hook-responses-Dg8wDvRo.d.mts → hook-responses-Dh1PWXqJ.d.mts} +0 -0
  391. /package/dist/{host-BfgdjlII.mjs → host-Caq6ZfSJ.mjs} +0 -0
  392. /package/dist/{identity-BmEHHoBw.mjs → identity-D6guMtmi.mjs} +0 -0
  393. /package/dist/{index-DEchpaya.d.mts → index-BIdsFcQs2.d.mts} +0 -0
  394. /package/dist/{index-DquI_1X5.d.mts → index-BVRQEpAg.d.mts} +0 -0
  395. /package/dist/{index-Brdc35b-.d.mts → index-BaZeoZoS.d.mts} +0 -0
  396. /package/dist/{index-BSmwpgkR.d.mts → index-ByKi34v5.d.mts} +0 -0
  397. /package/dist/{index-oYGf2zIe.d.mts → index-CGZQVTid.d.mts} +0 -0
  398. /package/dist/{index-Chy9aknK.d.mts → index-CMJZ2Z8m.d.mts} +0 -0
  399. /package/dist/{index-Bd1GC1kU2.d.mts → index-CjdRdsd0.d.mts} +0 -0
  400. /package/dist/{index-DYUxNOIX.d.mts → index-Cv-o5Krs.d.mts} +0 -0
  401. /package/dist/{index-DC0yVsYL.d.mts → index-DN4NOCqN2.d.mts} +0 -0
  402. /package/dist/{index-CcsJnJOD.d.mts → index-DR40QWlw.d.mts} +0 -0
  403. /package/dist/{index-BG9-vQHD.d.mts → index-DZunhZec.d.mts} +0 -0
  404. /package/dist/{index-BsBvs0aK.d.mts → index-DjgLchuQ.d.mts} +0 -0
  405. /package/dist/{index-pgYFJ5h6.d.mts → index-Dm1nUxCF.d.mts} +0 -0
  406. /package/dist/{index-C96LlS5m.d.mts → index-Ds5_rDEJ.d.mts} +0 -0
  407. /package/dist/{index-GYZs75UP.d.mts → index-dtsLKOID.d.mts} +0 -0
  408. /package/dist/{index-8fJ6dkzR.d.mts → index-gUhidukN.d.mts} +0 -0
  409. /package/dist/{index-BgpYhR2z.d.mts → index-jTaAHsul.d.mts} +0 -0
  410. /package/dist/{index-Ci3_i-WC2.d.mts → index-sS6KUlrx.d.mts} +0 -0
  411. /package/dist/{index-CFeY8lfU.d.mts → index-vA--0lOM.d.mts} +0 -0
  412. /package/dist/{index-BUYyZm5I.d.mts → index-vcSj12YQ.d.mts} +0 -0
  413. /package/dist/{index-CdEhEXlY.d.mts → index-ye0oklfU.d.mts} +0 -0
  414. /package/dist/{json-value-BwVdTylT.d.mts → json-value-Brslhqbm.d.mts} +0 -0
  415. /package/dist/{jsonl-transport-D8RBF0dK.mjs → jsonl-transport-bQl3JwIu.mjs} +0 -0
  416. /package/dist/{lib-3_xcE8J-.mjs → lib-DOBXZmYX.mjs} +0 -0
  417. /package/dist/{model-registry-CoegIvks.mjs → model-registry-CmgcPDH3.mjs} +0 -0
  418. /package/dist/{model-registry-BneK5SGo.mjs → model-registry-xyBKSye-.mjs} +0 -0
  419. /package/dist/{namespace-CDO4rY11.mjs → namespace-B8uKAzWJ.mjs} +0 -0
  420. /package/dist/{namespace-BsF9IxJ9.d.mts → namespace-BOkKoq34.d.mts} +0 -0
  421. /package/dist/{namespace-SQAGytmu.d.mts → namespace-Blp4c8GK.d.mts} +0 -0
  422. /package/dist/{namespace-BeED_Ojz.mjs → namespace-C-9si-fV.mjs} +0 -0
  423. /package/dist/{namespace-De9Mg3zv.d.mts → namespace-CErHuXtb.d.mts} +0 -0
  424. /package/dist/{namespace-BHj13hbA.mjs → namespace-CWGKCNZm.mjs} +0 -0
  425. /package/dist/{namespace-D7pE2QWv.mjs → namespace-CWUDFGOy.mjs} +0 -0
  426. /package/dist/{namespace-D9HNjIdc.d.mts → namespace-Cv1RFP7n.d.mts} +0 -0
  427. /package/dist/{namespace-CI313bRv.d.mts → namespace-Dkod-w11.d.mts} +0 -0
  428. /package/dist/{namespace-lWlqWTKu.d.mts → namespace-GPA7zots.d.mts} +0 -0
  429. /package/dist/{namespace-DWwWnLBu.mjs → namespace-HO2J9sO8.mjs} +0 -0
  430. /package/dist/{namespace-C238RqwB.mjs → namespace-YxU1xf-K.mjs} +0 -0
  431. /package/dist/{namespace-BetqZA7Z.d.mts → namespace-YytVKIgI.d.mts} +0 -0
  432. /package/dist/{namespace-B9CYb9Gh.d.mts → namespace-jDhZjw-i.d.mts} +0 -0
  433. /package/dist/{namespace-BSXHdCVh2.d.mts → namespace-tGRAod3o.d.mts} +0 -0
  434. /package/dist/{orchestrator-shared-BB6j8ezL.d.mts → orchestrator-shared-BHCv-l2O.d.mts} +0 -0
  435. /package/dist/{out-CFkI17mk.mjs → out-CvjtANXN.mjs} +0 -0
  436. /package/dist/{packages-DeIgn0Hn.d.mts → packages-BZ6pzFIq.d.mts} +0 -0
  437. /package/dist/{platform-CWhGFQFX.mjs → platform-Bv8llU9c.mjs} +0 -0
  438. /package/dist/{providers-CUnrif24.mjs → providers-Co5UszRH.mjs} +0 -0
  439. /package/dist/{providers-namespace-sPbGcZ6I.d.mts → providers-namespace-DjFkmvBR.d.mts} +0 -0
  440. /package/dist/{quick-lru-CTBjxfgD.mjs → quick-lru-CrOpWwrf.mjs} +0 -0
  441. /package/dist/{schema-cus0dJ81.mjs → schema-Db-y-09L.mjs} +0 -0
  442. /package/dist/{schema-introspection-BsWLmoFp.mjs → schema-introspection-DgWQCpwx.mjs} +0 -0
  443. /package/dist/{schemas-DYvvMd3c.d.mts → schemas-B1NWNASS.d.mts} +0 -0
  444. /package/dist/{schemas-CMyv7l7-.mjs → schemas-BGExwp3j.mjs} +0 -0
  445. /package/dist/{schemas-Dmij0PIc.d.mts → schemas-BO7uOum6.d.mts} +0 -0
  446. /package/dist/{schemas-BGS9RfqV.mjs → schemas-Bfxskx_2.mjs} +0 -0
  447. /package/dist/{schemas-BKKpQC4X2.d.mts → schemas-BtZqovRH.d.mts} +0 -0
  448. /package/dist/{schemas-BAvt2HDy.d.mts → schemas-CQyRBqD6.d.mts} +0 -0
  449. /package/dist/{schemas-D55eXBgl.d.mts → schemas-CR8hSqTy.d.mts} +0 -0
  450. /package/dist/{schemas-CWxf_Yut.mjs → schemas-CqRm0i9a.mjs} +0 -0
  451. /package/dist/{schemas-CiWCNQ9a2.d.mts → schemas-CwbYk_kZ.d.mts} +0 -0
  452. /package/dist/{schemas-CbMWN9-z.d.mts → schemas-DuIlOWR3.d.mts} +0 -0
  453. /package/dist/{schemas-B4FyOOJj.d.mts → schemas-miYxK_Z1.d.mts} +0 -0
  454. /package/dist/{semver-D3Y7uMEb.mjs → semver-DlM8znk4.mjs} +0 -0
  455. /package/dist/{server-lifecycle-C-3OgoKi.d.mts → server-lifecycle-Dsq56aqC.d.mts} +0 -0
  456. /package/dist/{server-lifecycle-DV6NMsgH.mjs → server-lifecycle-kmQ5PUDv.mjs} +0 -0
  457. /package/dist/{shared-schemas-BNCPgGYP.mjs → shared-schemas-DXwyMCwZ.mjs} +0 -0
  458. /package/dist/{src-ftBp6GpR.mjs → src-CCu8TwL6.mjs} +0 -0
  459. /package/dist/{storage-namespace-B1GI4elv.mjs → storage-namespace-BSrv0vXR.mjs} +0 -0
  460. /package/dist/{storage-namespace-definition-V8sc3drq.d.mts → storage-namespace-definition-BvlX0QV_.d.mts} +0 -0
  461. /package/dist/{storage-namespace-definition-4UYuij1r.mjs → storage-namespace-definition-CkMKt7-I.mjs} +0 -0
  462. /package/dist/{storage-namespace-9N9R61pI.d.mts → storage-namespace-dfywhXR3.d.mts} +0 -0
  463. /package/dist/{supports-color-DwW9N6YC.mjs → supports-color-DUugCQsK.mjs} +0 -0
  464. /package/dist/{telemetry-B42EMbZt.mjs → telemetry-Pr3oP2rk.mjs} +0 -0
  465. /package/dist/{timeout-CvONPl0l.mjs → timeout-DWDhddRJ.mjs} +0 -0
  466. /package/dist/{tray-menu-service-Dgedanv-.mjs → tray-menu-service-BBLa-Rcv.mjs} +0 -0
  467. /package/dist/{types-DkFvBdIY.d.mts → types-BrcjaNPZ.d.mts} +0 -0
  468. /package/dist/{types-DVLq657Y.d.mts → types-DHmPneIO.d.mts} +0 -0
  469. /package/dist/{types-Bju4dmAg.d.mts → types-b54n1o57.d.mts} +0 -0
  470. /package/dist/{ui-config-B2L3Xgqo.mjs → ui-config-CyCdlns_.mjs} +0 -0
  471. /package/dist/{variant-ByI-RZua.mjs → variant-krjlTdJt.mjs} +0 -0
  472. /package/dist/{window-registry-Qcnvlhp7.d.mts → window-registry-BDnZLPVx.d.mts} +0 -0
  473. /package/dist/{window-registry-DsWnCc8z.mjs → window-registry-I-imZHV_.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as DiscoveredExtension } from "./extension-discovery-B6p3iZaV.mjs";
1
+ import { t as DiscoveredExtension } from "./extension-discovery-CQRdbVQ6.mjs";
2
2
  import { KernelMakaioExtension } from "@makaio/framework/kernel";
3
3
  import { CliContribution } from "@makaio/framework/kernel/cli";
4
4
 
@@ -1 +1 @@
1
- import{t as e}from"./descriptor-to-package-VfB8lK5w.mjs";import{pathToFileURL as t}from"node:url";import*as n from"node:path";import*as r from"node:fs";import{versionSatisfies as i}from"@makaio/framework/contracts";async function a(e,t){let{frameworkVersion:n,importModule:r=S}=t,i=[],a=new Map,s;for(let t of e){let{descriptor:e,extensionPath:c}=t,l=`[extensions] ${e.name}@${e.version}`;if(!u(t,n))continue;if(e.execution===`detached`){let t;try{s??=(await import(`./detached-extension-handle-BsywhHfk.mjs`)).createDetachedExtensionPackage,t=s(e,c)}catch(e){console.warn(`${l}: failed to synthesize detached extension package:`,e instanceof Error?e.message:e);continue}i.push(t),e.config?.defaults&&a.set(e.name,e.config.defaults);continue}if(!e.entrypoints.server){!e.entrypoints.browser&&!e.entrypoints.cli&&console.warn(`${l}: no executable entrypoint declared, skipping`);continue}let d;if(t.preloadedModule)d=t.preloadedModule;else try{let t=_(`server`,e.entrypoints.server,c);if(!t){console.warn(`${l}: server entrypoint could not be resolved within extension directory, skipping`);continue}d=await r(t)}catch(e){console.warn(`${l}: failed to import server entry:`,e instanceof Error?e.message:e);continue}let f=o(d.default,e.name,l);f&&(i.push(...f),e.config?.defaults&&a.set(e.name,e.config.defaults))}return{packages:i,configDefaults:a}}function o(e,t,n){if(Array.isArray(e)){let r=[],i=new Set;for(let t of e){if(!f(t)){console.warn(`${n}: default export array contains an invalid MakaioExtension, skipping`);return}if(i.has(t.name)){console.warn(`${n}: default export array contains duplicate package name '${t.name}', skipping`);return}i.add(t.name),r.push(t)}if(!r.some(e=>e.name===t)){console.warn(`${n}: default export array must include a package named '${t}' to match descriptor identity, skipping`);return}if(r.some(e=>e.name!==t&&!e.name.startsWith(`${t}.`))){console.warn(`${n}: default export array contains package names outside descriptor namespace '${t}', skipping`);return}return r}if(!f(e)){console.warn(`${n}: default export is not a valid MakaioExtension or MakaioExtension[], skipping`);return}if(e.name!==t){console.warn(`${n}: imported package name '${e.name}' does not match descriptor name '${t}', skipping`);return}return[e]}async function s(e,t,n){let{importModule:r=S,frameworkVersion:i}=n,a=new Map(t.map(e=>[e.name,e])),o=new Map;for(let t of e){let e=c(t,i);if(!e)continue;let n=`[extensions] ${t.descriptor.name}@${t.descriptor.version}`,s=a.get(t.descriptor.name);if(s?.cli)continue;let u=await d(t,e,n,r);if(!u)continue;if(!p(u.default)){console.warn(`${n}: default export is not a valid CliContribution, skipping`);continue}let f=t.descriptor.cli?.name??t.descriptor.name;if(u.default.name!==f){console.warn(`${n}: imported CLI contribution name '${u.default.name}' does not match descriptor CLI name '${f}', skipping`);continue}if(s){a.set(t.descriptor.name,{...s,cli:u.default});continue}if(t.descriptor.entrypoints?.server||t.descriptor.entrypoints?.browser){console.warn(`${n}: server or browser entry is present but no package was loaded, skipping CLI-only synthesis`);continue}a.set(t.descriptor.name,l(t,u.default)),t.descriptor.config?.defaults&&o.set(t.descriptor.name,t.descriptor.config.defaults)}return{packages:[...a.values()],configDefaults:o}}function c(e,t){if(u(e,t)&&e.descriptor.execution!==`detached`)return e.descriptor.entrypoints?.cli}function l(t,n){return{...e(t.descriptor),cli:n}}function u(e,t){let{descriptor:n}=e,r=`[extensions] ${n.name}@${n.version}`;try{return i(t,n.makaio.framework)?!0:(console.warn(`${r}: requires framework ${n.makaio.framework}, current is ${t}, skipping`),!1)}catch(e){return console.warn(`${r}: invalid version metadata (framework=${t}, range=${n.makaio.framework}), skipping:`,e instanceof Error?e.message:e),!1}}async function d(e,t,n,r){try{let i=_(`cli`,t,e.extensionPath);if(!i){console.warn(`${n}: cli entrypoint has no resolvable candidate within extension directory, skipping`);return}return await r(i)}catch(e){console.warn(`${n}: failed to import cli entry:`,e instanceof Error?e.message:e);return}}function f(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.displayName==`string`&&typeof t.version==`string`}function p(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name!=`string`||typeof t.description!=`string`||!Array.isArray(t.subcommands)||`interactive`in t&&t.interactive!==void 0&&typeof t.interactive!=`function`?!1:t.subcommands.length===0?typeof t.interactive==`function`:t.subcommands.every(m)}function m(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&h(t.schema)&&typeof t.handler==`function`}function h(e){return typeof e==`object`&&!!e&&typeof e.safeParse==`function`}function g(e,t){return t===!0?e:t}function _(e,t,r){if(!n.isAbsolute(r))return;let i=g(e,t),a=x(r),o=n.resolve(r,`src`,`${i}.ts`);if(y(o,a))return o;let s=n.resolve(r,`dist`,`${i}.mjs`);if(y(s,a))return s}function v(e,t){let n=x(t);return b(x(e),n)}function y(e,t){try{return b(r.realpathSync(e),t)}catch{return!1}}function b(e,t){return e.startsWith(t+n.sep)}function x(e){let t=n.resolve(e);try{return r.realpathSync(t)}catch{return t}}async function S(e){return await import(t(e).href)}export{f as a,_ as c,u as i,g as n,v as o,p as r,a as s,s as t};
1
+ import{t as e}from"./descriptor-to-package-DvF08krT.mjs";import{pathToFileURL as t}from"node:url";import*as n from"node:path";import*as r from"node:fs";import{versionSatisfies as i}from"@makaio/framework/contracts";async function a(e,t){let{frameworkVersion:n,importModule:r=S}=t,i=[],a=new Map,s;for(let t of e){let{descriptor:e,extensionPath:c}=t,l=`[extensions] ${e.name}@${e.version}`;if(!u(t,n))continue;if(e.execution===`detached`){let t;try{s??=(await import(`./detached-extension-handle-Ddfquy5_.mjs`)).createDetachedExtensionPackage,t=s(e,c)}catch(e){console.warn(`${l}: failed to synthesize detached extension package:`,e instanceof Error?e.message:e);continue}i.push(t),e.config?.defaults&&a.set(e.name,e.config.defaults);continue}if(!e.entrypoints.server){!e.entrypoints.browser&&!e.entrypoints.cli&&console.warn(`${l}: no executable entrypoint declared, skipping`);continue}let d;if(t.preloadedModule)d=t.preloadedModule;else try{let t=_(`server`,e.entrypoints.server,c);if(!t){console.warn(`${l}: server entrypoint could not be resolved within extension directory, skipping`);continue}d=await r(t)}catch(e){console.warn(`${l}: failed to import server entry:`,e instanceof Error?e.message:e);continue}let f=o(d.default,e.name,l);f&&(i.push(...f),e.config?.defaults&&a.set(e.name,e.config.defaults))}return{packages:i,configDefaults:a}}function o(e,t,n){if(Array.isArray(e)){let r=[],i=new Set;for(let t of e){if(!f(t)){console.warn(`${n}: default export array contains an invalid MakaioExtension, skipping`);return}if(i.has(t.name)){console.warn(`${n}: default export array contains duplicate package name '${t.name}', skipping`);return}i.add(t.name),r.push(t)}if(!r.some(e=>e.name===t)){console.warn(`${n}: default export array must include a package named '${t}' to match descriptor identity, skipping`);return}if(r.some(e=>e.name!==t&&!e.name.startsWith(`${t}.`))){console.warn(`${n}: default export array contains package names outside descriptor namespace '${t}', skipping`);return}return r}if(!f(e)){console.warn(`${n}: default export is not a valid MakaioExtension or MakaioExtension[], skipping`);return}if(e.name!==t){console.warn(`${n}: imported package name '${e.name}' does not match descriptor name '${t}', skipping`);return}return[e]}async function s(e,t,n){let{importModule:r=S,frameworkVersion:i}=n,a=new Map(t.map(e=>[e.name,e])),o=new Map;for(let t of e){let e=c(t,i);if(!e)continue;let n=`[extensions] ${t.descriptor.name}@${t.descriptor.version}`,s=a.get(t.descriptor.name);if(s?.cli)continue;let u=await d(t,e,n,r);if(!u)continue;if(!p(u.default)){console.warn(`${n}: default export is not a valid CliContribution, skipping`);continue}let f=t.descriptor.cli?.name??t.descriptor.name;if(u.default.name!==f){console.warn(`${n}: imported CLI contribution name '${u.default.name}' does not match descriptor CLI name '${f}', skipping`);continue}if(s){a.set(t.descriptor.name,{...s,cli:u.default});continue}if(t.descriptor.entrypoints?.server||t.descriptor.entrypoints?.browser){console.warn(`${n}: server or browser entry is present but no package was loaded, skipping CLI-only synthesis`);continue}a.set(t.descriptor.name,l(t,u.default)),t.descriptor.config?.defaults&&o.set(t.descriptor.name,t.descriptor.config.defaults)}return{packages:[...a.values()],configDefaults:o}}function c(e,t){if(u(e,t)&&e.descriptor.execution!==`detached`)return e.descriptor.entrypoints?.cli}function l(t,n){return{...e(t.descriptor),cli:n}}function u(e,t){let{descriptor:n}=e,r=`[extensions] ${n.name}@${n.version}`;try{return i(t,n.makaio.framework)?!0:(console.warn(`${r}: requires framework ${n.makaio.framework}, current is ${t}, skipping`),!1)}catch(e){return console.warn(`${r}: invalid version metadata (framework=${t}, range=${n.makaio.framework}), skipping:`,e instanceof Error?e.message:e),!1}}async function d(e,t,n,r){try{let i=_(`cli`,t,e.extensionPath);if(!i){console.warn(`${n}: cli entrypoint has no resolvable candidate within extension directory, skipping`);return}return await r(i)}catch(e){console.warn(`${n}: failed to import cli entry:`,e instanceof Error?e.message:e);return}}function f(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.displayName==`string`&&typeof t.version==`string`}function p(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name!=`string`||typeof t.description!=`string`||!Array.isArray(t.subcommands)||`interactive`in t&&t.interactive!==void 0&&typeof t.interactive!=`function`?!1:t.subcommands.length===0?typeof t.interactive==`function`:t.subcommands.every(m)}function m(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&h(t.schema)&&typeof t.handler==`function`}function h(e){return typeof e==`object`&&!!e&&typeof e.safeParse==`function`}function g(e,t){return t===!0?e:t}function _(e,t,r){if(!n.isAbsolute(r))return;let i=g(e,t),a=x(r),o=n.resolve(r,`src`,`${i}.ts`);if(y(o,a))return o;let s=n.resolve(r,`dist`,`${i}.mjs`);if(y(s,a))return s}function v(e,t){let n=x(t);return b(x(e),n)}function y(e,t){try{return b(r.realpathSync(e),t)}catch{return!1}}function b(e,t){return e.startsWith(t+n.sep)}function x(e){let t=n.resolve(e);try{return r.realpathSync(t)}catch{return t}}async function S(e){return await import(t(e).href)}export{f as a,_ as c,u as i,g as n,v as o,p as r,a as s,s as t};
@@ -1 +1 @@
1
- import{A as e,B as t,D as n,M as r,l as i}from"./schemas-BRxU_oqL.mjs";import{z as a}from"zod";import{createBusNamespace as o}from"@makaio/framework/core";const s=r.extend({ref:i,affordance:e}),c=a.discriminatedUnion(`status`,[a.object({status:a.literal(`ok`),view:t,builderVersion:a.number().int().positive(),sourceRevision:a.string().min(1)}),a.object({status:a.literal(`artifact-not-found`),view:a.null()}),a.object({status:a.literal(`not-rendered`),view:a.null()})]),l={"surfaceBinding.register":{request:n,response:a.object({registered:a.boolean()})},"surfaceBinding.list":{request:a.object({id:a.string().min(1).optional(),provider:a.string().min(1).optional(),namespace:a.string().min(1).optional()}),response:a.object({bindings:a.array(n)})},"surfaceBinding.changed":a.object({id:a.string().min(1),provider:a.string().min(1)}),"ref.changed":a.object({artifactId:a.string().min(1),provider:a.string().min(1),externalId:a.string().min(1),operation:a.enum([`upserted`,`deleted`]),origin:a.enum([`factory`,`external`]).optional()}),"capability.resolved":a.object({provider:a.string().min(1),surface:a.string().min(1),capabilities:a.record(a.string().min(1),a.boolean()),degraded:a.boolean()}),"artifact.view.resolve":{request:s,response:c}},u=o(`materialization`,l),d=u.subjects;function f(e){return{id:e.id,toRegistration:()=>({id:e.id,provider:e.provider,namespace:e.namespace,target:structuredClone(e.target),appliesTo:[...e.appliesTo],...e.valueMapping===void 0?{}:{valueMapping:{...e.valueMapping}},...e.description===void 0?{}:{description:e.description},...e.params===void 0?{}:{params:structuredClone(e.params)}})}}export{l as a,u as i,s as n,d as o,c as r,f as t};
1
+ import{A as e,B as t,D as n,M as r,l as i}from"./schemas-CRB2O5zo.mjs";import{z as a}from"zod";import{createBusNamespace as o}from"@makaio/framework/core";const s=r.extend({ref:i,affordance:e}),c=a.discriminatedUnion(`status`,[a.object({status:a.literal(`ok`),view:t,builderVersion:a.number().int().positive(),sourceRevision:a.string().min(1)}),a.object({status:a.literal(`artifact-not-found`),view:a.null()}),a.object({status:a.literal(`not-rendered`),view:a.null()})]),l={"surfaceBinding.register":{request:n,response:a.object({registered:a.boolean()})},"surfaceBinding.list":{request:a.object({id:a.string().min(1).optional(),provider:a.string().min(1).optional(),namespace:a.string().min(1).optional()}),response:a.object({bindings:a.array(n)})},"surfaceBinding.changed":a.object({id:a.string().min(1),provider:a.string().min(1)}),"ref.changed":a.object({artifactId:a.string().min(1),provider:a.string().min(1),externalId:a.string().min(1),operation:a.enum([`upserted`,`deleted`]),origin:a.enum([`factory`,`external`]).optional()}),"capability.resolved":a.object({provider:a.string().min(1),surface:a.string().min(1),capabilities:a.record(a.string().min(1),a.boolean()),degraded:a.boolean()}),"artifact.view.resolve":{request:s,response:c}},u=o(`materialization`,l),d=u.subjects;function f(e){return{id:e.id,toRegistration:()=>({id:e.id,provider:e.provider,namespace:e.namespace,target:structuredClone(e.target),appliesTo:[...e.appliesTo],...e.valueMapping===void 0?{}:{valueMapping:{...e.valueMapping}},...e.description===void 0?{}:{description:e.description},...e.params===void 0?{}:{params:structuredClone(e.params)}})}}export{l as a,u as i,s as n,d as o,c as r,f as t};
@@ -4,7 +4,7 @@ import { BaseService } from "@makaio/framework/service-base";
4
4
  import { McpToolDefinition, ToolInfo } from "@makaio/framework/tools";
5
5
  import { IncomingMessage, ServerResponse } from "node:http";
6
6
  import { Server as Server$1 } from "@modelcontextprotocol/sdk/server/index.js";
7
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
7
+ import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
8
8
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
9
9
 
10
10
  //#region subsystems/mcp-http-server/src/context-registry.d.ts
@@ -60,32 +60,6 @@ declare class McpContextRegistry implements IMcpContextRegistry {
60
60
  unregister(adapterSessionId: string): void;
61
61
  }
62
62
  //#endregion
63
- //#region subsystems/mcp-http-server/src/approve-tool.d.ts
64
- /** MCP tool name for the permission prompt handler. */
65
- declare const APPROVE_TOOL_NAME = "approve";
66
- /** Payload forwarded to `agent.toolApprove`. */
67
- interface ToolApproveRequestPayload {
68
- toolName: string;
69
- args: Record<string, unknown>;
70
- toolCallId: string;
71
- agentId: string;
72
- adapterId: string;
73
- adapterName: string;
74
- adapterSessionId: string;
75
- /** Makaio session ID — required for approval routing to the owning tab. */
76
- sessionId: string;
77
- }
78
- /** Minimal response shape consumed from `agent.toolApprove`. */
79
- type ToolApproveResponse = {
80
- action: 'allow';
81
- updatedInput?: Record<string, unknown>;
82
- } | {
83
- action: 'deny';
84
- message?: string;
85
- };
86
- /** Function seam for approval RPC. */
87
- type RequestToolApproval = (payload: ToolApproveRequestPayload) => Promise<ToolApproveResponse>;
88
- //#endregion
89
63
  //#region subsystems/mcp-http-server/src/tool-discovery.d.ts
90
64
  /**
91
65
  * Maps a runtime toolset name to the plugin that owns it.
@@ -225,45 +199,34 @@ interface CreateMcpServerOptions extends ToolExecutionTimeoutOption {
225
199
  interface HttpMcpHandlerOptions extends ToolExecutionTimeoutOption {
226
200
  agentContext?: McpAgentContext$1;
227
201
  toolDiscovery?: McpToolDiscoveryOptions;
202
+ /**
203
+ * Fires once when the endpoint itself closes.
204
+ *
205
+ * It does **not** fire when an individual MCP client disconnects or
206
+ * terminates its session: one endpoint serves many MCP clients, and their
207
+ * comings and goings are not endpoint lifecycle events.
208
+ */
228
209
  onclose?: () => void;
229
210
  resolveContextOverrides?: ResolveContextOverrides;
211
+ /**
212
+ * Idle time (ms) with no open HTTP exchange before an MCP client session is
213
+ * closed. A client holding its standalone SSE stream is never idle. Defaults
214
+ * to 10 minutes.
215
+ */
216
+ idleTimeoutMs?: number;
217
+ /** Interval (ms) between idle-session sweeps. Defaults to 60 seconds. */
218
+ sweepIntervalMs?: number;
230
219
  }
231
220
  /** Options for starting a standalone HTTP MCP server. */
232
221
  interface HttpMcpServerOptions extends HttpMcpHandlerOptions {
233
222
  port?: number;
234
223
  }
235
224
  //#endregion
236
- //#region subsystems/mcp-http-server/src/server.d.ts
225
+ //#region subsystems/mcp-http-server/src/create-mcp-server.d.ts
237
226
  /** Query parameter name used by adapters to pass the session ID when custom headers are not available. */
238
227
  declare const ADAPTER_SESSION_ID_PARAM = "adapterSessionId";
239
228
  /** HTTP header name that carries the adapter session ID after query-param promotion. */
240
229
  declare const ADAPTER_SESSION_ID_HEADER = "x-adapter-session-id";
241
- /**
242
- * Result returned by {@link createHttpMcpHandler}.
243
- *
244
- * Provides a Node.js-compatible request handler that can be mounted on any
245
- * HTTP stack that exposes the raw `IncomingMessage` / `ServerResponse` pair,
246
- * plus lifecycle handles for the underlying MCP server. See
247
- * {@link createHttpMcpHandler} for usage and mounting examples.
248
- */
249
- interface HttpMcpHandlerHandle {
250
- /**
251
- * Mount this on any Node-compatible HTTP stack.
252
- *
253
- * The handler parses the raw request body internally; do not pre-read or
254
- * pre-parse the body before passing the request to this function.
255
- */
256
- readonly handler: (req: IncomingMessage, res: ServerResponse) => void;
257
- /** Context registry for registering and unregistering agent sessions. */
258
- readonly contextRegistry: IMcpContextRegistry;
259
- /**
260
- * Gracefully close the MCP server and its transport.
261
- *
262
- * Idempotent: repeated calls await the same underlying close operation and
263
- * do not trigger a second teardown.
264
- */
265
- close(): Promise<void>;
266
- }
267
230
  /**
268
231
  * Create and configure MCP server.
269
232
  *
@@ -308,23 +271,60 @@ declare function createMcpServer(bus: IMakaioBus, sessionId: string, options?: C
308
271
  } | undefined;
309
272
  } | undefined;
310
273
  }>>;
274
+ //#endregion
275
+ //#region subsystems/mcp-http-server/src/approve-tool.d.ts
276
+ /** MCP tool name for the permission prompt handler. */
277
+ declare const APPROVE_TOOL_NAME = "approve";
278
+ /** Payload forwarded to `agent.toolApprove`. */
279
+ interface ToolApproveRequestPayload {
280
+ toolName: string;
281
+ args: Record<string, unknown>;
282
+ toolCallId: string;
283
+ agentId: string;
284
+ adapterId: string;
285
+ adapterName: string;
286
+ adapterSessionId: string;
287
+ /** Makaio session ID — required for approval routing to the owning tab. */
288
+ sessionId: string;
289
+ }
290
+ /** Minimal response shape consumed from `agent.toolApprove`. */
291
+ type ToolApproveResponse = {
292
+ action: 'allow';
293
+ updatedInput?: Record<string, unknown>;
294
+ } | {
295
+ action: 'deny';
296
+ message?: string;
297
+ };
298
+ /** Function seam for approval RPC. */
299
+ type RequestToolApproval = (payload: ToolApproveRequestPayload) => Promise<ToolApproveResponse>;
300
+ //#endregion
301
+ //#region subsystems/mcp-http-server/src/server.d.ts
311
302
  /**
312
- * Create a framework-agnostic HTTP request handler that delegates to
313
- * {@link StreamableHTTPServerTransport.handleRequest}.
314
- *
315
- * **External consumers should prefer {@link createHttpMcpHandler}**, which
316
- * constructs the transport internally so no MCP SDK type needs to appear in
317
- * caller code. This lower-level function is exposed for internal composition
318
- * and testing.
319
- *
320
- * The transport handles body parsing internally; do not pre-parse the body
321
- * before calling this handler, as that would consume the request stream before
322
- * MCP can read it.
323
- * @param transport - Streamable HTTP transport instance connected to the server.
324
- * @param onBeforeDispatch - Optional hook called synchronously before request dispatch.
325
- * @returns Node.js-compatible request handler.
303
+ * Result returned by {@link createHttpMcpHandler}.
304
+ *
305
+ * Provides a Node.js-compatible request handler that can be mounted on any
306
+ * HTTP stack that exposes the raw `IncomingMessage` / `ServerResponse` pair,
307
+ * plus lifecycle handles for the underlying MCP server. See
308
+ * {@link createHttpMcpHandler} for usage and mounting examples.
326
309
  */
327
- declare function createMcpRequestHandler(transport: StreamableHTTPServerTransport, onBeforeDispatch?: (req: IncomingMessage, res: ServerResponse) => void): (req: IncomingMessage, res: ServerResponse) => void;
310
+ interface HttpMcpHandlerHandle {
311
+ /**
312
+ * Mount this on any Node-compatible HTTP stack.
313
+ *
314
+ * The handler parses the raw request body internally; do not pre-read or
315
+ * pre-parse the body before passing the request to this function.
316
+ */
317
+ readonly handler: (req: IncomingMessage, res: ServerResponse) => void;
318
+ /** Context registry for registering and unregistering agent sessions. */
319
+ readonly contextRegistry: IMcpContextRegistry;
320
+ /**
321
+ * Gracefully close the endpoint and every MCP client session it owns.
322
+ *
323
+ * Idempotent: repeated calls await the same underlying close operation and
324
+ * do not trigger a second teardown.
325
+ */
326
+ close(): Promise<void>;
327
+ }
328
328
  /**
329
329
  * Create a mountable MCP handler without starting a dedicated HTTP server.
330
330
  *
@@ -334,6 +334,12 @@ declare function createMcpRequestHandler(transport: StreamableHTTPServerTranspor
334
334
  * framework exposing the raw `IncomingMessage` / `ServerResponse` pair (e.g.
335
335
  * Hono's Node adapter via `(c) => { handler(c.env.incoming, c.env.outgoing); }`).
336
336
  *
337
+ * The endpoint serves **many concurrent MCP clients**. Each client gets its own
338
+ * `(transport, server)` pair keyed by the MCP protocol session ID; see
339
+ * {@link McpTransportRegistry} for the full lifecycle contract. This is
340
+ * independent of the adapter session carried by the `adapterSessionId` query
341
+ * param, of which many may share a single MCP client.
342
+ *
337
343
  * The MCP SDK transport is constructed and managed internally — no MCP SDK
338
344
  * types appear in the public API.
339
345
  *
@@ -341,8 +347,8 @@ declare function createMcpRequestHandler(transport: StreamableHTTPServerTranspor
341
347
  * rate limiting, or logging in the surrounding HTTP stack *before* delegating
342
348
  * to the returned handler.
343
349
  *
344
- * Closing the handle shuts down the MCP server and its transport; active
345
- * HTTP connections are left to the caller's HTTP stack.
350
+ * Closing the handle shuts down every live MCP client session; active HTTP
351
+ * connections are left to the caller's HTTP stack.
346
352
  * @param bus - Bus instance for tool execution and approval RPC.
347
353
  * @param options - Handler options; all fields are optional.
348
354
  * @returns Handle with the request handler function, context registry, and
@@ -390,10 +396,11 @@ declare function startHttpMcpServer(bus: IMakaioBus, options?: HttpMcpServerOpti
390
396
  *
391
397
  * For the stdio transport, returns a {@link StdioMcpServerHandle} whose
392
398
  * `close()` method gracefully tears down the MCP server. Pass
393
- * `options.onclose` to receive a single callback when the transport closes for
394
- * any reason (client detach via stdin EOF, or explicit `handle.close()`). Pass
395
- * `options.resolveContextOverrides` to resolve current execution context on
396
- * every tool call, including calls after client reconnects.
399
+ * `options.onclose` to receive a single callback when the server stops serving:
400
+ * for stdio that is client detach via stdin EOF or an explicit `handle.close()`;
401
+ * for HTTP it is endpoint shutdown only, never an individual MCP client
402
+ * disconnecting. Pass `options.resolveContextOverrides` to resolve current
403
+ * execution context on every tool call, including calls after client reconnects.
397
404
  * Signal handling is intentionally left to the composition root — library code
398
405
  * must not own process-global resources such as `process.on('SIGINT')`.
399
406
  * @param bus - Bus instance.
@@ -425,7 +432,7 @@ interface FetchMcpHandlerHandle {
425
432
  /** Context registry for registering and unregistering agent sessions. */
426
433
  readonly contextRegistry: IMcpContextRegistry;
427
434
  /**
428
- * Gracefully close the MCP server and its transport.
435
+ * Gracefully close the endpoint and every MCP client session it owns.
429
436
  *
430
437
  * Idempotent: repeated calls await the same underlying close operation and
431
438
  * do not trigger a second teardown.
@@ -442,6 +449,10 @@ interface FetchMcpHandlerHandle {
442
449
  * Web Standard `Request` and returns a `Promise<Response>`. Mount it on Hono,
443
450
  * Bun.serve, Cloudflare Workers, Deno, or any other fetch-compatible HTTP stack.
444
451
  *
452
+ * The endpoint serves many concurrent MCP clients, one `(transport, server)`
453
+ * pair per MCP protocol session; see `McpTransportRegistry` for the lifecycle
454
+ * contract shared with the Node handler.
455
+ *
445
456
  * ```ts
446
457
  * import { createFetchMcpHandler } from '@makaio/framework/mcp-http-server';
447
458
  *
@@ -469,6 +480,217 @@ interface FetchMcpHandlerHandle {
469
480
  */
470
481
  declare function createFetchMcpHandler(bus: IMakaioBus, options?: HttpMcpHandlerOptions): Promise<FetchMcpHandlerHandle>;
471
482
  //#endregion
483
+ //#region subsystems/mcp-http-server/src/mcp-http-errors.d.ts
484
+ /** Reasons the registry declined to dispatch a request to a transport. */
485
+ type McpRouteFailure = 'unknown-session' | 'session-id-required' | 'closed' | 'create-failed';
486
+ //#endregion
487
+ //#region subsystems/mcp-http-server/src/mcp-transport-registry.d.ts
488
+ /**
489
+ * Hooks the registry injects into the transport it asks the caller to build.
490
+ *
491
+ * The caller must forward {@link McpSessionHooks.onSessionInitialized} to the
492
+ * transport's `onsessioninitialized` option — that callback is the registry's
493
+ * only admission point.
494
+ */
495
+ interface McpSessionHooks {
496
+ /**
497
+ * Admit a freshly initialized session under its MCP session ID.
498
+ * @param mcpSessionId - Session ID the transport generated during `initialize`.
499
+ */
500
+ onSessionInitialized(mcpSessionId: string): void;
501
+ }
502
+ /**
503
+ * Build one unconnected `(transport, server)` pair.
504
+ *
505
+ * The factory must only construct: the registry owns wiring, connecting, and
506
+ * teardown. The transport must expose `sessionId` once initialized.
507
+ */
508
+ type CreateMcpSession<T extends Transport> = (hooks: McpSessionHooks) => Promise<{
509
+ transport: T;
510
+ server: Server$1;
511
+ }>;
512
+ /** Configuration for {@link McpTransportRegistry}. */
513
+ interface McpTransportRegistryOptions<T extends Transport> {
514
+ /** Builds one unconnected `(transport, server)` pair per MCP client session. */
515
+ createSession: CreateMcpSession<T>;
516
+ /** Idle time with zero open exchanges before a session is closed. Defaults to 10 minutes. */
517
+ idleTimeoutMs?: number;
518
+ /** Sweep cadence for idle sessions. Defaults to 60 seconds. */
519
+ sweepIntervalMs?: number;
520
+ }
521
+ /** A request reduced to what routing actually depends on. */
522
+ interface McpRouteRequest {
523
+ /** HTTP method of the incoming request. */
524
+ method: string;
525
+ /** Value of the `Mcp-Session-Id` header, when present. */
526
+ mcpSessionId: string | undefined;
527
+ }
528
+ /** Routing outcome for a session that could not be built or connected. */
529
+ interface McpCreateFailureResult {
530
+ outcome: 'create-failed';
531
+ /** Cause of the failure, already logged by the registry. */
532
+ error: unknown;
533
+ }
534
+ /** Outcome of routing one request. */
535
+ type McpRouteResult<T extends Transport> = {
536
+ outcome: 'dispatch'; /** Transport that owns this MCP session. */
537
+ transport: T; /** Releases the activity lease; safe to call more than once. */
538
+ finish(): void;
539
+ } | {
540
+ outcome: Exclude<McpRouteFailure, 'create-failed'>;
541
+ } | McpCreateFailureResult;
542
+ /**
543
+ * Registry owning one `(transport, server)` pair per MCP protocol session.
544
+ *
545
+ * Generic over the transport so the Node and fetch handlers share one routing
546
+ * and lifecycle implementation instead of duplicating it per transport family.
547
+ */
548
+ declare class McpTransportRegistry<T extends Transport> {
549
+ private readonly sessions;
550
+ private readonly pending;
551
+ /**
552
+ * In-flight session constructions.
553
+ *
554
+ * Third link in the ownership chain: a pair belongs to `startups` while it
555
+ * is being built, to `pending` once built but not yet initialized, and to
556
+ * `sessions` after admission. `closeAll()` drains all three in that order,
557
+ * so no phase of a pair's life can outlive a resolved shutdown.
558
+ */
559
+ private readonly startups;
560
+ /** In-flight background disposals started by the sweep or a lease release. */
561
+ private readonly disposals;
562
+ private readonly createSession;
563
+ private readonly idleTimeoutMs;
564
+ private readonly sweepTimer;
565
+ private closed;
566
+ /** Shared teardown, so every `closeAll()` caller awaits the same shutdown. */
567
+ private closePromise;
568
+ /**
569
+ * @param options - Session factory plus idle-reaping configuration.
570
+ * @throws RangeError When `idleTimeoutMs` or `sweepIntervalMs` is not a
571
+ * positive finite number, or when `sweepIntervalMs` exceeds the runtime's
572
+ * timer ceiling. Only the sweep interval is bounded by it: the idle timeout
573
+ * is clock arithmetic, so a multi-week idle policy is legitimate.
574
+ */
575
+ constructor(options: McpTransportRegistryOptions<T>);
576
+ /**
577
+ * Admitted MCP client sessions.
578
+ * @returns Number of routable sessions currently held by the registry. A pair
579
+ * whose `initialize` has not completed yet is not one of them.
580
+ */
581
+ get size(): number;
582
+ /**
583
+ * Resolve one request to a transport, or to the reason it cannot be served.
584
+ *
585
+ * Never rejects: a session that fails to build is reported as the
586
+ * `create-failed` outcome so callers have a single error surface.
587
+ * @param request - Method and `Mcp-Session-Id` of the incoming request.
588
+ * @returns The transport to dispatch to plus its lease, or a failure outcome.
589
+ */
590
+ route(request: McpRouteRequest): Promise<McpRouteResult<T>>;
591
+ /**
592
+ * Close every live pair and stop reaping.
593
+ *
594
+ * "Live" means both owner sets: an admitted session and a pair that has been
595
+ * built but has not initialized yet are equally real servers holding equally
596
+ * real bus subscriptions, and shutdown has to wait for both. Draining only
597
+ * the map would leave a pending pair to be disposed by its lease release,
598
+ * which an abandoned response can defer indefinitely.
599
+ *
600
+ * After this resolves the registry refuses all further routing. Concurrent
601
+ * and repeat callers all await the same shared teardown: without that, a
602
+ * second caller would observe the already-cleared owner sets and resolve
603
+ * while the first caller's teardown is still in flight.
604
+ * @returns Promise resolving once every pair has been torn down.
605
+ */
606
+ closeAll(): Promise<void>;
607
+ /**
608
+ * Tear down every owner set in lifecycle order.
609
+ * @returns Promise resolving once every pair has been torn down.
610
+ */
611
+ private drainAll;
612
+ /**
613
+ * Dispose a pair in the background, keeping the disposal owned until done.
614
+ *
615
+ * Used by the paths that cannot await a close — the sweep and the lease
616
+ * release — so `drainAll()` can still wait for every in-flight teardown.
617
+ * The raw close promise is what gets tracked: a rejection must stay visible
618
+ * to shutdown's aggregation, so background reporting happens on a separate
619
+ * chain that also keeps the rejection from going unhandled.
620
+ * @param record - Pair whose server is being closed.
621
+ */
622
+ private disposeInBackground;
623
+ /**
624
+ * Apply the routing rules for one request.
625
+ * @param request - Method and `Mcp-Session-Id` of the incoming request.
626
+ * @returns The routing outcome.
627
+ */
628
+ private resolve;
629
+ /**
630
+ * Take an activity lease on a session and hand back its transport.
631
+ * @param record - Session to lease.
632
+ * @returns Dispatch outcome carrying the lease release callback.
633
+ */
634
+ private lease;
635
+ /**
636
+ * Build a new session as a tracked startup task.
637
+ *
638
+ * The construction itself spans two awaits (`createSession`, `connect`)
639
+ * during which the pair exists in neither owner set. Registering the whole
640
+ * task in `startups` closes that window: `closeAll()` awaits these tasks, so
641
+ * a shutdown overlapping a slow factory or connect waits for the pair to be
642
+ * built and self-disposed instead of resolving while its server and bus
643
+ * subscription are still coming up.
644
+ * @returns Dispatch outcome for the new session, or `create-failed`.
645
+ */
646
+ private createPending;
647
+ /**
648
+ * Build, wire, and connect a new session, then lease it for this request.
649
+ * @returns Dispatch outcome for the new session, or `create-failed`.
650
+ */
651
+ private buildAndLeasePending;
652
+ /** Close every session that has been idle with no open exchanges. */
653
+ private sweep;
654
+ }
655
+ //#endregion
656
+ //#region subsystems/mcp-http-server/src/mcp-endpoint.d.ts
657
+ /**
658
+ * Build one unconnected transport for a new MCP client session.
659
+ *
660
+ * The implementation must forward {@link McpSessionHooks.onSessionInitialized}
661
+ * to the transport's `onsessioninitialized` option, which is the registry's
662
+ * only admission point.
663
+ */
664
+ type CreateMcpTransport<T extends Transport> = (hooks: McpSessionHooks) => T;
665
+ /** The transport-independent half of an MCP HTTP endpoint. */
666
+ interface McpEndpoint<T extends Transport> {
667
+ /** Routes requests to the transport owning their MCP protocol session. */
668
+ readonly registry: McpTransportRegistry<T>;
669
+ /** Context registry for registering and unregistering adapter sessions. */
670
+ readonly contextRegistry: IMcpContextRegistry;
671
+ /**
672
+ * Close every MCP client session and fire the caller's `onclose` once.
673
+ *
674
+ * Idempotent: repeated calls await the same underlying teardown.
675
+ * @returns Promise resolving once teardown has settled.
676
+ */
677
+ close(): Promise<void>;
678
+ }
679
+ /**
680
+ * Assemble the transport-independent half of an MCP HTTP endpoint.
681
+ *
682
+ * Sessions are built lazily, on the first request that opens one, so option
683
+ * validation runs here rather than in the session factory: a misconfigured
684
+ * endpoint must fail at creation time instead of surfacing as a 500 on
685
+ * someone's first tool call.
686
+ * @param bus - Bus instance for tool execution and approval RPC.
687
+ * @param options - Handler options shared by both HTTP handler flavours.
688
+ * @param createTransport - Builds the SDK transport for one client session.
689
+ * @returns The endpoint's registry, context registry, and close gate.
690
+ * @throws RangeError When a timeout or reaping duration option is out of range.
691
+ */
692
+ declare function createMcpEndpoint<T extends Transport>(bus: IMakaioBus, options: HttpMcpHandlerOptions, createTransport: CreateMcpTransport<T>): McpEndpoint<T>;
693
+ //#endregion
472
694
  //#region subsystems/mcp-http-server/src/mcp-server-bridge-service.d.ts
473
695
  /**
474
696
  * Singleton bus service that manages the HTTP MCP server lifecycle.
@@ -478,13 +700,17 @@ declare function createFetchMcpHandler(bus: IMakaioBus, options?: HttpMcpHandler
478
700
  * using a coalescing promise so concurrent registrations never start two
479
701
  * server instances.
480
702
  *
481
- * The service maintains three parallel session stores:
703
+ * Everything here is keyed by **adapter** session, not by MCP protocol session:
704
+ * many adapter sessions share one endpoint, and each connected MCP client owns
705
+ * a separate protocol session that the HTTP server manages internally.
706
+ *
707
+ * The service maintains three parallel adapter-session stores:
482
708
  * - `pinnedSessions` (plain Map) — sessions exempt from both TTL sweep and
483
709
  * LRU count-eviction; only removed by explicit `mcp.session.unregister` or
484
710
  * on server close
485
711
  * - `sessions` (QuickLRU) — non-pinned sessions subject to TTL/LRU eviction
486
712
  * - `contextRegistry` (Map-backed, inside the HTTP server handle) — source of
487
- * truth for the MCP server's per-request routing
713
+ * truth for resolving an adapter session's agent context on every MCP request
488
714
  *
489
715
  * The `resolveContextOverrides` callback threaded into `startHttpMcpServer`
490
716
  * bridges these stores so tool execution always uses session-stable
@@ -677,4 +903,4 @@ interface McpClientBridgeOptions {
677
903
  */
678
904
  declare function startMcpClientBridge(options: McpClientBridgeOptions): Promise<McpClientBridgeHandle>;
679
905
  //#endregion
680
- export { ADAPTER_SESSION_ID_HEADER, ADAPTER_SESSION_ID_PARAM, APPROVE_TOOL_NAME, type CreateMcpServerOptions, type FetchMcpHandlerHandle, type HttpMcpHandlerHandle, type HttpMcpHandlerOptions, type HttpMcpServerHandle, type HttpMcpServerOptions, type IMcpContextRegistry, type McpAgentContext, type McpBridgedTool, type McpCallToolResult, type McpClientBridgeHandle, type McpClientBridgeOptions, McpContextRegistry, type McpResolvedTools, McpServerBridgeService, type McpServerOptions, type McpToolDiscoveryIdentity, type McpToolDiscoveryOptions, type McpToolEntry, type PluginToolsetMap, type RequestToolApproval, type ResolveContextOverrides, type StdioMcpServerHandle, type ToolApproveRequestPayload, type ToolApproveResponse, createFetchMcpHandler, createHttpMcpHandler, createMcpRequestHandler, createMcpServer, resolveMcpTools, startHttpMcpServer, startMcpClientBridge, startMcpServer, toolInfoToMcpTool };
906
+ export { ADAPTER_SESSION_ID_HEADER, ADAPTER_SESSION_ID_PARAM, APPROVE_TOOL_NAME, type CreateMcpServerOptions, type CreateMcpSession, type CreateMcpTransport, type FetchMcpHandlerHandle, type HttpMcpHandlerHandle, type HttpMcpHandlerOptions, type HttpMcpServerHandle, type HttpMcpServerOptions, type IMcpContextRegistry, type McpAgentContext, type McpBridgedTool, type McpCallToolResult, type McpClientBridgeHandle, type McpClientBridgeOptions, McpContextRegistry, type McpCreateFailureResult, type McpEndpoint, type McpResolvedTools, type McpRouteRequest, type McpRouteResult, McpServerBridgeService, type McpServerOptions, type McpSessionHooks, type McpToolDiscoveryIdentity, type McpToolDiscoveryOptions, type McpToolEntry, McpTransportRegistry, type McpTransportRegistryOptions, type PluginToolsetMap, type RequestToolApproval, type ResolveContextOverrides, type StdioMcpServerHandle, type ToolApproveRequestPayload, type ToolApproveResponse, createFetchMcpHandler, createHttpMcpHandler, createMcpEndpoint, createMcpServer, resolveMcpTools, startHttpMcpServer, startMcpClientBridge, startMcpServer, toolInfoToMcpTool };