@makaio/framework 1.0.0-dev-1783705652236 → 1.0.0-dev-1783973359164

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 (460) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/account-identity-BYfeWLe-.mjs +1 -0
  3. package/dist/adapter-auth-runtime-a4O7cSNP.mjs +1 -0
  4. package/dist/adapter-binding-DDUyv1JK.d.mts +254 -0
  5. package/dist/{adapter-CA8rPIUz.mjs → adapter-nl_xz9dz.mjs} +1 -1
  6. package/dist/adapter-subsystem/index.d.mts +120 -5
  7. package/dist/adapter-subsystem/index.mjs +1 -1
  8. package/dist/adapters/acp-client/index.d.mts +10 -0
  9. package/dist/adapters/acp-client/index.mjs +2 -2
  10. package/dist/adapters/config/index.d.mts +176 -153
  11. package/dist/adapters/config/index.mjs +1 -1
  12. package/dist/adapters/index.d.mts +1021 -1005
  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 +7 -5
  17. package/dist/adapters/stream-session/index.mjs +1 -1
  18. package/dist/auth-C3NOWqTU.mjs +1 -0
  19. package/dist/authority-state-bootstrap-CEuKScnL.mjs +1 -0
  20. package/dist/{base-orchestrator-J1WKAUkF.d.mts → base-orchestrator-BiShpVKL.d.mts} +6 -0
  21. package/dist/bus/index.d.mts +10 -10
  22. package/dist/bus/index.mjs +1 -1
  23. package/dist/{canonical-model-DV-Z8gsb.mjs → canonical-model-C31NaBJs.mjs} +1 -1
  24. package/dist/client-BkpLM8Fx.mjs +1 -0
  25. package/dist/client-binary-version-verifier-BK_vIjIo.mjs +2 -0
  26. package/dist/client-binary-version-verifier-BwrMTAh2.d.mts +179 -0
  27. package/dist/clients/index.d.mts +69 -85
  28. package/dist/clients/index.mjs +1 -2
  29. package/dist/clients/managed-install.d.mts +2 -0
  30. package/dist/clients/managed-install.mjs +1 -0
  31. package/dist/{clients-namespace-Bt_VTkEU.d.mts → clients-namespace-B96QIJOs.d.mts} +224 -21
  32. package/dist/compression-CZ_6fYq8.mjs +1 -0
  33. package/dist/config-namespace-DTA6EQL8.mjs +1 -0
  34. package/dist/{config-namespace-DqdFE6zk.d.mts → config-namespace-x0fuhEXe.d.mts} +73 -1
  35. package/dist/contracts/adapter/index.d.mts +3 -3
  36. package/dist/contracts/adapter/index.mjs +1 -1
  37. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  38. package/dist/contracts/artifact/index.d.mts +1 -1
  39. package/dist/contracts/auth/index.d.mts +3 -0
  40. package/dist/contracts/auth/index.mjs +1 -0
  41. package/dist/contracts/canonical-model/index.d.mts +1 -1
  42. package/dist/contracts/canonical-model/index.mjs +1 -1
  43. package/dist/contracts/client/index.d.mts +3 -3
  44. package/dist/contracts/client/index.mjs +1 -1
  45. package/dist/contracts/common/index.d.mts +1 -1
  46. package/dist/contracts/config/index.d.mts +20 -93
  47. package/dist/contracts/config/index.mjs +1 -1
  48. package/dist/contracts/extension/index.d.mts +3 -3
  49. package/dist/contracts/extension/index.mjs +1 -1
  50. package/dist/contracts/facet/index.d.mts +1 -1
  51. package/dist/contracts/facet/index.mjs +1 -1
  52. package/dist/contracts/harness/index.d.mts +1 -1
  53. package/dist/contracts/harness/index.mjs +1 -1
  54. package/dist/contracts/host/index.d.mts +1 -1
  55. package/dist/contracts/host/index.mjs +1 -1
  56. package/dist/contracts/index.d.mts +1161 -140
  57. package/dist/contracts/index.mjs +1 -1
  58. package/dist/contracts/materialization/index.d.mts +3 -3
  59. package/dist/contracts/materialization/index.mjs +1 -1
  60. package/dist/contracts/model-registry/index.d.mts +1 -1
  61. package/dist/contracts/model-registry/index.mjs +1 -1
  62. package/dist/contracts/native-session-supervisor/index.d.mts +2 -2
  63. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  64. package/dist/contracts/platform/index.d.mts +1 -1
  65. package/dist/contracts/platform/index.mjs +1 -1
  66. package/dist/contracts/provider/index.d.mts +2 -2
  67. package/dist/contracts/provider/index.mjs +1 -1
  68. package/dist/contracts/session/index.d.mts +3 -3
  69. package/dist/contracts/session/index.mjs +1 -1
  70. package/dist/contracts/shared/index.d.mts +2 -2
  71. package/dist/contracts/shared/index.mjs +1 -1
  72. package/dist/contracts/skill/index.d.mts +1 -1
  73. package/dist/contracts/skill/index.mjs +1 -1
  74. package/dist/contracts/telemetry/index.d.mts +1 -1
  75. package/dist/contracts/telemetry/index.mjs +1 -1
  76. package/dist/contracts/timeout/index.d.mts +1 -1
  77. package/dist/contracts/timeout/index.mjs +1 -1
  78. package/dist/contracts/toast/index.mjs +1 -1
  79. package/dist/contracts/variant/index.d.mts +1 -1
  80. package/dist/contracts/variant/index.mjs +1 -1
  81. package/dist/contracts/workflow/index.d.mts +3 -3
  82. package/dist/contracts/workflow/index.mjs +1 -1
  83. package/dist/{definition-s9PIua2B.d.mts → definition-Bj9Vr16H.d.mts} +1 -1
  84. package/dist/{definition-Cllhr9mi.d.mts → definition-BsTlOz99.d.mts} +36 -4
  85. package/dist/{definition-CuJvtYeG.d.mts → definition-Cbl0k6Fc.d.mts} +31 -1
  86. package/dist/definition-K3m51lgO.mjs +1 -0
  87. package/dist/definitions-C1pgx0Nq.mjs +1 -0
  88. package/dist/{detached-extension-handle-Cx6-0eqg.mjs → detached-extension-handle-vDK194QV.mjs} +1 -1
  89. package/dist/drizzle/0026_m_mrgvi7fq.sql +16 -0
  90. package/dist/drizzle/0027_m_mrgw0uzg.sql +1 -0
  91. package/dist/drizzle/0028_m_mrgx04i1.sql +1 -0
  92. package/dist/drizzle/0029_terminal-authority.sql +1 -0
  93. package/dist/drizzle/meta/_journal.json +28 -0
  94. package/dist/execution-target-Bg2wpfML.mjs +1 -0
  95. package/dist/{extension-CJClssfp.mjs → extension-CjTu6mzW.mjs} +1 -1
  96. package/dist/extension-D4iKUUMG.mjs +1 -0
  97. package/dist/{filesystem-service-Bmyqo6po.mjs → filesystem-service-maY_P3yA.mjs} +1 -1
  98. package/dist/git/index.mjs +1 -1
  99. package/dist/{globby-D4SANVoq.mjs → globby-CisClzat.mjs} +1 -1
  100. package/dist/handlers-RGs3eC9X.mjs +57 -0
  101. package/dist/{harness-DkUpbsuY.mjs → harness-DflvHAGV.mjs} +1 -1
  102. package/dist/index-9dISOTLT.d.mts +174 -0
  103. package/dist/{index-B9d_8_V2.d.mts → index-9g0agW_p.d.mts} +55 -55
  104. package/dist/{index-DScUb-hF.d.mts → index-BDr2Ba122.d.mts} +34 -11
  105. package/dist/{index-BcvG3wPv.d.mts → index-BKZAAWo2.d.mts} +185 -45
  106. package/dist/{index-CaerrEDH.d.mts → index-Bbr5LEUc.d.mts} +2 -2
  107. package/dist/{index-C23g_M_J2.d.mts → index-BmsPH78f2.d.mts} +50 -5
  108. package/dist/index-ButbwvVY.d.mts +1175 -0
  109. package/dist/index-BxuiHVFi.d.mts +284 -0
  110. package/dist/{index-DnnKUwHm.d.mts → index-C2C1qH1Y.d.mts} +38 -32
  111. package/dist/{index-ntS1EXlf.d.mts → index-C6LZOiDv.d.mts} +150 -2
  112. package/dist/{index-C9FCWOhp.d.mts → index-COC9jCdc.d.mts} +124 -22
  113. package/dist/{index-Cx1Bm6WD.d.mts → index-CVs0Qxks.d.mts} +8 -8
  114. package/dist/index-CagRgpXI2.d.mts +84 -0
  115. package/dist/{index-DoEF9LAc.d.mts → index-CtjLeK1F.d.mts} +3 -3
  116. package/dist/{index-DZPNuWMc.d.mts → index-Cx8jGKOs.d.mts} +4 -4
  117. package/dist/{index-h5go5Dtd.d.mts → index-D75FnT0B.d.mts} +1 -1
  118. package/dist/{index-FFVwQMad.d.mts → index-DNkR5yTY.d.mts} +3401 -594
  119. package/dist/{index-wq7XeqyG.d.mts → index-DXBiCH2y.d.mts} +27 -1
  120. package/dist/{index-B2DjrVb8.d.mts → index-DpZbaS7y.d.mts} +1194 -87
  121. package/dist/{index-BvTd61i5.d.mts → index-T96ydgVk.d.mts} +260 -160
  122. package/dist/{index-DLNRgZPo2.d.mts → index-j2YlW_Fc.d.mts} +1 -1
  123. package/dist/{index-PIlYSC73.d.mts → index-x2gFj3BK.d.mts} +41 -28
  124. package/dist/kernel/cli/index.d.mts +2 -2
  125. package/dist/kernel/cli/index.mjs +1 -1
  126. package/dist/kernel/cli/register.d.mts +1 -1
  127. package/dist/kernel/cli/register.mjs +1 -1
  128. package/dist/kernel/cli/schemas.mjs +1 -1
  129. package/dist/kernel/extension/index.d.mts +1 -1
  130. package/dist/kernel/extension/index.mjs +1 -1
  131. package/dist/kernel/index.d.mts +5 -5
  132. package/dist/kernel/index.mjs +1 -1
  133. package/dist/kernel/namespace/index.d.mts +1 -1
  134. package/dist/kernel/namespace/index.mjs +1 -1
  135. package/dist/kernel/observability/index.d.mts +1 -1
  136. package/dist/kernel/observability/index.mjs +1 -1
  137. package/dist/kernel/providers/index.d.mts +1 -1
  138. package/dist/kernel/providers/index.mjs +1 -1
  139. package/dist/kernel/window/index.d.mts +1 -1
  140. package/dist/kernel/window/index.mjs +1 -1
  141. package/dist/{lib-BOmKyjWD.mjs → lib-DIVnpS8e.mjs} +1 -1
  142. package/dist/{lib-DLZYp5z3.mjs → lib-DymjnkAP.mjs} +1 -1
  143. package/dist/{load-extensions-DNRIy4zC.d.mts → load-extensions-_EnedkUp.d.mts} +1 -1
  144. package/dist/{load-extensions-Cze1RHcG.mjs → load-extensions-nqL5WAKj.mjs} +1 -1
  145. package/dist/mcp-http-server/index.d.mts +27 -90
  146. package/dist/mcp-http-server/index.mjs +2 -2
  147. package/dist/model-uE5IyUFJ.mjs +1 -0
  148. package/dist/namespace-C05pkLbN.mjs +1 -0
  149. package/dist/{namespace-D9PLFmPQ.d.mts → namespace-CCZXyxSe.d.mts} +18 -18
  150. package/dist/namespace-D7pE2QWv.mjs +1 -0
  151. package/dist/{namespace-dFBD2ZmS.mjs → namespace-DwQtzlY-.mjs} +1 -1
  152. package/dist/namespace-HsI0Jbbr.mjs +1 -0
  153. package/dist/namespace-VmsT_tLJ.d.mts +3729 -0
  154. package/dist/namespace-Xp9-g_r-.mjs +1 -0
  155. package/dist/{native-session-supervisor-7ElwM6Is.mjs → native-session-supervisor-CdtVGWA9.mjs} +1 -1
  156. package/dist/node/bus-server/index.d.mts +1 -1
  157. package/dist/node/bus-server/index.mjs +1 -1
  158. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  159. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  160. package/dist/node/transports/index.d.mts +36 -1
  161. package/dist/node/transports/index.mjs +2 -2
  162. package/dist/{orchestrator-shared-ChygCvR1.mjs → orchestrator-shared-DAkGOu9H.mjs} +1 -1
  163. package/dist/{orchestrator-shared-DFLb1otg.d.mts → orchestrator-shared-pxtyNu3W.d.mts} +13 -6
  164. package/dist/package-BYpWkSuQ.mjs +1 -0
  165. package/dist/package-CsFFT9iR.mjs +7 -0
  166. package/dist/{package-DmVZxufT.d.mts → package-DG9GSY8M.d.mts} +52 -1
  167. package/dist/package.json +1 -1
  168. package/dist/{profile-BMBXUqqh.mjs → profile-D2m94ZYD.mjs} +1 -1
  169. package/dist/provider-context-BYkMl--1.mjs +1 -0
  170. package/dist/provider-context-DOsjOjiR.mjs +1 -0
  171. package/dist/{providers-namespace-5GoTlHXz.d.mts → providers-namespace-O4de1tgO.d.mts} +161 -14
  172. package/dist/resolved-O2XXjTeu.mjs +1 -0
  173. package/dist/rules/index.d.mts +1 -1
  174. package/dist/rules/index.mjs +1 -1
  175. package/dist/rules/schemas.d.mts +1 -1
  176. package/dist/runtime-bun/index.mjs +1 -1
  177. package/dist/runtime-node/client-binary-strategy-dependencies.d.mts +34 -0
  178. package/dist/runtime-node/client-binary-strategy-dependencies.mjs +1 -0
  179. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  180. package/dist/runtime-node/extension-validation.d.mts +1 -1
  181. package/dist/runtime-node/extension-validation.mjs +1 -1
  182. package/dist/runtime-node/index.d.mts +25 -84
  183. package/dist/runtime-node/index.mjs +24 -24
  184. package/dist/runtime-node/makaio-config.d.mts +1 -1
  185. package/dist/runtime-node/makaio-config.mjs +1 -1
  186. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  187. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  188. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  189. package/dist/{schema-7aKBGB7S.mjs → schema-BI0aCHvV.mjs} +1 -1
  190. package/dist/schemas-C-J4W1ID.mjs +1 -0
  191. package/dist/{schemas-Br-rSxPE2.d.mts → schemas-CoJCTFod2.d.mts} +8 -8
  192. package/dist/schemas-K3Td_WdR.d.mts +3175 -0
  193. package/dist/schemas-n9Ff6_RX.mjs +1 -0
  194. package/dist/schemas-th_nuC5t.mjs +1 -0
  195. package/dist/selection-YRuVSdck.mjs +1 -0
  196. package/dist/service-base/index.d.mts +4 -3
  197. package/dist/service-base/index.mjs +1 -1
  198. package/dist/services/adapter-runtime/index.d.mts +3 -3
  199. package/dist/services/adapter-runtime/index.mjs +1 -1
  200. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  201. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  202. package/dist/services/adapter-subsystem/index.d.mts +4 -3
  203. package/dist/services/adapter-subsystem/index.mjs +1 -1
  204. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  205. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  206. package/dist/services/agent-runtime/index.d.mts +2 -2
  207. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  208. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  209. package/dist/services/capability/index.d.mts +1 -1
  210. package/dist/services/capability/index.mjs +1 -1
  211. package/dist/services/codebase/index.d.mts +2 -2
  212. package/dist/services/codebase/namespace.d.mts +1 -1
  213. package/dist/services/codebase/schemas.d.mts +1 -1
  214. package/dist/services/compression/index.d.mts +2 -2
  215. package/dist/services/compression/namespace.d.mts +1 -1
  216. package/dist/services/compression/schemas.d.mts +1 -1
  217. package/dist/services/context-rules/index.d.mts +4 -4
  218. package/dist/services/context-rules/index.mjs +1 -1
  219. package/dist/services/definition/namespace.d.mts +1 -19
  220. package/dist/services/definition/schemas.d.mts +0 -9
  221. package/dist/services/definition/schemas.mjs +1 -1
  222. package/dist/services/execution-target/index.d.mts +4 -4
  223. package/dist/services/execution-target/index.mjs +1 -1
  224. package/dist/services/execution-target/namespace.d.mts +1 -1
  225. package/dist/services/execution-target/namespace.mjs +1 -1
  226. package/dist/services/execution-target/schemas.d.mts +1 -1
  227. package/dist/services/execution-target/schemas.mjs +1 -1
  228. package/dist/services/filesystem/index.d.mts +1 -1
  229. package/dist/services/filesystem/index.mjs +1 -1
  230. package/dist/services/git/namespace.mjs +1 -1
  231. package/dist/services/git/schemas.mjs +1 -1
  232. package/dist/services/harness/index.d.mts +6 -6
  233. package/dist/services/harness/index.mjs +1 -1
  234. package/dist/services/index.d.mts +1591 -173
  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.mjs +1 -1
  241. package/dist/services/log-import/schemas.mjs +1 -1
  242. package/dist/services/model-registry/index.d.mts +1 -1
  243. package/dist/services/model-registry/index.mjs +1 -1
  244. package/dist/services/preferences/index.d.mts +2 -2
  245. package/dist/services/preferences/schemas.d.mts +1 -1
  246. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  247. package/dist/services/provider-context/index.d.mts +2 -2
  248. package/dist/services/provider-context/index.mjs +1 -1
  249. package/dist/services/provider-runtime/index.d.mts +18 -0
  250. package/dist/services/provider-runtime/index.mjs +1 -1
  251. package/dist/services/session/handlers/index.d.mts +1 -1
  252. package/dist/services/session/handlers/index.mjs +1 -1
  253. package/dist/services/session/index.d.mts +10 -10
  254. package/dist/services/session/index.mjs +1 -1
  255. package/dist/services/session/messages/namespace.d.mts +1 -1
  256. package/dist/services/session/messages/namespace.mjs +1 -1
  257. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  258. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  259. package/dist/services/session/session-events/namespace.d.mts +1 -1
  260. package/dist/services/session/session-events/namespace.mjs +1 -1
  261. package/dist/services/session/storage/namespace.d.mts +1 -1
  262. package/dist/services/session/storage/schema.d.mts +1 -1
  263. package/dist/services/session/testing/index.d.mts +2 -2
  264. package/dist/services/session/testing/index.mjs +10 -10
  265. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  266. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  267. package/dist/services/session/turns/namespace.d.mts +1 -1
  268. package/dist/services/session/turns/namespace.mjs +1 -1
  269. package/dist/services/session-editor/index.d.mts +1 -1
  270. package/dist/services/session-editor/index.mjs +1 -1
  271. package/dist/services/settings/index.d.mts +3 -3
  272. package/dist/services/settings/index.mjs +1 -1
  273. package/dist/services/settings/namespace.d.mts +18 -25
  274. package/dist/services/settings/namespace.mjs +1 -1
  275. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  276. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  277. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  278. package/dist/services/settings/storage/index.d.mts +3 -3
  279. package/dist/services/settings/storage/index.mjs +1 -1
  280. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  281. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  282. package/dist/services/subagent/index.d.mts +2 -2
  283. package/dist/services/subagent/index.mjs +1 -1
  284. package/dist/services/subagent-template/index.d.mts +2 -2
  285. package/dist/services/subagent-template/namespace.d.mts +1 -1
  286. package/dist/services/subagent-template/schemas.d.mts +1 -1
  287. package/dist/services/tool-approval/index.d.mts +1 -1
  288. package/dist/services/tool-approval/index.mjs +1 -1
  289. package/dist/services/tools/index.d.mts +1 -1
  290. package/dist/services/tools/index.mjs +1 -1
  291. package/dist/services/tray-menu/index.d.mts +3 -3
  292. package/dist/services/tray-menu/index.mjs +1 -1
  293. package/dist/services/tray-menu/namespace.d.mts +1 -1
  294. package/dist/services/tray-menu/schemas.d.mts +1 -1
  295. package/dist/services/turn/index.d.mts +1 -1
  296. package/dist/services/turn/namespace.d.mts +1 -1
  297. package/dist/session-CAjudDuJ.mjs +76 -0
  298. package/dist/{session-DBfQkgdy.mjs → session-lRd8HZNZ.mjs} +1 -1
  299. package/dist/{shared-BVW-3Dhy.mjs → shared-RP_KARKF.mjs} +1 -1
  300. package/dist/{skill-N-ttlp1i.mjs → skill-CpNjWFuE.mjs} +1 -1
  301. package/dist/{src-Ck2sbaDa.mjs → src-Bo2eA51B.mjs} +1 -1
  302. package/dist/storage/drizzle/client.d.mts +1 -1
  303. package/dist/storage/drizzle/client.mjs +1 -1
  304. package/dist/storage/drizzle/index.d.mts +9 -2
  305. package/dist/storage/drizzle/index.mjs +1 -1
  306. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  307. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  308. package/dist/storage/handlers/index.d.mts +1 -1
  309. package/dist/storage/handlers/index.mjs +1 -1
  310. package/dist/{tool-approval-service-DEiMKTv9.mjs → tool-approval-service-Dh0XI21f.mjs} +1 -1
  311. package/dist/tools/index.d.mts +1 -1
  312. package/dist/tools-PC_L6g2m.mjs +1 -0
  313. package/dist/{transition-OzGXyy3p.d.mts → transition-CwUIm1hJ.d.mts} +10 -2
  314. package/dist/{types-BWduCvRU.d.mts → types-B-xY9WW2.d.mts} +1 -1
  315. package/dist/{types-CBLPaQXe.d.mts → types-BaDYigzD.d.mts} +486 -25
  316. package/dist/{types-BrUOVfwe.d.mts → types-DvKaEOOn.d.mts} +252 -19
  317. package/dist/ui-hooks/index.d.mts +103 -14
  318. package/dist/ui-hooks/index.mjs +1 -1
  319. package/dist/ui-kernel/index.d.mts +3 -3
  320. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  321. package/dist/utils/keychain.mjs +1 -1
  322. package/dist/{version-DoV_pSzT.mjs → version-C1-VD-XL.mjs} +1 -1
  323. package/dist/workflow-DFJYGjq_.mjs +1 -0
  324. package/dist/workflow-engine/index.d.mts +663 -60
  325. package/dist/workflow-engine/index.mjs +1 -1
  326. package/dist/workflow-engine/package.d.mts +1 -1
  327. package/dist/workflow-engine/package.mjs +1 -1
  328. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  329. package/dist/workflow-worker-BEFjCccX.mjs +1 -0
  330. package/package.json +13 -8
  331. package/dist/account-identity-C7Kx_ieU.mjs +0 -1
  332. package/dist/cleanEnvForAdapter-BooAgM2R.mjs +0 -1
  333. package/dist/client-DaR4mzqn.mjs +0 -1
  334. package/dist/compression-C5JAWdgZ.mjs +0 -1
  335. package/dist/config-namespace-CY9leBnE.mjs +0 -1
  336. package/dist/credential-ref-YWQQENEo.mjs +0 -1
  337. package/dist/definition-C-GVz7uw.mjs +0 -1
  338. package/dist/execution-target-BR8bLkCR.mjs +0 -1
  339. package/dist/extension-BS_4BOeO.mjs +0 -1
  340. package/dist/handlers-B74FvKlA.mjs +0 -57
  341. package/dist/index-BcwOnvUh.d.mts +0 -749
  342. package/dist/index-D6aAzr32.d.mts +0 -997
  343. package/dist/index-DtwGhFFQ.d.mts +0 -40
  344. package/dist/loop-gate-handlers-o2B5FPdF.mjs +0 -1
  345. package/dist/namespace-B4cV_pk3.d.mts +0 -1317
  346. package/dist/namespace-BO3tODGC.mjs +0 -1
  347. package/dist/namespace-CVMZVqB5.mjs +0 -1
  348. package/dist/namespace-DBHwyhME.mjs +0 -1
  349. package/dist/namespace-DibbhCPP.mjs +0 -1
  350. package/dist/package-CF_Zm2v4.mjs +0 -1
  351. package/dist/package-Co_GO3UD.mjs +0 -7
  352. package/dist/provider-context-CqMgPOWF.mjs +0 -1
  353. package/dist/provider-context-DC_eq7es.mjs +0 -1
  354. package/dist/schemas-CVo8qAK-.mjs +0 -1
  355. package/dist/schemas-CuG17U3L.mjs +0 -1
  356. package/dist/session-CX6QDhi2.mjs +0 -76
  357. package/dist/tools-CGFZkB7F.mjs +0 -1
  358. package/dist/workflow-C3dgVwTY.mjs +0 -1
  359. package/dist/workflow-worker-dH70EbjE.mjs +0 -1
  360. /package/dist/{ajv-B5dPIck0.mjs → ajv-DfHhgdS5.mjs} +0 -0
  361. /package/dist/{await-trigger-DwVldnMt.mjs → await-trigger-DP-fTQc4.mjs} +0 -0
  362. /package/dist/{capability-service-XlymTzz1.mjs → capability-service-Dg2bU8qc.mjs} +0 -0
  363. /package/dist/{client-CebV_fZc.d.mts → client-DmJwprw1.d.mts} +0 -0
  364. /package/dist/{create-static-mount-DkK28kKW.mjs → create-static-mount-CBTXRtbN.mjs} +0 -0
  365. /package/dist/{cross-spawn-CDXy3BjE.mjs → cross-spawn-D9WWFl2a.mjs} +0 -0
  366. /package/dist/{cursor-storage-luQAg7E_.mjs → cursor-storage-Bw-7ROzx.mjs} +0 -0
  367. /package/dist/{descriptor-to-package-DdpjpT7n.mjs → descriptor-to-package-Rs-OjOQU.mjs} +0 -0
  368. /package/dist/{drizzle-DVTAl7Us.mjs → drizzle-DYfaDzlO.mjs} +0 -0
  369. /package/dist/{esm-CQG9Pc7n.mjs → esm-C_WW4-pP.mjs} +0 -0
  370. /package/dist/{event-DguYjV6D.mjs → event-DTM0-qWP.mjs} +0 -0
  371. /package/dist/{extension-discovery-CIZn5bkq.d.mts → extension-discovery-APMf1Tes.d.mts} +0 -0
  372. /package/dist/{extension-namespace-v3K0qVry.mjs → extension-namespace-vrh4ERXR.mjs} +0 -0
  373. /package/dist/{facet-BM4y4aQP.mjs → facet-DqPBpqkl.mjs} +0 -0
  374. /package/dist/{filesystem-service-Cwp0sWNc.d.mts → filesystem-service-Bx0bR2Lb.d.mts} +0 -0
  375. /package/dist/{handler-BFNvtv5t.mjs → handler-4pKQi3eo.mjs} +0 -0
  376. /package/dist/{host-vY07gek-.mjs → host-BfgdjlII.mjs} +0 -0
  377. /package/dist/{identity-DC3Pk0ps.mjs → identity-2qUT1NME.mjs} +0 -0
  378. /package/dist/{index-COI1tjAf.d.mts → index-BZ_DSGnE.d.mts} +0 -0
  379. /package/dist/{index-D7rWAEY0.d.mts → index-Bd52mmj9.d.mts} +0 -0
  380. /package/dist/{index-Dfi8Rorw.d.mts → index-BkAKfh4d.d.mts} +0 -0
  381. /package/dist/{index-CuHqL95P.d.mts → index-Bv9lm0Kf.d.mts} +0 -0
  382. /package/dist/{index-C4nStEdA.d.mts → index-C18Pn3zP.d.mts} +0 -0
  383. /package/dist/{index-Cr9lh21j.d.mts → index-CarbJsC92.d.mts} +0 -0
  384. /package/dist/{index-BjoOSg95.d.mts → index-Ctw617Tj.d.mts} +0 -0
  385. /package/dist/{index-DUD7wikz2.d.mts → index-D0eUQjTU2.d.mts} +0 -0
  386. /package/dist/{index-O08Q2ikz.d.mts → index-DHGW7dFf.d.mts} +0 -0
  387. /package/dist/{index-DEzdNQum.d.mts → index-DfVSWBBp.d.mts} +0 -0
  388. /package/dist/{index-WHUV7neB.d.mts → index-DlAfs3RD.d.mts} +0 -0
  389. /package/dist/{index-D3ahzHwb.d.mts → index-DnWZdG6C.d.mts} +0 -0
  390. /package/dist/{index-CpKikwK4.d.mts → index-DoLdETfR.d.mts} +0 -0
  391. /package/dist/{index-B92mToDo2.d.mts → index-DvaPrL6C.d.mts} +0 -0
  392. /package/dist/{index-D7Hkmrr3.d.mts → index-DwDBa2mb.d.mts} +0 -0
  393. /package/dist/{index-Y8rMeYYX.d.mts → index-FDyqQIt5.d.mts} +0 -0
  394. /package/dist/{index-BWIkf5oJ.d.mts → index-Lp0T_V1W.d.mts} +0 -0
  395. /package/dist/{index-OGIC4puQ.d.mts → index-Rhcr4YNA.d.mts} +0 -0
  396. /package/dist/{index-BvLXySoB2.d.mts → index-S-mAqWwq.d.mts} +0 -0
  397. /package/dist/{index-DOOrKin9.d.mts → index-_zsihEmk.d.mts} +0 -0
  398. /package/dist/{json-value-DtIkQN7g.d.mts → json-value-C8duSh9X.d.mts} +0 -0
  399. /package/dist/{jsonl-transport-CGPgD8iU.mjs → jsonl-transport-l5NPcQ_2.mjs} +0 -0
  400. /package/dist/{lib-ZKtnbCqH.mjs → lib-ClRTNIuz.mjs} +0 -0
  401. /package/dist/{materialization-CUYxZCfk.mjs → materialization-BwTORtBr.mjs} +0 -0
  402. /package/dist/{model-registry-C2VXobZj.mjs → model-registry-BneK5SGo.mjs} +0 -0
  403. /package/dist/{model-registry-rYICIwyR.mjs → model-registry-C8MInDtX.mjs} +0 -0
  404. /package/dist/{namespace-65uwTpbg.d.mts → namespace-3YVLQ_bM.d.mts} +0 -0
  405. /package/dist/{namespace-BGIeqwfU.d.mts → namespace-B0uZIZYT.d.mts} +0 -0
  406. /package/dist/{namespace-CQ8uza7o.d.mts → namespace-BcDHt-ww.d.mts} +0 -0
  407. /package/dist/{namespace-BigVYQyx.d.mts → namespace-BhVlHfoO.d.mts} +0 -0
  408. /package/dist/{namespace-j7vFsmYL.d.mts → namespace-Bl1UhLnK.d.mts} +0 -0
  409. /package/dist/{namespace-CfvtDD_U.d.mts → namespace-BoA6u44C.d.mts} +0 -0
  410. /package/dist/{namespace-Dk4OslmY.d.mts → namespace-BsEoWXV_.d.mts} +0 -0
  411. /package/dist/{namespace-DYSFDC2G.mjs → namespace-C238RqwB.mjs} +0 -0
  412. /package/dist/{namespace-BdO4e1Fm.mjs → namespace-CDO4rY11.mjs} +0 -0
  413. /package/dist/{namespace-CZK2ff3B.d.mts → namespace-CukqFYHf2.d.mts} +0 -0
  414. /package/dist/{namespace-wke7juzy.mjs → namespace-DDx4NVJm.mjs} +0 -0
  415. /package/dist/{namespace-D1_9WVCo.d.mts → namespace-Dar3O6iT.d.mts} +0 -0
  416. /package/dist/{namespace-DAj_riOn.d.mts → namespace-DoNigVgx.d.mts} +0 -0
  417. /package/dist/{namespace-D2s-4pyg.d.mts → namespace-Dvi66QS6.d.mts} +0 -0
  418. /package/dist/{namespace-D8P8Sxce2.d.mts → namespace-rO-C2Dgu2.d.mts} +0 -0
  419. /package/dist/{out-BoEZjBNz.mjs → out-BB6Kb4Xu.mjs} +0 -0
  420. /package/dist/{platform-DnbSvm2u.mjs → platform-CWhGFQFX.mjs} +0 -0
  421. /package/dist/{providers-Bd7BOZs0.mjs → providers-CUnrif24.mjs} +0 -0
  422. /package/dist/{quick-lru-6e7I1Bgf.mjs → quick-lru-BLaSzINB.mjs} +0 -0
  423. /package/dist/{registry-U_3aYSin.mjs → registry-TJjQgTgp.mjs} +0 -0
  424. /package/dist/{schema-B5vHi7Uu.d.mts → schema-aOwmHxaF.d.mts} +0 -0
  425. /package/dist/{schema-CHp6I33k.mjs → schema-cus0dJ81.mjs} +0 -0
  426. /package/dist/{schema-introspection-B7xODt4I.mjs → schema-introspection-BsWLmoFp.mjs} +0 -0
  427. /package/dist/{schemas-KlH1hB7u.d.mts → schemas-9QJf1FtS.d.mts} +0 -0
  428. /package/dist/{schemas-CJ2JvA7d.d.mts → schemas-BolSW7pQ.d.mts} +0 -0
  429. /package/dist/{schemas-D4zaFE2p.d.mts → schemas-CLsbsX1W.d.mts} +0 -0
  430. /package/dist/{schemas-XeIBqwvE.mjs → schemas-CMyv7l7-.mjs} +0 -0
  431. /package/dist/{schemas-CPI00yvh.mjs → schemas-CWxf_Yut.mjs} +0 -0
  432. /package/dist/{schemas-BemsLc_V.d.mts → schemas-D_9X_CRo.d.mts} +0 -0
  433. /package/dist/{schemas-DZGnr9Tl.mjs → schemas-DwfTUQIa.mjs} +0 -0
  434. /package/dist/{schemas-CoFCV42v.d.mts → schemas-OaBqeEUT.d.mts} +0 -0
  435. /package/dist/{schemas-B6tEKf9T.d.mts → schemas-XRhqOgVE.d.mts} +0 -0
  436. /package/dist/{schemas-DKncXGnb.d.mts → schemas-fRLDhefF.d.mts} +0 -0
  437. /package/dist/{schemas-DWfo0wp4.d.mts → schemas-jDRSOXJL.d.mts} +0 -0
  438. /package/dist/{schemas-lnE9YoG7.d.mts → schemas-qpo1Goit.d.mts} +0 -0
  439. /package/dist/{schemas-t6h9oSct.d.mts → schemas-qt5QTjVc.d.mts} +0 -0
  440. /package/dist/{semver-CIhHqMkw.mjs → semver-BccS1s9R.mjs} +0 -0
  441. /package/dist/{server-lifecycle-C5Z5PSMD.mjs → server-lifecycle-D-jxVr_0.mjs} +0 -0
  442. /package/dist/{server-lifecycle-_AA6EfzL.d.mts → server-lifecycle-r5Tkk8bU.d.mts} +0 -0
  443. /package/dist/{session-lineage-C1M7-O3C.d.mts → session-lineage-YShrn77v.d.mts} +0 -0
  444. /package/dist/{shared-schemas-BEVG96xW.mjs → shared-schemas-BNCPgGYP.mjs} +0 -0
  445. /package/dist/{src-_VODAJnf.mjs → src-Ci_WY9uw.mjs} +0 -0
  446. /package/dist/{storage-namespace-D5q9CrBp.mjs → storage-namespace-BzE2M4Hq.mjs} +0 -0
  447. /package/dist/{storage-namespace-Di1A3DMm.d.mts → storage-namespace-DWKFqEW-.d.mts} +0 -0
  448. /package/dist/{storage-namespace-definition-CzXPW45M.mjs → storage-namespace-definition-4UYuij1r.mjs} +0 -0
  449. /package/dist/{storage-namespace-definition-BffdI5Bz.d.mts → storage-namespace-definition-BZJGSaX3.d.mts} +0 -0
  450. /package/dist/{supports-color-DcXkvGDF.mjs → supports-color-Dzp6WuF5.mjs} +0 -0
  451. /package/dist/{telemetry-Cvi4rxiE.mjs → telemetry-B42EMbZt.mjs} +0 -0
  452. /package/dist/{timeout-XsYIOKrc.mjs → timeout-CvONPl0l.mjs} +0 -0
  453. /package/dist/{tray-menu-service-B2AxiQqL.mjs → tray-menu-service-Bonl2KXf.mjs} +0 -0
  454. /package/dist/{types-Bo78h9e3.d.mts → types-BCW9kr4L.d.mts} +0 -0
  455. /package/dist/{types-DCvp_swt.d.mts → types-CrJ7KEZ0.d.mts} +0 -0
  456. /package/dist/{types-BNW5n6qm.d.mts → types-DWNoZ3Sd.d.mts} +0 -0
  457. /package/dist/{ui-config-9bDRwFZr.mjs → ui-config-B2L3Xgqo.mjs} +0 -0
  458. /package/dist/{variant-5huHjUTm.mjs → variant-ByI-RZua.mjs} +0 -0
  459. /package/dist/{window-registry-PkrFIwX2.mjs → window-registry-DsWnCc8z.mjs} +0 -0
  460. /package/dist/{window-registry-ofIUQnfo.d.mts → window-registry-WsWu-rcK.d.mts} +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./visibility-Cb62p9bv.mjs";import{i as t,l as n,r,t as i}from"./compression-C5JAWdgZ.mjs";import{t as a}from"./schemas-XeIBqwvE.mjs";import{o}from"./schemas-CuG17U3L.mjs";import{z as s}from"zod";import{createBusNamespace as c}from"@makaio/framework/core";const l=[`empty`,`empty-model`,`empty-routing`,`empty-segment`,`too-many-segments`,`invalid-segment`,`invalid-virtual-name`,`empty-virtual-name`],u=s.enum(l),d=s.object({kind:s.literal(`parse-error`),code:u,message:s.string(),input:s.string()}),f=s.object({kind:s.literal(`bare`),model:s.string()}),p=s.object({kind:s.literal(`qualified`),segment1:s.string(),segment2:s.string().optional(),model:s.string()}),m=s.object({kind:s.literal(`virtual`),name:s.string()}),h=s.discriminatedUnion(`kind`,[f,p,m]),g=s.discriminatedUnion(`kind`,[f,p]),_=s.discriminatedUnion(`kind`,[f,p,m,d]),v=/^[a-z0-9][a-z0-9._-]*$/,y=/^[a-z0-9][a-z0-9_-]*$/;function b(e,t,n){return{kind:`parse-error`,code:e,message:t,input:n}}function x(e){let t=e.trim();if(t.length===0)return b(`empty`,`Canonical model string must not be empty.`,e);if(t.startsWith(`~`)){let n=t.slice(1);return n.length===0?b(`empty-virtual-name`,`Virtual model reference '~' must be followed by a name.`,e):y.test(n)?{kind:`virtual`,name:n}:b(`invalid-virtual-name`,`Invalid virtual model name '${n}': must match [a-z0-9][a-z0-9_-]*.`,e)}let n=t.indexOf(`::`);if(n===-1)return{kind:`bare`,model:t};let r=t.slice(0,n),i=t.slice(n+2);if(r.length===0)return b(`empty-routing`,`Canonical model string must have a routing segment before '::'.`,e);if(i.length===0)return b(`empty-model`,`Canonical model string must have a model name after '::'.`,e);let a=r.toLowerCase().split(`/`);for(let t of a)if(t.length===0)return b(`empty-segment`,`Routing segment must not be empty - check for consecutive '/' characters.`,e);if(a.length>2)return b(`too-many-segments`,`Routing part '${r}' has ${a.length} segments; at most 2 are allowed.`,e);for(let t of a)if(!v.test(t))return b(`invalid-segment`,`Routing segment '${t}' is invalid: must match [a-z0-9][a-z0-9._-]*.`,e);return{kind:`qualified`,segment1:a[0],segment2:a.length>1?a[1]:void 0,model:i}}function S(e){return e.kind===`parse-error`}const C=s.object({adapterName:s.string(),providerConfigId:s.string().optional(),model:s.string().optional(),systemPrompt:s.string().optional(),contextMode:o,compressionMode:i,allowedTools:s.array(s.string()).optional(),disallowedTools:s.array(s.string()).optional(),allowedDirectories:s.array(s.string()).optional(),reasoningEffort:e.optional(),approvalPolicy:a.optional(),harnessId:s.string().optional(),profileId:s.string().optional(),mcpConfig:n.optional()}),w=s.object({sessionId:s.string().optional(),projectId:s.string().optional(),promptText:s.string().optional(),sessionContext:s.unknown().optional()}),T=c(`agentResolution`,{resolve:{request:s.object({selection:t,context:w.optional()}),response:C}}),E=T.subjects,D=r.safeExtend({kind:s.literal(`adapter`),adapterName:s.string(),providerConfigId:s.string(),model:s.string()}),O={resolve:{request:s.object({parsed:g,context:w.optional()}),response:D}},k=c(`canonicalModel`,O),A=k.subjects;export{h as _,T as a,m as b,v as c,x as d,f,_ as g,d as h,O as i,y as l,u as m,A as n,E as o,l as p,D as r,C as s,k as t,S as u,p as v,g as y};
