@makaio/framework 1.0.0-dev-1781022866275 → 1.0.0-dev-1781023871421

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 (456) hide show
  1. package/dist/.makaio-build.json +5 -0
  2. package/dist/account-identity-DT5NOtFi.mjs +1 -0
  3. package/dist/adapter-C1eI-fGV.mjs +1 -0
  4. package/dist/adapters/acp-client/index.d.mts +6208 -0
  5. package/dist/adapters/acp-client/index.mjs +3 -0
  6. package/dist/adapters/config/index.d.mts +429 -0
  7. package/dist/adapters/config/index.mjs +1 -0
  8. package/dist/adapters/index.d.mts +4202 -0
  9. package/dist/adapters/index.mjs +18 -0
  10. package/dist/adapters/node.d.mts +263 -0
  11. package/dist/adapters/node.mjs +4 -0
  12. package/dist/adapters/stream-session/index.d.mts +1414 -0
  13. package/dist/adapters/stream-session/index.mjs +1 -0
  14. package/dist/adapters/stream-session/testing/index.d.mts +29 -0
  15. package/dist/adapters/stream-session/testing/index.mjs +1 -0
  16. package/dist/artifact-B3npq1cy.mjs +1 -0
  17. package/dist/base-orchestrator-wyumsn3b.d.mts +772 -0
  18. package/dist/bus/index.d.mts +3994 -0
  19. package/dist/bus/index.mjs +1 -0
  20. package/dist/bus-Caz3Jpbc.mjs +1 -0
  21. package/dist/bus-Hb-LGzgb.mjs +2 -0
  22. package/dist/capability-service-CJbmhfv9.mjs +1 -0
  23. package/dist/chunk-DTipWd-i.mjs +1 -0
  24. package/dist/chunk-cpUYaJdV.mjs +1 -0
  25. package/dist/cleanEnvForAdapter-KkYzQa1f.mjs +1 -0
  26. package/dist/client-bx74gm4R.mjs +1 -0
  27. package/dist/clients/index.d.mts +2639 -0
  28. package/dist/clients/index.mjs +2 -0
  29. package/dist/clients-namespace-GmSJpBUV.d.mts +332 -0
  30. package/dist/config-namespace-CPY9YsR8.d.mts +638 -0
  31. package/dist/config-namespace-ncYg2ct_.mjs +1 -0
  32. package/dist/contracts/adapter/index.d.mts +3 -0
  33. package/dist/contracts/adapter/index.mjs +1 -0
  34. package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
  35. package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
  36. package/dist/contracts/artifact/index.d.mts +2 -0
  37. package/dist/contracts/artifact/index.mjs +1 -0
  38. package/dist/contracts/client/index.d.mts +3 -0
  39. package/dist/contracts/client/index.mjs +1 -0
  40. package/dist/contracts/common/index.d.mts +2 -0
  41. package/dist/contracts/common/index.mjs +1 -0
  42. package/dist/contracts/config/index.d.mts +455 -0
  43. package/dist/contracts/config/index.mjs +1 -0
  44. package/dist/contracts/extension/index.d.mts +4 -0
  45. package/dist/contracts/extension/index.mjs +1 -0
  46. package/dist/contracts/facet/index.d.mts +2 -0
  47. package/dist/contracts/facet/index.mjs +1 -0
  48. package/dist/contracts/harness/index.d.mts +2 -0
  49. package/dist/contracts/harness/index.mjs +1 -0
  50. package/dist/contracts/host/index.d.mts +2 -0
  51. package/dist/contracts/host/index.mjs +1 -0
  52. package/dist/contracts/index.d.mts +23046 -0
  53. package/dist/contracts/index.mjs +1 -0
  54. package/dist/contracts/materialization/index.d.mts +4 -0
  55. package/dist/contracts/materialization/index.mjs +1 -0
  56. package/dist/contracts/model-registry/index.d.mts +2 -0
  57. package/dist/contracts/model-registry/index.mjs +1 -0
  58. package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
  59. package/dist/contracts/native-session-supervisor/index.mjs +1 -0
  60. package/dist/contracts/platform/index.d.mts +2 -0
  61. package/dist/contracts/platform/index.mjs +1 -0
  62. package/dist/contracts/provider/index.d.mts +3 -0
  63. package/dist/contracts/provider/index.mjs +1 -0
  64. package/dist/contracts/session/index.d.mts +3 -0
  65. package/dist/contracts/session/index.mjs +1 -0
  66. package/dist/contracts/shared/index.d.mts +2 -0
  67. package/dist/contracts/shared/index.mjs +1 -0
  68. package/dist/contracts/skill/index.d.mts +2 -0
  69. package/dist/contracts/skill/index.mjs +1 -0
  70. package/dist/contracts/telemetry/index.d.mts +2 -0
  71. package/dist/contracts/telemetry/index.mjs +1 -0
  72. package/dist/contracts/timeout/index.d.mts +2 -0
  73. package/dist/contracts/timeout/index.mjs +1 -0
  74. package/dist/contracts/toast/index.d.mts +198 -0
  75. package/dist/contracts/toast/index.mjs +1 -0
  76. package/dist/contracts/variant/index.d.mts +2 -0
  77. package/dist/contracts/variant/index.mjs +1 -0
  78. package/dist/core/index.d.mts +1263 -0
  79. package/dist/core/index.mjs +1 -0
  80. package/dist/credential-ref-YWQQENEo.mjs +1 -0
  81. package/dist/cursor-storage-CtVJ3JzB.mjs +1 -0
  82. package/dist/definition-BLCdXGzh.d.mts +383 -0
  83. package/dist/definition-CrgHIpTK.d.mts +60 -0
  84. package/dist/definition-DZMXOnjX.mjs +1 -0
  85. package/dist/definition-pkJ6szUl.d.mts +158 -0
  86. package/dist/drizzle-Eq8W1EbD.mjs +1 -0
  87. package/dist/event-Ca2yUf5i.mjs +1 -0
  88. package/dist/execution-target-CRPTfZlc.mjs +1 -0
  89. package/dist/extension-C-4BHMRI.mjs +1 -0
  90. package/dist/extension-CpIUgBKI.mjs +1 -0
  91. package/dist/extension-namespace-cMh_mMiL.mjs +1 -0
  92. package/dist/facet-BuwhrThl.mjs +1 -0
  93. package/dist/filesystem-service-B8rhBRgB.mjs +1 -0
  94. package/dist/filesystem-service-p_iJVHd4.d.mts +66 -0
  95. package/dist/git/index.d.mts +210 -0
  96. package/dist/git/index.mjs +18 -0
  97. package/dist/globby-rtWVaFHv.mjs +41 -0
  98. package/dist/handlers-CkTsQLra.mjs +41 -0
  99. package/dist/harness-BRCMcvQN.mjs +1 -0
  100. package/dist/hooks/index.d.mts +423 -0
  101. package/dist/hooks/index.mjs +1 -0
  102. package/dist/host-Br9VuOyr.mjs +1 -0
  103. package/dist/identity-Cz2IeEtm.mjs +1 -0
  104. package/dist/index-472sOmsW.d.mts +218 -0
  105. package/dist/index-8SZkg7s6.d.mts +353 -0
  106. package/dist/index-B3PK4FIn.d.mts +5116 -0
  107. package/dist/index-B80L4YqA.d.mts +180 -0
  108. package/dist/index-BFg9BUpx.d.mts +355 -0
  109. package/dist/index-BGfWS6GE.d.mts +483 -0
  110. package/dist/index-BVgfS-AJ.d.mts +109 -0
  111. package/dist/index-B_zQC98V.d.mts +995 -0
  112. package/dist/index-Bh_Ne7LF.d.mts +1008 -0
  113. package/dist/index-Bvb2mMH6.d.mts +1730 -0
  114. package/dist/index-CCGVh9BF2.d.mts +749 -0
  115. package/dist/index-CGmcS0Ma.d.mts +412 -0
  116. package/dist/index-CHQ1SqT0.d.mts +117 -0
  117. package/dist/index-CLpjm52M.d.mts +183 -0
  118. package/dist/index-Caig6TeF.d.mts +6746 -0
  119. package/dist/index-CelJCBjk.d.mts +2992 -0
  120. package/dist/index-ChunCFu4.d.mts +11 -0
  121. package/dist/index-Cm0dUkWL.d.mts +4651 -0
  122. package/dist/index-CokQYGVP.d.mts +184 -0
  123. package/dist/index-Cs0kZXIz2.d.mts +37 -0
  124. package/dist/index-D5d5HeWI2.d.mts +259 -0
  125. package/dist/index-D90OmGmV.d.mts +389 -0
  126. package/dist/index-D9MwJ2Q8.d.mts +67 -0
  127. package/dist/index-DANINzMu.d.mts +40 -0
  128. package/dist/index-DBw-89vC2.d.mts +3640 -0
  129. package/dist/index-DGBu6bHi2.d.mts +438 -0
  130. package/dist/index-DKC62dY5.d.mts +146 -0
  131. package/dist/index-DKia0MX1.d.mts +43 -0
  132. package/dist/index-DMKnON5s.d.mts +28 -0
  133. package/dist/index-DUaw0Dw8.d.mts +14747 -0
  134. package/dist/index-De3kPhlN.d.mts +72 -0
  135. package/dist/index-L4GjJDKb.d.mts +822 -0
  136. package/dist/index-U-A8eyGT.d.mts +1490 -0
  137. package/dist/index-eemAKwsB.d.mts +362 -0
  138. package/dist/index-mNec7V-9.d.mts +1075 -0
  139. package/dist/index-soFznFCy2.d.mts +89 -0
  140. package/dist/index-vtXJuwrz.d.mts +40 -0
  141. package/dist/index-x_lVDp_J.d.mts +134 -0
  142. package/dist/json-value-CmhSGMLv.mjs +1 -0
  143. package/dist/kernel/cli/index.d.mts +143 -0
  144. package/dist/kernel/cli/index.mjs +1 -0
  145. package/dist/kernel/cli/schemas.d.mts +64 -0
  146. package/dist/kernel/cli/schemas.mjs +1 -0
  147. package/dist/kernel/extension/index.d.mts +2 -0
  148. package/dist/kernel/extension/index.mjs +1 -0
  149. package/dist/kernel/index.d.mts +296 -0
  150. package/dist/kernel/index.mjs +1 -0
  151. package/dist/kernel/namespace/index.d.mts +2 -0
  152. package/dist/kernel/namespace/index.mjs +1 -0
  153. package/dist/kernel/observability/index.d.mts +2 -0
  154. package/dist/kernel/observability/index.mjs +1 -0
  155. package/dist/kernel/providers/index.d.mts +2 -0
  156. package/dist/kernel/providers/index.mjs +1 -0
  157. package/dist/kernel/window/index.d.mts +2 -0
  158. package/dist/kernel/window/index.mjs +1 -0
  159. package/dist/materialization-CuUBu4XI.mjs +1 -0
  160. package/dist/model-registry-CfXytvzx.mjs +1 -0
  161. package/dist/model-registry-Scn_MC2d.mjs +1 -0
  162. package/dist/namespace-5QQqbF-B.d.mts +3133 -0
  163. package/dist/namespace-BM7Djng9.d.mts +189 -0
  164. package/dist/namespace-BoD94mrN.mjs +1 -0
  165. package/dist/namespace-BwzZJqTV.mjs +1 -0
  166. package/dist/namespace-CFLAmQfh.mjs +1 -0
  167. package/dist/namespace-CTm3nEvh.d.mts +51 -0
  168. package/dist/namespace-CaaNnKcR.d.mts +921 -0
  169. package/dist/namespace-CaoZ3S78.d.mts +43 -0
  170. package/dist/namespace-CxhsoFUP.d.mts +607 -0
  171. package/dist/namespace-DD8Oiqo7.d.mts +580 -0
  172. package/dist/namespace-DLovh2Ws.d.mts +1313 -0
  173. package/dist/namespace-DgqkaOVu.d.mts +768 -0
  174. package/dist/namespace-DkRgbZYn.mjs +1 -0
  175. package/dist/namespace-Dr8K0MCp.d.mts +2047 -0
  176. package/dist/namespace-DuXK5AYN.mjs +1 -0
  177. package/dist/namespace-EQniz-Aw.d.mts +142 -0
  178. package/dist/namespace-IV1QK__V.d.mts +159 -0
  179. package/dist/namespace-LViZ-EQk.mjs +1 -0
  180. package/dist/namespace-TyiTsLFv.d.mts +3020 -0
  181. package/dist/namespace-Yna5-Pws.mjs +1 -0
  182. package/dist/namespace-xcmbQlxh.mjs +1 -0
  183. package/dist/native-session-supervisor-B1TnaPUF.mjs +1 -0
  184. package/dist/node/bus-server/index.d.mts +178 -0
  185. package/dist/node/bus-server/index.mjs +1 -0
  186. package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
  187. package/dist/node/bus-server/server-lifecycle.mjs +1 -0
  188. package/dist/node/machine-identity/index.d.mts +85 -0
  189. package/dist/node/machine-identity/index.mjs +3 -0
  190. package/dist/node/transports/index.d.mts +1945 -0
  191. package/dist/node/transports/index.mjs +2 -0
  192. package/dist/orchestrator-shared-CIDiFJMD.mjs +1 -0
  193. package/dist/orchestrator-shared-Dfa7FMyw.d.mts +249 -0
  194. package/dist/package-DKVlsMP3.mjs +1 -0
  195. package/dist/platform-DZ7z-wXD.mjs +1 -0
  196. package/dist/profile-6ynCD5k3.mjs +1 -0
  197. package/dist/provider-context-CK6B4X_8.mjs +1 -0
  198. package/dist/providers/index.d.mts +135 -0
  199. package/dist/providers/index.mjs +1 -0
  200. package/dist/providers-namespace-DSEpli4A.d.mts +583 -0
  201. package/dist/providers-u8i15co9.mjs +1 -0
  202. package/dist/schema-CoyE6mPt.mjs +1 -0
  203. package/dist/schema-M5YTvSAG.d.mts +949 -0
  204. package/dist/schema-e0wU_lcV.mjs +1 -0
  205. package/dist/schema-introspection-Dn1jWQs1.mjs +1 -0
  206. package/dist/schemas-Bd0OjRQf.d.mts +46 -0
  207. package/dist/schemas-C46QfKzv.d.mts +459 -0
  208. package/dist/schemas-CDBSjg7o.d.mts +237 -0
  209. package/dist/schemas-CR1Rripy.mjs +1 -0
  210. package/dist/schemas-CVvwIfG4.mjs +1 -0
  211. package/dist/schemas-CaLhkkLn.mjs +1 -0
  212. package/dist/schemas-ClOOT1W6.d.mts +174 -0
  213. package/dist/schemas-DATniTHb.d.mts +182 -0
  214. package/dist/schemas-DE-GNmSD.mjs +1 -0
  215. package/dist/schemas-DVF1A4DF.d.mts +160 -0
  216. package/dist/schemas-DaRSfYLf.d.mts +73 -0
  217. package/dist/schemas-DiYVzG6e.d.mts +315 -0
  218. package/dist/schemas-hSrzflwZ.mjs +1 -0
  219. package/dist/schemas-j7ivZ2HI.d.mts +944 -0
  220. package/dist/schemas-jFe1AuI-.mjs +1 -0
  221. package/dist/schemas-wg_6PAdV.d.mts +153 -0
  222. package/dist/scoped-bus-04pwo1uM.mjs +1 -0
  223. package/dist/server-lifecycle-FXTPW39-.mjs +1 -0
  224. package/dist/server-lifecycle-YoSGFGnU.d.mts +160 -0
  225. package/dist/service-base/index.d.mts +98 -0
  226. package/dist/service-base/index.mjs +1 -0
  227. package/dist/services/adapter-runtime/index.d.mts +4 -0
  228. package/dist/services/adapter-runtime/index.mjs +1 -0
  229. package/dist/services/adapter-runtime/namespace.d.mts +2 -0
  230. package/dist/services/adapter-runtime/namespace.mjs +1 -0
  231. package/dist/services/adapter-runtime/schemas.d.mts +2 -0
  232. package/dist/services/adapter-runtime/schemas.mjs +1 -0
  233. package/dist/services/adapter-subsystem/index.d.mts +3 -0
  234. package/dist/services/adapter-subsystem/index.mjs +1 -0
  235. package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
  236. package/dist/services/adapter-subsystem/namespace.mjs +1 -0
  237. package/dist/services/agent-runtime/index.d.mts +3 -0
  238. package/dist/services/agent-runtime/index.mjs +1 -0
  239. package/dist/services/agent-runtime/namespace.d.mts +2 -0
  240. package/dist/services/agent-runtime/namespace.mjs +1 -0
  241. package/dist/services/agent-runtime/schemas.d.mts +2 -0
  242. package/dist/services/agent-runtime/schemas.mjs +1 -0
  243. package/dist/services/capability/index.d.mts +2 -0
  244. package/dist/services/capability/index.mjs +1 -0
  245. package/dist/services/cli-detection/namespace.d.mts +56 -0
  246. package/dist/services/cli-detection/namespace.mjs +1 -0
  247. package/dist/services/codebase/index.d.mts +3 -0
  248. package/dist/services/codebase/index.mjs +1 -0
  249. package/dist/services/codebase/namespace.d.mts +2 -0
  250. package/dist/services/codebase/namespace.mjs +1 -0
  251. package/dist/services/codebase/schemas.d.mts +2 -0
  252. package/dist/services/codebase/schemas.mjs +1 -0
  253. package/dist/services/compression/index.d.mts +3 -0
  254. package/dist/services/compression/index.mjs +1 -0
  255. package/dist/services/compression/namespace.d.mts +2 -0
  256. package/dist/services/compression/namespace.mjs +1 -0
  257. package/dist/services/compression/schemas.d.mts +2 -0
  258. package/dist/services/compression/schemas.mjs +1 -0
  259. package/dist/services/context-rules/index.d.mts +412 -0
  260. package/dist/services/context-rules/index.mjs +1 -0
  261. package/dist/services/credential-change/index.d.mts +17 -0
  262. package/dist/services/credential-change/index.mjs +1 -0
  263. package/dist/services/definition/index.d.mts +2 -0
  264. package/dist/services/definition/index.mjs +1 -0
  265. package/dist/services/definition/namespace.d.mts +71 -0
  266. package/dist/services/definition/namespace.mjs +1 -0
  267. package/dist/services/definition/schemas.d.mts +38 -0
  268. package/dist/services/definition/schemas.mjs +1 -0
  269. package/dist/services/dialog/namespace.d.mts +105 -0
  270. package/dist/services/dialog/namespace.mjs +1 -0
  271. package/dist/services/dialog/schemas.d.mts +109 -0
  272. package/dist/services/dialog/schemas.mjs +1 -0
  273. package/dist/services/execution-target/index.d.mts +4 -0
  274. package/dist/services/execution-target/index.mjs +1 -0
  275. package/dist/services/execution-target/namespace.d.mts +2 -0
  276. package/dist/services/execution-target/namespace.mjs +1 -0
  277. package/dist/services/execution-target/schemas.d.mts +2 -0
  278. package/dist/services/execution-target/schemas.mjs +1 -0
  279. package/dist/services/filesystem/index.d.mts +3 -0
  280. package/dist/services/filesystem/index.mjs +1 -0
  281. package/dist/services/filesystem/namespace.d.mts +432 -0
  282. package/dist/services/filesystem/namespace.mjs +1 -0
  283. package/dist/services/filesystem/schemas.d.mts +240 -0
  284. package/dist/services/filesystem/schemas.mjs +1 -0
  285. package/dist/services/git/namespace.d.mts +1163 -0
  286. package/dist/services/git/namespace.mjs +1 -0
  287. package/dist/services/git/schemas.d.mts +932 -0
  288. package/dist/services/git/schemas.mjs +1 -0
  289. package/dist/services/harness/index.d.mts +861 -0
  290. package/dist/services/harness/index.mjs +1 -0
  291. package/dist/services/harness/storage/schema.d.mts +424 -0
  292. package/dist/services/harness/storage/schema.mjs +1 -0
  293. package/dist/services/index.d.mts +6185 -0
  294. package/dist/services/index.mjs +1 -0
  295. package/dist/services/local-notification/index.d.mts +25 -0
  296. package/dist/services/local-notification/index.mjs +1 -0
  297. package/dist/services/local-notification/namespace.d.mts +73 -0
  298. package/dist/services/local-notification/namespace.mjs +1 -0
  299. package/dist/services/local-notification/schemas.d.mts +88 -0
  300. package/dist/services/local-notification/schemas.mjs +1 -0
  301. package/dist/services/log-import/browser.d.mts +3 -0
  302. package/dist/services/log-import/browser.mjs +1 -0
  303. package/dist/services/log-import/index.d.mts +274 -0
  304. package/dist/services/log-import/index.mjs +2 -0
  305. package/dist/services/log-import/log-import.d.mts +3 -0
  306. package/dist/services/log-import/log-import.mjs +1 -0
  307. package/dist/services/log-import/namespace.d.mts +327 -0
  308. package/dist/services/log-import/namespace.mjs +1 -0
  309. package/dist/services/log-import/schemas.d.mts +217 -0
  310. package/dist/services/log-import/schemas.mjs +1 -0
  311. package/dist/services/model-registry/index.d.mts +2 -0
  312. package/dist/services/model-registry/index.mjs +1 -0
  313. package/dist/services/preferences/index.d.mts +3 -0
  314. package/dist/services/preferences/index.mjs +1 -0
  315. package/dist/services/preferences/schemas.d.mts +2 -0
  316. package/dist/services/preferences/schemas.mjs +1 -0
  317. package/dist/services/preferences/storage-namespace.d.mts +3 -0
  318. package/dist/services/preferences/storage-namespace.mjs +1 -0
  319. package/dist/services/provider-context/index.d.mts +2 -0
  320. package/dist/services/provider-context/index.mjs +1 -0
  321. package/dist/services/provider-runtime/index.d.mts +136 -0
  322. package/dist/services/provider-runtime/index.mjs +1 -0
  323. package/dist/services/session/handlers/index.d.mts +2 -0
  324. package/dist/services/session/handlers/index.mjs +1 -0
  325. package/dist/services/session/index.d.mts +10 -0
  326. package/dist/services/session/index.mjs +1 -0
  327. package/dist/services/session/messages/namespace.d.mts +2 -0
  328. package/dist/services/session/messages/namespace.mjs +1 -0
  329. package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
  330. package/dist/services/session/orchestrator-testing/index.mjs +1 -0
  331. package/dist/services/session/session-events/namespace.d.mts +2 -0
  332. package/dist/services/session/session-events/namespace.mjs +1 -0
  333. package/dist/services/session/storage/namespace.d.mts +2 -0
  334. package/dist/services/session/storage/namespace.mjs +1 -0
  335. package/dist/services/session/storage/schema.d.mts +2 -0
  336. package/dist/services/session/storage/schema.mjs +1 -0
  337. package/dist/services/session/testing/index.d.mts +35 -0
  338. package/dist/services/session/testing/index.mjs +65 -0
  339. package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
  340. package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
  341. package/dist/services/session/turns/namespace.d.mts +2 -0
  342. package/dist/services/session/turns/namespace.mjs +1 -0
  343. package/dist/services/session-editor/index.d.mts +119 -0
  344. package/dist/services/session-editor/index.mjs +1 -0
  345. package/dist/services/settings/index.d.mts +47 -0
  346. package/dist/services/settings/index.mjs +1 -0
  347. package/dist/services/settings/namespace.d.mts +663 -0
  348. package/dist/services/settings/namespace.mjs +1 -0
  349. package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
  350. package/dist/services/settings/storage/clients-namespace.mjs +1 -0
  351. package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
  352. package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
  353. package/dist/services/settings/storage/index.d.mts +4 -0
  354. package/dist/services/settings/storage/index.mjs +1 -0
  355. package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
  356. package/dist/services/settings/storage/providers-namespace.mjs +1 -0
  357. package/dist/services/subagent/index.d.mts +2 -0
  358. package/dist/services/subagent/index.mjs +1 -0
  359. package/dist/services/subagent-template/index.d.mts +3 -0
  360. package/dist/services/subagent-template/index.mjs +1 -0
  361. package/dist/services/subagent-template/namespace.d.mts +2 -0
  362. package/dist/services/subagent-template/namespace.mjs +1 -0
  363. package/dist/services/subagent-template/schemas.d.mts +2 -0
  364. package/dist/services/subagent-template/schemas.mjs +1 -0
  365. package/dist/services/tool-approval/index.d.mts +2 -0
  366. package/dist/services/tool-approval/index.mjs +1 -0
  367. package/dist/services/tools/index.d.mts +2 -0
  368. package/dist/services/tools/index.mjs +1 -0
  369. package/dist/services/tray-menu/index.d.mts +4 -0
  370. package/dist/services/tray-menu/index.mjs +1 -0
  371. package/dist/services/tray-menu/namespace.d.mts +2 -0
  372. package/dist/services/tray-menu/namespace.mjs +1 -0
  373. package/dist/services/tray-menu/schemas.d.mts +2 -0
  374. package/dist/services/tray-menu/schemas.mjs +1 -0
  375. package/dist/services/turn/index.d.mts +2 -0
  376. package/dist/services/turn/index.mjs +1 -0
  377. package/dist/services/turn/namespace.d.mts +2 -0
  378. package/dist/services/turn/namespace.mjs +1 -0
  379. package/dist/services/turn/schemas.d.mts +335 -0
  380. package/dist/services/turn/schemas.mjs +1 -0
  381. package/dist/session-BoldSdNZ2.mjs +134 -0
  382. package/dist/session-DuVOYctZ.mjs +1 -0
  383. package/dist/session-lineage-CRsc9g1x.d.mts +65 -0
  384. package/dist/shared-DpOEfD8F.mjs +1 -0
  385. package/dist/shared-schemas-CPShiLNp.mjs +1 -0
  386. package/dist/skill-CQO4mDqK.mjs +1 -0
  387. package/dist/storage/drizzle/client.d.mts +78 -0
  388. package/dist/storage/drizzle/client.mjs +1 -0
  389. package/dist/storage/drizzle/index.d.mts +137 -0
  390. package/dist/storage/drizzle/index.mjs +1 -0
  391. package/dist/storage/handlers/drizzle/index.d.mts +2 -0
  392. package/dist/storage/handlers/drizzle/index.mjs +1 -0
  393. package/dist/storage/handlers/index.d.mts +33 -0
  394. package/dist/storage/handlers/index.mjs +1 -0
  395. package/dist/storage/index.d.mts +192 -0
  396. package/dist/storage/index.mjs +1 -0
  397. package/dist/storage-namespace-BXkoh5Sy.d.mts +221 -0
  398. package/dist/storage-namespace-DWsYLAXa.mjs +1 -0
  399. package/dist/storage-namespace-definition-Bkx5rSto.d.mts +17 -0
  400. package/dist/storage-namespace-definition-CqSdsuCC.mjs +1 -0
  401. package/dist/style.css +3782 -0
  402. package/dist/telemetry-CvdLBWuk.mjs +1 -0
  403. package/dist/testing/drizzle-harness.d.mts +130 -0
  404. package/dist/testing/drizzle-harness.mjs +1 -0
  405. package/dist/testing/index.d.mts +106 -0
  406. package/dist/testing/index.mjs +1 -0
  407. package/dist/timeout-XsYIOKrc.mjs +1 -0
  408. package/dist/tool-approval-service-BvZWhYZp.mjs +1 -0
  409. package/dist/tools/index.d.mts +835 -0
  410. package/dist/tools/index.mjs +1 -0
  411. package/dist/tools/testing/index.d.mts +53 -0
  412. package/dist/tools/testing/index.mjs +1 -0
  413. package/dist/tools-D-luYcDw.mjs +1431 -0
  414. package/dist/tray-menu-service-DuXq5k22.mjs +1 -0
  415. package/dist/types-BCMUtBj1.d.mts +1106 -0
  416. package/dist/types-C2Ob9zz_.d.mts +128 -0
  417. package/dist/types-CCdqjeuH.d.mts +262 -0
  418. package/dist/types-DZHvOc_Q.d.mts +305 -0
  419. package/dist/types-Dy3YTcTF.d.mts +6777 -0
  420. package/dist/types-MfJZ67e9.d.mts +315 -0
  421. package/dist/types-dyP-bXXE.d.mts +31 -0
  422. package/dist/ui-components/index.d.mts +2342 -0
  423. package/dist/ui-components/index.mjs +8 -0
  424. package/dist/ui-config-9bDRwFZr.mjs +1 -0
  425. package/dist/ui-hooks/index.d.mts +1915 -0
  426. package/dist/ui-hooks/index.mjs +1 -0
  427. package/dist/ui-kernel/index.d.mts +2793 -0
  428. package/dist/ui-kernel/index.mjs +1 -0
  429. package/dist/ui-kernel/pages/namespace.d.mts +88 -0
  430. package/dist/ui-kernel/pages/namespace.mjs +1 -0
  431. package/dist/ui-kernel/pages/schemas.d.mts +2 -0
  432. package/dist/ui-kernel/pages/schemas.mjs +1 -0
  433. package/dist/ui-views/index.d.mts +487 -0
  434. package/dist/ui-views/index.mjs +30 -0
  435. package/dist/utils/health-probe.d.mts +26 -0
  436. package/dist/utils/health-probe.mjs +1 -0
  437. package/dist/utils/index.d.mts +262 -0
  438. package/dist/utils/index.mjs +2 -0
  439. package/dist/utils/keychain.d.mts +31 -0
  440. package/dist/utils/keychain.mjs +1 -0
  441. package/dist/utils/project-manifest.d.mts +130 -0
  442. package/dist/utils/project-manifest.mjs +1 -0
  443. package/dist/utils/resolve-package-root.d.mts +12 -0
  444. package/dist/utils/resolve-package-root.mjs +1 -0
  445. package/dist/utils/scope-paths.d.mts +33 -0
  446. package/dist/utils/scope-paths.mjs +1 -0
  447. package/dist/utils/workspace-packages.d.mts +59 -0
  448. package/dist/utils/workspace-packages.mjs +1 -0
  449. package/dist/utils/workspace-root.d.mts +24 -0
  450. package/dist/utils/workspace-root.mjs +2 -0
  451. package/dist/variant-CT6XBP6T.mjs +1 -0
  452. package/dist/version-BeT3ASEe.mjs +1 -0
  453. package/dist/visibility-Cb62p9bv.mjs +1 -0
  454. package/dist/window-registry-CBcrGTv4.d.mts +130 -0
  455. package/dist/window-registry-DW-dKRjQ.mjs +1 -0
  456. package/package.json +1 -1
