@makaio/framework 1.0.0-dev-1790114433794 → 1.0.0-dev-1790165411632

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 (290) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/adapter-subsystem/index.mjs +1 -1
  3. package/dist/adapters/claude/index.d.mts +24 -24
  4. package/dist/adapters/config/index.d.mts +1 -1
  5. package/dist/adapters/index.d.mts +2 -2
  6. package/dist/adapters/node.d.mts +1 -1
  7. package/dist/bus/index.d.mts +46 -21
  8. package/dist/bus/index.mjs +1 -1
  9. package/dist/{bus-CX0d5tTa.mjs → bus-D4DBDaoS.mjs} +1 -1
  10. package/dist/clients/index.d.mts +2 -1
  11. package/dist/clients/index.mjs +1 -1
  12. package/dist/clients/managed-install.d.mts +1 -1
  13. package/dist/code-execution/worker-entry.d.mts +1 -1
  14. package/dist/contracts/adapter/index.d.mts +2 -2
  15. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  16. package/dist/contracts/artifact/index.d.mts +2 -2
  17. package/dist/contracts/auth/index.d.mts +2 -2
  18. package/dist/contracts/automation-trigger/index.d.mts +3 -3
  19. package/dist/contracts/canonical-model/index.d.mts +1 -1
  20. package/dist/contracts/capabilities/index.d.mts +1 -1
  21. package/dist/contracts/client/index.d.mts +2 -2
  22. package/dist/contracts/code-execution/index.d.mts +1 -1
  23. package/dist/contracts/common/index.d.mts +1 -1
  24. package/dist/contracts/config/index.d.mts +2 -2
  25. package/dist/contracts/extension/index.d.mts +5 -5
  26. package/dist/contracts/facet/index.d.mts +1 -1
  27. package/dist/contracts/harness/index.d.mts +1 -1
  28. package/dist/contracts/host/index.d.mts +1 -1
  29. package/dist/contracts/index.d.mts +179 -179
  30. package/dist/contracts/index.mjs +1 -1
  31. package/dist/contracts/materialization/index.d.mts +2 -2
  32. package/dist/contracts/model-registry/index.d.mts +1 -1
  33. package/dist/contracts/native-session-supervisor/index.d.mts +2 -2
  34. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  35. package/dist/contracts/platform/index.d.mts +1 -1
  36. package/dist/contracts/provider/index.d.mts +2 -2
  37. package/dist/contracts/reaction/index.d.mts +1 -1
  38. package/dist/contracts/session/index.d.mts +2 -2
  39. package/dist/contracts/shared/index.d.mts +2 -2
  40. package/dist/contracts/skill/index.d.mts +1 -1
  41. package/dist/contracts/telemetry/index.d.mts +1 -1
  42. package/dist/contracts/timeout/index.d.mts +1 -1
  43. package/dist/contracts/variant/index.d.mts +1 -1
  44. package/dist/contracts/worker/index.d.mts +2 -2
  45. package/dist/contracts/workflow/index.d.mts +2 -2
  46. package/dist/{contribution-1GL7Rjaq.d.mts → contribution-DTb65rRN.d.mts} +2 -2
  47. package/dist/{definition-DeIGoROj.d.mts → definition-DWhjp0db.d.mts} +1 -1
  48. package/dist/{detached-extension-handle-W5_yfCyE.mjs → detached-extension-handle-QrXVNUR2.mjs} +1 -1
  49. package/dist/{extension-context-pQ7Uio_s.d.mts → extension-context-DH84KOm9.d.mts} +1 -1
  50. package/dist/filesystem-service-CIaAqTRi.mjs +1 -0
  51. package/dist/{framework-packages-U4Xhouxe.mjs → framework-packages-C2tvdFmP.mjs} +1 -1
  52. package/dist/{hook-responses-B882RcQc.d.mts → hook-responses-OETFKaAL.d.mts} +1 -1
  53. package/dist/{index-BtMWM80d.d.mts → index-8hJCLlAE.d.mts} +12 -12
  54. package/dist/{index-DfREUyAk.d.mts → index-B1uHTa1l.d.mts} +1 -1
  55. package/dist/{index-UjNxC0VC2.d.mts → index-B7KgjUmJ2.d.mts} +4 -4
  56. package/dist/{index-DGoJayJg.d.mts → index-BDTcg6tu.d.mts} +100 -100
  57. package/dist/{index-DQU8ZoJr.d.mts → index-BM53WQaQ.d.mts} +1 -1
  58. package/dist/{index-CmCLAMNs.d.mts → index-BRF5X-EZ.d.mts} +1 -1
  59. package/dist/{index-D6Uq1btG.d.mts → index-BUxs65tf.d.mts} +2 -2
  60. package/dist/{index-ConhyAnB.d.mts → index-BVG-RaIu.d.mts} +102 -102
  61. package/dist/{index-L6mssyeZ.d.mts → index-BfFi98B_.d.mts} +1 -1
  62. package/dist/{index-FyY9jdCQ2.d.mts → index-BnNNfBck.d.mts} +12 -12
  63. package/dist/{index-CESqYf8a.d.mts → index-C0Jfr8UK.d.mts} +2 -2
  64. package/dist/{index-DqliLe_D2.d.mts → index-C9Dz8UoK2.d.mts} +242 -7
  65. package/dist/{index-D2TphOHU2.d.mts → index-CDuEmakt2.d.mts} +383 -383
  66. package/dist/{index-DOD7Lmgu.d.mts → index-CI5ss_XH.d.mts} +357 -357
  67. package/dist/{index-DUYjTfHD.d.mts → index-CLwnkYRD.d.mts} +1 -1
  68. package/dist/{index-C8two8wz.d.mts → index-CdkIg4Gu.d.mts} +1 -1
  69. package/dist/{index-Di-R1gmo.d.mts → index-CmTVBNCe.d.mts} +288 -288
  70. package/dist/{index-DJxg7U2X.d.mts → index-D5BLD2Pw.d.mts} +7 -3
  71. package/dist/{index-B2bxgKiK.d.mts → index-D9BLsMs8.d.mts} +1 -1
  72. package/dist/{index-DdJKsdya.d.mts → index-D9hIDsPr.d.mts} +1 -1
  73. package/dist/{index-m5ZQFglW2.d.mts → index-DPsQ_cFG2.d.mts} +1 -1
  74. package/dist/{index-DpLjyQ-Z.d.mts → index-DRSeELQh.d.mts} +3 -3
  75. package/dist/{index-6bsTWnnc.d.mts → index-DyzmUD1S.d.mts} +27 -27
  76. package/dist/{index-aIJ7A4DC2.d.mts → index-QYdQSOnc2.d.mts} +6 -6
  77. package/dist/{index-DJVQG6Nn.d.mts → index-qtH2O8j_.d.mts} +14 -14
  78. package/dist/{index-Jdju2W3y.d.mts → index-t6LnywuE.d.mts} +1 -1
  79. package/dist/kernel/cli/index.d.mts +2 -2
  80. package/dist/kernel/cli/register.d.mts +1 -1
  81. package/dist/kernel/extension/index.d.mts +2 -2
  82. package/dist/kernel/index.d.mts +5 -5
  83. package/dist/kernel/namespace/index.d.mts +1 -1
  84. package/dist/kernel/observability/index.d.mts +1 -1
  85. package/dist/kernel/providers/index.d.mts +1 -1
  86. package/dist/kernel/window/index.d.mts +1 -1
  87. package/dist/{load-extensions-Be_lOjm_.d.mts → load-extensions-CCzTHlUE.d.mts} +1 -1
  88. package/dist/{load-extensions-BGfSWW_R.mjs → load-extensions-eyXZhbRn.mjs} +1 -1
  89. package/dist/{namespace-D5DkpaaN.d.mts → namespace-B0__88KU.d.mts} +154 -154
  90. package/dist/{namespace-Bhx72V7S.d.mts → namespace-BaUgxONS.d.mts} +2 -2
  91. package/dist/{namespace-B1CgZ0oQ.d.mts → namespace-BhpzgnH3.d.mts} +1 -1
  92. package/dist/{namespace-BtOBQybk.d.mts → namespace-Bz0ZDWhE.d.mts} +18 -18
  93. package/dist/{namespace-zusFEJPh.d.mts → namespace-CNX4llM5.d.mts} +6 -6
  94. package/dist/native-session-supervisor-BmnAZuia.mjs +1 -0
  95. package/dist/node/bus-server/index.d.mts +1 -1
  96. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  97. package/dist/node/transports/index.d.mts +53 -1
  98. package/dist/node/transports/index.mjs +2 -2
  99. package/dist/node-bridge-backend-DtRT--yn.mjs +1 -0
  100. package/dist/node-pty-backend-C72EgRws.mjs +1 -0
  101. package/dist/{package-kkPGlxMm.mjs → package-CeEUAKHI.mjs} +1 -1
  102. package/dist/{package-CwyC-Krg.d.mts → package-jjugnMVh.d.mts} +2 -2
  103. package/dist/package.json +1 -1
  104. package/dist/rules/index.d.mts +1 -1
  105. package/dist/rules/schemas.d.mts +1 -1
  106. package/dist/runtime-bun/index.d.mts +5 -0
  107. package/dist/runtime-bun/index.mjs +1 -1
  108. package/dist/runtime-node/bridge/pty-bridge.cjs +222 -0
  109. package/dist/runtime-node/code-execution/index.d.mts +2 -2
  110. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  111. package/dist/runtime-node/extension-validation.d.mts +1 -1
  112. package/dist/runtime-node/extension-validation.mjs +1 -1
  113. package/dist/runtime-node/index.d.mts +5 -5
  114. package/dist/runtime-node/index.mjs +25 -21
  115. package/dist/runtime-node/makaio-config.d.mts +1 -1
  116. package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
  117. package/dist/{schemas-B7YzDHLs.d.mts → schemas-CjFPsYeV.d.mts} +4 -4
  118. package/dist/{schemas-BLxdGZkr.d.mts → schemas-D9pXu76T.d.mts} +4 -4
  119. package/dist/{schemas-CD3Mq-jC.d.mts → schemas-DFamD1UF.d.mts} +154 -154
  120. package/dist/{schemas-DNNHiY8g2.d.mts → schemas-DPtj1sPC2.d.mts} +7 -7
  121. package/dist/{schemas--wiEYYQs.d.mts → schemas-KyQQPGjX.d.mts} +11 -11
  122. package/dist/service-base/index.d.mts +35 -5
  123. package/dist/service-base/index.mjs +1 -1
  124. package/dist/services/adapter-runtime/index.d.mts +3 -3
  125. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  126. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  127. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  128. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  129. package/dist/services/agent-runtime/index.d.mts +2 -2
  130. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  131. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  132. package/dist/services/capability/index.d.mts +2 -2
  133. package/dist/services/code-execution/index.d.mts +1 -1
  134. package/dist/services/codebase/index.d.mts +2 -2
  135. package/dist/services/codebase/namespace.d.mts +1 -1
  136. package/dist/services/codebase/schemas.d.mts +1 -1
  137. package/dist/services/compression/index.d.mts +2 -2
  138. package/dist/services/compression/namespace.d.mts +1 -1
  139. package/dist/services/compression/schemas.d.mts +1 -1
  140. package/dist/services/context-rules/index.d.mts +1 -1
  141. package/dist/services/execution-target/index.d.mts +3 -3
  142. package/dist/services/execution-target/namespace.d.mts +1 -1
  143. package/dist/services/execution-target/schemas.d.mts +1 -1
  144. package/dist/services/filesystem/index.d.mts +1 -1
  145. package/dist/services/filesystem/index.mjs +1 -1
  146. package/dist/services/filesystem/namespace.d.mts +12 -12
  147. package/dist/services/filesystem/schemas.d.mts +6 -6
  148. package/dist/services/git/namespace.d.mts +2 -2
  149. package/dist/services/git/schemas.d.mts +2 -2
  150. package/dist/services/index.d.mts +134 -134
  151. package/dist/services/index.mjs +1 -1
  152. package/dist/services/log-import/browser.d.mts +2 -2
  153. package/dist/services/log-import/index.d.mts +2 -2
  154. package/dist/services/log-import/log-import.d.mts +1 -1
  155. package/dist/services/materialization/index.d.mts +1 -1
  156. package/dist/services/model-registry/index.d.mts +1 -1
  157. package/dist/services/preferences/index.d.mts +2 -2
  158. package/dist/services/preferences/schemas.d.mts +1 -1
  159. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  160. package/dist/services/provider-context/index.d.mts +1 -1
  161. package/dist/services/session/handlers/index.d.mts +1 -1
  162. package/dist/services/session/index.d.mts +9 -9
  163. package/dist/services/session/index.mjs +1 -1
  164. package/dist/services/session/messages/namespace.d.mts +1 -1
  165. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  166. package/dist/services/session/session-events/namespace.d.mts +1 -1
  167. package/dist/services/session/storage/namespace.d.mts +1 -1
  168. package/dist/services/session/storage/schema.d.mts +1 -1
  169. package/dist/services/session/testing/index.mjs +1 -1
  170. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  171. package/dist/services/session/turns/namespace.d.mts +1 -1
  172. package/dist/services/session-editor/index.d.mts +1 -1
  173. package/dist/services/settings/index.d.mts +3 -3
  174. package/dist/services/settings/namespace.d.mts +8 -8
  175. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  176. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  177. package/dist/services/settings/storage/index.d.mts +3 -3
  178. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  179. package/dist/services/subagent/index.d.mts +1 -1
  180. package/dist/services/subagent-template/index.d.mts +2 -2
  181. package/dist/services/subagent-template/namespace.d.mts +1 -1
  182. package/dist/services/subagent-template/schemas.d.mts +1 -1
  183. package/dist/services/tool-approval/index.d.mts +1 -1
  184. package/dist/services/tool-approval/index.mjs +1 -1
  185. package/dist/services/tools/index.d.mts +1 -1
  186. package/dist/services/tools/index.mjs +1 -1
  187. package/dist/services/tray-menu/index.d.mts +3 -3
  188. package/dist/services/tray-menu/namespace.d.mts +1 -1
  189. package/dist/services/tray-menu/schemas.d.mts +1 -1
  190. package/dist/services/turn/index.d.mts +1 -1
  191. package/dist/services/turn/namespace.d.mts +1 -1
  192. package/dist/services/workflow-transitions/index.d.mts +1 -1
  193. package/dist/services/workflow-transitions/index.mjs +1 -1
  194. package/dist/{session-CMbztxNO.mjs → session-D38UuGGX.mjs} +1 -1
  195. package/dist/{session-lineage-BuGN3RZs.d.mts → session-lineage-CmP7L5g2.d.mts} +1 -1
  196. package/dist/storage/drizzle/client.d.mts +1 -1
  197. package/dist/storage/drizzle/index.d.mts +1 -1
  198. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  199. package/dist/storage/handlers/index.d.mts +1 -1
  200. package/dist/{storage-namespace-DaCB01dg.d.mts → storage-namespace-CwwiV3kt.d.mts} +10 -10
  201. package/dist/{tool-approval-service-CRo3fZRF.mjs → tool-approval-service-vG2mEC9p.mjs} +1 -1
  202. package/dist/{tools-CKaxi3Mb.mjs → tools-ByDy0ueE.mjs} +1 -1
  203. package/dist/{transition-DMv8cgEd.d.mts → transition-CAtcgdUp.d.mts} +2 -2
  204. package/dist/{types-Dvsn8TOX.d.mts → types-BbqmHOM-.d.mts} +341 -341
  205. package/dist/{types-7L3BrU9m2.d.mts → types-DyBD5MdV2.d.mts} +1 -1
  206. package/dist/ui-kernel/index.d.mts +4 -4
  207. package/dist/ui-kernel/pages/namespace.d.mts +4 -4
  208. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  209. package/dist/{view-builder-BVIbIS_J.d.mts → view-builder-6YQFmKD6.d.mts} +2 -2
  210. package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
  211. package/dist/workflow-engine/index.d.mts +59 -59
  212. package/dist/workflow-engine/index.mjs +1 -1
  213. package/dist/workflow-engine/package.d.mts +1 -1
  214. package/dist/workflow-engine/package.mjs +1 -1
  215. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  216. package/dist/workflow-engine/testing/conformance.d.mts +1 -1
  217. package/dist/workflow-engine/testing/index.d.mts +1 -1
  218. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  219. package/dist/{workflow-transitions-t0ORS1F5.mjs → workflow-transitions-UOXY-VZa.mjs} +1 -1
  220. package/package.json +2 -1
  221. package/dist/filesystem-service-ClZEAw7E.mjs +0 -1
  222. package/dist/native-session-supervisor-DtuN1Dgs.mjs +0 -1
  223. package/dist/{adapter-binding-CaYBrIkL.d.mts → adapter-binding-DF-j-XHg.d.mts} +0 -0
  224. package/dist/{base-orchestrator-1ofFsqUz.d.mts → base-orchestrator-FNFJ6Cwf.d.mts} +0 -0
  225. package/dist/{capability-service-CUN0MIS7.d.mts → capability-service-BHcRd1td.d.mts} +0 -0
  226. package/dist/{client-BY3sBW2L.d.mts → client-Sx_N8LXo.d.mts} +0 -0
  227. package/dist/{client-binary-version-verifier-BeO4Eptw.d.mts → client-binary-version-verifier-C8gtKQFO.d.mts} +0 -0
  228. package/dist/{clients-namespace-D92YsbKI.d.mts → clients-namespace-CASHxXUM.d.mts} +0 -0
  229. package/dist/{config-namespace-OEckUfVE.d.mts → config-namespace-CeTODseW.d.mts} +0 -0
  230. package/dist/{credential-ref-w4ZYpYW0.d.mts → credential-ref-MsnUkz9G.d.mts} +0 -0
  231. package/dist/{definition-DLJg-P4G.d.mts → definition-D2SO1tX-.d.mts} +0 -0
  232. package/dist/{execution-attempt-repository-DOb5V4N2.d.mts → execution-attempt-repository-C2XKRZ3O.d.mts} +0 -0
  233. package/dist/{extension-discovery-Rup-gANp.d.mts → extension-discovery-BqSPn73R.d.mts} +0 -0
  234. package/dist/{filesystem-service-BmavE-uO.d.mts → filesystem-service-5Ecp3nSV.d.mts} +0 -0
  235. package/dist/{index-DubyRZD9.d.mts → index-62OoZLGr.d.mts} +0 -0
  236. package/dist/{index-DEx4ZFkz.d.mts → index-BCuWtlv5.d.mts} +0 -0
  237. package/dist/{index-BneZFJ7x.d.mts → index-BEPn58tG.d.mts} +0 -0
  238. package/dist/{index-CpN2C9jq.d.mts → index-BOxMyaqG.d.mts} +0 -0
  239. package/dist/{index-fxh7TB0q.d.mts → index-BTd3fTkW.d.mts} +0 -0
  240. package/dist/{index--gbsE1W0.d.mts → index-B_Hf4XPX.d.mts} +0 -0
  241. package/dist/{index-BQYGOXY5.d.mts → index-BjrbddkU.d.mts} +0 -0
  242. package/dist/{index-D7smT-YD.d.mts → index-BleQ0SR7.d.mts} +0 -0
  243. package/dist/{index-BDcK7jqJ2.d.mts → index-Bmb7jPIe2.d.mts} +0 -0
  244. package/dist/{index-CvdvuhTL2.d.mts → index-By1UhKYU2.d.mts} +0 -0
  245. package/dist/{index-YOXWpZAS.d.mts → index-CURT4JaX.d.mts} +0 -0
  246. package/dist/{index-CCTzitBA.d.mts → index-Ce6-SiB3.d.mts} +0 -0
  247. package/dist/{index-DxkSkszz.d.mts → index-CwVSr7Ow.d.mts} +0 -0
  248. package/dist/{index-C2StVLk4.d.mts → index-DAqAa9aL.d.mts} +0 -0
  249. package/dist/{index-CsRPJ9FV.d.mts → index-DDnY7JhE.d.mts} +0 -0
  250. package/dist/{index-DTvYp2GT.d.mts → index-DMgbNdEU.d.mts} +0 -0
  251. package/dist/{index-BD1SbHpP.d.mts → index-DOui-7u2.d.mts} +0 -0
  252. package/dist/{index-BujgCaKt.d.mts → index-DsmyofuM.d.mts} +0 -0
  253. package/dist/{index-DwOpaQAE.d.mts → index-N0-r5Hcd.d.mts} +0 -0
  254. package/dist/{index-Cj_V1aRL.d.mts → index-_OD_Nz3m.d.mts} +0 -0
  255. package/dist/{index-TBJ1kIGA.d.mts → index-rik4Uc5G.d.mts} +0 -0
  256. package/dist/{index-D3peNmHN2.d.mts → index-u0EteHlR2.d.mts} +0 -0
  257. package/dist/{index-B36rL4gp.d.mts → index-w1AeWV4F.d.mts} +0 -0
  258. package/dist/{index-anIxF_eT.d.mts → index-wGlFWRXg.d.mts} +0 -0
  259. package/dist/{index-zqo2mX_Z.d.mts → index-z_wA9LhQ.d.mts} +0 -0
  260. package/dist/{json-value-Bjl8jzom.d.mts → json-value--pv1-OHx.d.mts} +0 -0
  261. package/dist/{namespace-DudchWPb.d.mts → namespace-6O0G1s65.d.mts} +0 -0
  262. package/dist/{namespace-hlhPqSsw.d.mts → namespace-CHSwZhH7.d.mts} +0 -0
  263. package/dist/{namespace-D09uQ231.d.mts → namespace-CJ5sH_Bp.d.mts} +0 -0
  264. package/dist/{namespace-DHLwz4o3.d.mts → namespace-CL9OyrHs.d.mts} +0 -0
  265. package/dist/{namespace-DHbrNQYD.d.mts → namespace-D38Fmd0E.d.mts} +0 -0
  266. package/dist/{namespace-MW-Eg_yB.d.mts → namespace-D6W4Erwp.d.mts} +0 -0
  267. package/dist/{namespace-CxEQv9iZ.d.mts → namespace-DbtfwD5Z.d.mts} +0 -0
  268. package/dist/{namespace-Dz5_Hrz7.d.mts → namespace-QV_2m25r.d.mts} +0 -0
  269. package/dist/{namespace-DyD06b5-.d.mts → namespace-Sd6qj6w22.d.mts} +0 -0
  270. package/dist/{orchestrator-shared-ChU5qRSe.d.mts → orchestrator-shared-Bvo0u-1D.d.mts} +0 -0
  271. package/dist/{packages-D2s51nGU.d.mts → packages-KX9yofCa.d.mts} +0 -0
  272. package/dist/{providers-namespace-BLVt8OyP.d.mts → providers-namespace-B-l-OQZk.d.mts} +0 -0
  273. package/dist/{runtime-inputs-BU_kBrP7.d.mts → runtime-inputs-B7nWstrY.d.mts} +0 -0
  274. package/dist/{schema-FY0EakKe.d.mts → schema-De6d0FWI.d.mts} +0 -0
  275. package/dist/{schemas-CqawCYTY.d.mts → schemas-BGTuiO3u.d.mts} +0 -0
  276. package/dist/{schemas-3KTmPuZg.d.mts → schemas-BXkSHQaF.d.mts} +0 -0
  277. package/dist/{schemas-B-5_Dp4_.d.mts → schemas-C0Fb2-LN.d.mts} +0 -0
  278. package/dist/{schemas-DiXL8NfA.d.mts → schemas-Cb9OJ9va.d.mts} +0 -0
  279. package/dist/{schemas-rMUsvzeJ.d.mts → schemas-CuOZoC08.d.mts} +8 -8
  280. /package/dist/{schemas-CBBzvIh0.d.mts → schemas-Dxfk39-v.d.mts} +0 -0
  281. /package/dist/{schemas-BegArpU_.d.mts → schemas-feb64ScA.d.mts} +0 -0
  282. /package/dist/{server-lifecycle-CTJvpdeL.d.mts → server-lifecycle-BINetU26.d.mts} +0 -0
  283. /package/dist/{src-C0sw_Vs_.mjs → src-CkKKoY0M.mjs} +0 -0
  284. /package/dist/{storage-namespace-definition-DiYr8UNl.d.mts → storage-namespace-definition-DV3IipmH.d.mts} +0 -0
  285. /package/dist/{types-DEGuc-fn.d.mts → types-B_mVEuYd.d.mts} +0 -0
  286. /package/dist/{types-CpEoQapk.d.mts → types-BrsmFcWl.d.mts} +0 -0
  287. /package/dist/{types-DciLiPMd.d.mts → types-CjoaGe_E.d.mts} +0 -0
  288. /package/dist/{types-BSx8YYlc.d.mts → types-CqVuKsLC.d.mts} +0 -0
  289. /package/dist/{types-Cuhnt15L.d.mts → types-D7WtaoMR.d.mts} +0 -0
  290. /package/dist/{window-registry-C3W2wtlX.d.mts → window-registry-1jI3f9ir.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- import { $t as SessionToolLedger, A as AgentTeardownArbiter, At as runBestEffortStage, Bt as MessageHandle, C as NormalizedCallUsage, Ct as ObservedExitOptions, D as AdapterProviderDefinition, Dt as reportBestEffortStages, E as StartAgentOptions, Et as exitWasObserved, F as TeardownSubject, Ft as unknownTeardown, Gt as MessageState, Ht as NormalizedMessageInput, I as CreateConnectorRuntimeOptions, It as CONNECTOR_EXIT_OBSERVATION_MS, Jt as AIModel, Kt as ProcessingState, Lt as SWAP_SETTLEMENT_WAIT_MS, M as ConnectorReplacementSettlement, Mt as TeardownReport, N as ConnectorSwapAdmission, Nt as aggregateTeardownReports, O as ConfigFactoryInput, Ot as reportObservedExit, P as ConnectorSwapHandover, Pt as rethrowTeardownFailure, Qt as LedgerSessionContext, R as AdapterAuthRuntimePreparer, Rt as AIAgentConnector, S as GetCapabilitiesResponsePayload, St as SupersededGeneration, T as SendMessageResponsePayload, Tt as describeTeardownFailure, Ut as normalizeMessageInput, Vt as markCompletedWithFinalResult, Wt as MessageResult, Xt as ReasoningLevelMap, Yt as AIReasoningLevel, Zt as ISessionToolLedger, _ as BaseAgentConnectorConfig, _t as BaseConnectorTurn, a as AgentCredentialChangeResponsePayload, at as WireSessionSubjects, b as ContextWindowInput, bt as ConnectorSessionConfig, c as AgentIdentity, ct as QueueableTurn, d as AgentMcpServersSetRequestPayload, dt as rejectQueuedHandles, en as ToolLedgerEntry, f as AgentMcpServersSetResponsePayload, ft as UserMessageQueue, g as AgentStartResult, gt as TurnSubjects, h as AgentSendMessageOptions, ht as ProceduralTurnState, i as AgentCredentialChangeRequestPayload, it as WireSessionConfig, j as ClosableConnectorRuntime, jt as stageFailure, k as IAdapterConfigFactory, kt as reportRepeatTeardown, l as AgentInterruptRequestPayload, lt as SESSION_CLOSED_QUEUE_ERROR, m as AgentModelChangeResponsePayload, mt as ProceduralTurnConfig, n as AgentConnectorConfigOverrides, nt as ProceduralAgentConnector, o as AgentCwdChangeRequestPayload, ot as MergeResult, p as AgentModelChangeRequestPayload, pt as ProceduralConnectorTurn, qt as SendMessageOptions, r as AgentContext, rt as ProceduralConnectorSession, s as AgentCwdChangeResponsePayload, st as ProcessQueueCallbacks, t as AIAgentConfig, u as AgentInterruptResponsePayload, ut as processQueueMessages, v as ConnectorSendMessageOptions, vt as PauseResult, w as SendMessageRequestPayload, wt as capTeardownEvidence, x as ExecutionContext, xt as GenerationRetirementLedger, y as ConnectorStartOptions, yt as BaseConnectorSession, zt as MessageDeliveryMode } from "../types-CpEoQapk.mjs";
2
- import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-1ofFsqUz.mjs";
1
+ import { $t as SessionToolLedger, A as AgentTeardownArbiter, At as runBestEffortStage, Bt as MessageHandle, C as NormalizedCallUsage, Ct as ObservedExitOptions, D as AdapterProviderDefinition, Dt as reportBestEffortStages, E as StartAgentOptions, Et as exitWasObserved, F as TeardownSubject, Ft as unknownTeardown, Gt as MessageState, Ht as NormalizedMessageInput, I as CreateConnectorRuntimeOptions, It as CONNECTOR_EXIT_OBSERVATION_MS, Jt as AIModel, Kt as ProcessingState, Lt as SWAP_SETTLEMENT_WAIT_MS, M as ConnectorReplacementSettlement, Mt as TeardownReport, N as ConnectorSwapAdmission, Nt as aggregateTeardownReports, O as ConfigFactoryInput, Ot as reportObservedExit, P as ConnectorSwapHandover, Pt as rethrowTeardownFailure, Qt as LedgerSessionContext, R as AdapterAuthRuntimePreparer, Rt as AIAgentConnector, S as GetCapabilitiesResponsePayload, St as SupersededGeneration, T as SendMessageResponsePayload, Tt as describeTeardownFailure, Ut as normalizeMessageInput, Vt as markCompletedWithFinalResult, Wt as MessageResult, Xt as ReasoningLevelMap, Yt as AIReasoningLevel, Zt as ISessionToolLedger, _ as BaseAgentConnectorConfig, _t as BaseConnectorTurn, a as AgentCredentialChangeResponsePayload, at as WireSessionSubjects, b as ContextWindowInput, bt as ConnectorSessionConfig, c as AgentIdentity, ct as QueueableTurn, d as AgentMcpServersSetRequestPayload, dt as rejectQueuedHandles, en as ToolLedgerEntry, f as AgentMcpServersSetResponsePayload, ft as UserMessageQueue, g as AgentStartResult, gt as TurnSubjects, h as AgentSendMessageOptions, ht as ProceduralTurnState, i as AgentCredentialChangeRequestPayload, it as WireSessionConfig, j as ClosableConnectorRuntime, jt as stageFailure, k as IAdapterConfigFactory, kt as reportRepeatTeardown, l as AgentInterruptRequestPayload, lt as SESSION_CLOSED_QUEUE_ERROR, m as AgentModelChangeResponsePayload, mt as ProceduralTurnConfig, n as AgentConnectorConfigOverrides, nt as ProceduralAgentConnector, o as AgentCwdChangeRequestPayload, ot as MergeResult, p as AgentModelChangeRequestPayload, pt as ProceduralConnectorTurn, qt as SendMessageOptions, r as AgentContext, rt as ProceduralConnectorSession, s as AgentCwdChangeResponsePayload, st as ProcessQueueCallbacks, t as AIAgentConfig, u as AgentInterruptResponsePayload, ut as processQueueMessages, v as ConnectorSendMessageOptions, vt as PauseResult, w as SendMessageRequestPayload, wt as capTeardownEvidence, x as ExecutionContext, xt as GenerationRetirementLedger, y as ConnectorStartOptions, yt as BaseConnectorSession, zt as MessageDeliveryMode } from "../types-BrsmFcWl.mjs";
2
+ import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-FNFJ6Cwf.mjs";
3
3
  import { z } from "zod";
4
4
  import * as _$_makaio_core0 from "@makaio/framework/core";
5
5
  import { CreateBusNamespaceOptions, ExtractSubjectPayload, FilterablePayloadIntersection, HandlerForSubjectDefinition, RegistrableBusNamespaceDefinition, RequestContext, SchemaRecord, ScopedSubjectDefinition, SubjectDefinition, SubjectRecordFromSchemaRecord } from "@makaio/framework/core";
@@ -1,4 +1,4 @@
1
- import { _ as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-1ofFsqUz.mjs";
1
+ import { _ as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-FNFJ6Cwf.mjs";
2
2
 
3
3
  //#region adapters/core/src/log-importer/jsonl-parser.d.ts
4
4
  /**
@@ -1929,6 +1929,23 @@ interface BusTransport {
1929
1929
  nodeId: string;
1930
1930
  payload: unknown;
1931
1931
  }> : boolean>;
1932
+ /**
1933
+ * Optionally deliver an event to one trusted transport connection.
1934
+ *
1935
+ * The connection ID comes from a locally-derived `TransportReceiveContext`;
1936
+ * it is never supplied on the wire. Implementations must not fall back to
1937
+ * broadcast when the connection no longer exists.
1938
+ * @param message - Event to deliver.
1939
+ * @param connectionId - Transport-local connection identity.
1940
+ * @returns Whether the event reached the still-connected target.
1941
+ */
1942
+ sendToConnection?(message: BusEventMessage, connectionId: string): Promise<boolean>;
1943
+ /**
1944
+ * Observe trusted remote-connection teardown.
1945
+ * @param handler - Invoked after the connection is no longer routable.
1946
+ * @returns Unsubscribe function.
1947
+ */
1948
+ onConnectionClosed?(handler: (connectionId: string) => void): () => void;
1932
1949
  /**
1933
1950
  * Optional: cancel/cleanup pending correlation state for an in-flight request.
1934
1951
  *
@@ -2219,13 +2236,21 @@ interface EmitOptions {
2219
2236
  * Can be provided as a Set or Array of transport names.
2220
2237
  */
2221
2238
  transports?: Set<BusTransportKeys> | Array<BusTransportKeys>;
2239
+ /**
2240
+ * Deliver only to this trusted connection on the selected transport.
2241
+ *
2242
+ * This is server-local routing metadata, never a wire field. Each selected
2243
+ * transport must implement connection-scoped delivery; a missing target is
2244
+ * treated as an undelivered event and never widened to a broadcast.
2245
+ */
2246
+ connectionId?: string;
2222
2247
  }
2223
2248
  /**
2224
2249
  * Options for making requests.
2225
2250
  *
2226
2251
  * Extends EmitOptions with request-specific settings like timeout.
2227
2252
  */
2228
- interface RequestOptions extends EmitOptions {
2253
+ interface RequestOptions extends Omit<EmitOptions, 'connectionId'> {
2229
2254
  /**
2230
2255
  * Timeout in milliseconds. Defaults to DEFAULT_REQUEST_TIMEOUT_MS (60 seconds) if not specified.
2231
2256
  * Use `0` for no automatic timeout — the request stays open until resolved,
@@ -3936,6 +3961,25 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
3936
3961
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3937
3962
  mcpSessionContext: z.ZodOptional<z.ZodObject<{
3938
3963
  sessionId: z.ZodString;
3964
+ directTools: z.ZodArray<z.ZodObject<{
3965
+ fullName: z.ZodString;
3966
+ originalName: z.ZodString;
3967
+ serverName: z.ZodString;
3968
+ description: z.ZodOptional<z.ZodString>;
3969
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3970
+ exposureMode: z.ZodEnum<{
3971
+ discovery: "discovery";
3972
+ direct: "direct";
3973
+ hidden: "hidden";
3974
+ }>;
3975
+ enabled: z.ZodBoolean;
3976
+ enabledBy: z.ZodOptional<z.ZodEnum<{
3977
+ discovery: "discovery";
3978
+ toolset: "toolset";
3979
+ }>>;
3980
+ enabledAt: z.ZodOptional<z.ZodNumber>;
3981
+ exposed: z.ZodBoolean;
3982
+ }, z.core.$strip>>;
3939
3983
  servers: z.ZodArray<z.ZodObject<{
3940
3984
  name: z.ZodString;
3941
3985
  transport: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3972,28 +4016,9 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
3972
4016
  type: z.ZodLiteral<"http">;
3973
4017
  }, z.core.$strip>], "type">;
3974
4018
  exposureMode: z.ZodEnum<{
3975
- direct: "direct";
3976
4019
  discovery: "discovery";
3977
- }>;
3978
- }, z.core.$strip>>;
3979
- directTools: z.ZodArray<z.ZodObject<{
3980
- fullName: z.ZodString;
3981
- originalName: z.ZodString;
3982
- serverName: z.ZodString;
3983
- description: z.ZodOptional<z.ZodString>;
3984
- inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3985
- exposureMode: z.ZodEnum<{
3986
4020
  direct: "direct";
3987
- discovery: "discovery";
3988
- hidden: "hidden";
3989
4021
  }>;
3990
- enabled: z.ZodBoolean;
3991
- enabledBy: z.ZodOptional<z.ZodEnum<{
3992
- discovery: "discovery";
3993
- toolset: "toolset";
3994
- }>>;
3995
- enabledAt: z.ZodOptional<z.ZodNumber>;
3996
- exposed: z.ZodBoolean;
3997
4022
  }, z.core.$strip>>;
3998
4023
  discoverableTools: z.ZodArray<z.ZodObject<{
3999
4024
  fullName: z.ZodString;
@@ -4002,8 +4027,8 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
4002
4027
  description: z.ZodOptional<z.ZodString>;
4003
4028
  inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4004
4029
  exposureMode: z.ZodEnum<{
4005
- direct: "direct";
4006
4030
  discovery: "discovery";
4031
+ direct: "direct";
4007
4032
  hidden: "hidden";
4008
4033
  }>;
4009
4034
  enabled: z.ZodBoolean;
@@ -1 +1 @@
1
- import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as ee,M as te,N as f,O as ne,P as re,Q as p,R as m,S as h,T as ie,U as ae,V as g,W as oe,X as se,Y as ce,Z as le,_ as ue,a as de,at as fe,b as pe,d as _,et as me,f as he,g as v,h as y,i as ge,it as b,j as x,k as S,l as C,m as w,nt as T,o as E,p as D,q as O,r as k,rt as A,s as j,t as M,tt as N,u as P,v as F,w as I,x as L,y as _e,z as ve}from"../bus-CX0d5tTa.mjs";import{z as R}from"zod";const z={"channel.open":{request:R.object({endpoint:R.string(),token:R.string(),clientPubKey:R.string(),transports:R.array(R.string())}),response:R.object({channelId:R.string(),endpointPubKey:R.string()})}};function B(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=String.fromCharCode(t[e]);return btoa(n.join(``))}function V(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}async function H(){return globalThis.crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveKey`])}async function U(e){return B(await globalThis.crypto.subtle.exportKey(`raw`,e))}async function W(e){let t=V(e);return globalThis.crypto.subtle.importKey(`raw`,t,{name:`ECDH`,namedCurve:`P-256`},!1,[])}async function G(e,t){return globalThis.crypto.subtle.deriveKey({name:`ECDH`,public:t},e,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function K(e,t,n){let r=globalThis.crypto.getRandomValues(new Uint8Array(12)),i=new TextEncoder().encode(t),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.encrypt(a,e,i);return{iv:B(r),data:B(o)}}async function q(e,t,n){let r=V(t.iv),i=V(t.data),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.decrypt(a,e,i);return new TextDecoder().decode(o)}function J(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!1,payload:{},local:!1,channel:!1}}}function Y(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!0,payload:{},local:!1,channel:!1}}}var X=class{channelId;sharedKey;context;transportNames;cleanups=[];pendingRequests=new Set;closed=!1;constructor(e,t,n,r){this.channelId=e,this.sharedKey=t,this.context=n,this.transportNames=r;let i=J(e,`$close`);this.cleanups.push(this.registerEventHandler(i,t,e=>{this.handlePeerClose()}))}on(e,t,n){this.assertOpen();let r=this.requireKey(),i=e.$meta.isRequest?this.registerRequestHandler(e,r,t,n):this.registerEventHandler(e,r,t,n);return this.cleanups.push(i),()=>{i();let e=this.cleanups.indexOf(i);e!==-1&&this.cleanups.splice(e,1)}}once(e,t){this.assertOpen();let n=this.requireKey(),r=null,i=(e=>{let n=r;if(r=null,n){let e=this.cleanups.indexOf(n);e!==-1&&this.cleanups.splice(e,1)}return n?.(),t(e)});return r=e.$meta.isRequest?this.registerRequestHandler(e,n,i):this.registerEventHandler(e,n,i),this.cleanups.push(r),()=>{if(r){let e=r;r=null;let t=this.cleanups.indexOf(e);t!==-1&&this.cleanups.splice(t,1),e()}}}async emit(e,t){this.assertOpen();let n=this.requireKey(),r=J(this.channelId,e.subject),i=await K(n,JSON.stringify(t),`${this.channelId}:${e.subject}:evt`);await w(this.context,r,i,{...this.transportNames?{transports:[...this.transportNames]}:{}})}async request(e,t,n){this.assertOpen();let r=this.requireKey(),i=new AbortController;this.pendingRequests.add(i);try{let a=Y(this.channelId,e.subject),o=await K(r,JSON.stringify(t),`${this.channelId}:${e.subject}:req`),s=await q(r,await _(this.context,a,o,{signal:i.signal,...n?.timeout===void 0?{}:{timeout:n.timeout},...this.transportNames?{transports:[...this.transportNames]}:{}}),`${this.channelId}:${e.subject}:res`);return JSON.parse(s)}finally{this.pendingRequests.delete(i)}}async requestOptional(e,t,n){try{return{handled:!0,data:await this.request(e,t,n)}}catch(e){if(e instanceof l)return{handled:!1};throw e}}close(){if(this.closed)return;this.closed=!0;let e=this.sharedKey;if(e){let t=J(this.channelId,`$close`);K(e,JSON.stringify({}),`${this.channelId}:$close:evt`).then(e=>w(this.context,t,e,{...this.transportNames?{transports:[...this.transportNames]}:{}})).catch(()=>{})}this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null}assertOpen(){if(this.closed)throw new g(this.channelId)}requireKey(){return this.sharedKey}registerEventHandler(e,t,n,r){let i=J(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:evt`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r);return n({...e,payload:i})},r)}registerRequestHandler(e,t,n,r){let i=Y(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:req`,o=`${this.channelId}:${e.subject}:res`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r),s,c=e=>{s={value:e}},l=e=>{s={value:{...s?.value??{},...e}}},u=async()=>{let n=s;if(await e.next(),n!==void 0){s=n;return}let r=e.result;if(r!==void 0){let e=await q(t,r,o);s={value:JSON.parse(e)}}};if(await n({...e,payload:i,get result(){return s?.value},setResult:c,extendResult:l,next:u}),s!==void 0){let n=await K(t,JSON.stringify(s.value),o);e.setResult(n)}},r)}handlePeerClose(){this.closed||(this.closed=!0,this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null)}abortPendingRequests(){let e=new g(this.channelId);for(let t of this.pendingRequests)t.abort(e);this.pendingRequests.clear()}runCleanups(){for(let e of this.cleanups)try{e()}catch{}this.cleanups.length=0}};function Z(e){return e.namespaceRegistry.registerNamespace(p(`system`,z)).subjects.channel.open}function ye(e,t,n,r){let i=v(e,Z(e),async i=>{if(i.payload.endpoint!==t){await i.next();return}if(i.payload.token!==r.token)throw new c(t);let{publicKey:a,privateKey:o}=await H(),s=await G(o,await W(i.payload.clientPubKey)),l=globalThis.crypto.randomUUID(),u=new Set(e.transportRegistry.names()),d=new X(l,s,e,(i.payload.transports??[]).filter(e=>u.has(e)));try{n(d),i.setResult({channelId:l,endpointPubKey:await U(a)})}catch(e){throw d.close(),e}});return{name:t,token:r.token,close:i}}async function be(e,t,n){let r=Z(e),{publicKey:i,privateKey:a}=await H(),o=await U(i),s=n.transports!==void 0,c=s?[...n.transports]:[...e.transportRegistry.names()],l=s?{transports:c}:void 0,u=await _(e,r,{endpoint:t,token:n.token,clientPubKey:o,transports:c},l),d=await G(a,await W(u.endpointPubKey));return new X(u.channelId,d,e,c)}var xe=class{pending;constructor(){this.pending=new Map}track(e,t,n){return new Promise((r,i)=>{if(n?.aborted){i(s(n.reason));return}let a=t===0?void 0:setTimeout(()=>{let n=this.pending.get(e);n!==void 0&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(new f(e,t)))},t);if(this.pending.set(e,{resolve:r,reject:i,timeoutId:a,removeAbortListener:void 0}),n){let t=()=>{this.reject(e,s(n.reason))};n.addEventListener(`abort`,t,{once:!0});let r=()=>{n.removeEventListener(`abort`,t)},i=this.pending.get(e);i&&(i.removeAbortListener=r)}n?.aborted&&this.reject(e,s(n.reason))})}resolve(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.resolve(t))}reject(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(t))}cancel(e,t){this.reject(e,t??s(void 0))}rejectAll(e){for(let[t,n]of this.pending.entries())clearTimeout(n.timeoutId),n.removeAbortListener?.(),n.reject(e);this.pending.clear()}cleanup(){this.rejectAll(Error(`Transport disconnected`))}};const Se=p(`bus:lifecycle`,de).subjects;function Ce(e,t){let n={},r={},i={};for(let[t,a]of e)n[t]=a.priorities,r[t]=a.deliveryClass??`relayable`,a.filter!==void 0&&(i[t]=a.filter);return{type:`subscribe`,...t===void 0?{}:{ackId:t},subjects:n,deliveryClasses:r,...Object.keys(i).length>0&&{filters:i}}}function we(e,t){return{type:`unsubscribe`,...t===void 0?{}:{ackId:t},subjects:e}}function Q(e,t){let n=e.trim();if(n.length===0||n.startsWith(`extension:`))throw Error(`Invalid extensionName: expected a non-empty extension name without the "extension:" prefix.`);let r=n;return{...p(`extension:${r}`,t.schemas),domain:r,extensions:t.extensions??{}}}function $(e,t){return`${e}.${t}`}function Te(){let e=new Map;return{register(t){let n=$(t.namespace,t.subject);return e.set(n,t),()=>{e.get(n)===t&&e.delete(n)}},get(t,n){return e.get($(t,n))}}}const Ee=x.fact.$meta.namespace,De=x.fact.subject;function Oe(e){return e.type===`event`||e.type===`request`||e.type===`broadcast`}async function ke(e,t,n,r,i,a){let o=y({message:t,direction:`outbound`,observedAt:a(),machineId:i,namespaceRegistry:n,projectorRegistry:r});for(let n of o)await e.send({type:`event`,namespace:Ee,subject:De,payload:n,messageId:`${t.messageId}:telemetry:${n.factId}`,correlationId:t.correlationId})}function Ae(e,t,n,r,i){return async function(a,o){if(!Oe(a))return!0;if(await ke(e,a,t,n,r,i),a.type===`request`)throw Error(`Projected telemetry transport cannot satisfy request responses; exclude it from request routing.`);return a.type===`broadcast`?[]:!0}}function je(e){let{inner:t,namespaceRegistry:n,projectorRegistry:r,machineId:i,now:a=Date.now}=e,o={name:e.name,send:Ae(t,n,r,i,a),onReceive(e){return t.onReceive(async()=>{})},connect(){return t.connect()},disconnect(){return t.disconnect()},subscribe(){return Promise.resolve()},unsubscribe(){return Promise.resolve()},get ready(){return t.ready},get onNewReadySession(){return t.onNewReadySession},set onNewReadySession(e){t.onNewReadySession=e},get onConnected(){return t.onConnected},set onConnected(e){t.onConnected=e},get onDisconnected(){return t.onDisconnected},set onDisconnected(e){t.onDisconnected=e},isReady(){return t.isReady?.()??!0},cancelRequest(e,n){t.cancelRequest?.(e,n)},onBroadcastResults(e,n,r){t.onBroadcastResults?.(e,n,r)}};return t.reconnect&&(o.reconnect=()=>t.reconnect()),o}export{ae as BusAbortError,d as BusError,Se as BusLifecycle,m as CONNECTION_LOST_ERROR_CODE,c as ChannelAuthError,g as ChannelClosedError,n as ChannelOnlyError,ve as ConnectionLostError,xe as CorrelationTracker,he as DEFAULT_READINESS_TIMEOUT_MS,D as DEFAULT_REQUEST_TIMEOUT_MS,pe as LOCAL_ORIGIN,ee as LocalSubjectError,M as MakaioBus,o as NO_HANDLER_ERROR_CODE,l as NoHandlerError,P as OnceAbortError,L as REMOTE_ORIGIN,re as RequestError,z as SystemChannelSchemas,f as TimeoutError,te as ValidationError,F as __resetWarnedSubjects,Ce as buildSubscribeMessage,we as buildUnsubscribeMessage,b as channelSubject,me as collectorOnlySubject,k as createBusContext,ge as createBusInstance,ye as createChannelEndpoint,Q as createExtensionNamespace,C as createFilteredBus,je as createProjectedTelemetryTransport,Te as createSubjectTelemetryProjectorRegistry,N as defaultTransports,E as defineSubjectExtension,a as deserializeTransportError,j as extendSubject,i as findInErrorChain,e as getFullSubjectForSubjectDefinition,O as getPath,ne as getSubjectFromBusMessage,h as handleCorrelationResponse,T as hostLocalRequest,S as isNoHandlerErrorForSubject,oe as isRequestCancellation,fe as isRequestSchema,A as localSubject,se as matchesAnySubscription,u as matchesFilter,le as matchesSubscription,ce as mergeFilters,be as openChannel,_e as parseBusUrl,y as projectSubjectTelemetryFacts,r as serializeTransportError,I as shouldReceiveMessage,ie as trackMessageCorrelation,t as transportErrorData,ue as waitForSubscriptionPropagation};
1
+ import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as ee,M as te,N as f,O as ne,P as re,Q as p,R as m,S as h,T as ie,U as ae,V as g,W as oe,X as se,Y as ce,Z as le,_ as ue,a as de,at as fe,b as pe,d as _,et as me,f as he,g as v,h as y,i as ge,it as b,j as x,k as S,l as C,m as w,nt as T,o as E,p as D,q as O,r as k,rt as A,s as j,t as M,tt as N,u as P,v as F,w as I,x as L,y as _e,z as ve}from"../bus-D4DBDaoS.mjs";import{z as R}from"zod";const z={"channel.open":{request:R.object({endpoint:R.string(),token:R.string(),clientPubKey:R.string(),transports:R.array(R.string())}),response:R.object({channelId:R.string(),endpointPubKey:R.string()})}};function B(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=String.fromCharCode(t[e]);return btoa(n.join(``))}function V(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}async function H(){return globalThis.crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveKey`])}async function U(e){return B(await globalThis.crypto.subtle.exportKey(`raw`,e))}async function W(e){let t=V(e);return globalThis.crypto.subtle.importKey(`raw`,t,{name:`ECDH`,namedCurve:`P-256`},!1,[])}async function G(e,t){return globalThis.crypto.subtle.deriveKey({name:`ECDH`,public:t},e,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function K(e,t,n){let r=globalThis.crypto.getRandomValues(new Uint8Array(12)),i=new TextEncoder().encode(t),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.encrypt(a,e,i);return{iv:B(r),data:B(o)}}async function q(e,t,n){let r=V(t.iv),i=V(t.data),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.decrypt(a,e,i);return new TextDecoder().decode(o)}function J(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!1,payload:{},local:!1,channel:!1}}}function Y(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!0,payload:{},local:!1,channel:!1}}}var X=class{channelId;sharedKey;context;transportNames;cleanups=[];pendingRequests=new Set;closed=!1;constructor(e,t,n,r){this.channelId=e,this.sharedKey=t,this.context=n,this.transportNames=r;let i=J(e,`$close`);this.cleanups.push(this.registerEventHandler(i,t,e=>{this.handlePeerClose()}))}on(e,t,n){this.assertOpen();let r=this.requireKey(),i=e.$meta.isRequest?this.registerRequestHandler(e,r,t,n):this.registerEventHandler(e,r,t,n);return this.cleanups.push(i),()=>{i();let e=this.cleanups.indexOf(i);e!==-1&&this.cleanups.splice(e,1)}}once(e,t){this.assertOpen();let n=this.requireKey(),r=null,i=(e=>{let n=r;if(r=null,n){let e=this.cleanups.indexOf(n);e!==-1&&this.cleanups.splice(e,1)}return n?.(),t(e)});return r=e.$meta.isRequest?this.registerRequestHandler(e,n,i):this.registerEventHandler(e,n,i),this.cleanups.push(r),()=>{if(r){let e=r;r=null;let t=this.cleanups.indexOf(e);t!==-1&&this.cleanups.splice(t,1),e()}}}async emit(e,t){this.assertOpen();let n=this.requireKey(),r=J(this.channelId,e.subject),i=await K(n,JSON.stringify(t),`${this.channelId}:${e.subject}:evt`);await w(this.context,r,i,{...this.transportNames?{transports:[...this.transportNames]}:{}})}async request(e,t,n){this.assertOpen();let r=this.requireKey(),i=new AbortController;this.pendingRequests.add(i);try{let a=Y(this.channelId,e.subject),o=await K(r,JSON.stringify(t),`${this.channelId}:${e.subject}:req`),s=await q(r,await _(this.context,a,o,{signal:i.signal,...n?.timeout===void 0?{}:{timeout:n.timeout},...this.transportNames?{transports:[...this.transportNames]}:{}}),`${this.channelId}:${e.subject}:res`);return JSON.parse(s)}finally{this.pendingRequests.delete(i)}}async requestOptional(e,t,n){try{return{handled:!0,data:await this.request(e,t,n)}}catch(e){if(e instanceof l)return{handled:!1};throw e}}close(){if(this.closed)return;this.closed=!0;let e=this.sharedKey;if(e){let t=J(this.channelId,`$close`);K(e,JSON.stringify({}),`${this.channelId}:$close:evt`).then(e=>w(this.context,t,e,{...this.transportNames?{transports:[...this.transportNames]}:{}})).catch(()=>{})}this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null}assertOpen(){if(this.closed)throw new g(this.channelId)}requireKey(){return this.sharedKey}registerEventHandler(e,t,n,r){let i=J(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:evt`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r);return n({...e,payload:i})},r)}registerRequestHandler(e,t,n,r){let i=Y(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:req`,o=`${this.channelId}:${e.subject}:res`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r),s,c=e=>{s={value:e}},l=e=>{s={value:{...s?.value??{},...e}}},u=async()=>{let n=s;if(await e.next(),n!==void 0){s=n;return}let r=e.result;if(r!==void 0){let e=await q(t,r,o);s={value:JSON.parse(e)}}};if(await n({...e,payload:i,get result(){return s?.value},setResult:c,extendResult:l,next:u}),s!==void 0){let n=await K(t,JSON.stringify(s.value),o);e.setResult(n)}},r)}handlePeerClose(){this.closed||(this.closed=!0,this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null)}abortPendingRequests(){let e=new g(this.channelId);for(let t of this.pendingRequests)t.abort(e);this.pendingRequests.clear()}runCleanups(){for(let e of this.cleanups)try{e()}catch{}this.cleanups.length=0}};function Z(e){return e.namespaceRegistry.registerNamespace(p(`system`,z)).subjects.channel.open}function ye(e,t,n,r){let i=v(e,Z(e),async i=>{if(i.payload.endpoint!==t){await i.next();return}if(i.payload.token!==r.token)throw new c(t);let{publicKey:a,privateKey:o}=await H(),s=await G(o,await W(i.payload.clientPubKey)),l=globalThis.crypto.randomUUID(),u=new Set(e.transportRegistry.names()),d=new X(l,s,e,(i.payload.transports??[]).filter(e=>u.has(e)));try{n(d),i.setResult({channelId:l,endpointPubKey:await U(a)})}catch(e){throw d.close(),e}});return{name:t,token:r.token,close:i}}async function be(e,t,n){let r=Z(e),{publicKey:i,privateKey:a}=await H(),o=await U(i),s=n.transports!==void 0,c=s?[...n.transports]:[...e.transportRegistry.names()],l=s?{transports:c}:void 0,u=await _(e,r,{endpoint:t,token:n.token,clientPubKey:o,transports:c},l),d=await G(a,await W(u.endpointPubKey));return new X(u.channelId,d,e,c)}var xe=class{pending;constructor(){this.pending=new Map}track(e,t,n){return new Promise((r,i)=>{if(n?.aborted){i(s(n.reason));return}let a=t===0?void 0:setTimeout(()=>{let n=this.pending.get(e);n!==void 0&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(new f(e,t)))},t);if(this.pending.set(e,{resolve:r,reject:i,timeoutId:a,removeAbortListener:void 0}),n){let t=()=>{this.reject(e,s(n.reason))};n.addEventListener(`abort`,t,{once:!0});let r=()=>{n.removeEventListener(`abort`,t)},i=this.pending.get(e);i&&(i.removeAbortListener=r)}n?.aborted&&this.reject(e,s(n.reason))})}resolve(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.resolve(t))}reject(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(t))}cancel(e,t){this.reject(e,t??s(void 0))}rejectAll(e){for(let[t,n]of this.pending.entries())clearTimeout(n.timeoutId),n.removeAbortListener?.(),n.reject(e);this.pending.clear()}cleanup(){this.rejectAll(Error(`Transport disconnected`))}};const Se=p(`bus:lifecycle`,de).subjects;function Ce(e,t){let n={},r={},i={};for(let[t,a]of e)n[t]=a.priorities,r[t]=a.deliveryClass??`relayable`,a.filter!==void 0&&(i[t]=a.filter);return{type:`subscribe`,...t===void 0?{}:{ackId:t},subjects:n,deliveryClasses:r,...Object.keys(i).length>0&&{filters:i}}}function we(e,t){return{type:`unsubscribe`,...t===void 0?{}:{ackId:t},subjects:e}}function Q(e,t){let n=e.trim();if(n.length===0||n.startsWith(`extension:`))throw Error(`Invalid extensionName: expected a non-empty extension name without the "extension:" prefix.`);let r=n;return{...p(`extension:${r}`,t.schemas),domain:r,extensions:t.extensions??{}}}function $(e,t){return`${e}.${t}`}function Te(){let e=new Map;return{register(t){let n=$(t.namespace,t.subject);return e.set(n,t),()=>{e.get(n)===t&&e.delete(n)}},get(t,n){return e.get($(t,n))}}}const Ee=x.fact.$meta.namespace,De=x.fact.subject;function Oe(e){return e.type===`event`||e.type===`request`||e.type===`broadcast`}async function ke(e,t,n,r,i,a){let o=y({message:t,direction:`outbound`,observedAt:a(),machineId:i,namespaceRegistry:n,projectorRegistry:r});for(let n of o)await e.send({type:`event`,namespace:Ee,subject:De,payload:n,messageId:`${t.messageId}:telemetry:${n.factId}`,correlationId:t.correlationId})}function Ae(e,t,n,r,i){return async function(a,o){if(!Oe(a))return!0;if(await ke(e,a,t,n,r,i),a.type===`request`)throw Error(`Projected telemetry transport cannot satisfy request responses; exclude it from request routing.`);return a.type===`broadcast`?[]:!0}}function je(e){let{inner:t,namespaceRegistry:n,projectorRegistry:r,machineId:i,now:a=Date.now}=e,o={name:e.name,send:Ae(t,n,r,i,a),onReceive(e){return t.onReceive(async()=>{})},connect(){return t.connect()},disconnect(){return t.disconnect()},subscribe(){return Promise.resolve()},unsubscribe(){return Promise.resolve()},get ready(){return t.ready},get onNewReadySession(){return t.onNewReadySession},set onNewReadySession(e){t.onNewReadySession=e},get onConnected(){return t.onConnected},set onConnected(e){t.onConnected=e},get onDisconnected(){return t.onDisconnected},set onDisconnected(e){t.onDisconnected=e},isReady(){return t.isReady?.()??!0},cancelRequest(e,n){t.cancelRequest?.(e,n)},onBroadcastResults(e,n,r){t.onBroadcastResults?.(e,n,r)}};return t.reconnect&&(o.reconnect=()=>t.reconnect()),o}export{ae as BusAbortError,d as BusError,Se as BusLifecycle,m as CONNECTION_LOST_ERROR_CODE,c as ChannelAuthError,g as ChannelClosedError,n as ChannelOnlyError,ve as ConnectionLostError,xe as CorrelationTracker,he as DEFAULT_READINESS_TIMEOUT_MS,D as DEFAULT_REQUEST_TIMEOUT_MS,pe as LOCAL_ORIGIN,ee as LocalSubjectError,M as MakaioBus,o as NO_HANDLER_ERROR_CODE,l as NoHandlerError,P as OnceAbortError,L as REMOTE_ORIGIN,re as RequestError,z as SystemChannelSchemas,f as TimeoutError,te as ValidationError,F as __resetWarnedSubjects,Ce as buildSubscribeMessage,we as buildUnsubscribeMessage,b as channelSubject,me as collectorOnlySubject,k as createBusContext,ge as createBusInstance,ye as createChannelEndpoint,Q as createExtensionNamespace,C as createFilteredBus,je as createProjectedTelemetryTransport,Te as createSubjectTelemetryProjectorRegistry,N as defaultTransports,E as defineSubjectExtension,a as deserializeTransportError,j as extendSubject,i as findInErrorChain,e as getFullSubjectForSubjectDefinition,O as getPath,ne as getSubjectFromBusMessage,h as handleCorrelationResponse,T as hostLocalRequest,S as isNoHandlerErrorForSubject,oe as isRequestCancellation,fe as isRequestSchema,A as localSubject,se as matchesAnySubscription,u as matchesFilter,le as matchesSubscription,ce as mergeFilters,be as openChannel,_e as parseBusUrl,y as projectSubjectTelemetryFacts,r as serializeTransportError,I as shouldReceiveMessage,ie as trackMessageCorrelation,t as transportErrorData,ue as waitForSubscriptionPropagation};