1
+ import{a as e}from"./visibility-Cb62p9bv.mjs";import{i as t,l as n,r,t as i}from"./compression-CZ_6fYq8.mjs";import{t as a}from"./schemas-CMyv7l7-.mjs";import{o}from"./schemas-th_nuC5t.mjs";import{z as s}from"zod";import{createBusNamespace as c}from"@makaio/framework/core";const l=[`empty`,`empty-model`,`empty-routing`,`empty-segment`,`too-many-segments`,`invalid-segment`,`invalid-virtual-name`,`empty-virtual-name`],u=s.enum(l),d=s.object({kind:s.literal(`parse-error`),code:u,message:s.string(),input:s.string()}),f=s.object({kind:s.literal(`bare`),model:s.string()}),p=s.object({kind:s.literal(`qualified`),segment1:s.string(),segment2:s.string().optional(),model:s.string()}),m=s.object({kind:s.literal(`virtual`),name:s.string()}),h=s.discriminatedUnion(`kind`,[f,p,m]),g=s.discriminatedUnion(`kind`,[f,p]),_=s.discriminatedUnion(`kind`,[f,p,m,d]),v=/^[a-z0-9][a-z0-9._-]*$/,y=/^[a-z0-9][a-z0-9_-]*$/;function b(e,t,n){return{kind:`parse-error`,code:e,message:t,input:n}}function x(e){let t=e.trim();if(t.length===0)return b(`empty`,`Canonical model string must not be empty.`,e);if(t.startsWith(`~`)){let n=t.slice(1);return n.length===0?b(`empty-virtual-name`,`Virtual model reference '~' must be followed by a name.`,e):y.test(n)?{kind:`virtual`,name:n}:b(`invalid-virtual-name`,`Invalid virtual model name '${n}': must match [a-z0-9][a-z0-9_-]*.`,e)}let n=t.indexOf(`::`);if(n===-1)return{kind:`bare`,model:t};let r=t.slice(0,n),i=t.slice(n+2);if(r.length===0)return b(`empty-routing`,`Canonical model string must have a routing segment before '::'.`,e);if(i.length===0)return b(`empty-model`,`Canonical model string must have a model name after '::'.`,e);let a=r.toLowerCase().split(`/`);for(let t of a)if(t.length===0)return b(`empty-segment`,`Routing segment must not be empty - check for consecutive '/' characters.`,e);if(a.length>2)return b(`too-many-segments`,`Routing part '${r}' has ${a.length} segments; at most 2 are allowed.`,e);for(let t of a)if(!v.test(t))return b(`invalid-segment`,`Routing segment '${t}' is invalid: must match [a-z0-9][a-z0-9._-]*.`,e);return{kind:`qualified`,segment1:a[0],segment2:a.length>1?a[1]:void 0,model:i}}function S(e){return e.kind===`parse-error`}const C=s.object({adapterName:s.string(),providerConfigId:s.string().optional(),model:s.string().optional(),systemPrompt:s.string().optional(),contextMode:o,compressionMode:i,allowedTools:s.array(s.string()).optional(),disallowedTools:s.array(s.string()).optional(),allowedDirectories:s.array(s.string()).optional(),reasoningEffort:e.optional(),approvalPolicy:a.optional(),harnessId:s.string().optional(),profileId:s.string().optional(),mcpConfig:n.optional()}),w=s.object({sessionId:s.string().optional(),projectId:s.string().optional(),promptText:s.string().optional(),sessionContext:s.unknown().optional()}),T=c(`agentResolution`,{resolve:{request:s.object({selection:t,context:w.optional()}),response:C}}),E=T.subjects,D=r.safeExtend({kind:s.literal(`adapter`),adapterName:s.string(),providerConfigId:s.string(),model:s.string()}),O={resolve:{request:s.object({parsed:g,context:w.optional()}),response:D}},k=c(`canonicalModel`,O),A=k.subjects;export{h as _,T as a,m as b,v as c,x as d,f,_ as g,d as h,O as i,y as l,u as m,A as n,E as o,l as p,D as r,C as s,k as t,S as u,p as v,g as y};
@@ -0,0 +1 @@
1
+ import{o as e,s as t}from"./definitions-C1pgx0Nq.mjs";import{t as n}from"./schemas-CMyv7l7-.mjs";import{_ as r,a as i,g as a,h as o,m as s,n as ee,o as te}from"./profile-D2m94ZYD.mjs";import{n as ne,t as c}from"./version-C1-VD-XL.mjs";import{c as re,d as ie,n as ae,o as oe,s as se,t as l,u as ce}from"./account-identity-BYfeWLe-.mjs";import{z as u}from"zod";import{createBusNamespace as le,observability as d}from"@makaio/framework/core";const f=u.object({tag:u.string(),description:u.string().optional()}),p=u.object({name:u.string(),friendlyName:u.string(),description:u.string().optional(),category:u.string().optional(),capabilities:u.array(f).default([])}),m=u.object({id:u.string(),name:u.string(),description:u.string().optional(),glob:u.string().optional()}),h=u.object({name:u.string().min(1),frameworkSubject:u.string().min(1).optional(),mode:u.enum([`event`,`request`]).default(`event`)}),g=u.object({envVar:a.regex(/^[A-Za-z_][A-Za-z0-9_]*$/,{message:`envVar must be a valid environment variable name (letters, digits, underscores)`}),defaultPath:a.refine(e=>e===`~`||e.startsWith(`~/`)||r(e),{message:`defaultPath must be absolute, '~', or start with '~/'`}),pathKind:u.enum([`directory`,`file`]).default(`directory`)});function ue(e){if(!e.startsWith(`@`))return!e.includes(`@`);let t=e.indexOf(`/`);return t>1&&!e.slice(t+1).includes(`@`)}const _=u.object({type:u.literal(`npm`),package:u.string().min(1).refine(ue,{message:"package must not include an inline `@version` suffix; use the version field instead"}),version:c}),v=u.object({type:u.literal(`signed-binary-bucket`),version:c,config:u.object({baseUrl:u.string().url(),manifestPathTemplate:u.string().min(1),manifestSignaturePathTemplate:u.string().min(1),publicKeyUrl:u.string().url(),publicKeyFingerprint:u.string().min(1),binaryPathTemplate:u.string().min(1),platforms:u.record(u.string().min(1),u.string().min(1))})}),y=u.discriminatedUnion(`type`,[_,v]),b=u.object({executable:u.union([u.string().min(1),u.object({default:u.string().min(1),darwin:u.string().min(1).optional(),linux:u.string().min(1).optional(),win32:u.string().min(1).optional()}).strict()]),args:u.array(u.string()).default([])}).strict(),x=u.object({kind:u.string().min(1),payload:u.record(u.string(),u.unknown()).optional()}),S=u.object({supportsHooks:u.boolean().default(!1),supportsStatusline:u.boolean().default(!1),supportsSupervisorLaunch:u.boolean().default(!1),supportsManagedBinary:u.boolean().default(!1),hookEvents:u.array(h).default([])}).refine(e=>e.supportsHooks||e.hookEvents.length===0,{message:`hookEvents must be empty when supportsHooks is false`,path:[`hookEvents`]}),C=u.object({name:u.string().min(1),supportedVersions:ne}).strict(),w=u.object({id:u.string(),name:u.string(),version:c,description:u.string().optional(),binary:C.optional(),nativeTools:u.array(p).default([]),defaultApprovalPolicy:n,logSources:u.array(m).optional(),authMethods:e,defaultAuth:t.optional(),runtimeCapabilities:S.optional().transform(e=>S.parse(e??{})),managedInstall:y.optional(),versionCommand:b.optional(),postInstall:x.optional(),configIsolation:g.optional()}).strict().refine(e=>!e.runtimeCapabilities.supportsManagedBinary||e.managedInstall!==void 0,{message:`managedInstall is required when runtimeCapabilities.supportsManagedBinary is true`,path:[`managedInstall`]}).refine(e=>e.managedInstall===void 0||e.runtimeCapabilities.supportsManagedBinary,{message:`runtimeCapabilities.supportsManagedBinary must be true when managedInstall is provided`,path:[`runtimeCapabilities`,`supportsManagedBinary`]}).refine(e=>e.managedInstall===void 0||e.versionCommand!==void 0,{message:`versionCommand is required when managedInstall is provided`,path:[`versionCommand`]}).superRefine((e,t)=>{e.defaultAuth!==void 0&&e.authMethods.find(({id:t})=>t===e.defaultAuth?.methodId)?.mode!==`inferred`&&t.addIssue({code:u.ZodIssueCode.custom,message:`defaultAuth.methodId must reference an inferred method declared by this client.`,path:[`defaultAuth`,`methodId`]})}).superRefine((e,t)=>{if(e.managedInstall===void 0||e.versionCommand===void 0)return;let{executable:n}=e.versionCommand,r=typeof n==`string`?[{path:n,issuePath:[`versionCommand`,`executable`]}]:[{path:n.default,issuePath:[`versionCommand`,`executable`,`default`]},...n.darwin===void 0?[]:[{path:n.darwin,issuePath:[`versionCommand`,`executable`,`darwin`]}],...n.linux===void 0?[]:[{path:n.linux,issuePath:[`versionCommand`,`executable`,`linux`]}],...n.win32===void 0?[]:[{path:n.win32,issuePath:[`versionCommand`,`executable`,`win32`]}]];for(let{path:e,issuePath:n}of r){let r=e.startsWith(`/`),i=/^[A-Za-z]:/.test(e),a=e.startsWith(`\\`);if(r||i||a){t.addIssue({code:u.ZodIssueCode.custom,path:n,message:`${n.join(`.`)} must be a relative path within the install directory`});continue}e.split(/[/\\]/).some(e=>e===`..`)&&t.addIssue({code:u.ZodIssueCode.custom,path:n,message:`${n.join(`.`)} must be a relative path within the install directory`})}}),T=u.object({binaryPath:s.nullable(),env:u.record(u.string(),u.string()),configDir:s.nullable(),source:u.enum([`managed`,`global`]),version:a.nullable()}),E={request:u.object({clientId:a,sessionId:a.optional(),projectDir:s.optional(),preferSource:u.enum([`managed`,`global`]).optional(),harnessId:a.optional()}),response:T},D=u.enum([`npm`,`signed-binary-bucket`]),O=u.object({version:a,installPath:s,installedAt:o,isActive:u.boolean()}),k=u.object({clientId:a,installedVersions:u.array(O),activeVersion:a.nullable(),pinnedVersion:c,updateAvailable:u.boolean()}).strict(),A={request:u.object({forceRefresh:u.boolean().optional()}),response:u.object({clients:u.array(k)})},j={request:u.object({clientId:a,version:c.optional()}),response:u.object({jobId:a,requestedVersion:c.nullable(),resolvedVersion:c.nullable()})},de={request:u.object({clientId:a,version:a}),response:u.object({clientId:a,removedVersion:a,activeVersion:a.nullable()})},M={request:u.object({clientId:a}),response:u.object({jobId:a,resolvedVersion:c.nullable()})},N={request:u.object({clientId:a,version:a}),response:u.object({clientId:a,activeVersion:a})},P=u.enum([`resolving`,`downloading`,`verifying`,`extracting`,`installing`,`post-install`,`activating`]),F=u.object({jobId:a,clientId:a,version:a.optional(),strategy:D,stage:P,progress:u.number().min(0).max(100).nullable(),installPath:s.optional(),activeAfterCompletion:u.boolean().optional(),metadata:u.record(u.string(),u.unknown()).optional()}),I=u.object({message:u.string(),code:u.string().optional()}),L=u.object({jobId:a,clientId:a,version:a.optional(),strategy:D,status:u.enum([`success`,`error`]),installPath:s.optional(),activeVersion:a.nullable(),error:I.optional(),metadata:u.record(u.string(),u.unknown()).optional()}),R=u.object({clientId:a,previousActiveVersion:a.nullable(),activeVersion:a.nullable(),reason:u.enum([`install`,`update`,`set-active`,`uninstall`])}),z=u.enum([`supervisor`,`adapter`,`client-hook`,`statusline`,`cli-wrapper`]),B=u.object({layer:z,producer:a}),V=u.object({supervisorSessionId:a.optional(),pid:u.number().int().positive().optional(),parentPid:u.number().int().positive().optional(),adapterSessionId:a.optional(),sessionId:a.optional(),cwd:u.string().optional(),argv:u.array(u.string()).optional(),metadata:u.record(u.string(),u.unknown()).optional()}),H={request:u.object({clientId:a,source:B,observedAt:o}).merge(V).refine(e=>e.supervisorSessionId!==void 0||e.pid!==void 0||e.adapterSessionId!==void 0,{message:`At least one hard-evidence field is required (supervisorSessionId, pid, or adapterSessionId)`}),response:u.object({clientRuntimeId:a,created:u.boolean(),promoted:u.boolean()})},U=V.extend({clientRuntimeId:a,clientId:a,status:u.enum([`observed`,`started`]),source:B,observedAt:o}),W={request:u.object({adapterSessionId:a,clientId:a}),response:u.object({managed:u.boolean()})},G=u.object({clientId:d.attribute(a,`makaio.client.id`),source:d.attribute(a,`makaio.client.lifecycle.source`),observedAt:d.attribute(o,`event.observed_at`),sessionId:d.attribute(u.string(),`makaio.session.id`).optional(),adapterSessionId:d.attribute(u.string(),`makaio.adapter.session_id`).optional(),metadata:u.record(u.string(),u.unknown()).optional()}),K=[`fresh`,`fork`,`resume`,`clear`,`compact`],q=u.enum(K),J=G.extend({transcriptPath:u.string().optional(),cwd:u.string().optional(),machineId:d.attribute(u.string(),`makaio.machine.id`).optional(),startMode:d.attribute(q,`makaio.session.start_mode`).optional(),parentAdapterSessionId:d.attribute(u.string(),`makaio.session.parent_adapter_session_id`).optional()}),Y=G.extend({prompt:a.optional()}),X=G.extend({}),fe=G.extend({transcriptPath:u.string().optional()}),pe=G.extend({toolName:d.attribute(a,`tool.name`).optional(),toolCallId:d.attribute(a,`tool.call_id`).optional()}),me=G.extend({toolName:d.attribute(a,`tool.name`).optional(),toolCallId:d.attribute(a,`tool.call_id`).optional(),success:d.attribute(u.boolean(),`tool.success`).optional()}),he=u.object({group:a,name:a,installed:u.boolean(),command:a}),Z=u.enum([`provider-reported`,`client-reported`,`estimated`]),Q=u.number().finite().nonnegative(),ge=u.number().finite().min(0).max(100),_e=u.object({clientId:d.attribute(a,`makaio.client.id`),clientAccountId:d.attribute(a,`makaio.client.account_id`).optional(),sessionId:d.attribute(a,`makaio.session.id`).optional(),adapterSessionId:d.attribute(a,`makaio.adapter.session_id`).optional(),source:d.attribute(a,`makaio.client.usage.source`),observedAt:d.attribute(o,`event.observed_at`),clientVersion:d.attribute(a,`makaio.client.version`).optional(),modelId:d.attribute(a,`llm.model`).optional(),modelDisplayName:d.attribute(a,`llm.model.display_name`).optional(),modelFamily:d.attribute(a,`llm.model.family`).optional(),latestRequestInputTokens:d.attribute(Q,`llm.tokens.latest_request.input`).optional(),latestRequestOutputTokens:d.attribute(Q,`llm.tokens.latest_request.output`).optional(),latestRequestCacheReadTokens:d.attribute(Q,`llm.tokens.latest_request.cache_read`).optional(),latestRequestCacheWriteTokens:d.attribute(Q,`llm.tokens.latest_request.cache_write`).optional(),currentContextInputTokens:d.attribute(Q,`llm.context.tokens.input`).optional(),currentContextOutputTokens:d.attribute(Q,`llm.context.tokens.output`).optional(),contextWindowSizeTokens:d.attribute(Q,`llm.context.window_size`).optional(),contextUsedPercentage:d.attribute(ge,`llm.context.used_percentage`).optional(),contextRemainingPercentage:d.attribute(ge,`llm.context.remaining_percentage`).optional(),contextThresholdExceeded:d.attribute(u.boolean(),`llm.context.threshold_exceeded`).optional(),totalCost:d.attribute(Q,`llm.cost.total`).optional(),costCurrency:d.attribute(a,`llm.cost.currency`).optional(),costProvenance:d.attribute(Z,`llm.cost.provenance`).optional(),totalDurationMs:d.attribute(Q,`makaio.session.duration_ms`).optional(),totalApiDurationMs:d.attribute(Q,`llm.duration.total_api_ms`).optional(),totalLinesAdded:d.attribute(Q,`code.lines_added`).optional(),totalLinesRemoved:d.attribute(Q,`code.lines_removed`).optional(),totalEdits:d.attribute(Q,`code.edits`).optional()}).strict().superRefine((e,t)=>{let n=[`totalCost`,`costCurrency`,`costProvenance`],r=n.filter(t=>e[t]!==void 0).length;if(!(r===0||r===n.length))for(let r of n)e[r]===void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:[r],message:`totalCost, costCurrency, and costProvenance must be supplied together`})}),ve={"runtime.observe":H,"runtime.started":U,"runtime.isAdapterManaged":W,scan:{request:u.object({targets:u.array(se).optional()}),response:u.object({results:u.array(oe)})},"session.account.observe":re,"account.observe":ae,"account.activate":{request:u.object({clientId:a,clientAccountId:a,identifiers:u.array(l).min(1),displayLabel:u.string().optional()}),response:u.object({accepted:u.boolean()})},"account.getActive":{request:u.object({clientId:a}),response:u.object({identity:u.object({clientAccountId:a,identifiers:u.array(l).min(1),displayLabel:u.string().optional()}).nullable()})},"usage.ingest":ce,"usage.snapshot":ie,"session.usage.snapshot":_e,"session.started":J,"session.userPrompt.submitted":Y,"session.turn.started":X,"session.turn.completed":fe,"session.tool.pre":pe,"session.tool.post":me,"wiring.list":{request:u.object({clientId:a.optional(),projectDir:s.optional(),makaioCommand:a}),response:u.object({results:u.array(u.object({clientId:a,entries:u.array(he)}))})},list:A,install:j,uninstall:de,update:M,setActive:N,"installJob.progress":F,"installJob.completed":L,"version.changed":R,resolveBinary:E,...i,...te,"config.prime":ee},ye=le(`client`,ve),be=ye.subjects;function $(e){if(Array.isArray(e)){for(let t of e)$(t);return Object.freeze(e)}if(e&&typeof e==`object`){for(let t of Object.values(e))$(t);return Object.freeze(e)}return e}function xe(e){return $(w.parse(e))}export{M as A,h as B,k as C,A as D,j as E,D as F,m as G,f as H,T as I,x as J,y as K,E as L,I as M,P as N,N as O,O as P,C as R,U as S,F as T,p as U,S as V,g as W,b as X,v as Y,V as _,Z as a,z as b,G as c,me as d,pe as f,he as g,Y as h,ve as i,R as j,de as k,q as l,X as m,ye as n,_e as o,fe as p,_ as q,be as r,K as s,xe as t,J as u,W as v,L as w,B as x,H as y,w as z};
@@ -0,0 +1,2 @@
1
+ import*as e from"node:fs/promises";import*as t from"node:path";import{ManagedInstallDescriptorSchema as n}from"@makaio/framework/contracts/client";function r(e){if(e!==void 0)return(t,n)=>{n!==null&&n>0?e(`downloading`,t/n*100):e(`downloading`,null)}}var i=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async execute(e,t,n){if(e!==this.#e.version)throw Error(`npm managed install requested version ${e} but descriptor pins ${this.#e.version}`);n?.(`installing`,null);let r=`${this.#e.package}@${this.#e.version}`;return await this.#t.exec(`npm`,[`install`,r,`--prefix`,t,`--no-save`,`--ignore-scripts`]),n?.(`installing`,100),{installPath:t,version:this.#e.version,strategy:`npm`}}};function a(){if(process.platform!==`linux`)return!1;try{let e=process.report?.getReport?.();if(typeof e!=`object`||!e||!(`header`in e))return!0;let{header:t}=e;return typeof t!=`object`||!t?!0:!(`glibcVersionRuntime`in t)}catch{return!1}}function o(e){return e.replace(/[^0-9a-fA-F]/g,``).toUpperCase()}function s(e,t,n,r){let i=e.replaceAll(`{version}`,t);return n!==void 0&&(i=i.replaceAll(`{platform}`,n)),r!==void 0&&(i=i.replaceAll(`{binary}`,r)),i}function c(e){let t=`${e.platform}-${e.arch}`;return e.platform===`linux`&&e.isMusl?`${t}-musl`:t}function l(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Signed manifest must be a JSON object`);let n=e,r=n.version;if(r!==t)throw Error(`Signed manifest version ${String(r)} does not match descriptor pin ${t}`);let i=n.platforms;if(typeof i!=`object`||!i||Array.isArray(i))throw Error(`Signed manifest must contain a platforms object`);return{version:r,platforms:i}}function u(e,t){let n=e.platforms[t];if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Signed manifest does not contain a platform entry for '${t}'`);let{binary:r,checksum:i}=n;if(typeof r!=`string`||!d(r))throw Error(`Manifest entry for '${t}' has unsafe binary filename`);if(typeof i!=`string`||i.length===0)throw Error(`Manifest entry for '${t}' is missing a valid 'checksum' field`);return{binary:r,checksum:i}}function d(e){return e.length>0&&e!==`.`&&e!==`..`&&!e.includes(`/`)&&!e.includes(`\\`)}var f=class{#e;#t;#n;constructor(e,t,n){this.#e=e,this.#t=t,this.#n={platform:n?.platform??process.platform,arch:n?.arch??process.arch,isMusl:n?.isMusl??a()}}async execute(n,i,a){if(n!==this.#e.version)throw Error(`signed-binary-bucket managed install requested version ${n} but descriptor pins ${this.#e.version}`);let{config:o}=this.#e,l=c(this.#n),u=o.platforms[l];if(u===void 0)throw Error(`signed-binary-bucket descriptor has no platform entry for '${l}'. Supported platforms: ${Object.keys(o.platforms).join(`, `)}`);await e.mkdir(i,{recursive:!0});let d=t.join(i,`.gnupg`),f=t.join(i,`signing-key.asc`),p=t.join(i,`manifest.json`),m=t.join(i,`manifest.json.sig`);a?.(`resolving`,null),await this.#r(o,n,f,p,m),a?.(`verifying`,null);let h=await this.#i(o,d,f,p,m,l);a?.(`downloading`,null);let g=s(o.binaryPathTemplate,n,u,h.binary),_=t.resolve(i,h.binary);await this.#t.downloadFile(`${o.baseUrl}/${g}`,_,r(a)),a?.(`verifying`,null);let v=await this.#t.computeChecksum(_);if(v!==h.checksum)throw Error(`Binary checksum mismatch: expected ${h.checksum} but computed ${v}`);return a?.(`installing`,null),this.#n.platform!==`win32`&&await e.chmod(_,493),await this.#t.removeDirectory(d),await this.#t.deleteFile(f),await this.#t.deleteFile(m),a?.(`installing`,100),{installPath:i,version:this.#e.version,strategy:`signed-binary-bucket`}}async#r(t,n,r,i,a){let o=`${t.baseUrl}/${s(t.manifestPathTemplate,n)}`,c=`${t.baseUrl}/${s(t.manifestSignaturePathTemplate,n)}`,l=await this.#t.fetchText(t.publicKeyUrl);await e.writeFile(r,l,`utf-8`),await this.#t.downloadFile(o,i),await this.#t.downloadFile(c,a)}async#i(t,n,r,i,a,s){await e.mkdir(n,{recursive:!0,mode:448}),await this.#t.exec(`gpg`,[`--homedir`,n,`--import`,r]);let c=await this.#t.exec(`gpg`,[`--homedir`,n,`--with-colons`,`--fingerprint`,`--list-keys`]),d=this.#a(c);if(o(d)!==o(t.publicKeyFingerprint))throw Error(`GPG key fingerprint mismatch: expected ${t.publicKeyFingerprint} but got ${d}`);await this.#t.exec(`gpg`,[`--homedir`,n,`--verify`,a,i]).catch(e=>{throw Error(`Manifest GPG signature verification failed: ${e.message}`)});let f=await e.readFile(i,`utf-8`);return u(l(JSON.parse(f),this.#e.version),s)}#a(e){for(let t of e.split(`
2
+ `)){let e=t.split(`:`);if(e[0]===`fpr`&&e[9]!==void 0&&e[9].length>0)return e[9]}throw Error(`Could not extract GPG key fingerprint from output`)}};function p(e,t){let r=n.safeParse(e);if(r.success)switch(r.data.type){case`npm`:return new i(r.data,t);case`signed-binary-bucket`:return new f(r.data,t)}}function m(e,n){let r=t.relative(e,n);return r!==``&&!r.startsWith(`..${t.sep}`)&&r!==`..`&&!t.isAbsolute(r)}async function h(n,r,i,a){let[o,...s]=i;if(_(o))throw Error(`versionCommand[0] must be a relative path; received absolute path "${o}"`);if(o.split(/[/\\]/).includes(`..`))throw Error(`versionCommand[0] must not contain path traversal segments; received "${o}"`);let c=t.normalize(o),l=t.join(r,c),u=await e.realpath(r),d=await e.realpath(l);if(!m(u,d))throw Error(`versionCommand[0] must not escape the install directory; "${o}" resolves outside installPath`);let f;try{f=await n(d,s,{cwd:u})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Version verification failed: command "${l}" exited with an error: ${t}`,{cause:e})}let p=g(a);if(!v(f,p))throw Error(`Version mismatch: expected "${a}" but command output was "${f.trim()}"`)}function g(e){return e[0]===`v`||e[0]===`V`?e.slice(1):e}function _(e){return e.startsWith(`/`)||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith(`\\`)}function v(e,t){return(e.match(/[A-Za-z0-9][A-Za-z0-9._+-]*/g)??[]).some(e=>g(e)===t)}export{m as n,p as r,h as t};
@@ -0,0 +1,179 @@
1
+ import { InstallStage, ManagedInstallDescriptor, ManagedInstallStrategy } from "@makaio/framework/contracts/client";
2
+
3
+ //#region subsystems/client/src/binary-strategies/types.d.ts
4
+ /**
5
+ * Progress callback invoked by a strategy as it moves through pipeline stages.
6
+ * @param stage - The current install pipeline stage.
7
+ * @param progress - Fractional progress in `[0, 100]`, or `null` when the
8
+ * stage does not have deterministic progress (e.g. resolving, verifying).
9
+ */
10
+ type StrategyProgressCallback = (stage: InstallStage, progress: number | null) => void;
11
+ /**
12
+ * Normalized result of a successful strategy execution.
13
+ *
14
+ * Every strategy returns this shape so the `ClientBinaryManager` can handle
15
+ * all strategies without branching on type.
16
+ */
17
+ interface InstallArtifact {
18
+ /**
19
+ * Absolute path to the installed binary's directory.
20
+ *
21
+ * For `npm`, this is the `node_modules/.bin`-accessible root.
22
+ * For archive strategies this is the extraction target directory.
23
+ */
24
+ installPath: string;
25
+ /**
26
+ * The exact version that was installed, as passed to {@link InstallStrategy.execute}.
27
+ *
28
+ * For `npm` this mirrors the registry semver tag. For `signed-binary-bucket`
29
+ * this is the version string from the descriptor.
30
+ */
31
+ version: string;
32
+ /** The strategy that performed the install. */
33
+ strategy: ManagedInstallStrategy;
34
+ }
35
+ /**
36
+ * Injected I/O dependencies for install strategy implementations.
37
+ *
38
+ * Abstracting these operations behind an interface makes every strategy
39
+ * testable without touching the network or file system.
40
+ */
41
+ interface StrategyDependencies {
42
+ /**
43
+ * Fetch `url` and return the full response body as a string.
44
+ * @param url - The URL to fetch.
45
+ * @returns The raw response body text.
46
+ */
47
+ fetchText(url: string): Promise<string>;
48
+ /**
49
+ * Fetch `url`, parse the response body as JSON, and return it.
50
+ * @param url - The URL to fetch.
51
+ * @returns The parsed JSON value.
52
+ */
53
+ fetchJson(url: string): Promise<unknown>;
54
+ /**
55
+ * Download `url` to `destPath` on disk, optionally reporting byte progress.
56
+ * @param url - The URL to download.
57
+ * @param destPath - Absolute destination file path.
58
+ * @param onProgress - Optional callback; `total` is `null` when the server
59
+ * does not advertise a `Content-Length`.
60
+ * @returns The resolved absolute destination path.
61
+ */
62
+ downloadFile(url: string, destPath: string, onProgress?: (downloaded: number, total: number | null) => void): Promise<string>;
63
+ /**
64
+ * Execute a shell command and return its stdout.
65
+ * @param command - The executable to run (no shell expansion).
66
+ * @param args - Positional arguments passed to the executable.
67
+ * @param options - Optional execution options. `cwd` sets the working
68
+ * directory; `env` is merged on top of the parent environment when present
69
+ * (when absent the parent environment is inherited unchanged).
70
+ * @returns Trimmed stdout string.
71
+ */
72
+ exec(command: string, args: string[], options?: {
73
+ cwd?: string;
74
+ env?: Record<string, string>;
75
+ }): Promise<string>;
76
+ /**
77
+ * Extract an archive file into `destDir`.
78
+ * @param archivePath - Absolute path to the archive file.
79
+ * @param destDir - Absolute directory to extract into.
80
+ * @param format - Archive type (`'tar.gz'` or `'zip'`).
81
+ */
82
+ extractArchive(archivePath: string, destDir: string, format: 'tar.gz' | 'zip'): Promise<void>;
83
+ /**
84
+ * Delete a single file from disk.
85
+ *
86
+ * Implementations must be idempotent — if `filePath` does not exist the call
87
+ * should resolve without error.
88
+ * @param filePath - Absolute path to the file to remove.
89
+ */
90
+ deleteFile(filePath: string): Promise<void>;
91
+ /**
92
+ * Compute the checksum of a file at `filePath`.
93
+ * @param filePath - Absolute path to the file to hash.
94
+ * @param algorithm - Hash algorithm name (defaults to `'sha256'`).
95
+ * @returns Lowercase hex-encoded digest string.
96
+ */
97
+ computeChecksum(filePath: string, algorithm?: string): Promise<string>;
98
+ /**
99
+ * Recursively remove a directory and all of its contents.
100
+ *
101
+ * Implementations must be idempotent — if `dirPath` does not exist the
102
+ * call should resolve without error. This mirrors the `force` flag of
103
+ * `fs.rm` from `node:fs/promises`.
104
+ * @param dirPath - Absolute path to the directory to remove.
105
+ */
106
+ removeDirectory(dirPath: string): Promise<void>;
107
+ }
108
+ /**
109
+ * Common interface implemented by all install strategy classes.
110
+ *
111
+ * A strategy is a pure computation unit — it has no bus, no BaseService, and
112
+ * no side effects beyond what is provided through {@link StrategyDependencies}.
113
+ * Strategies operate only on pinned versions; upstream version resolution is not
114
+ * part of this contract.
115
+ */
116
+ interface InstallStrategy {
117
+ /**
118
+ * Execute the install pipeline for `version` into `targetDir`.
119
+ *
120
+ * The strategy is responsible for downloading, verifying (when applicable),
121
+ * extracting, and writing the binary into `targetDir`. The returned
122
+ * {@link InstallArtifact} tells the manager where the binary landed and
123
+ * which version was installed.
124
+ * @param version - The exact version to install.
125
+ * @param targetDir - Absolute path to the directory to install into.
126
+ * @param onProgress - Optional progress callback invoked at each stage.
127
+ * @returns A normalized install artifact describing the installed binary.
128
+ */
129
+ execute(version: string, targetDir: string, onProgress?: StrategyProgressCallback): Promise<InstallArtifact>;
130
+ }
131
+ //#endregion
132
+ //#region subsystems/client/src/binary-strategies/index.d.ts
133
+ /**
134
+ * Instantiate the appropriate {@link InstallStrategy} for the given descriptor.
135
+ *
136
+ * The factory validates the descriptor and then performs narrowing over the
137
+ * `type` discriminant so callers do not need to repeat the switch logic.
138
+ *
139
+ * Supported descriptor types:
140
+ * - `'npm'` → {@link NpmStrategy}
141
+ * - `'signed-binary-bucket'` → {@link SignedBinaryBucketStrategy}
142
+ * @param descriptor - The managed install descriptor from a
143
+ * {@link ClientDefinition}, or an unvalidated runtime value with a `type`
144
+ * field.
145
+ * @param deps - Injected I/O dependencies forwarded to the chosen strategy.
146
+ * @returns A ready-to-use {@link InstallStrategy} instance, or `undefined`
147
+ * when the descriptor fails validation.
148
+ */
149
+ declare function createStrategy(descriptor: ManagedInstallDescriptor, deps: StrategyDependencies): InstallStrategy | undefined;
150
+ declare function createStrategy(descriptor: {
151
+ readonly type: string;
152
+ }, deps: StrategyDependencies): InstallStrategy | undefined;
153
+ //#endregion
154
+ //#region subsystems/client/src/client-binary-version-verifier.d.ts
155
+ /**
156
+ * Verifies that the binary installed at `installPath` reports the expected
157
+ * version when executed with the declared `versionCommand`.
158
+ *
159
+ * The first element of `versionCommand` is resolved relative to `installPath`.
160
+ * Absolute paths and any `..` segments are rejected to prevent path traversal.
161
+ * The binary is executed with `{ cwd: installPath }` so relative paths within
162
+ * the binary work as expected. Before execution, both the install directory
163
+ * and resolved executable are canonicalized with `realpath()` so symlinked
164
+ * executables cannot escape the install directory.
165
+ *
166
+ * Version strings are compared as output tokens after stripping a single
167
+ * leading `v`, so `v1.2.3` and `1.2.3` are equivalent but `1.2.30` does not
168
+ * satisfy `1.2.3`.
169
+ * @param exec - Exec dependency from {@link StrategyDependencies}
170
+ * @param installPath - Absolute directory where the binary was installed
171
+ * @param versionCommand - Command and arguments declared on the client definition
172
+ * @param expectedVersion - The version string that the binary must report
173
+ * @throws When the command path is absolute or contains `..`
174
+ * @throws When the command fails to execute
175
+ * @throws When the command output does not contain the expected version token
176
+ */
177
+ declare function verifyInstalledVersion(exec: StrategyDependencies['exec'], installPath: string, versionCommand: readonly [string, ...string[]], expectedVersion: string): Promise<void>;
178
+ //#endregion
179
+ export { StrategyDependencies as a, InstallStrategy as i, createStrategy as n, InstallArtifact as r, verifyInstalledVersion as t };
@@ -1,3 +1,4 @@
1
+ import { a as StrategyDependencies, i as InstallStrategy, n as createStrategy, r as InstallArtifact, t as verifyInstalledVersion } from "../client-binary-version-verifier-BwrMTAh2.mjs";
1
2
  import * as _$zod from "zod";