@@ -0,0 +1,1263 @@
1
+ import { ZodType, z } from "zod";
2
+ import { Paths, Simplify, UnknownRecord } from "type-fest";
3
+
4
+ //#region core/makaio-core/src/types/config-storage.d.ts
5
+ /**
6
+ * Storage interface for config persistence.
7
+ *
8
+ * Generic interface allowing type-safe implementations with different
9
+ * config types. Simple file-based storage for bootstrap configuration.
10
+ * @typeParam TConfig - Type for configuration (defaults to unknown)
11
+ * @example Node.js file-based implementation
12
+ * ```typescript
13
+ * import type { Config } from '@makaio/framework/contracts';
14
+ *
15
+ * class FileConfigStorage implements IConfigStorage<Config> {
16
+ * async getConfig(): Promise<Config> {
17
+ * const content = await fs.readFile('~/.makaio/config.json', 'utf-8');
18
+ * return ConfigSchema.parse(JSON.parse(content));
19
+ * }
20
+ *
21
+ * async saveConfig(config: Config): Promise<void> {
22
+ * await fs.writeFile('~/.makaio/config.json', JSON.stringify(config, null, 2));
23
+ * }
24
+ * }
25
+ * ```
26
+ * @example In-memory implementation for testing
27
+ * ```typescript
28
+ * class MemoryConfigStorage implements IConfigStorage<Config> {
29
+ * private config: Config = { mode: 'local', adapters: [] };
30
+ *
31
+ * async getConfig() { return this.config; }
32
+ * async saveConfig(config: Config) { this.config = config; }
33
+ * }
34
+ * ```
35
+ */
36
+ interface IConfigStorage<TConfig = unknown> {
37
+ /**
38
+ * Get the current config, or default if missing.
39
+ * @returns The config object
40
+ */
41
+ getConfig(): Promise<TConfig>;
42
+ /**
43
+ * Save the config.
44
+ * @param config - The config object to save
45
+ */
46
+ saveConfig(config: TConfig): Promise<void>;
47
+ }
48
+ //#endregion
49
+ //#region core/makaio-core/src/types/message.d.ts
50
+ /**
51
+ * Host-agnostic principal attached by a trusted local transport.
52
+ *
53
+ * The framework treats this as opaque metadata. Host code decides what
54
+ * principal kinds and claims mean.
55
+ */
56
+ interface PrincipalContext {
57
+ /** Principal kind, such as `user`, `device`, `machine`, or host-defined values. */
58
+ readonly kind: string;
59
+ /** Optional stable principal identifier in the principal namespace. */
60
+ readonly id?: string;
61
+ /** Optional opaque claims supplied by the authenticating transport or host policy. */
62
+ readonly claims?: Readonly<Record<string, unknown>>;
63
+ }
64
+ /**
65
+ * Authenticated peer metadata supplied by a transport connection.
66
+ */
67
+ interface TransportPeerContext {
68
+ /** Peer kind, such as `browser`, `machine`, `worker`, or host-defined values. */
69
+ readonly kind: string;
70
+ /** Optional transport-level peer identifier. */
71
+ readonly id?: string;
72
+ /** Whether the receiving transport authenticated the peer. */
73
+ readonly authenticated?: boolean;
74
+ /** Whether the receiving transport established encrypted payload transport. */
75
+ readonly encrypted?: boolean;
76
+ /** Optional opaque peer claims. */
77
+ readonly claims?: Readonly<Record<string, unknown>>;
78
+ }
79
+ /**
80
+ * Trusted context derived locally by the receiving transport.
81
+ *
82
+ * This context is never serialized into `BusMessage`; each receiving node must
83
+ * derive its own context from its own transport/session state.
84
+ */
85
+ interface TransportReceiveContext {
86
+ /** Registered bus transport name that received the message. */
87
+ readonly transportName: string;
88
+ /** Optional connection/session identifier local to the transport. */
89
+ readonly connectionId?: string;
90
+ /** Optional authenticated transport peer. */
91
+ readonly peer?: TransportPeerContext;
92
+ /** Optional host-agnostic principal resolved for this connection. */
93
+ readonly principal?: PrincipalContext;
94
+ }
95
+ /**
96
+ * Describes the call origin of a bus message.
97
+ *
98
+ * Set on every context before handlers run; never serialized to wire.
99
+ * Derivation: `local` is `true` when no transport received the message
100
+ * (the call originated in this process), `false` when it arrived over
101
+ * a transport from a remote peer.
102
+ */
103
+ interface MessageOrigin {
104
+ /** Whether the message originated locally (not from a remote transport). */
105
+ readonly local: boolean;
106
+ }
107
+ /**
108
+ * Base message context interface for both events and requests.
109
+ *
110
+ * Provides common metadata for tracking and correlation:
111
+ * - `messageId`: Unique identifier for this specific message
112
+ * - `correlationId`: Optional identifier linking related operations
113
+ */
114
+ interface BaseMessageContext {
115
+ /**
116
+ * Unique identifier for this specific message.
117
+ * Auto-generated if not provided.
118
+ *
119
+ * Used for:
120
+ * - Message deduplication
121
+ * - Idempotency checks
122
+ * - Tracking individual messages in logs
123
+ */
124
+ messageId: string;
125
+ /**
126
+ * Optional identifier linking related operations.
127
+ * Propagated through chains of requests/events.
128
+ *
129
+ * Used for:
130
+ * - Distributed tracing
131
+ * - Causality tracking
132
+ * - Following a workflow through the system
133
+ * @example
134
+ * ```typescript
135
+ * // Initial request generates correlationId
136
+ * const result = await request(
137
+ * UserSubjects.getUser,
138
+ * { userId: '42' },
139
+ * { correlationId: 'user-action-123' }
140
+ * );
141
+ *
142
+ * // Handler propagates correlationId to downstream operations
143
+ * await emit(
144
+ * UserSubjects.userLoaded,
145
+ * { user: result },
146
+ * { correlationId: context.correlationId }
147
+ * );
148
+ * ```
149
+ */
150
+ correlationId?: string;
151
+ /**
152
+ * Trusted context supplied by the local receiving transport.
153
+ *
154
+ * Undefined for local calls and for transports that do not supply connection
155
+ * context. Never trust similarly named fields in payloads or wire messages.
156
+ */
157
+ transport?: TransportReceiveContext;
158
+ /**
159
+ * Where this message originated.
160
+ *
161
+ * `local: true` — emitted in this process.
162
+ * `local: false` — arrived via a transport from a remote caller.
163
+ *
164
+ * Always present; never serialized to the wire. Location-sensitive handlers
165
+ * check this before executing local side-effects.
166
+ */
167
+ origin: MessageOrigin;
168
+ isRequest: boolean;
169
+ }
170
+ type EventMessagePayload<Payload extends UnknownRecord = UnknownRecord> = Payload & {
171
+ request?: never;
172
+ response?: never;
173
+ };
174
+ type RequestMessagePayload<Request extends UnknownRecord = UnknownRecord, Response extends UnknownRecord = UnknownRecord> = {
175
+ request: Request;
176
+ response: Response;
177
+ };
178
+ type MessagePayload = RequestMessagePayload | EventMessagePayload;
179
+ //#endregion
180
+ //#region core/makaio-core/src/types/context.d.ts
181
+ /**
182
+ * Context object passed to event handlers when using wildcard patterns.
183
+ *
184
+ * Provides:
185
+ * - `isRequest`: Always false (discriminator for type narrowing)
186
+ * - `payload`: The event payload
187
+ * - Message tracking fields from BaseMessage (messageId, correlationId)
188
+ */
189
+ interface EventContext<Payload> extends BaseMessageContext {
190
+ /** Discriminator - always false for events */
191
+ isRequest: false;
192
+ /** The event payload */
193
+ payload: Payload;
194
+ /** The event subject */
195
+ subject: string;
196
+ }
197
+ /**
198
+ * Context object passed to request handlers.
199
+ *
200
+ * Provides:
201
+ * - `isRequest`: Always true (discriminator for type narrowing)
202
+ * - `payload`: The request payload
203
+ * - `setResult`: Function to set the response value
204
+ * - `next`: Function to call the next handler in the middleware chain
205
+ * - `replacePayload`: Function to transform the payload for subsequent handlers
206
+ * - `identify`: Optional function to identify the handler for broadcast aggregation
207
+ * - `signal`: Optional AbortSignal from the originating request
208
+ * - Message tracking fields from BaseMessage (messageId, correlationId)
209
+ */
210
+ interface RequestContext<Payload, Response> extends BaseMessageContext {
211
+ /** Discriminator - always true for requests */
212
+ isRequest: true;
213
+ /** The request payload */
214
+ payload: Payload;
215
+ /** AbortSignal supplied by the originating request, if any. */
216
+ signal?: AbortSignal;
217
+ /** Set the response value (ends the handler chain) */
218
+ setResult: (result: Response) => void;
219
+ /**
220
+ * Read the current result value.
221
+ *
222
+ * Returns the value set by `setResult()` in this handler or by a downstream
223
+ * handler after `await next()`. Undefined until a result has been set.
224
+ */
225
+ readonly result: Response | undefined;
226
+ /**
227
+ * Shallow-merge additional fields into the current result.
228
+ *
229
+ * Only valid for object-typed responses. In the request path the operation
230
+ * uses spread (immutable); in broadcast mode it uses `Object.assign`
231
+ * (in-place mutation) so the already-pushed result reference stays current.
232
+ * If no result has been set yet, starts from an empty object.
233
+ * @param extension - Fields to merge into the current result
234
+ */
235
+ extendResult: (extension: [Response] extends [Record<string, unknown>] ? Partial<Response> : never) => void;
236
+ /**
237
+ * Call the next handler in the middleware chain.
238
+ * If no more handlers exist, throws NoHandlerError.
239
+ */
240
+ next: () => Promise<void>;
241
+ /**
242
+ * Replace the payload with a new value.
243
+ * Subsequent handlers in the middleware chain will receive the new payload.
244
+ * Useful for hooks that need to inject context before the main handler runs.
245
+ */
246
+ replacePayload: (newPayload: Payload) => void;
247
+ /**
248
+ * Identify this handler for broadcast aggregation.
249
+ * Only present when called via broadcast() - call before setResult().
250
+ * @param nodeId - Unique identifier for this handler/node
251
+ */
252
+ identify?: (nodeId: string) => void;
253
+ }
254
+ /**
255
+ * Unified context for wildcard handlers that can match both events and requests.
256
+ * Use the `isRequest` discriminator to narrow the type.
257
+ * @example
258
+ * ```typescript
259
+ * MakaioBus.on('adapter.*', (context) => {
260
+ * if (context.isRequest) {
261
+ * // TypeScript knows this is RequestContext
262
+ * context.setResult({ handled: true });
263
+ * } else {
264
+ * // TypeScript knows this is EventContext
265
+ * console.debug('Event:', context.payload);
266
+ * }
267
+ * });
268
+ * ```
269
+ */
270
+ type WildcardContext<Payload = unknown, Response = unknown> = EventContext<Payload> | RequestContext<Payload, Response>;
271
+ //#endregion
272
+ //#region core/makaio-core/src/types/filter.d.ts
273
+ type Primitive = string | number | boolean | null;
274
+ /**
275
+ * Filter operators for payload field matching.
276
+ * @example
277
+ * ```typescript
278
+ * // Equality (implicit)
279
+ * { agentId: 'agent-123' }
280
+ *
281
+ * // Membership
282
+ * { status: { $in: ['active', 'pending'] } }
283
+ *
284
+ * // Not equal
285
+ * { type: { $ne: 'internal' } }
286
+ *
287
+ * // Presence check
288
+ * { error: { $exists: false } }
289
+ *
290
+ * // String prefix/suffix matching
291
+ * { path: { $startsWith: '.git/' } }
292
+ * { file: { $endsWith: '.ts' } }
293
+ * ```
294
+ */
295
+ type FilterOperator<T extends Primitive = Primitive> = T | {
296
+ $in: T[];
297
+ } | {
298
+ $ne: T;
299
+ } | {
300
+ $exists: boolean;
301
+ } | {
302
+ $startsWith: string;
303
+ } | {
304
+ $endsWith: string;
305
+ };
306
+ /**
307
+ * Untyped payload filter - accepts any string keys.
308
+ * Use TypedPayloadFilter<T> for type-safe filters.
309
+ */
310
+ type PayloadFilter = Record<string, FilterOperator>;
311
+ /**
312
+ * Type-safe payload filter constrained to valid paths of a payload type.
313
+ *
314
+ * Uses type-fest's `Paths` to support dotted path notation for nested fields.
315
+ * @example
316
+ * ```typescript
317
+ * interface McpPayload {
318
+ * agentId: string;
319
+ * raw: { msg: { type: string } };
320
+ * }
321
+ *
322
+ * // Type-safe - validates both top-level and nested paths
323
+ * const filter: TypedPayloadFilter<McpPayload> = {
324
+ * agentId: 'agent-123',
325
+ * 'raw.msg.type': 'session_configured', // ✅ valid path
326
+ * 'raw.msg.typo': 'x', // ❌ type error
327
+ * };
328
+ * ```
329
+ */
330
+ type TypedPayloadFilter<T> = { [K in Paths<T> & string]?: FilterOperator };
331
+ /**
332
+ * Type guard to check if a value is a filter operator object.
333
+ * @param value - The filter operator value to check
334
+ * @returns True if the value is a filter operator object with $in, $ne, $exists, $startsWith, or $endsWith
335
+ */
336
+ declare function isOperatorObject(value: FilterOperator): value is {
337
+ $in: Primitive[];
338
+ } | {
339
+ $ne: Primitive;
340
+ } | {
341
+ $exists: boolean;
342
+ } | {
343
+ $startsWith: string;
344
+ } | {
345
+ $endsWith: string;
346
+ };
347
+ //#endregion
348
+ //#region core/makaio-core/src/types/schema.d.ts
349
+ /**
350
+ * Schema definition for event subjects (fire-and-forget).
351
+ * Events have only a payload schema, no response.
352
+ * The payload is now separate from the context, so no restrictions needed.
353
+ */
354
+ type EventSchema = z.ZodType;
355
+ /**
356
+ * Schema definition for request subjects (request-response).
357
+ * Requests have both a request payload schema and a response schema.
358
+ */
359
+ type RequestSchema<Request extends ZodType = ZodType, Response extends ZodType = ZodType> = {
360
+ request: Request;
361
+ response: Response;
362
+ };
363
+ /**
364
+ * Wrapper to mark a subject as local-only (never sent to transports).
365
+ *
366
+ * Use `localSubject()` from `@makaio/bus-core` to create these.
367
+ * @example
368
+ * ```typescript
369
+ * import { localSubject } from '@makaio/framework/bus';
370
+ *
371
+ * const WidgetSchemas = {
372
+ * register: localSubject(widgetDefinitionSchema), // local event
373
+ * unregister: localSubject(z.object({ widgetId: z.string() })),
374
+ * };
375
+ * ```
376
+ */
377
+ type LocalSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | RequestSchema> = {
378
+ readonly __local: true;
379
+ readonly schema: T;
380
+ };
381
+ /**
382
+ * Wrapper to mark an event subject as collector-only.
383
+ *
384
+ * Collector-only events may be received from a transport and delivered to local
385
+ * handlers, but the receiving bus must not relay them onward to other
386
+ * transports. Local emits are also kept local.
387
+ */
388
+ type CollectorOnlySubjectSchema<T extends EventSchema = EventSchema> = {
389
+ readonly __collectorOnly: true;
390
+ readonly schema: T;
391
+ };
392
+ /**
393
+ * Wrapper to mark a subject as channel-only (encrypted point-to-point).
394
+ *
395
+ * Channel subjects are rejected by public bus methods and are only
396
+ * routable through the DirectChannel encrypted transport. Use
397
+ * `channelSubject()` from `@makaio/bus-core` to create these.
398
+ * @example
399
+ * ```typescript
400
+ * import { channelSubject } from '@makaio/framework/bus';
401
+ *
402
+ * const DirectSchemas = {
403
+ * message: channelSubject(z.object({ text: z.string() })),
404
+ * ping: channelSubject({
405
+ * request: z.object({ ts: z.number() }),
406
+ * response: z.object({ ts: z.number() }),
407
+ * }),
408
+ * };
409
+ * ```
410
+ */
411
+ type ChannelSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | RequestSchema> = {
412
+ readonly __channel: true;
413
+ readonly schema: T;
414
+ };
415
+ /**
416
+ * Wrapper to set a subject-level default transport routing policy.
417
+ *
418
+ * This is weaker than `localSubject()`: the subject remains routable remotely,
419
+ * but local callers that omit an explicit `transports` option use this default.
420
+ */
421
+ type DefaultTransportsSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | RequestSchema, Default extends TransportRoutingDefault = TransportRoutingDefault> = {
422
+ readonly __defaultTransports: Default;
423
+ readonly schema: T;
424
+ };
425
+ /**
426
+ * Base schema types (unwrapped).
427
+ */
428
+ type BaseSubjectSchema = EventSchema | RequestSchema;
429
+ /**
430
+ * Union of all subject schema types (including metadata wrappers).
431
+ */
432
+ type SubjectSchema = BaseSubjectSchema | LocalSubjectSchema | CollectorOnlySubjectSchema | ChannelSubjectSchema | DefaultTransportsSubjectSchema;
433
+ type SchemaRecord = Record<string, SubjectSchema>;
434
+ //#endregion
435
+ //#region core/makaio-core/src/types/type-helpers.d.ts
436
+ /**
437
+ * Unwrap subject schema wrappers if present. Returns the inner schema for
438
+ * wrapped subjects, or the schema as-is otherwise.
439
+ */
440
+ type UnwrapSchema<S> = S extends {
441
+ readonly __local: true;
442
+ readonly schema: infer Inner;
443
+ } ? Inner : S extends {
444
+ readonly __collectorOnly: true;
445
+ readonly schema: infer Inner;
446
+ } ? Inner : S extends {
447
+ readonly __channel: true;
448
+ readonly schema: infer Inner;
449
+ } ? Inner : S extends {
450
+ readonly __defaultTransports: TransportRoutingDefault;
451
+ readonly schema: infer Inner;
452
+ } ? Inner : S;
453
+ /**
454
+ * Infer payload type from schema, including subject metadata wrappers.
455
+ *
456
+ * For requests:
457
+ * - Uses z.input for request (what callers pass before validation/defaults)
458
+ * - Uses z.infer for response (what handlers return after processing)
459
+ *
460
+ * This allows schemas with .default() to have optional fields in the caller API
461
+ * while the response type reflects the validated output.
462
+ *
463
+ * Subject schema wrappers are automatically unwrapped before inference.
464
+ *
465
+ * Idempotent: Returns already-inferred types as-is.
466
+ */
467
+ type InferSchemaPayload<S extends SubjectSchema> = InferSchemaPayloadInner<UnwrapSchema<S>>;
468
+ type InferSchemaPayloadInner<S> = S extends {
469
+ request: infer Req extends z.ZodType;
470
+ response: infer Res extends z.ZodType;
471
+ } ? {
472
+ request: z.input<Req>;
473
+ response: z.infer<Res>;
474
+ } : S extends z.ZodType ? Simplify<z.infer<S>> : unknown;
475
+ /**
476
+ * Compute all subject meta from the original schema in one place.
477
+ *
478
+ * Resolves payload, locality, channel membership, request/event discriminator,
479
+ * default transport routing, and namespace from a raw SubjectSchema.
480
+ * @typeParam S - The subject schema type
481
+ * @typeParam Ns - The namespace string
482
+ */
483
+ type InferSubjectMeta<S extends SubjectSchema, Ns extends string> = {
484
+ /** True when the subject is a request-response pair, false for events. */isRequest: UnwrapSchema<S> extends {
485
+ request: z.ZodType;
486
+ response: z.ZodType;
487
+ } ? true : false; /** True when the subject is wrapped with `localSubject()`. */
488
+ local: S extends LocalSubjectSchema ? true : false; /** True when the subject is wrapped with `channelSubject()`. */
489
+ channel: S extends ChannelSubjectSchema ? true : false; /** Inferred payload type (request/response pair or event payload). */
490
+ payload: InferSchemaPayload<S>; /** The namespace this subject belongs to. */
491
+ namespace: Ns;
492
+ } & (S extends DefaultTransportsSubjectSchema<EventSchema | RequestSchema, infer Default> ? {
493
+ defaultTransports: Default;
494
+ } : {
495
+ defaultTransports?: TransportRoutingDefault;
496
+ });
497
+ //#endregion
498
+ //#region core/makaio-core/src/types/subjects.d.ts
499
+ type SubjectRecord<SubjectKeys extends string = string, Payload extends MessagePayload = MessagePayload> = Record<SubjectKeys, Payload>;
500
+ /**
501
+ * Default transport routing semantics for a subject or namespace.
502
+ *
503
+ * - `'all'` — send to all registered transports (the default when omitted).
504
+ * - `'local-only'` — suppress outbound transport fan-out unless the caller
505
+ * explicitly provides a `transports` override. Weaker than `localSubject()`:
506
+ * the subject can still be invoked remotely.
507
+ */
508
+ type TransportRoutingDefault = 'all' | 'local-only';
509
+ type SubjectRecordFromSchemaRecord<SchemaRecord extends Record<string, SubjectSchema>> = { [K in keyof SchemaRecord & string]: Simplify<InferSchemaPayload<SchemaRecord[K]>> };
510
+ type SubjectDefinitionMeta<Subject extends SubjectRecord = SubjectRecord<'default'>, K extends keyof Subject = keyof Subject, Namespace extends string = string> = {
511
+ isRequest: Subject extends SubjectRecord<'default'> ? boolean : Subject[K] extends RequestMessagePayload ? true : false;
512
+ payload: K extends string ? Subject[K] : unknown;
513
+ namespace: Namespace;
514
+ /**
515
+ * If true, this subject is local-only and will never be sent to transports.
516
+ * Use for subjects whose payloads contain non-serializable data (e.g., React components).
517
+ */
518
+ local: boolean;
519
+ /**
520
+ * If true, this subject is channel-only and is only routable through the
521
+ * DirectChannel encrypted point-to-point transport.
522
+ */
523
+ channel: boolean;
524
+ /**
525
+ * Default transport routing for bus calls on this subject when the caller
526
+ * does not provide an explicit `transports` option.
527
+ *
528
+ * - `'all'` (default) — send to all registered transports as usual.
529
+ * - `'local-only'` — suppress transport fan-out unless the caller explicitly
530
+ * provides a `transports` override. Weaker than `localSubject()`: the
531
+ * subject can still be invoked remotely; only the outbound default is
532
+ * suppressed.
533
+ */
534
+ defaultTransports?: TransportRoutingDefault;
535
+ };
536
+ type SubjectDefinition<Subject extends SubjectRecord = SubjectRecord, SubjectKey extends keyof Subject = keyof Subject, Namespace extends string = string> = {
537
+ $meta: SubjectDefinitionMeta<Subject, SubjectKey, Namespace>;
538
+ subject: SubjectKey;
539
+ };
540
+ /** Extract payload (event payload or request/response pair) */
541
+ type ExtractInternalSubjectPayload<T extends SubjectDefinition> = T['$meta']['payload'];
542
+ /** Extract subject payload */
543
+ type ExtractSubjectPayload<T extends SubjectDefinition> = ExtractInternalSubjectPayload<T> extends RequestMessagePayload ? ExtractInternalSubjectPayload<T>['request'] : ExtractInternalSubjectPayload<T>;
544
+ /** Extract response payload (request subjects only) */
545
+ type ExtractSubjectResponse<T extends SubjectDefinition> = ExtractInternalSubjectPayload<T> extends RequestMessagePayload ? ExtractInternalSubjectPayload<T>['response'] : never;
546
+ type ScopedSubjectDefinition<Namespace extends string = string> = SubjectDefinition<SubjectRecord, keyof SubjectRecord, Namespace>;
547
+ /**
548
+ * Extract the filterable payload from a MessagePayload.
549
+ * For requests, returns the request part (what we filter on).
550
+ * For events, returns the payload as-is.
551
+ */
552
+ type FilterablePayload<P> = P extends RequestMessagePayload ? P['request'] : P;
553
+ /**
554
+ * Union of all filterable payloads from a SubjectRecord.
555
+ */
556
+ type FilterablePayloadsUnion<Subjects extends SubjectRecord> = FilterablePayload<Subjects[keyof Subjects]>;
557
+ /**
558
+ * Extract keys from ANY member of a union type (distributive).
559
+ *
560
+ * For `{ a: 1, b: 2 } | { a: 1, c: 3 }`, returns `'a' | 'b' | 'c'`.
561
+ */
562
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
563
+ /**
564
+ * Extract value type for a key from union members that have it.
565
+ */
566
+ type ValueOfKey<T, K extends PropertyKey> = T extends { [P in K]: infer V } ? V : never;
567
+ /**
568
+ * Build an object type with ALL keys from ANY union member.
569
+ *
570
+ * For `{ type: 'a', id: string } | { type: 'b', name: string }`:
571
+ * Result = `{ type: 'a' | 'b', id: string, name: string }`
572
+ *
573
+ * Allows filtering by any key that exists in any payload.
574
+ */
575
+ type AllPropertiesOfUnion<T> = { [K in KeysOfUnion<T>]: ValueOfKey<T, K> };
576
+ /**
577
+ * Union of all filterable payload properties from a SubjectRecord.
578
+ *
579
+ * Collects ALL keys from ANY payload, allowing filtering by any field.
580
+ * Events without a filtered key simply won't match.
581
+ * @example
582
+ * ```typescript
583
+ * // Given subjects with payloads:
584
+ * // - 'event': { agentId: string, foo: number }
585
+ * // - 'request': { sessionId: string }
586
+ *
587
+ * // FilterablePayloadUnion = { agentId: string, foo: number, sessionId: string }
588
+ *
589
+ * // Filter can use any key from any payload
590
+ * bus.withFilter({ agentId: 'x' }); // ✅ matches events with agentId
591
+ * bus.withFilter({ sessionId: 'y' }); // ✅ matches requests with sessionId
592
+ * ```
593
+ */
594
+ type FilterablePayloadIntersection<Subjects extends SubjectRecord> = Simplify<AllPropertiesOfUnion<FilterablePayloadsUnion<Subjects>>>;
595
+ /**
596
+ * Compute FilterPayload directly from a schema record.
597
+ *
598
+ * This bypasses SubjectRecordFromSchemaRecord and computes directly from schemas,
599
+ * which TypeScript can evaluate because Schemas is concrete at registration time.
600
+ */
601
+ type FilterPayloadFromSchemas<Schemas extends Record<string, SubjectSchema>> = Simplify<AllPropertiesOfUnion<{ [K in keyof Schemas]: FilterablePayload<InferSchemaPayload<Schemas[K]>> }[keyof Schemas]>>;
602
+ //#endregion
603
+ //#region core/makaio-core/src/types/wildcards.d.ts
604
+ type WildcardSubject = '*';
605
+ declare const WildcardSubjectKey = "*";
606
+ type WildcardSubjectDefinition<Namespace extends string = string> = SubjectDefinition<Record<'*', MessagePayload>, WildcardSubject, Namespace>;
607
+ //#endregion
608
+ //#region core/makaio-core/src/types/handler-types.d.ts
609
+ type EventHandler<T> = (context: EventContext<T>) => void | Promise<void>;
610
+ type RequestHandler<Payload, Response> = (context: RequestContext<Payload, Response>) => void | Promise<void>;
611
+ /**
612
+ * Context provided to __onAny handlers for debugging/testing.
613
+ * Captures all message metadata regardless of type (event/request/broadcast).
614
+ */
615
+ interface AnyMessageContext {
616
+ type: 'event' | 'request' | 'broadcast';
617
+ subject: string;
618
+ namespace: string;
619
+ payload: unknown;
620
+ messageId: string;
621
+ correlationId?: string;
622
+ }
623
+ /**
624
+ * Handler for __onAny - receives all messages (events and requests) across all namespaces.
625
+ * Used for debugging and testing only.
626
+ */
627
+ type AnyHandler = (context: AnyMessageContext) => void | Promise<void>;
628
+ /**
629
+ * Special handler for wildcards that match both events and requests.
630
+ * @public
631
+ */
632
+ type WildcardUnifiedHandler = (context: WildcardContext<unknown, unknown>) => void | Promise<void>;
633
+ /**
634
+ * Resolve the appropriate handler type for a subject pattern (exact or wildcard).
635
+ *
636
+ * Handles all subscription patterns:
637
+ * - Event wildcards (`adapter.*`) → `(payload: unknown) => void | Promise<void>`
638
+ * - Request wildcards (`adapter.*`) → `(context: RequestContext<unknown, unknown>) => void | Promise<void>`
639
+ * - Exact request subjects → `RequestHandler<TPayload, TReturnValue>`
640
+ * - Exact event subjects → `EventHandler<TPayload>`
641
+ *
642
+ * This is the primary type used by the `on()` method to resolve handler signatures.
643
+ * @example
644
+ * ```typescript
645
+ * // Event wildcard - unknown payload
646
+ * type Handler1 = HandlerForPattern<'adapter.*'>;
647
+ * // (payload: unknown) => void | Promise<void>
648
+ *
649
+ * // Exact event subject - typed payload
650
+ * type Handler2 = HandlerForPattern<'adapter.log'>;
651
+ * // EventHandler<{ message: string, level: string }>
652
+ *
653
+ * // Request wildcard - unknown context
654
+ * type Handler3 = HandlerForPattern<'adapter.*'>;
655
+ * // (context: RequestContext<unknown, unknown>) => void | Promise<void>
656
+ *
657
+ * // Exact request subject - typed context
658
+ * type Handler4 = HandlerForPattern<'adapter.getCapabilities'>;
659
+ * // RequestHandler<{ adapterName: string }, { capabilities: string[] }>
660
+ * ```
661
+ */
662
+ /**
663
+ * Resolve the handler type for a SubjectDefinition.
664
+ *
665
+ * Uses indexed access (`T['$meta']['payload']`) instead of nested `extends` with `infer`
666
+ * to ensure proper type resolution when T is a generic type parameter.
667
+ */
668
+ type HandlerForSubjectDefinition<T extends SubjectDefinition> = T['subject'] extends WildcardSubject ? WildcardUnifiedHandler : T['$meta']['payload'] extends RequestMessagePayload<infer Request, infer Response> ? RequestHandler<Request, Response> : T['$meta']['payload'] extends EventMessagePayload<infer Payload> ? EventHandler<Payload> : never;
669
+ /**
670
+ * Extract context type for once() promise return value.
671
+ *
672
+ * Uses the same pattern as HandlerForSubjectDefinition for consistency.
673
+ */
674
+ type ContextForSubjectDefinition<T extends SubjectDefinition> = T['subject'] extends WildcardSubject ? WildcardContext<unknown, unknown> : T['$meta']['payload'] extends RequestMessagePayload<infer Request, infer Response> ? RequestContext<Request, Response> : T['$meta']['payload'] extends EventMessagePayload<infer Payload> ? EventContext<Payload> : never;
675
+ //#endregion
676
+ //#region core/makaio-core/src/types/result.d.ts
677
+ /**
678
+ * Result types for optional request handling.
679
+ *
680
+ * Used by requestOptional to distinguish between "handler returned data"
681
+ * and "no handler was registered".
682
+ */
683
+ /**
684
+ * Discriminated union for optional request results.
685
+ *
686
+ * - `handled: true` - A handler was found and returned data
687
+ * - `handled: false` - No handler was registered for the subject
688
+ * @example
689
+ * ```typescript
690
+ * const result = await bus.requestOptional(Subjects.getData, { id: '123' });
691
+ * if (result.handled) {
692
+ * console.debug('Got data:', result.data);
693
+ * } else {
694
+ * console.debug('No handler registered for getData');
695
+ * }
696
+ * ```
697
+ */
698
+ type OptionalResult<T> = {
699
+ handled: true;
700
+ data: T;
701
+ } | {
702
+ handled: false;
703
+ };
704
+ //#endregion
705
+ //#region core/makaio-core/src/types/bus-like.d.ts
706
+ type EventSubjectLike = SubjectDefinition & {
707
+ readonly $meta: {
708
+ readonly isRequest: false;
709
+ readonly channel: false;
710
+ };
711
+ };
712
+ type RequestSubjectLike = SubjectDefinition & {
713
+ readonly $meta: {
714
+ readonly isRequest: true;
715
+ readonly channel: false;
716
+ readonly payload: RequestMessagePayload;
717
+ };
718
+ };
719
+ /**
720
+ * Minimal structural bus seam for contracts-owned helpers.
721
+ *
722
+ * This deliberately does not re-model `@makaio/bus-core`'s generic overloads.
723
+ * Bus-core owns the full magic inference surface; this type only covers the
724
+ * event/request calls that contract helper APIs make without importing bus-core.
725
+ */
726
+ interface MakaioBusLike {
727
+ /** Emit an event. */
728
+ emit<Subject extends EventSubjectLike>(subject: Subject, payload: Subject['$meta']['payload']): Promise<void>;
729
+ /** Send a request and await a response. */
730
+ request<Subject extends RequestSubjectLike>(subject: Subject, payload: Subject['$meta']['payload']['request']): Promise<Subject['$meta']['payload']['response']>;
731
+ }
732
+ //#endregion
733
+ //#region core/makaio-core/src/subject-helpers/nest-subject-definitions.d.ts
734
+ /**
735
+ * Recursively nests a flat record of dotted keys into a hierarchical object type.
736
+ *
737
+ * ```
738
+ * { 'assistant.text': SubjectDef, 'agent.tool.started': SubjectDef }
739
+ * → { assistant: { text: SubjectDef }, agent: { tool: { started: SubjectDef } } }
740
+ * ```
741
+ *
742
+ * Used to expose registered subjects as a nested accessor tree (e.g.
743
+ * `BootSubjects.service.ready`) without requiring callers to deal with
744
+ * flat dotted-key strings at the type level.
745
+ */
746
+ type NestedSubjectDefinitions<T extends Record<string, unknown> = Record<string, SubjectDefinition>> = { [K in ExtractPrefixes<keyof T & string>]: NestByPrefix<T, K> };
747
+ type ExtractPrefixes<Keys extends string> = Keys extends `${infer Prefix}.${string}` ? Prefix : Keys;
748
+ type StripPrefixMap<T, Prefix extends string> = { [K in keyof T as K extends `${Prefix}.${infer Rest}` ? Rest : never]: T[K] };
749
+ type NestByPrefix<T extends Record<string, unknown>, Prefix extends string> = Prefix extends keyof T ? T[Prefix] : NestedSubjectDefinitions<StripPrefixMap<T, Prefix>>;
750
+ /**
751
+ * Maps a flat schema record to a flat subject-definition record, attaching the
752
+ * correct `$meta` (namespace, isRequest, local, channel) and `subject` key for
753
+ * each entry.
754
+ *
755
+ * Intermediate type used by {@link nestSubjectDefinitions} before nesting.
756
+ * @typeParam Domain - Namespace domain string (e.g. `'boot'`)
757
+ * @typeParam Schemas - Flat record of raw Zod schemas keyed by dotted subject names
758
+ */
759
+ type FlatSubjectDefinitions<Domain extends string, Schemas extends Record<string, SubjectSchema>> = { [K in keyof Schemas & string]: {
760
+ $meta: InferSubjectMeta<Schemas[K], Domain>;
761
+ subject: K;
762
+ } };
763
+ /**
764
+ * Fully-nested subject accessor tree returned by `registerNamespace`.
765
+ *
766
+ * Combines the {@link NestedSubjectDefinitions} hierarchy with a `$all`
767
+ * wildcard that matches every subject in the namespace. Consumers use this
768
+ * type to write `SomeNamespace.subjects.foo.bar` instead of raw strings.
769
+ * @typeParam RecordOfSubjectDefinitions - Flat record of subject definitions
770
+ * @typeParam Domain - Namespace domain string used for `$all` wildcard typing
771
+ */
772
+ type BusSubjects<RecordOfSubjectDefinitions extends Record<string, unknown> = Record<string, SubjectDefinition>, Domain extends string = string> = NestedSubjectDefinitions<RecordOfSubjectDefinitions> & {
773
+ $all: WildcardSubjectDefinition<Domain>;
774
+ };
775
+ /**
776
+ * Nests flat dotted subject keys into a hierarchical structure.
777
+ * @param namespace - The domain/namespace for the subject definitions
778
+ * @param flat - Flat record of subject schemas with dotted keys
779
+ * @param namespaceDefaultTransports - Optional namespace-level transport default
780
+ * propagated to each subject's `$meta.defaultTransports` unless the subject
781
+ * schema is wrapped with `defaultTransports()`.
782
+ * @returns Nested subject definitions with hierarchical structure and a $all wildcard
783
+ */
784
+ declare function nestSubjectDefinitions<Domain extends string, T extends Record<string, SubjectSchema>>(namespace: Domain, flat: T, namespaceDefaultTransports?: TransportRoutingDefault): NestedSubjectDefinitions<FlatSubjectDefinitions<Domain, T>> & {
785
+ $all: WildcardSubjectDefinition<Domain>;
786
+ };
787
+ /**
788
+ * Gets the fully qualified subject name in namespace.subject format.
789
+ * @param subject - The subject definition to format
790
+ * @returns The full subject string in the format "namespace.subject"
791
+ */
792
+ declare function getFullSubjectForSubjectDefinition(subject: SubjectDefinition): string;
793
+ //#endregion
794
+ //#region core/makaio-core/src/subject-helpers/is-request-schema.d.ts
795
+ /**
796
+ * Type guard to check if a schema is a request schema.
797
+ * @param schema - The schema to check
798
+ * @returns True if the schema is a RequestSchema, false otherwise
799
+ */
800
+ declare function isRequestSchema(schema: SubjectSchema): schema is RequestSchema;
801
+ //#endregion
802
+ //#region core/makaio-core/src/subject-helpers/is-local-schema.d.ts
803
+ /**
804
+ * Check if a schema is wrapped as a local subject.
805
+ * @param schema - The schema to check
806
+ * @returns True if the schema is a LocalSubjectSchema wrapper
807
+ */
808
+ declare function isLocalSchema(schema: SubjectSchema): schema is LocalSubjectSchema;
809
+ /**
810
+ * Create a local-only subject schema wrapper.
811
+ *
812
+ * Local subjects are never sent to transports (SharedWorker, WebSocket, etc.).
813
+ * Use this for subjects whose payloads contain non-serializable data like
814
+ * React components or functions.
815
+ * @param schema - The event or request schema to mark as local
816
+ * @returns A LocalSubjectSchema wrapper
817
+ * @example
818
+ * ```typescript
819
+ * import { localSubject } from '@makaio/framework/core';
820
+ *
821
+ * const WidgetSchemas = {
822
+ * // Local event - contains React component, can't be serialized
823
+ * register: localSubject(widgetDefinitionSchema),
824
+ *
825
+ * // Local request - response contains functions
826
+ * getRenderer: localSubject({
827
+ * request: z.object({ widgetId: z.string() }),
828
+ * response: z.object({ render: z.function() }),
829
+ * }),
830
+ * };
831
+ * ```
832
+ */
833
+ declare function localSubject<T extends EventSchema | RequestSchema>(schema: T): LocalSubjectSchema<T>;
834
+ //#endregion
835
+ //#region core/makaio-core/src/subject-helpers/is-collector-only-schema.d.ts
836
+ /**
837
+ * Check if a schema is wrapped as a collector-only subject.
838
+ * @param schema - The schema to check.
839
+ * @returns True if the schema is a CollectorOnlySubjectSchema wrapper.
840
+ */
841
+ declare function isCollectorOnlySchema(schema: SubjectSchema): schema is CollectorOnlySubjectSchema;
842
+ /**
843
+ * Create a collector-only event schema wrapper.
844
+ *
845
+ * Collector-only events are transport-ingestable but not transport-relayable:
846
+ * a collector bus can receive them from an upstream peer and handle them
847
+ * locally without pushing them laterally to unrelated peers.
848
+ * @param schema - The event schema to mark as collector-only.
849
+ * @returns A CollectorOnlySubjectSchema wrapper.
850
+ */
851
+ declare function collectorOnlySubject<T extends EventSchema>(schema: T): CollectorOnlySubjectSchema<T>;
852
+ //#endregion
853
+ //#region core/makaio-core/src/subject-helpers/is-channel-schema.d.ts
854
+ /**
855
+ * Check if a schema is wrapped as a channel subject.
856
+ * @param schema - The schema to check
857
+ * @returns True if the schema is a ChannelSubjectSchema wrapper
858
+ */
859
+ declare function isChannelSchema(schema: SubjectSchema): schema is ChannelSubjectSchema;
860
+ /**
861
+ * Create a channel-only subject schema wrapper.
862
+ *
863
+ * Channel subjects are rejected by public bus methods and are only
864
+ * routable through the DirectChannel encrypted point-to-point transport.
865
+ * Use this for subjects that must never travel over the public bus.
866
+ * @param schema - The event or request schema to mark as channel-only
867
+ * @returns A ChannelSubjectSchema wrapper
868
+ * @example
869
+ * ```typescript
870
+ * import { channelSubject } from '@makaio/framework/core';
871
+ *
872
+ * const DirectSchemas = {
873
+ * // Channel event - encrypted, point-to-point only
874
+ * message: channelSubject(z.object({ text: z.string() })),
875
+ *
876
+ * // Channel request - encrypted request-response pair
877
+ * ping: channelSubject({
878
+ * request: z.object({ ts: z.number() }),
879
+ * response: z.object({ ts: z.number() }),
880
+ * }),
881
+ * };
882
+ * ```
883
+ */
884
+ declare function channelSubject<T extends EventSchema | RequestSchema>(schema: T): ChannelSubjectSchema<T>;
885
+ //#endregion
886
+ //#region core/makaio-core/src/subject-helpers/default-transports-schema.d.ts
887
+ /**
888
+ * Check if a schema carries a subject-level default transport routing policy.
889
+ * @param schema - The schema to check
890
+ * @returns True if the schema is a DefaultTransportsSubjectSchema wrapper
891
+ */
892
+ declare function isDefaultTransportsSchema(schema: SubjectSchema): schema is DefaultTransportsSubjectSchema;
893
+ /**
894
+ * Create a subject schema wrapper with a subject-level default transport policy.
895
+ *
896
+ * Use this when one subject should override its namespace's default transport
897
+ * routing while still remaining remotely invokable when a caller explicitly
898
+ * targets a transport.
899
+ * @param schema - The event or request schema to wrap
900
+ * @param value - Default transport routing policy for this subject
901
+ * @returns A DefaultTransportsSubjectSchema wrapper
902
+ * @example
903
+ * ```typescript
904
+ * import { defaultTransports } from '@makaio/framework/core';
905
+ *
906
+ * const Schemas = {
907
+ * internalEvent: defaultTransports(z.object({ id: z.string() }), 'local-only'),
908
+ * };
909
+ * ```
910
+ */
911
+ declare function defaultTransports<T extends EventSchema | RequestSchema, Default extends TransportRoutingDefault>(schema: T, value: Default): DefaultTransportsSubjectSchema<T, Default>;
912
+ //#endregion
913
+ //#region core/makaio-core/src/subject-helpers/unwrap-schema.d.ts
914
+ /**
915
+ * Unwrap any subject schema wrapper to get the inner schema.
916
+ * Returns the schema as-is if not wrapped.
917
+ * @param schema - The schema to unwrap
918
+ * @returns The inner EventSchema or RequestSchema
919
+ */
920
+ declare function unwrapSchema(schema: SubjectSchema): EventSchema | RequestSchema;
921
+ //#endregion
922
+ //#region core/makaio-core/src/bus-namespace-definition.d.ts
923
+ /**
924
+ * Report passed to the {@link NamespaceRegistrationOptions} `onSchemaViolation` callback
925
+ * when lenient validation detects a schema mismatch.
926
+ *
927
+ * Canonical owner: `@makaio/core`. `@makaio/bus-core` imports this type from core.
928
+ */
929
+ interface SchemaViolationReport {
930
+ /** Fully-qualified subject key (e.g., `"adapter:claude-code.sdk.event"`) */
931
+ subject: string;
932
+ /** Raw payload that failed validation */
933
+ payload: unknown;
934
+ /** Individual Zod issues from the failed parse */
935
+ issues: unknown[];
936
+ }
937
+ /**
938
+ * Options controlling runtime schema validation for a registered bus namespace.
939
+ *
940
+ * - `strict` (default) — throw `ValidationError` on schema mismatch
941
+ * - `lenient` — invoke `onSchemaViolation` callback, then deliver the event anyway
942
+ * - `skip` — no validation at all (for cross-Zod-version scenarios, e.g., SDK bundles Zod v3)
943
+ *
944
+ * Canonical owner: `@makaio/core`. `@makaio/bus-core` imports this type from core,
945
+ * not the other way around. Single source of truth — no mirroring.
946
+ */
947
+ type NamespaceRegistrationOptions = {
948
+ busValidationMode?: 'strict';
949
+ } | {
950
+ busValidationMode: 'lenient';
951
+ onSchemaViolation: (report: SchemaViolationReport) => void;
952
+ } | {
953
+ busValidationMode: 'skip';
954
+ };
955
+ /**
956
+ * A declarative bus namespace definition.
957
+ *
958
+ * Created by {@link createBusNamespace}. Carries typed subject tokens for
959
+ * immediate use in bus operations, plus the original schemas for deferred
960
+ * registration at boot time via `MakaioBus.registerNamespace()`.
961
+ *
962
+ * Does not include `scopedBus()` — that method requires a bus instance and
963
+ * is available on the `BusNamespace` object returned by `registerNamespace()`.
964
+ * @typeParam Domain - Namespace domain string (e.g. `'adapter'`, `'session'`)
965
+ * @typeParam Schemas - Schema record mapping subject keys to Zod schemas
966
+ */
967
+ interface BusNamespaceDefinition<Domain extends string = string, Schemas extends Record<string, SubjectSchema> = Record<string, SubjectSchema>> {
968
+ /** Namespace domain string (e.g., `'adapter'`, `'session'`) */
969
+ readonly name: Domain;
970
+ /**
971
+ * Typed subject tokens for bus operations — no registration needed to use
972
+ * these for `bus.on()`, `bus.emit()`, or `bus.request()`.
973
+ */
974
+ readonly subjects: BusSubjects<FlatSubjectDefinitions<Domain, Schemas>, Domain>;
975
+ /** Original Zod schemas — carried for deferred registration */
976
+ readonly schemas: Schemas;
977
+ /** Registration options (validation mode, violation callback) */
978
+ readonly options?: NamespaceRegistrationOptions;
979
+ /**
980
+ * Default transport routing for all subjects in this namespace when the
981
+ * caller does not provide an explicit `transports` option.
982
+ *
983
+ * Subject-level `defaultTransports` (set via `SubjectDefinitionMeta`) takes
984
+ * precedence over this namespace-level default when both are set.
985
+ *
986
+ * - `'all'` (default when omitted) — send to all registered transports.
987
+ * - `'local-only'` — suppress outbound transport fan-out by default. Callers
988
+ * can still force transport delivery by passing an explicit `transports`
989
+ * option. Weaker than `localSubject()`: subjects remain reachable remotely.
990
+ */
991
+ readonly defaultTransports?: TransportRoutingDefault;
992
+ /**
993
+ * Phantom field for type inference of filterable payload shape.
994
+ *
995
+ * Never set at runtime. Exists solely so TypeScript can infer the
996
+ * `FilterPayload` type parameter from the schema record without an
997
+ * explicit annotation at every callsite.
998
+ * @internal
999
+ */
1000
+ readonly __filterPayload?: FilterablePayloadIntersection<SubjectRecordFromSchemaRecord<Schemas>>;
1001
+ }
1002
+ /**
1003
+ * Namespace definition shape required for runtime registration.
1004
+ *
1005
+ * Structurally derived from {@link BusNamespaceDefinition} with the typed
1006
+ * subject tree erased to `unknown`. Composition-root catalogs and extension
1007
+ * manifests only need the namespace name, schemas, options, and the runtime
1008
+ * subject tokens; keeping this structural type separate lets those catalogs
1009
+ * contain heterogeneous namespace definitions without widening every subject
1010
+ * tree to an unsafe index signature.
1011
+ */
1012
+ type RegistrableBusNamespaceDefinition = Omit<BusNamespaceDefinition, 'subjects' | '__filterPayload'> & {
1013
+ /** Runtime subject token tree created by `createBusNamespace`. */readonly subjects: unknown;
1014
+ };
1015
+ /**
1016
+ * Options for {@link createBusNamespace}.
1017
+ *
1018
+ * Extends each variant of {@link NamespaceRegistrationOptions} with an optional
1019
+ * `defaultTransports` field so callers can pass both validation mode and routing
1020
+ * default in a single options object.
1021
+ */
1022
+ type CreateBusNamespaceOptions = NamespaceRegistrationOptions & {
1023
+ /**
1024
+ * Default transport routing for every subject in this namespace when the
1025
+ * caller does not provide an explicit `transports` option.
1026
+ *
1027
+ * Subject-level `defaultTransports` (set via `SubjectDefinitionMeta`) takes
1028
+ * precedence over this namespace-level default when both are set.
1029
+ *
1030
+ * - `'all'` (default when omitted) — send to all registered transports.
1031
+ * - `'local-only'` — suppress outbound transport fan-out by default.
1032
+ */
1033
+ defaultTransports?: TransportRoutingDefault;
1034
+ };
1035
+ /**
1036
+ * Creates a bus namespace definition with typed subject tokens.
1037
+ *
1038
+ * Pure function — no side-effects, no bus singleton mutation. The returned
1039
+ * definition can be used immediately for bus operations (`bus.on()`,
1040
+ * `bus.emit()`, etc.) and registered later at boot time via
1041
+ * `MakaioBus.registerNamespace(definition)`.
1042
+ * @param name - Namespace domain string (e.g., `'adapter'`, `'session'`)
1043
+ * @param schemas - Schema record mapping subject keys to Zod schemas
1044
+ * @param options - Optional registration and routing options
1045
+ * @returns Namespace definition with typed subject tokens and carried schemas
1046
+ * @example
1047
+ * ```typescript
1048
+ * import { createBusNamespace } from '@makaio/framework/core';
1049
+ * import { AdapterSchemas } from './schemas.js';
1050
+ *
1051
+ * export const AdapterNamespace = createBusNamespace('adapter', AdapterSchemas);
1052
+ * export const AdapterSubjects = AdapterNamespace.subjects;
1053
+ * ```
1054
+ */
1055
+ declare function createBusNamespace<Domain extends string, Schemas extends Record<string, SubjectSchema>>(name: Domain, schemas: Schemas, options?: CreateBusNamespaceOptions): BusNamespaceDefinition<Domain, Schemas>;
1056
+ //#endregion
1057
+ //#region core/makaio-core/src/context/index.d.ts
1058
+ /**
1059
+ * Platform identifier for tool execution context.
1060
+ * Used to determine platform-specific behavior in tools.
1061
+ */
1062
+ type Platform = 'posix' | 'windows';
1063
+ /**
1064
+ * Execution context passed to tool implementations.
1065
+ *
1066
+ * Provides tools with essential runtime information about the execution environment,
1067
+ * including working directory, environment variables, platform, and cancellation support.
1068
+ * @example
1069
+ * ```typescript
1070
+ * const result = await tool.execute(input, {
1071
+ * cwd: '/path/to/project',
1072
+ * env: { NODE_ENV: 'development' },
1073
+ * platform: 'posix',
1074
+ * signal: abortController.signal,
1075
+ * });
1076
+ * ```
1077
+ */
1078
+ interface MakaioContext {
1079
+ /** Working directory for tool execution */
1080
+ cwd: string;
1081
+ /** Read-only environment variables available to the tool */
1082
+ env: Readonly<Record<string, string>>;
1083
+ /** Platform identifier for cross-platform compatibility */
1084
+ platform: Platform;
1085
+ /** Optional abort signal for cancellation support */
1086
+ signal?: AbortSignal;
1087
+ /** Optional constraints that tools can check for specific behaviors */
1088
+ constraints?: Record<string, unknown>;
1089
+ /** Session ID for the current execution context */
1090
+ sessionId?: string;
1091
+ /** Subagent ID if running as a subagent */
1092
+ subagentId?: string;
1093
+ /** Current nesting depth in subagent hierarchy (0 = root) */
1094
+ subagentDepth?: number;
1095
+ }
1096
+ /**
1097
+ * Creates a MakaioContext with sensible defaults and optional overrides.
1098
+ *
1099
+ * Default behavior:
1100
+ * - `cwd`: Uses process.cwd() or '/' in non-Node environments
1101
+ * - `env`: Sanitized process.env (filters undefined values)
1102
+ * - `platform`: Auto-detected from process.platform
1103
+ * @param overrides - Optional partial context to merge with defaults
1104
+ * @returns Complete MakaioContext ready for tool execution
1105
+ * @example
1106
+ * ```typescript
1107
+ * // Create context with all defaults
1108
+ * const ctx = createMakaioContext();
1109
+ *
1110
+ * // Override specific values
1111
+ * const ctx = createMakaioContext({
1112
+ * cwd: '/custom/path',
1113
+ * signal: abortController.signal,
1114
+ * });
1115
+ * ```
1116
+ */
1117
+ declare function createMakaioContext(overrides?: Partial<MakaioContext>): MakaioContext;
1118
+ //#endregion
1119
+ //#region core/makaio-core/src/errors/index.d.ts
1120
+ /**
1121
+ * Base error class for all Makaio-related errors.
1122
+ */
1123
+ declare class MakaioError extends Error {
1124
+ readonly subject?: string | undefined;
1125
+ constructor(message: string, subject?: string | undefined);
1126
+ }
1127
+ declare class InvalidModelError extends MakaioError {
1128
+ readonly subject?: string | undefined;
1129
+ constructor(requestedModel: string, subject?: string | undefined);
1130
+ }
1131
+ declare class DirectoryNotFoundError extends MakaioError {
1132
+ readonly subject?: string | undefined;
1133
+ constructor(path: string, subject?: string | undefined);
1134
+ }
1135
+ declare class ConfigError extends MakaioError {
1136
+ readonly subject?: string | undefined;
1137
+ constructor(message: string, subject?: string | undefined);
1138
+ }
1139
+ /** Thrown when a provider rate-limits the request. */
1140
+ declare class RateLimitError extends MakaioError {
1141
+ readonly code: "rate_limit";
1142
+ }
1143
+ /** Thrown when authentication/authorization fails. */
1144
+ declare class AuthenticationError extends MakaioError {
1145
+ readonly code: "auth";
1146
+ }
1147
+ /** Thrown when the requested model is unavailable (deprecated, not found, etc.). */
1148
+ declare class ModelUnavailableError extends MakaioError {
1149
+ readonly code: "model_unavailable";
1150
+ }
1151
+ /** Thrown when a usage quota (tokens, requests) is exceeded. */
1152
+ declare class QuotaExceededError extends MakaioError {
1153
+ readonly code: "quota_exceeded";
1154
+ }
1155
+ //#endregion
1156
+ //#region core/makaio-core/src/observability/schema-observability.d.ts
1157
+ /**
1158
+ * Zod metadata key under which observability policies are stored.
1159
+ *
1160
+ * Using a namespaced string key avoids collisions with any other metadata
1161
+ * that callers attach to a schema via `.meta()`.
1162
+ */
1163
+ declare const OBSERVABILITY_META_KEY = "makaio.observability";
1164
+ /**
1165
+ * Schema-level observability policy attached to a Zod object schema via
1166
+ * {@link observability.schema}.
1167
+ */
1168
+ interface ObservabilitySchemaPolicy {
1169
+ /**
1170
+ * When `true`, all scalar fields of the schema are projected to telemetry
1171
+ * unless a field opts out with `visibility: 'hidden'`.
1172
+ */
1173
+ readonly traceAll?: boolean;
1174
+ }
1175
+ /** Controls how a single field participates in subject telemetry projection. */
1176
+ type ObservabilityFieldVisibility = 'attribute' | 'hidden' | 'count';
1177
+ /**
1178
+ * Field-level observability policy attached to a Zod field schema via
1179
+ * {@link observability.field}, {@link observability.hidden},
1180
+ * {@link observability.count}, or {@link observability.attribute}.
1181
+ */
1182
+ interface ObservabilityFieldPolicy {
1183
+ /** How this field participates in subject telemetry projection. */
1184
+ readonly visibility: ObservabilityFieldVisibility;
1185
+ /**
1186
+ * Telemetry attribute name for this field.
1187
+ * Defaults to the object property key when absent.
1188
+ */
1189
+ readonly attributeName?: string;
1190
+ }
1191
+ /**
1192
+ * Returns the {@link ObservabilitySchemaPolicy} stored on a schema, or
1193
+ * `undefined` if the schema has no schema-level observability metadata.
1194
+ * @param schema - The Zod schema to inspect.
1195
+ * @returns The schema-level observability policy, or `undefined`.
1196
+ */
1197
+ declare function getObservabilitySchemaPolicy(schema: z.ZodType): ObservabilitySchemaPolicy | undefined;
1198
+ /**
1199
+ * Returns the {@link ObservabilityFieldPolicy} stored on a field schema, or
1200
+ * `undefined` if no field-level observability metadata is found.
1201
+ *
1202
+ * The lookup walks transparent wrapper layers from outermost to innermost so
1203
+ * wrapper-level metadata can override inner metadata, and metadata attached to
1204
+ * any intermediate wrapper remains readable after additional wrapping.
1205
+ * @param schema - The Zod field schema to inspect.
1206
+ * @returns The field-level observability policy, or `undefined`.
1207
+ */
1208
+ declare function getObservabilityFieldPolicy(schema: z.ZodType): ObservabilityFieldPolicy | undefined;
1209
+ /**
1210
+ * Fluent helpers for attaching observability metadata to Zod schemas.
1211
+ *
1212
+ * All methods return a new schema instance — Zod schemas are immutable. The
1213
+ * original schema is never mutated.
1214
+ * @example
1215
+ * ```typescript
1216
+ * const RequestSchema = observability.schema(
1217
+ * z.object({ query: z.string(), limit: z.number() }),
1218
+ * { traceAll: true },
1219
+ * );
1220
+ *
1221
+ * const HiddenField = observability.hidden(z.string()).optional();
1222
+ * ```
1223
+ */
1224
+ declare const observability: {
1225
+ /**
1226
+ * Attaches a schema-level {@link ObservabilitySchemaPolicy} to a Zod schema.
1227
+ * Preserves any metadata already present on the schema.
1228
+ * @param schema - The Zod schema to annotate.
1229
+ * @param policy - The schema-level observability policy to store.
1230
+ * @returns A new schema instance with the policy merged into its metadata.
1231
+ */
1232
+ schema<TSchema extends z.ZodType>(schema: TSchema, policy: ObservabilitySchemaPolicy): TSchema;
1233
+ /**
1234
+ * Attaches a field-level {@link ObservabilityFieldPolicy} to a Zod schema.
1235
+ * Preserves any metadata already present on the schema.
1236
+ * @param schema - The Zod field schema to annotate.
1237
+ * @param policy - The field-level observability policy to store.
1238
+ * @returns A new schema instance with the policy merged into its metadata.
1239
+ */
1240
+ field<TSchema extends z.ZodType>(schema: TSchema, policy: ObservabilityFieldPolicy): TSchema;
1241
+ /**
1242
+ * Marks a field as hidden from subject telemetry projection.
1243
+ * @param schema - The Zod field schema to hide.
1244
+ * @returns A new schema instance with `visibility: 'hidden'` stored in its metadata.
1245
+ */
1246
+ hidden<TSchema extends z.ZodType>(schema: TSchema): TSchema;
1247
+ /**
1248
+ * Marks a field to be projected as a count metric in subject telemetry.
1249
+ * @param schema - The Zod field schema to count.
1250
+ * @param attributeName - Optional telemetry attribute name override.
1251
+ * @returns A new schema instance with `visibility: 'count'` stored in its metadata.
1252
+ */
1253
+ count<TSchema extends z.ZodType>(schema: TSchema, attributeName?: string): TSchema;
1254
+ /**
1255
+ * Marks a field to be projected as a named attribute in subject telemetry.
1256
+ * @param schema - The Zod field schema to expose as an attribute.
1257
+ * @param attributeName - Optional telemetry attribute name override.
1258
+ * @returns A new schema instance with `visibility: 'attribute'` stored in its metadata.
1259
+ */
1260
+ attribute<TSchema extends z.ZodType>(schema: TSchema, attributeName?: string): TSchema;
1261
+ };
1262
+ //#endregion
1263
+ export { type AnyHandler, type AnyMessageContext, AuthenticationError, type BaseMessageContext, type BaseSubjectSchema, type BusNamespaceDefinition, type BusSubjects, type ChannelSubjectSchema, type CollectorOnlySubjectSchema, ConfigError, type ContextForSubjectDefinition, type CreateBusNamespaceOptions, type DefaultTransportsSubjectSchema, DirectoryNotFoundError, type EventContext, type EventHandler, type EventMessagePayload, type EventSchema, type ExtractSubjectPayload, type ExtractSubjectResponse, type FilterOperator, type FilterPayloadFromSchemas, type FilterablePayloadIntersection, type FlatSubjectDefinitions, type HandlerForSubjectDefinition, type IConfigStorage, type InferSchemaPayload, type InferSubjectMeta, InvalidModelError, type LocalSubjectSchema, type MakaioBusLike, type MakaioContext, MakaioError, type MessageOrigin, type MessagePayload, ModelUnavailableError, type NamespaceRegistrationOptions, type NestedSubjectDefinitions, OBSERVABILITY_META_KEY, type ObservabilityFieldPolicy, type ObservabilityFieldVisibility, type ObservabilitySchemaPolicy, type OptionalResult, type PayloadFilter, type PrincipalContext, QuotaExceededError, RateLimitError, type RegistrableBusNamespaceDefinition, type RequestContext, type RequestHandler, type RequestMessagePayload, type RequestSchema, type SchemaRecord, type SchemaViolationReport, type ScopedSubjectDefinition, type SubjectDefinition, type SubjectRecord, type SubjectRecordFromSchemaRecord, type SubjectSchema, type TransportPeerContext, type TransportReceiveContext, type TransportRoutingDefault, type TypedPayloadFilter, type WildcardContext, type WildcardSubject, type WildcardSubjectDefinition, WildcardSubjectKey, type WildcardUnifiedHandler, channelSubject, collectorOnlySubject, createBusNamespace, createMakaioContext, defaultTransports, getFullSubjectForSubjectDefinition, getObservabilityFieldPolicy, getObservabilitySchemaPolicy, isChannelSchema, isCollectorOnlySchema, isDefaultTransportsSchema, isLocalSchema, isOperatorObject, isRequestSchema, localSubject, nestSubjectDefinitions, observability, unwrapSchema };