2
3
  import { z } from "zod";
3
4
  import * as _$_makaio_core0 from "@makaio/framework/core";
@@ -157,82 +158,17 @@ declare class ClientAccountRegistry {
157
158
  private mergeInto;
158
159
  }
159
160
  //#endregion
160
- //#region subsystems/client/src/binary-strategies/types.d.ts
161
+ //#region subsystems/client/src/client-binary-manager-types.d.ts
161
162
  /**
162
- * Injected I/O dependencies for install strategy implementations.
163
+ * Policy controlling which filesystem owns binary resolution.
163
164
  *
164
- * Abstracting these operations behind an interface makes every strategy
165
- * testable without touching the network or file system.
165
+ * `managed-first` is the normal host behavior: resolve the active managed
166
+ * install from persisted state, then fall back to the current process PATH.
167
+ * `global-only` is for isolated runtimes whose filesystem cannot access the
168
+ * host's persisted managed-install paths; those runtimes resolve only binaries
169
+ * available on their own PATH.
166
170
  */
167
- interface StrategyDependencies {
168
- /**
169
- * Fetch `url` and return the full response body as a string.
170
- * @param url - The URL to fetch.
171
- * @returns The raw response body text.
172
- */
173
- fetchText(url: string): Promise<string>;
174
- /**
175
- * Fetch `url`, parse the response body as JSON, and return it.
176
- * @param url - The URL to fetch.
177
- * @returns The parsed JSON value.
178
- */
179
- fetchJson(url: string): Promise<unknown>;
180
- /**
181
- * Download `url` to `destPath` on disk, optionally reporting byte progress.
182
- * @param url - The URL to download.
183
- * @param destPath - Absolute destination file path.
184
- * @param onProgress - Optional callback; `total` is `null` when the server
185
- * does not advertise a `Content-Length`.
186
- * @returns The resolved absolute destination path.
187
- */
188
- downloadFile(url: string, destPath: string, onProgress?: (downloaded: number, total: number | null) => void): Promise<string>;
189
- /**
190
- * Execute a shell command and return its stdout.
191
- * @param command - The executable to run (no shell expansion).
192
- * @param args - Positional arguments passed to the executable.
193
- * @param options - Optional execution options. `cwd` sets the working
194
- * directory; `env` is merged on top of the parent environment when present
195
- * (when absent the parent environment is inherited unchanged).
196
- * @returns Trimmed stdout string.
197
- */
198
- exec(command: string, args: string[], options?: {
199
- cwd?: string;
200
- env?: Record<string, string>;
201
- }): Promise<string>;
202
- /**
203
- * Extract an archive file into `destDir`.
204
- * @param archivePath - Absolute path to the archive file.
205
- * @param destDir - Absolute directory to extract into.
206
- * @param format - Archive type (`'tar.gz'` or `'zip'`).
207
- */
208
- extractArchive(archivePath: string, destDir: string, format: 'tar.gz' | 'zip'): Promise<void>;
209
- /**
210
- * Delete a single file from disk.
211
- *
212
- * Implementations must be idempotent — if `filePath` does not exist the call
213
- * should resolve without error.
214
- * @param filePath - Absolute path to the file to remove.
215
- */
216
- deleteFile(filePath: string): Promise<void>;
217
- /**
218
- * Compute the checksum of a file at `filePath`.
219
- * @param filePath - Absolute path to the file to hash.
220
- * @param algorithm - Hash algorithm name (defaults to `'sha256'`).
221
- * @returns Lowercase hex-encoded digest string.
222
- */
223
- computeChecksum(filePath: string, algorithm?: string): Promise<string>;
224
- /**
225
- * Recursively remove a directory and all of its contents.
226
- *
227
- * Implementations must be idempotent — if `dirPath` does not exist the
228
- * call should resolve without error. This mirrors the `force` flag of
229
- * `fs.rm` from `node:fs/promises`.
230
- * @param dirPath - Absolute path to the directory to remove.
231
- */
232
- removeDirectory(dirPath: string): Promise<void>;
233
- }
234
- //#endregion
235
- //#region subsystems/client/src/client-binary-manager-types.d.ts
171
+ type ClientBinaryResolutionPolicy = 'managed-first' | 'global-only';
236
172
  /**
237
173
  * Configuration for the managed binary base directory.
238
174
  *
@@ -268,6 +204,11 @@ interface ClientBinaryManagerConfig extends ClientBinaryJobRunnerConfig {
268
204
  * the definition declares `configIsolation`.
269
205
  */
270
206
  configBasePath: string;
207
+ /**
208
+ * Filesystem ownership policy for `client.resolveBinary`.
209
+ * @defaultValue 'managed-first'
210
+ */
211
+ resolutionPolicy?: ClientBinaryResolutionPolicy;
271
212
  }
272
213
  /**
273
214
  * Context passed to a framework-owned post-install handler.
@@ -1219,12 +1160,14 @@ declare class ClientProfileService extends BaseService {
1219
1160
  //#endregion
1220
1161
  //#region subsystems/client/src/client-session-config-service.d.ts
1221
1162
  /**
1222
- * Handles `client.sessionConfig.*` bus subjects, providing per-session config
1163
+ * Handles `client.sessionConfig.*` bus subjects, providing leased config
1223
1164
  * directory isolation for client processes.
1224
1165
  */
1225
1166
  declare class ClientSessionConfigService extends BaseService {
1226
1167
  private readonly clientsBasePath;
1227
1168
  private readonly getNow;
1169
+ private readonly liveLeasesByClient;
1170
+ private readonly liveLeasesByOwner;
1228
1171
  /**
1229
1172
  * @param bus - Bus instance used for handler registration and storage requests
1230
1173
  * @param clientsBasePath - Absolute path to the top-level clients directory
@@ -1237,8 +1180,10 @@ declare class ClientSessionConfigService extends BaseService {
1237
1180
  * Register all `client.sessionConfig.*` handlers and run boot-time cleanup.
1238
1181
  */
1239
1182
  protected onInit(): Promise<void>;
1183
+ /** Register the config-lease creation handler and its rollback lifecycle. */
1184
+ private registerCreateHandler;
1240
1185
  /**
1241
- * Resolve the base configuration directory for a session.
1186
+ * Resolve the base configuration directory for a config lease.
1242
1187
  *
1243
1188
  * Resolution order:
1244
1189
  * 1. Explicit `baseConfigDir` from the request payload.
@@ -1263,10 +1208,10 @@ declare class ClientSessionConfigService extends BaseService {
1263
1208
  */
1264
1209
  private cleanupOrphanedDirs;
1265
1210
  /**
1266
- * Remove every per-client config directory for a closed framework session.
1267
- * @param sessionId - Framework session ID from `session.closed`.
1211
+ * Release every live config lease owned by a closed framework session.
1212
+ * @param ownerSessionId - Framework session ID from `session.closed`.
1268
1213
  */
1269
- private destroySessionDirsForSessionId;
1214
+ private destroyOwnedLeases;
1270
1215
  /**
1271
1216
  * Run client-owned session config teardown before removing the directory.
1272
1217
  * @param clientId - Canonical client identifier.
@@ -1274,19 +1219,49 @@ declare class ClientSessionConfigService extends BaseService {
1274
1219
  */
1275
1220
  private destroyClientSessionDir;
1276
1221
  /**
1277
- * Check whether a stale-looking directory belongs to a still-active session.
1278
- * @param sessionId - Session directory name.
1279
- * @returns `true` when the session registry still marks the session active.
1222
+ * Check whether a stale-looking directory belongs to a live config lease.
1223
+ * @param clientId - Canonical client identifier.
1224
+ * @param leaseId - Lease directory name.
1225
+ * @returns `true` when the service still tracks the connector lease.
1280
1226
  */
1281
- private isActiveSession;
1227
+ private isLiveLease;
1228
+ /**
1229
+ * Get the currently registered generation for a lease coordinate.
1230
+ * @param clientId - Canonical client identifier.
1231
+ * @param leaseId - Connector-unique config lease ID.
1232
+ * @returns Current lease generation, or `undefined` when none is reserved.
1233
+ */
1234
+ private getLiveLease;
1282
1235
  /**
1283
1236
  * Resolve a session directory for a canonical client ID.
1284
1237
  * @param clientId - Canonical client identifier.
1285
- * @param sessionId - Framework session ID.
1238
+ * @param leaseId - Connector-unique config lease ID.
1286
1239
  * @param operation - Operation name used in error messages.
1287
1240
  * @returns Absolute session directory path.
1288
1241
  */
1289
1242
  private resolveClientSessionDir;
1243
+ /**
1244
+ * Atomically reserve a lease in both the client-primary and optional owner indexes.
1245
+ * @param identity - Lease identity to reserve before materialization starts.
1246
+ * @returns Newly reserved lease generation.
1247
+ */
1248
+ private reserveLiveLease;
1249
+ /**
1250
+ * Release one lease generation, waiting for in-flight creation when needed.
1251
+ * @param lease - Exact reservation generation to release.
1252
+ */
1253
+ private releaseLiveLease;
1254
+ /**
1255
+ * Start or join the single cleanup operation for a lease generation.
1256
+ * @param lease - Exact reservation generation whose resources must be removed.
1257
+ * @returns Shared cleanup promise for this generation.
1258
+ */
1259
+ private beginLeaseCleanup;
1260
+ /**
1261
+ * Remove an exact lease generation from both indexes. Stale generations are a no-op.
1262
+ * @param lease - Exact reservation generation to remove.
1263
+ */
1264
+ private untrackLiveLease;
1290
1265
  /**
1291
1266
  * List all client IDs that currently have a directory under `clientsBasePath`.
1292
1267
  * @returns Array of directory names (one per client)
@@ -1762,6 +1737,14 @@ interface ClientsCorePackageOptions {
1762
1737
  * When omitted no post-install handlers are registered.
1763
1738
  */
1764
1739
  readonly postInstallHandlers?: ReadonlyMap<string, PostInstallHandler>;
1740
+ /**
1741
+ * Filesystem ownership policy used by `client.resolveBinary`.
1742
+ *
1743
+ * Isolated runtimes use `global-only` so persisted host install paths are
1744
+ * never interpreted inside a different filesystem namespace.
1745
+ * @defaultValue 'managed-first'
1746
+ */
1747
+ readonly binaryResolutionPolicy?: ClientBinaryResolutionPolicy;
1765
1748
  }
1766
1749
  /**
1767
1750
  * Run storage handler registrations and return one cleanup that unwinds every
@@ -2694,12 +2677,13 @@ declare const clientRuntimesDual: _$_makaio_storage_drizzle0.DualTable<"client_r
2694
2677
  * Uses `requestOptional` so the adapter continues to function in
2695
2678
  * framework-only boot where no `client.resolveBinary` handler is registered.
2696
2679
  * In that case `undefined` is returned and callers fall back to PATH lookup.
2680
+ * @param bus - Runtime bus that owns the client-resolution handlers.
2697
2681
  * @param clientId - Stable client identifier to resolve (e.g. `'claude-code'`)
2698
2682
  * @returns Resolved execution context (source `'managed'` or `'global'`), or
2699
2683
  * `undefined` when no `client.resolveBinary` handler is registered
2700
2684
  * (framework-only boot)
2701
2685
  */
2702
- declare function resolveClientBinary(clientId: string): Promise<ClientExecutionContext | undefined>;
2686
+ declare function resolveClientBinary(bus: IMakaioBus, clientId: string): Promise<ClientExecutionContext | undefined>;
2703
2687
  //#endregion
2704
2688
  //#region subsystems/client/src/wiring-helpers.d.ts
2705
2689
  /**
@@ -2766,4 +2750,4 @@ declare function buildHookCommand(makaioCommand: string, sentinel: string, event
2766
2750
  */
2767
2751
  declare function deriveSessionEventDescriptors(clientDefinition: ClientDefinition$1): ReadonlyArray<SessionEventDescriptor>;
2768
2752
  //#endregion
2769
- export { AbsolutePathSchema, type AtomicContentParser, type AtomicModifier, type AtomicModifyOutcome, BinaryNotFoundError, type BuildClientSessionBaseOpts, CLIENT_RUNTIME_STATUSES, ClientAccountRegistry, type ClientAccountUpsertResult, ClientBinaryJobRunner, ClientBinaryManager, type ClientBinaryManagerConfig, type ClientBinaryStateRecord, ClientBinaryStateRecordSchema, ClientBinaryStorageNamespace, ClientBinaryStorageSubjects, type ClientBinaryVersionRecord, ClientBinaryVersionRecordSchema, ClientBinaryVersionResolver, ClientConfigPrimeService, type ClientDefinitionLookup, ClientDefinitionRegistry, type ClientHookHandleResponse, ClientHookHandleResponseSchema, type ClientNamespaceResult, type ClientProfileRecord, ClientProfileRecordSchema, ClientProfileService, ClientProfileStorageNamespace, ClientProfileStorageSubjects, type ClientRuntimeRecord, ClientRuntimeRegistry, ClientRuntimeService, type ClientRuntimeStatus, ClientRuntimeStorageNamespace, ClientRuntimeStorageSubjects, ClientSessionConfigService, ClientSubjects, type ClientWiringAggregatedResult, ClientWiringAggregatedResultSchema, type ClientWiringApplyResponse, ClientWiringApplyResponseSchema, type ClientWiringEntry, ClientWiringEntrySchema, type ClientWiringListResponse, ClientWiringListResponseSchema, type ClientWiringListSubjectDef, type ClientWiringRemoveResponse, ClientWiringRemoveResponseSchema, type ClientWiringSubjectDefBase, type ClientsCorePackageOptions, ClientsCoreService, ClientsCoreToken, DEFAULT_HOOK_HANDLE_TIMEOUT_MS, type InstallJob, type JobCompletedCallback, type JobCompletionCallback, type JobCompletionResult, type JobProgressCallback, type PostInstallContext, type PostInstallHandler, type RawClientHookHandleSubject, type RawClientHookPayload, RawClientHookPayloadSchema, type RawClientHookReceivedSubject, type ResolvedInstallVersion, RuntimeRecordSchema, type RuntimeUpsertResult, type SessionEventDescriptor, type StrategyDependencies, assertAbsoluteProjectDir, atomicModifyFile, buildClientCommand, buildClientSessionBase, buildHookCommand, canonicalizeClientId, clientRuntimesDual, createClientNamespace, createClientWiringListSubjectDef, createClientWiringSubjectDef, createClientsCorePackage, createRawClientHookHandleSubject, createRawClientHookReceivedSubject, deriveSessionEventDescriptors, emitBestEffort, isPathWithinBase, pickNonEmptyString, pickNonEmptyStringValue, registerDrizzleClientBinaryStorage, registerDrizzleProfileStorage, registerDrizzleRuntimeStorage, registerStorageHandlersWithRollback, resolveAndValidateBasePath, resolveClientBinary };
2753
+ export { AbsolutePathSchema, type AtomicContentParser, type AtomicModifier, type AtomicModifyOutcome, BinaryNotFoundError, type BuildClientSessionBaseOpts, CLIENT_RUNTIME_STATUSES, ClientAccountRegistry, type ClientAccountUpsertResult, ClientBinaryJobRunner, ClientBinaryManager, type ClientBinaryManagerConfig, type ClientBinaryResolutionPolicy, type ClientBinaryStateRecord, ClientBinaryStateRecordSchema, ClientBinaryStorageNamespace, ClientBinaryStorageSubjects, type ClientBinaryVersionRecord, ClientBinaryVersionRecordSchema, ClientBinaryVersionResolver, ClientConfigPrimeService, type ClientDefinitionLookup, ClientDefinitionRegistry, type ClientHookHandleResponse, ClientHookHandleResponseSchema, type ClientNamespaceResult, type ClientProfileRecord, ClientProfileRecordSchema, ClientProfileService, ClientProfileStorageNamespace, ClientProfileStorageSubjects, type ClientRuntimeRecord, ClientRuntimeRegistry, ClientRuntimeService, type ClientRuntimeStatus, ClientRuntimeStorageNamespace, ClientRuntimeStorageSubjects, ClientSessionConfigService, ClientSubjects, type ClientWiringAggregatedResult, ClientWiringAggregatedResultSchema, type ClientWiringApplyResponse, ClientWiringApplyResponseSchema, type ClientWiringEntry, ClientWiringEntrySchema, type ClientWiringListResponse, ClientWiringListResponseSchema, type ClientWiringListSubjectDef, type ClientWiringRemoveResponse, ClientWiringRemoveResponseSchema, type ClientWiringSubjectDefBase, type ClientsCorePackageOptions, ClientsCoreService, ClientsCoreToken, DEFAULT_HOOK_HANDLE_TIMEOUT_MS, type InstallArtifact, type InstallJob, type InstallStrategy, type JobCompletedCallback, type JobCompletionCallback, type JobCompletionResult, type JobProgressCallback, type PostInstallContext, type PostInstallHandler, type RawClientHookHandleSubject, type RawClientHookPayload, RawClientHookPayloadSchema, type RawClientHookReceivedSubject, type ResolvedInstallVersion, RuntimeRecordSchema, type RuntimeUpsertResult, type SessionEventDescriptor, type StrategyDependencies, assertAbsoluteProjectDir, atomicModifyFile, buildClientCommand, buildClientSessionBase, buildHookCommand, canonicalizeClientId, clientRuntimesDual, createClientNamespace, createClientWiringListSubjectDef, createClientWiringSubjectDef, createClientsCorePackage, createRawClientHookHandleSubject, createRawClientHookReceivedSubject, createStrategy, deriveSessionEventDescriptors, emitBestEffort, isPathWithinBase, pickNonEmptyString, pickNonEmptyStringValue, registerDrizzleClientBinaryStorage, registerDrizzleProfileStorage, registerDrizzleRuntimeStorage, registerStorageHandlersWithRollback, resolveAndValidateBasePath, resolveClientBinary, verifyInstalledVersion };