@makaio/framework 1.0.0-dev-1779046984397

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 (410) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +363 -0
  3. package/dist/account-identity-Ce1Bwrqi.mjs +1 -0
  4. package/dist/adapter-CbyjCE2d.mjs +1 -0
  5. package/dist/adapters/acp-client/index.d.mts +209 -0
  6. package/dist/adapters/acp-client/index.mjs +1 -0
  7. package/dist/adapters/config/index.d.mts +429 -0
  8. package/dist/adapters/config/index.mjs +1 -0
  9. package/dist/adapters/index.d.mts +4175 -0
  10. package/dist/adapters/index.mjs +11 -0
  11. package/dist/adapters/node.d.mts +263 -0
  12. package/dist/adapters/node.mjs +4 -0
  13. package/dist/adapters/stream-session/index.d.mts +1384 -0
  14. package/dist/adapters/stream-session/index.mjs +1 -0
  15. package/dist/adapters/stream-session/testing/index.d.mts +29 -0
  16. package/dist/adapters/stream-session/testing/index.mjs +1 -0
  17. package/dist/base-orchestrator-9z8TuA5a.d.mts +772 -0
  18. package/dist/bus/index.d.mts +3331 -0
  19. package/dist/bus/index.mjs +1 -0
  20. package/dist/bus-B1seC4M_.mjs +2 -0
  21. package/dist/capability-service-tnpR_TaB.mjs +1 -0
  22. package/dist/chunk-Dc06z0qk.mjs +1 -0
  23. package/dist/chunk-cpUYaJdV.mjs +1 -0
  24. package/dist/cleanEnvForAdapter-DvcIGXTG.mjs +1 -0
  25. package/dist/client-Dh4x4GQN.mjs +1 -0
  26. package/dist/clients/index.d.mts +2786 -0
  27. package/dist/clients/index.mjs +1 -0
  28. package/dist/clients-namespace-B0xAPZ6J.d.mts +332 -0
  29. package/dist/config-namespace-DLSs83zr.d.mts +638 -0
  30. package/dist/config-namespace-MJT8P0Ud.mjs +1 -0
  31. package/dist/contracts/adapter/index.d.mts +3 -0
  32. package/dist/contracts/adapter/index.mjs +1 -0
  33. package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
  34. package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
  35. package/dist/contracts/client/index.d.mts +3 -0
  36. package/dist/contracts/client/index.mjs +1 -0
  37. package/dist/contracts/common/index.d.mts +2 -0
  38. package/dist/contracts/common/index.mjs +1 -0
  39. package/dist/contracts/config/index.d.mts +455 -0
  40. package/dist/contracts/config/index.mjs +1 -0
  41. package/dist/contracts/extension/index.d.mts +3 -0
  42. package/dist/contracts/extension/index.mjs +1 -0
  43. package/dist/contracts/harness/index.d.mts +2 -0
  44. package/dist/contracts/harness/index.mjs +1 -0
  45. package/dist/contracts/host/index.d.mts +2 -0
  46. package/dist/contracts/host/index.mjs +1 -0
  47. package/dist/contracts/index.d.mts +12665 -0
  48. package/dist/contracts/index.mjs +1 -0
  49. package/dist/contracts/model-registry/index.d.mts +2 -0
  50. package/dist/contracts/model-registry/index.mjs +1 -0
  51. package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
  52. package/dist/contracts/native-session-supervisor/index.mjs +1 -0
  53. package/dist/contracts/platform/index.d.mts +2 -0
  54. package/dist/contracts/platform/index.mjs +1 -0
  55. package/dist/contracts/provider/index.d.mts +3 -0
  56. package/dist/contracts/provider/index.mjs +1 -0
  57. package/dist/contracts/session/index.d.mts +3 -0
  58. package/dist/contracts/session/index.mjs +1 -0
  59. package/dist/contracts/shared/index.d.mts +2 -0
  60. package/dist/contracts/shared/index.mjs +1 -0
  61. package/dist/contracts/skill/index.d.mts +2 -0
  62. package/dist/contracts/skill/index.mjs +1 -0
  63. package/dist/contracts/toast/index.d.mts +198 -0
  64. package/dist/contracts/toast/index.mjs +1 -0
  65. package/dist/contracts/variant/index.d.mts +2 -0
  66. package/dist/contracts/variant/index.mjs +1 -0
  67. package/dist/core/index.d.mts +1001 -0
  68. package/dist/core/index.mjs +1 -0
  69. package/dist/credential-ref-DLCsoKVZ.mjs +1 -0
  70. package/dist/cursor-storage-DOQdvo9j.mjs +1 -0
  71. package/dist/definition-DkYy1PZz.mjs +1 -0
  72. package/dist/definition-DtUNiGom.d.mts +158 -0
  73. package/dist/definition-DxvZ9e22.d.mts +376 -0
  74. package/dist/drizzle-CWVVw7Er.mjs +1 -0
  75. package/dist/execution-target-BW_uiBVe.mjs +1 -0
  76. package/dist/extension-COqwS-2Q.mjs +1 -0
  77. package/dist/extension-Cbrl4YGX.mjs +1 -0
  78. package/dist/extension-namespace-zaGKi6Qj.mjs +1 -0
  79. package/dist/handlers-iGKUJ380.mjs +41 -0
  80. package/dist/harness-CEq1Zkf9.mjs +1 -0
  81. package/dist/hooks/index.d.mts +423 -0
  82. package/dist/hooks/index.mjs +1 -0
  83. package/dist/host-CXAUGGN0.mjs +1 -0
  84. package/dist/identity-B_A0mE63.mjs +1 -0
  85. package/dist/index-6lyShOoU.d.mts +225 -0
  86. package/dist/index-7sXlairn2.d.mts +43 -0
  87. package/dist/index-BAKM2GMH2.d.mts +535 -0
  88. package/dist/index-BB419vv-.d.mts +3897 -0
  89. package/dist/index-BJOfdtbw.d.mts +729 -0
  90. package/dist/index-BXP9GK5q.d.mts +1075 -0
  91. package/dist/index-BdPwu6c0.d.mts +1730 -0
  92. package/dist/index-BePI0ckL.d.mts +40 -0
  93. package/dist/index-Bigx81Kr.d.mts +37 -0
  94. package/dist/index-BnNqbx2I.d.mts +134 -0
  95. package/dist/index-Bv15sNLn.d.mts +389 -0
  96. package/dist/index-C-myW_aK.d.mts +412 -0
  97. package/dist/index-C9F3Fc1A.d.mts +2938 -0
  98. package/dist/index-CNxS4Tlu.d.mts +1 -0
  99. package/dist/index-CVA0m1g9.d.mts +995 -0
  100. package/dist/index-C_kS2aqV2.d.mts +438 -0
  101. package/dist/index-Ch3ph52M2.d.mts +40 -0
  102. package/dist/index-CnZOKNjU.d.mts +89 -0
  103. package/dist/index-D1T-PPqF.d.mts +67 -0
  104. package/dist/index-D7T8XCku.d.mts +341 -0
  105. package/dist/index-DBQtpFLE.d.mts +4843 -0
  106. package/dist/index-DEw90pa2.d.mts +183 -0
  107. package/dist/index-DQRsGXb5.d.mts +109 -0
  108. package/dist/index-Dd5s4MSm.d.mts +72 -0
  109. package/dist/index-DubqLGH8.d.mts +1002 -0
  110. package/dist/index-ESSDWIB7.d.mts +11 -0
  111. package/dist/index-N5K1NOYs.d.mts +184 -0
  112. package/dist/index-PdUSmPT2.d.mts +180 -0
  113. package/dist/index-SzSiyG61.d.mts +117 -0
  114. package/dist/index-T0471kWA.d.mts +6760 -0
  115. package/dist/index-WKjrpcA_.d.mts +218 -0
  116. package/dist/index-hapw9_En.d.mts +13592 -0
  117. package/dist/index-iID2R9G1.d.mts +1490 -0
  118. package/dist/kernel/cli/index.d.mts +141 -0
  119. package/dist/kernel/cli/index.mjs +1 -0
  120. package/dist/kernel/cli/schemas.d.mts +63 -0
  121. package/dist/kernel/cli/schemas.mjs +1 -0
  122. package/dist/kernel/extension/index.d.mts +2 -0
  123. package/dist/kernel/extension/index.mjs +1 -0
  124. package/dist/kernel/index.d.mts +296 -0
  125. package/dist/kernel/index.mjs +1 -0
  126. package/dist/kernel/namespace/index.d.mts +2 -0
  127. package/dist/kernel/namespace/index.mjs +1 -0
  128. package/dist/kernel/observability/index.d.mts +2 -0
  129. package/dist/kernel/observability/index.mjs +1 -0
  130. package/dist/kernel/providers/index.d.mts +2 -0
  131. package/dist/kernel/providers/index.mjs +1 -0
  132. package/dist/kernel/window/index.d.mts +2 -0
  133. package/dist/kernel/window/index.mjs +1 -0
  134. package/dist/model-registry-BNzpR6TU.mjs +1 -0
  135. package/dist/model-registry-CIscwC52.mjs +1 -0
  136. package/dist/namespace-0yuzAKlr.mjs +1 -0
  137. package/dist/namespace-8cNguvIp.mjs +1 -0
  138. package/dist/namespace-BK2erxpV.d.mts +921 -0
  139. package/dist/namespace-Bmc7AW4J2.mjs +1 -0
  140. package/dist/namespace-C2ufjgaQ.d.mts +767 -0
  141. package/dist/namespace-C54Oj025.d.mts +159 -0
  142. package/dist/namespace-CCDEOwmW.d.mts +1313 -0
  143. package/dist/namespace-CfEWMXBx.mjs +1 -0
  144. package/dist/namespace-CkLUtc0g.d.mts +580 -0
  145. package/dist/namespace-D5Wrt7YU.mjs +1 -0
  146. package/dist/namespace-DZcuLwEA.d.mts +51 -0
  147. package/dist/namespace-Db-p67Rg.mjs +1 -0
  148. package/dist/namespace-FWx6HxaW.d.mts +611 -0
  149. package/dist/namespace-GLGGcWPH.d.mts +43 -0
  150. package/dist/namespace-N0dfwSg6.mjs +1 -0
  151. package/dist/namespace-O5SNY-LV.d.mts +2226 -0
  152. package/dist/namespace-ZbthBQVt.d.mts +142 -0
  153. package/dist/namespace-bq4Prtzn.d.mts +2046 -0
  154. package/dist/namespace-pNcSglBS.mjs +1 -0
  155. package/dist/namespace-ptv-pw_g.d.mts +3019 -0
  156. package/dist/namespace-xkvVw3hf2.d.mts +189 -0
  157. package/dist/native-session-supervisor-L-UIaEfd.mjs +1 -0
  158. package/dist/node/bus-server/index.d.mts +178 -0
  159. package/dist/node/bus-server/index.mjs +1 -0
  160. package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
  161. package/dist/node/bus-server/server-lifecycle.mjs +1 -0
  162. package/dist/node/machine-identity/index.d.mts +85 -0
  163. package/dist/node/machine-identity/index.mjs +3 -0
  164. package/dist/node/transports/index.d.mts +1752 -0
  165. package/dist/node/transports/index.mjs +2 -0
  166. package/dist/orchestrator-shared-DrjtTXYh.d.mts +249 -0
  167. package/dist/orchestrator-shared-Wv1GI2mW.mjs +1 -0
  168. package/dist/platform-BbSLVg5b.mjs +1 -0
  169. package/dist/profile-4StaDQW0.mjs +1 -0
  170. package/dist/provider-context-CNRQ4d5m.mjs +1 -0
  171. package/dist/providers/index.d.mts +135 -0
  172. package/dist/providers/index.mjs +1 -0
  173. package/dist/providers-Cr4Za8a1.mjs +1 -0
  174. package/dist/providers-namespace-CDwxY_DV.d.mts +583 -0
  175. package/dist/schema-BwzXEtT2.d.mts +837 -0
  176. package/dist/schema-CAw_BqaG.mjs +1 -0
  177. package/dist/schema-introspection-D61TT_7b.mjs +1 -0
  178. package/dist/schema-uSGW-6oM.mjs +1 -0
  179. package/dist/schemas-BXstpWVp.mjs +1 -0
  180. package/dist/schemas-BdMU-gew.d.mts +160 -0
  181. package/dist/schemas-C40ZAJ33.mjs +1 -0
  182. package/dist/schemas-C5xtVqdb.d.mts +46 -0
  183. package/dist/schemas-CGZy_rU6.d.mts +13 -0
  184. package/dist/schemas-CLxtoKFy.mjs +1 -0
  185. package/dist/schemas-Co_sVhzz.mjs +1 -0
  186. package/dist/schemas-D9108Iv1.d.mts +182 -0
  187. package/dist/schemas-DENVYyds.d.mts +463 -0
  188. package/dist/schemas-DbWs_hj8.d.mts +174 -0
  189. package/dist/schemas-Di0XnnMX.d.mts +73 -0
  190. package/dist/schemas-KMA1efQg.d.mts +944 -0
  191. package/dist/schemas-qmn5SWPU.d.mts +312 -0
  192. package/dist/schemas-sshQEF3l.d.mts +237 -0
  193. package/dist/server-lifecycle-Cf_SZ27k.d.mts +160 -0
  194. package/dist/server-lifecycle-DbFwlrTW.mjs +1 -0
  195. package/dist/service-base/index.d.mts +98 -0
  196. package/dist/service-base/index.mjs +1 -0
  197. package/dist/services/adapter-runtime/index.d.mts +4 -0
  198. package/dist/services/adapter-runtime/index.mjs +1 -0
  199. package/dist/services/adapter-runtime/namespace.d.mts +2 -0
  200. package/dist/services/adapter-runtime/namespace.mjs +1 -0
  201. package/dist/services/adapter-runtime/schemas.d.mts +2 -0
  202. package/dist/services/adapter-runtime/schemas.mjs +1 -0
  203. package/dist/services/adapter-subsystem/index.d.mts +3 -0
  204. package/dist/services/adapter-subsystem/index.mjs +1 -0
  205. package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
  206. package/dist/services/adapter-subsystem/namespace.mjs +1 -0
  207. package/dist/services/agent-runtime/index.d.mts +3 -0
  208. package/dist/services/agent-runtime/index.mjs +1 -0
  209. package/dist/services/agent-runtime/namespace.d.mts +2 -0
  210. package/dist/services/agent-runtime/namespace.mjs +1 -0
  211. package/dist/services/agent-runtime/schemas.d.mts +2 -0
  212. package/dist/services/agent-runtime/schemas.mjs +1 -0
  213. package/dist/services/capability/index.d.mts +2 -0
  214. package/dist/services/capability/index.mjs +1 -0
  215. package/dist/services/cli-detection/namespace.d.mts +56 -0
  216. package/dist/services/cli-detection/namespace.mjs +1 -0
  217. package/dist/services/codebase/index.d.mts +3 -0
  218. package/dist/services/codebase/index.mjs +1 -0
  219. package/dist/services/codebase/namespace.d.mts +2 -0
  220. package/dist/services/codebase/namespace.mjs +1 -0
  221. package/dist/services/codebase/schemas.d.mts +2 -0
  222. package/dist/services/codebase/schemas.mjs +1 -0
  223. package/dist/services/compression/index.d.mts +3 -0
  224. package/dist/services/compression/index.mjs +1 -0
  225. package/dist/services/compression/namespace.d.mts +2 -0
  226. package/dist/services/compression/namespace.mjs +1 -0
  227. package/dist/services/compression/schemas.d.mts +2 -0
  228. package/dist/services/compression/schemas.mjs +1 -0
  229. package/dist/services/context-rules/index.d.mts +412 -0
  230. package/dist/services/context-rules/index.mjs +1 -0
  231. package/dist/services/credential-change/index.d.mts +17 -0
  232. package/dist/services/credential-change/index.mjs +1 -0
  233. package/dist/services/definition/index.d.mts +2 -0
  234. package/dist/services/definition/index.mjs +1 -0
  235. package/dist/services/definition/namespace.d.mts +71 -0
  236. package/dist/services/definition/namespace.mjs +1 -0
  237. package/dist/services/definition/schemas.d.mts +38 -0
  238. package/dist/services/definition/schemas.mjs +1 -0
  239. package/dist/services/dialog/namespace.d.mts +105 -0
  240. package/dist/services/dialog/namespace.mjs +1 -0
  241. package/dist/services/dialog/schemas.d.mts +109 -0
  242. package/dist/services/dialog/schemas.mjs +1 -0
  243. package/dist/services/execution-target/index.d.mts +4 -0
  244. package/dist/services/execution-target/index.mjs +1 -0
  245. package/dist/services/execution-target/namespace.d.mts +2 -0
  246. package/dist/services/execution-target/namespace.mjs +1 -0
  247. package/dist/services/execution-target/schemas.d.mts +2 -0
  248. package/dist/services/execution-target/schemas.mjs +1 -0
  249. package/dist/services/filesystem/namespace.d.mts +432 -0
  250. package/dist/services/filesystem/namespace.mjs +1 -0
  251. package/dist/services/filesystem/schemas.d.mts +240 -0
  252. package/dist/services/filesystem/schemas.mjs +1 -0
  253. package/dist/services/harness/index.d.mts +861 -0
  254. package/dist/services/harness/index.mjs +1 -0
  255. package/dist/services/harness/storage/schema.d.mts +424 -0
  256. package/dist/services/harness/storage/schema.mjs +1 -0
  257. package/dist/services/index.d.mts +5703 -0
  258. package/dist/services/index.mjs +1 -0
  259. package/dist/services/local-notification/index.d.mts +25 -0
  260. package/dist/services/local-notification/index.mjs +1 -0
  261. package/dist/services/local-notification/namespace.d.mts +73 -0
  262. package/dist/services/local-notification/namespace.mjs +1 -0
  263. package/dist/services/local-notification/schemas.d.mts +88 -0
  264. package/dist/services/local-notification/schemas.mjs +1 -0
  265. package/dist/services/log-import/browser.d.mts +3 -0
  266. package/dist/services/log-import/browser.mjs +1 -0
  267. package/dist/services/log-import/index.d.mts +275 -0
  268. package/dist/services/log-import/index.mjs +2 -0
  269. package/dist/services/log-import/log-import.d.mts +3 -0
  270. package/dist/services/log-import/log-import.mjs +1 -0
  271. package/dist/services/log-import/namespace.d.mts +327 -0
  272. package/dist/services/log-import/namespace.mjs +1 -0
  273. package/dist/services/log-import/schemas.d.mts +217 -0
  274. package/dist/services/log-import/schemas.mjs +1 -0
  275. package/dist/services/model-registry/index.d.mts +2 -0
  276. package/dist/services/model-registry/index.mjs +1 -0
  277. package/dist/services/preferences/index.d.mts +3 -0
  278. package/dist/services/preferences/index.mjs +1 -0
  279. package/dist/services/preferences/schemas.d.mts +2 -0
  280. package/dist/services/preferences/schemas.mjs +1 -0
  281. package/dist/services/preferences/storage-namespace.d.mts +3 -0
  282. package/dist/services/preferences/storage-namespace.mjs +1 -0
  283. package/dist/services/provider-context/index.d.mts +2 -0
  284. package/dist/services/provider-context/index.mjs +1 -0
  285. package/dist/services/provider-runtime/index.d.mts +136 -0
  286. package/dist/services/provider-runtime/index.mjs +1 -0
  287. package/dist/services/session/handlers/index.d.mts +2 -0
  288. package/dist/services/session/handlers/index.mjs +1 -0
  289. package/dist/services/session/index.d.mts +10 -0
  290. package/dist/services/session/index.mjs +1 -0
  291. package/dist/services/session/messages/namespace.d.mts +2 -0
  292. package/dist/services/session/messages/namespace.mjs +1 -0
  293. package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
  294. package/dist/services/session/orchestrator-testing/index.mjs +1 -0
  295. package/dist/services/session/session-events/namespace.d.mts +2 -0
  296. package/dist/services/session/session-events/namespace.mjs +1 -0
  297. package/dist/services/session/storage/namespace.d.mts +2 -0
  298. package/dist/services/session/storage/namespace.mjs +1 -0
  299. package/dist/services/session/storage/schema.d.mts +2 -0
  300. package/dist/services/session/storage/schema.mjs +1 -0
  301. package/dist/services/session/testing/index.d.mts +35 -0
  302. package/dist/services/session/testing/index.mjs +52 -0
  303. package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
  304. package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
  305. package/dist/services/session/turns/namespace.d.mts +2 -0
  306. package/dist/services/session/turns/namespace.mjs +1 -0
  307. package/dist/services/session-editor/index.d.mts +119 -0
  308. package/dist/services/session-editor/index.mjs +1 -0
  309. package/dist/services/settings/index.d.mts +47 -0
  310. package/dist/services/settings/index.mjs +1 -0
  311. package/dist/services/settings/namespace.d.mts +662 -0
  312. package/dist/services/settings/namespace.mjs +1 -0
  313. package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
  314. package/dist/services/settings/storage/clients-namespace.mjs +1 -0
  315. package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
  316. package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
  317. package/dist/services/settings/storage/index.d.mts +4 -0
  318. package/dist/services/settings/storage/index.mjs +1 -0
  319. package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
  320. package/dist/services/settings/storage/providers-namespace.mjs +1 -0
  321. package/dist/services/tool-approval/index.d.mts +2 -0
  322. package/dist/services/tool-approval/index.mjs +1 -0
  323. package/dist/services/tools/index.d.mts +2 -0
  324. package/dist/services/tools/index.mjs +1 -0
  325. package/dist/services/tray-menu/index.d.mts +4 -0
  326. package/dist/services/tray-menu/index.mjs +1 -0
  327. package/dist/services/tray-menu/namespace.d.mts +2 -0
  328. package/dist/services/tray-menu/namespace.mjs +1 -0
  329. package/dist/services/tray-menu/schemas.d.mts +2 -0
  330. package/dist/services/tray-menu/schemas.mjs +1 -0
  331. package/dist/services/turn/index.d.mts +2 -0
  332. package/dist/services/turn/index.mjs +1 -0
  333. package/dist/services/turn/namespace.d.mts +2 -0
  334. package/dist/services/turn/namespace.mjs +1 -0
  335. package/dist/services/turn/schemas.d.mts +335 -0
  336. package/dist/services/turn/schemas.mjs +1 -0
  337. package/dist/services/worker/index.d.mts +3 -0
  338. package/dist/services/worker/index.mjs +1 -0
  339. package/dist/services/worker/namespace.d.mts +2 -0
  340. package/dist/services/worker/namespace.mjs +1 -0
  341. package/dist/services/worker/schemas.d.mts +2 -0
  342. package/dist/services/worker/schemas.mjs +1 -0
  343. package/dist/session-Do6lDZM4.mjs +123 -0
  344. package/dist/session-lineage-Eev4uo4I.d.mts +65 -0
  345. package/dist/session-piI1R5rP.mjs +1 -0
  346. package/dist/shared-DxHLl9UP.mjs +1 -0
  347. package/dist/shared-schemas-BgQv_tnu.mjs +1 -0
  348. package/dist/skill-CB5h-ZFQ.mjs +1 -0
  349. package/dist/storage/drizzle/client.d.mts +78 -0
  350. package/dist/storage/drizzle/client.mjs +1 -0
  351. package/dist/storage/drizzle/index.d.mts +98 -0
  352. package/dist/storage/drizzle/index.mjs +1 -0
  353. package/dist/storage/handlers/drizzle/index.d.mts +2 -0
  354. package/dist/storage/handlers/drizzle/index.mjs +1 -0
  355. package/dist/storage/handlers/index.d.mts +33 -0
  356. package/dist/storage/handlers/index.mjs +1 -0
  357. package/dist/storage/index.d.mts +192 -0
  358. package/dist/storage/index.mjs +1 -0
  359. package/dist/storage-namespace-ADwyijoe.mjs +1 -0
  360. package/dist/storage-namespace-DAm8iWEj.d.mts +221 -0
  361. package/dist/storage-namespace-definition-CHu2k14q.mjs +1 -0
  362. package/dist/storage-namespace-definition-CJgqyXH1.d.mts +17 -0
  363. package/dist/style.css +3782 -0
  364. package/dist/testing/drizzle-harness.d.mts +130 -0
  365. package/dist/testing/drizzle-harness.mjs +1 -0
  366. package/dist/testing/index.d.mts +106 -0
  367. package/dist/testing/index.mjs +1 -0
  368. package/dist/tool-approval-service-BcBSUZCO.mjs +1 -0
  369. package/dist/tools/index.d.mts +825 -0
  370. package/dist/tools/index.mjs +1 -0
  371. package/dist/tools/testing/index.d.mts +53 -0
  372. package/dist/tools/testing/index.mjs +1 -0
  373. package/dist/tools-CDSgj0ee.mjs +1 -0
  374. package/dist/tray-menu-service-CTXC1Elg.mjs +1 -0
  375. package/dist/types-6WxLfoM3.d.mts +31 -0
  376. package/dist/types-BjToUrHp.d.mts +6619 -0
  377. package/dist/types-CD1LJwPc.d.mts +1009 -0
  378. package/dist/types-Cvrj2ogm.d.mts +305 -0
  379. package/dist/types-DYF5LxZY.d.mts +233 -0
  380. package/dist/types-t295YC6T.d.mts +262 -0
  381. package/dist/types-vNpkAe4Y.d.mts +128 -0
  382. package/dist/ui-components/index.d.mts +2342 -0
  383. package/dist/ui-components/index.mjs +8 -0
  384. package/dist/ui-config-CXmbsqZV.mjs +1 -0
  385. package/dist/ui-hooks/index.d.mts +1805 -0
  386. package/dist/ui-hooks/index.mjs +1 -0
  387. package/dist/ui-kernel/index.d.mts +2793 -0
  388. package/dist/ui-kernel/index.mjs +1 -0
  389. package/dist/ui-kernel/pages/namespace.d.mts +88 -0
  390. package/dist/ui-kernel/pages/namespace.mjs +1 -0
  391. package/dist/ui-kernel/pages/schemas.d.mts +2 -0
  392. package/dist/ui-kernel/pages/schemas.mjs +1 -0
  393. package/dist/ui-views/index.d.mts +487 -0
  394. package/dist/ui-views/index.mjs +30 -0
  395. package/dist/utils/health-probe.d.mts +26 -0
  396. package/dist/utils/health-probe.mjs +1 -0
  397. package/dist/utils/index.d.mts +227 -0
  398. package/dist/utils/index.mjs +2 -0
  399. package/dist/utils/keychain.d.mts +31 -0
  400. package/dist/utils/keychain.mjs +1 -0
  401. package/dist/utils/resolve-package-root.d.mts +12 -0
  402. package/dist/utils/resolve-package-root.mjs +1 -0
  403. package/dist/utils/workspace-root.d.mts +27 -0
  404. package/dist/utils/workspace-root.mjs +2 -0
  405. package/dist/variant-D5kSrL3m.mjs +1 -0
  406. package/dist/version-CjS20oXi.mjs +1 -0
  407. package/dist/visibility-CZu8ooOA.mjs +1 -0
  408. package/dist/window-registry-CUftmDr3.mjs +1 -0
  409. package/dist/window-registry-C_IJmY8_.d.mts +130 -0
  410. package/package.json +346 -0
@@ -0,0 +1,1001 @@
1
+ import { ZodType, z } from "zod";
2
+ import { Paths, Simplify, UnknownRecord } from "type-fest";
3
+
4
+ //#region packages/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 packages/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
+ * Base message context interface for both events and requests.
97
+ *
98
+ * Provides common metadata for tracking and correlation:
99
+ * - `messageId`: Unique identifier for this specific message
100
+ * - `correlationId`: Optional identifier linking related operations
101
+ */
102
+ interface BaseMessageContext {
103
+ /**
104
+ * Unique identifier for this specific message.
105
+ * Auto-generated if not provided.
106
+ *
107
+ * Used for:
108
+ * - Message deduplication
109
+ * - Idempotency checks
110
+ * - Tracking individual messages in logs
111
+ */
112
+ messageId: string;
113
+ /**
114
+ * Optional identifier linking related operations.
115
+ * Propagated through chains of requests/events.
116
+ *
117
+ * Used for:
118
+ * - Distributed tracing
119
+ * - Causality tracking
120
+ * - Following a workflow through the system
121
+ * @example
122
+ * ```typescript
123
+ * // Initial request generates correlationId
124
+ * const result = await request(
125
+ * UserSubjects.getUser,
126
+ * { userId: '42' },
127
+ * { correlationId: 'user-action-123' }
128
+ * );
129
+ *
130
+ * // Handler propagates correlationId to downstream operations
131
+ * await emit(
132
+ * UserSubjects.userLoaded,
133
+ * { user: result },
134
+ * { correlationId: context.correlationId }
135
+ * );
136
+ * ```
137
+ */
138
+ correlationId?: string;
139
+ /**
140
+ * Trusted context supplied by the local receiving transport.
141
+ *
142
+ * Undefined for local calls and for transports that do not supply connection
143
+ * context. Never trust similarly named fields in payloads or wire messages.
144
+ */
145
+ transport?: TransportReceiveContext;
146
+ isRequest: boolean;
147
+ }
148
+ type EventMessagePayload<Payload extends UnknownRecord = UnknownRecord> = Payload & {
149
+ request?: never;
150
+ response?: never;
151
+ };
152
+ type RequestMessagePayload<Request extends UnknownRecord = UnknownRecord, Response extends UnknownRecord = UnknownRecord> = {
153
+ request: Request;
154
+ response: Response;
155
+ };
156
+ type MessagePayload = RequestMessagePayload | EventMessagePayload;
157
+ //#endregion
158
+ //#region packages/makaio-core/src/types/context.d.ts
159
+ /**
160
+ * Context object passed to event handlers when using wildcard patterns.
161
+ *
162
+ * Provides:
163
+ * - `isRequest`: Always false (discriminator for type narrowing)
164
+ * - `payload`: The event payload
165
+ * - Message tracking fields from BaseMessage (messageId, correlationId)
166
+ */
167
+ interface EventContext<Payload> extends BaseMessageContext {
168
+ /** Discriminator - always false for events */
169
+ isRequest: false;
170
+ /** The event payload */
171
+ payload: Payload;
172
+ /** The event subject */
173
+ subject: string;
174
+ }
175
+ /**
176
+ * Context object passed to request handlers.
177
+ *
178
+ * Provides:
179
+ * - `isRequest`: Always true (discriminator for type narrowing)
180
+ * - `payload`: The request payload
181
+ * - `setResult`: Function to set the response value
182
+ * - `next`: Function to call the next handler in the middleware chain
183
+ * - `replacePayload`: Function to transform the payload for subsequent handlers
184
+ * - `identify`: Optional function to identify the handler for broadcast aggregation
185
+ * - Message tracking fields from BaseMessage (messageId, correlationId)
186
+ */
187
+ interface RequestContext<Payload, Response> extends BaseMessageContext {
188
+ /** Discriminator - always true for requests */
189
+ isRequest: true;
190
+ /** The request payload */
191
+ payload: Payload;
192
+ /** Set the response value (ends the handler chain) */
193
+ setResult: (result: Response) => void;
194
+ /**
195
+ * Read the current result value.
196
+ *
197
+ * Returns the value set by `setResult()` in this handler or by a downstream
198
+ * handler after `await next()`. Undefined until a result has been set.
199
+ */
200
+ readonly result: Response | undefined;
201
+ /**
202
+ * Shallow-merge additional fields into the current result.
203
+ *
204
+ * Only valid for object-typed responses. In the request path the operation
205
+ * uses spread (immutable); in broadcast mode it uses `Object.assign`
206
+ * (in-place mutation) so the already-pushed result reference stays current.
207
+ * If no result has been set yet, starts from an empty object.
208
+ * @param extension - Fields to merge into the current result
209
+ */
210
+ extendResult: (extension: [Response] extends [Record<string, unknown>] ? Partial<Response> : never) => void;
211
+ /**
212
+ * Call the next handler in the middleware chain.
213
+ * If no more handlers exist, throws NoHandlerError.
214
+ */
215
+ next: () => Promise<void>;
216
+ /**
217
+ * Replace the payload with a new value.
218
+ * Subsequent handlers in the middleware chain will receive the new payload.
219
+ * Useful for hooks that need to inject context before the main handler runs.
220
+ */
221
+ replacePayload: (newPayload: Payload) => void;
222
+ /**
223
+ * Identify this handler for broadcast aggregation.
224
+ * Only present when called via broadcast() - call before setResult().
225
+ * @param nodeId - Unique identifier for this handler/node
226
+ */
227
+ identify?: (nodeId: string) => void;
228
+ }
229
+ /**
230
+ * Unified context for wildcard handlers that can match both events and requests.
231
+ * Use the `isRequest` discriminator to narrow the type.
232
+ * @example
233
+ * ```typescript
234
+ * MakaioBus.on('adapter.*', (context) => {
235
+ * if (context.isRequest) {
236
+ * // TypeScript knows this is RequestContext
237
+ * context.setResult({ handled: true });
238
+ * } else {
239
+ * // TypeScript knows this is EventContext
240
+ * console.debug('Event:', context.payload);
241
+ * }
242
+ * });
243
+ * ```
244
+ */
245
+ type WildcardContext<Payload = unknown, Response = unknown> = EventContext<Payload> | RequestContext<Payload, Response>;
246
+ //#endregion
247
+ //#region packages/makaio-core/src/types/filter.d.ts
248
+ type Primitive = string | number | boolean | null;
249
+ /**
250
+ * Filter operators for payload field matching.
251
+ * @example
252
+ * ```typescript
253
+ * // Equality (implicit)
254
+ * { agentId: 'agent-123' }
255
+ *
256
+ * // Membership
257
+ * { status: { $in: ['active', 'pending'] } }
258
+ *
259
+ * // Not equal
260
+ * { type: { $ne: 'internal' } }
261
+ *
262
+ * // Presence check
263
+ * { error: { $exists: false } }
264
+ *
265
+ * // String prefix/suffix matching
266
+ * { path: { $startsWith: '.git/' } }
267
+ * { file: { $endsWith: '.ts' } }
268
+ * ```
269
+ */
270
+ type FilterOperator<T extends Primitive = Primitive> = T | {
271
+ $in: T[];
272
+ } | {
273
+ $ne: T;
274
+ } | {
275
+ $exists: boolean;
276
+ } | {
277
+ $startsWith: string;
278
+ } | {
279
+ $endsWith: string;
280
+ };
281
+ /**
282
+ * Untyped payload filter - accepts any string keys.
283
+ * Use TypedPayloadFilter<T> for type-safe filters.
284
+ */
285
+ type PayloadFilter = Record<string, FilterOperator>;
286
+ /**
287
+ * Type-safe payload filter constrained to valid paths of a payload type.
288
+ *
289
+ * Uses type-fest's `Paths` to support dotted path notation for nested fields.
290
+ * @example
291
+ * ```typescript
292
+ * interface McpPayload {
293
+ * agentId: string;
294
+ * raw: { msg: { type: string } };
295
+ * }
296
+ *
297
+ * // Type-safe - validates both top-level and nested paths
298
+ * const filter: TypedPayloadFilter<McpPayload> = {
299
+ * agentId: 'agent-123',
300
+ * 'raw.msg.type': 'session_configured', // ✅ valid path
301
+ * 'raw.msg.typo': 'x', // ❌ type error
302
+ * };
303
+ * ```
304
+ */
305
+ type TypedPayloadFilter<T> = { [K in Paths<T> & string]?: FilterOperator };
306
+ /**
307
+ * Type guard to check if a value is a filter operator object.
308
+ * @param value - The filter operator value to check
309
+ * @returns True if the value is a filter operator object with $in, $ne, $exists, $startsWith, or $endsWith
310
+ */
311
+ declare function isOperatorObject(value: FilterOperator): value is {
312
+ $in: Primitive[];
313
+ } | {
314
+ $ne: Primitive;
315
+ } | {
316
+ $exists: boolean;
317
+ } | {
318
+ $startsWith: string;
319
+ } | {
320
+ $endsWith: string;
321
+ };
322
+ //#endregion
323
+ //#region packages/makaio-core/src/types/schema.d.ts
324
+ /**
325
+ * Schema definition for event subjects (fire-and-forget).
326
+ * Events have only a payload schema, no response.
327
+ * The payload is now separate from the context, so no restrictions needed.
328
+ */
329
+ type EventSchema = z.ZodType;
330
+ /**
331
+ * Schema definition for request subjects (request-response).
332
+ * Requests have both a request payload schema and a response schema.
333
+ */
334
+ type RequestSchema<Request extends ZodType = ZodType, Response extends ZodType = ZodType> = {
335
+ request: Request;
336
+ response: Response;
337
+ };
338
+ /**
339
+ * Wrapper to mark a subject as local-only (never sent to transports).
340
+ *
341
+ * Use `localSubject()` from `@makaio/bus-core` to create these.
342
+ * @example
343
+ * ```typescript
344
+ * import { localSubject } from '@makaio/framework/bus';
345
+ *
346
+ * const WidgetSchemas = {
347
+ * register: localSubject(widgetDefinitionSchema), // local event
348
+ * unregister: localSubject(z.object({ widgetId: z.string() })),
349
+ * };
350
+ * ```
351
+ */
352
+ type LocalSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | RequestSchema> = {
353
+ readonly __local: true;
354
+ readonly schema: T;
355
+ };
356
+ /**
357
+ * Wrapper to mark a subject as channel-only (encrypted point-to-point).
358
+ *
359
+ * Channel subjects are rejected by public bus methods and are only
360
+ * routable through the DirectChannel encrypted transport. Use
361
+ * `channelSubject()` from `@makaio/bus-core` to create these.
362
+ * @example
363
+ * ```typescript
364
+ * import { channelSubject } from '@makaio/framework/bus';
365
+ *
366
+ * const DirectSchemas = {
367
+ * message: channelSubject(z.object({ text: z.string() })),
368
+ * ping: channelSubject({
369
+ * request: z.object({ ts: z.number() }),
370
+ * response: z.object({ ts: z.number() }),
371
+ * }),
372
+ * };
373
+ * ```
374
+ */
375
+ type ChannelSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | RequestSchema> = {
376
+ readonly __channel: true;
377
+ readonly schema: T;
378
+ };
379
+ /**
380
+ * Base schema types (unwrapped).
381
+ */
382
+ type BaseSubjectSchema = EventSchema | RequestSchema;
383
+ /**
384
+ * Union of all subject schema types (including local and channel wrappers).
385
+ */
386
+ type SubjectSchema = BaseSubjectSchema | LocalSubjectSchema | ChannelSubjectSchema;
387
+ type SchemaRecord = Record<string, SubjectSchema>;
388
+ //#endregion
389
+ //#region packages/makaio-core/src/types/type-helpers.d.ts
390
+ /**
391
+ * Unwrap LocalSubjectSchema or ChannelSubjectSchema wrappers if present.
392
+ * Returns the inner schema for wrapped subjects, or the schema as-is otherwise.
393
+ */
394
+ type UnwrapSchema<S> = S extends {
395
+ readonly __local: true;
396
+ readonly schema: infer Inner;
397
+ } ? Inner : S extends {
398
+ readonly __channel: true;
399
+ readonly schema: infer Inner;
400
+ } ? Inner : S;
401
+ /**
402
+ * Infer payload type from schema (handles EventSchema, RequestSchema,
403
+ * LocalSubjectSchema, and ChannelSubjectSchema).
404
+ *
405
+ * For requests:
406
+ * - Uses z.input for request (what callers pass before validation/defaults)
407
+ * - Uses z.infer for response (what handlers return after processing)
408
+ *
409
+ * This allows schemas with .default() to have optional fields in the caller API
410
+ * while the response type reflects the validated output.
411
+ *
412
+ * LocalSubjectSchema and ChannelSubjectSchema wrappers are automatically
413
+ * unwrapped before inference.
414
+ *
415
+ * Idempotent: Returns already-inferred types as-is.
416
+ */
417
+ type InferSchemaPayload<S extends SubjectSchema> = InferSchemaPayloadInner<UnwrapSchema<S>>;
418
+ type InferSchemaPayloadInner<S> = S extends {
419
+ request: infer Req extends z.ZodType;
420
+ response: infer Res extends z.ZodType;
421
+ } ? {
422
+ request: z.input<Req>;
423
+ response: z.infer<Res>;
424
+ } : S extends z.ZodType ? Simplify<z.infer<S>> : unknown;
425
+ /**
426
+ * Compute all subject meta from the original schema in one place.
427
+ *
428
+ * Resolves payload, locality, channel membership, request/event discriminator,
429
+ * and namespace from a raw SubjectSchema.
430
+ * @typeParam S - The subject schema type
431
+ * @typeParam Ns - The namespace string
432
+ */
433
+ type InferSubjectMeta<S extends SubjectSchema, Ns extends string> = {
434
+ /** True when the subject is a request-response pair, false for events. */isRequest: UnwrapSchema<S> extends {
435
+ request: z.ZodType;
436
+ response: z.ZodType;
437
+ } ? true : false; /** True when the subject is wrapped with `localSubject()`. */
438
+ local: S extends LocalSubjectSchema ? true : false; /** True when the subject is wrapped with `channelSubject()`. */
439
+ channel: S extends ChannelSubjectSchema ? true : false; /** Inferred payload type (request/response pair or event payload). */
440
+ payload: InferSchemaPayload<S>; /** The namespace this subject belongs to. */
441
+ namespace: Ns;
442
+ };
443
+ //#endregion
444
+ //#region packages/makaio-core/src/types/subjects.d.ts
445
+ type SubjectRecord<SubjectKeys extends string = string, Payload extends MessagePayload = MessagePayload> = Record<SubjectKeys, Payload>;
446
+ type SubjectRecordFromSchemaRecord<SchemaRecord extends Record<string, SubjectSchema>> = { [K in keyof SchemaRecord & string]: Simplify<InferSchemaPayload<SchemaRecord[K]>> };
447
+ type SubjectDefinitionMeta<Subject extends SubjectRecord = SubjectRecord<'default'>, K extends keyof Subject = keyof Subject, Namespace extends string = string> = {
448
+ isRequest: Subject extends SubjectRecord<'default'> ? boolean : Subject[K] extends RequestMessagePayload ? true : false;
449
+ payload: K extends string ? Subject[K] : unknown;
450
+ namespace: Namespace;
451
+ /**
452
+ * If true, this subject is local-only and will never be sent to transports.
453
+ * Use for subjects whose payloads contain non-serializable data (e.g., React components).
454
+ */
455
+ local: boolean;
456
+ /**
457
+ * If true, this subject is channel-only and is only routable through the
458
+ * DirectChannel encrypted point-to-point transport.
459
+ */
460
+ channel: boolean;
461
+ };
462
+ type SubjectDefinition<Subject extends SubjectRecord = SubjectRecord, SubjectKey extends keyof Subject = keyof Subject, Namespace extends string = string> = {
463
+ $meta: SubjectDefinitionMeta<Subject, SubjectKey, Namespace>;
464
+ subject: SubjectKey;
465
+ };
466
+ /** Extract payload (event payload or request/response pair) */
467
+ type ExtractInternalSubjectPayload<T extends SubjectDefinition> = T['$meta']['payload'];
468
+ /** Extract subject payload */
469
+ type ExtractSubjectPayload<T extends SubjectDefinition> = ExtractInternalSubjectPayload<T> extends RequestMessagePayload ? ExtractInternalSubjectPayload<T>['request'] : ExtractInternalSubjectPayload<T>;
470
+ /** Extract response payload (request subjects only) */
471
+ type ExtractSubjectResponse<T extends SubjectDefinition> = ExtractInternalSubjectPayload<T> extends RequestMessagePayload ? ExtractInternalSubjectPayload<T>['response'] : never;
472
+ type ScopedSubjectDefinition<Namespace extends string = string> = SubjectDefinition<SubjectRecord, keyof SubjectRecord, Namespace>;
473
+ /**
474
+ * Extract the filterable payload from a MessagePayload.
475
+ * For requests, returns the request part (what we filter on).
476
+ * For events, returns the payload as-is.
477
+ */
478
+ type FilterablePayload<P> = P extends RequestMessagePayload ? P['request'] : P;
479
+ /**
480
+ * Union of all filterable payloads from a SubjectRecord.
481
+ */
482
+ type FilterablePayloadsUnion<Subjects extends SubjectRecord> = FilterablePayload<Subjects[keyof Subjects]>;
483
+ /**
484
+ * Extract keys from ANY member of a union type (distributive).
485
+ *
486
+ * For `{ a: 1, b: 2 } | { a: 1, c: 3 }`, returns `'a' | 'b' | 'c'`.
487
+ */
488
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
489
+ /**
490
+ * Extract value type for a key from union members that have it.
491
+ */
492
+ type ValueOfKey<T, K extends PropertyKey> = T extends { [P in K]: infer V } ? V : never;
493
+ /**
494
+ * Build an object type with ALL keys from ANY union member.
495
+ *
496
+ * For `{ type: 'a', id: string } | { type: 'b', name: string }`:
497
+ * Result = `{ type: 'a' | 'b', id: string, name: string }`
498
+ *
499
+ * Allows filtering by any key that exists in any payload.
500
+ */
501
+ type AllPropertiesOfUnion<T> = { [K in KeysOfUnion<T>]: ValueOfKey<T, K> };
502
+ /**
503
+ * Union of all filterable payload properties from a SubjectRecord.
504
+ *
505
+ * Collects ALL keys from ANY payload, allowing filtering by any field.
506
+ * Events without a filtered key simply won't match.
507
+ * @example
508
+ * ```typescript
509
+ * // Given subjects with payloads:
510
+ * // - 'event': { agentId: string, foo: number }
511
+ * // - 'request': { sessionId: string }
512
+ *
513
+ * // FilterablePayloadUnion = { agentId: string, foo: number, sessionId: string }
514
+ *
515
+ * // Filter can use any key from any payload
516
+ * bus.withFilter({ agentId: 'x' }); // ✅ matches events with agentId
517
+ * bus.withFilter({ sessionId: 'y' }); // ✅ matches requests with sessionId
518
+ * ```
519
+ */
520
+ type FilterablePayloadIntersection<Subjects extends SubjectRecord> = Simplify<AllPropertiesOfUnion<FilterablePayloadsUnion<Subjects>>>;
521
+ /**
522
+ * Compute FilterPayload directly from a schema record.
523
+ *
524
+ * This bypasses SubjectRecordFromSchemaRecord and computes directly from schemas,
525
+ * which TypeScript can evaluate because Schemas is concrete at registration time.
526
+ */
527
+ type FilterPayloadFromSchemas<Schemas extends Record<string, SubjectSchema>> = Simplify<AllPropertiesOfUnion<{ [K in keyof Schemas]: FilterablePayload<InferSchemaPayload<Schemas[K]>> }[keyof Schemas]>>;
528
+ //#endregion
529
+ //#region packages/makaio-core/src/types/wildcards.d.ts
530
+ type WildcardSubject = '*';
531
+ declare const WildcardSubjectKey = "*";
532
+ type WildcardSubjectDefinition<Namespace extends string = string> = SubjectDefinition<Record<'*', MessagePayload>, WildcardSubject, Namespace>;
533
+ //#endregion
534
+ //#region packages/makaio-core/src/types/handler-types.d.ts
535
+ type EventHandler<T> = (context: EventContext<T>) => void | Promise<void>;
536
+ type RequestHandler<Payload, Response> = (context: RequestContext<Payload, Response>) => void | Promise<void>;
537
+ /**
538
+ * Context provided to __onAny handlers for debugging/testing.
539
+ * Captures all message metadata regardless of type (event/request/broadcast).
540
+ */
541
+ interface AnyMessageContext {
542
+ type: 'event' | 'request' | 'broadcast';
543
+ subject: string;
544
+ namespace: string;
545
+ payload: unknown;
546
+ messageId: string;
547
+ correlationId?: string;
548
+ }
549
+ /**
550
+ * Handler for __onAny - receives all messages (events and requests) across all namespaces.
551
+ * Used for debugging and testing only.
552
+ */
553
+ type AnyHandler = (context: AnyMessageContext) => void | Promise<void>;
554
+ /**
555
+ * Special handler for wildcards that match both events and requests.
556
+ * @public
557
+ */
558
+ type WildcardUnifiedHandler = (context: WildcardContext<unknown, unknown>) => void | Promise<void>;
559
+ /**
560
+ * Resolve the appropriate handler type for a subject pattern (exact or wildcard).
561
+ *
562
+ * Handles all subscription patterns:
563
+ * - Event wildcards (`adapter.*`) → `(payload: unknown) => void | Promise<void>`
564
+ * - Request wildcards (`adapter.*`) → `(context: RequestContext<unknown, unknown>) => void | Promise<void>`
565
+ * - Exact request subjects → `RequestHandler<TPayload, TReturnValue>`
566
+ * - Exact event subjects → `EventHandler<TPayload>`
567
+ *
568
+ * This is the primary type used by the `on()` method to resolve handler signatures.
569
+ * @example
570
+ * ```typescript
571
+ * // Event wildcard - unknown payload
572
+ * type Handler1 = HandlerForPattern<'adapter.*'>;
573
+ * // (payload: unknown) => void | Promise<void>
574
+ *
575
+ * // Exact event subject - typed payload
576
+ * type Handler2 = HandlerForPattern<'adapter.log'>;
577
+ * // EventHandler<{ message: string, level: string }>
578
+ *
579
+ * // Request wildcard - unknown context
580
+ * type Handler3 = HandlerForPattern<'adapter.*'>;
581
+ * // (context: RequestContext<unknown, unknown>) => void | Promise<void>
582
+ *
583
+ * // Exact request subject - typed context
584
+ * type Handler4 = HandlerForPattern<'adapter.getCapabilities'>;
585
+ * // RequestHandler<{ adapterName: string }, { capabilities: string[] }>
586
+ * ```
587
+ */
588
+ /**
589
+ * Resolve the handler type for a SubjectDefinition.
590
+ *
591
+ * Uses indexed access (`T['$meta']['payload']`) instead of nested `extends` with `infer`
592
+ * to ensure proper type resolution when T is a generic type parameter.
593
+ */
594
+ 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;
595
+ /**
596
+ * Extract context type for once() promise return value.
597
+ *
598
+ * Uses the same pattern as HandlerForSubjectDefinition for consistency.
599
+ */
600
+ 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;
601
+ //#endregion
602
+ //#region packages/makaio-core/src/types/result.d.ts
603
+ /**
604
+ * Result types for optional request handling.
605
+ *
606
+ * Used by requestOptional to distinguish between "handler returned data"
607
+ * and "no handler was registered".
608
+ */
609
+ /**
610
+ * Discriminated union for optional request results.
611
+ *
612
+ * - `handled: true` - A handler was found and returned data
613
+ * - `handled: false` - No handler was registered for the subject
614
+ * @example
615
+ * ```typescript
616
+ * const result = await bus.requestOptional(Subjects.getData, { id: '123' });
617
+ * if (result.handled) {
618
+ * console.debug('Got data:', result.data);
619
+ * } else {
620
+ * console.debug('No handler registered for getData');
621
+ * }
622
+ * ```
623
+ */
624
+ type OptionalResult<T> = {
625
+ handled: true;
626
+ data: T;
627
+ } | {
628
+ handled: false;
629
+ };
630
+ //#endregion
631
+ //#region packages/makaio-core/src/types/bus-like.d.ts
632
+ type EventSubjectLike = SubjectDefinition & {
633
+ readonly $meta: {
634
+ readonly isRequest: false;
635
+ readonly channel: false;
636
+ };
637
+ };
638
+ type RequestSubjectLike = SubjectDefinition & {
639
+ readonly $meta: {
640
+ readonly isRequest: true;
641
+ readonly channel: false;
642
+ readonly payload: RequestMessagePayload;
643
+ };
644
+ };
645
+ /**
646
+ * Minimal structural bus seam for contracts-owned helpers.
647
+ *
648
+ * This deliberately does not re-model `@makaio/bus-core`'s generic overloads.
649
+ * Bus-core owns the full magic inference surface; this type only covers the
650
+ * event/request calls that contract helper APIs make without importing bus-core.
651
+ */
652
+ interface MakaioBusLike {
653
+ /** Emit an event. */
654
+ emit<Subject extends EventSubjectLike>(subject: Subject, payload: Subject['$meta']['payload']): Promise<void>;
655
+ /** Send a request and await a response. */
656
+ request<Subject extends RequestSubjectLike>(subject: Subject, payload: Subject['$meta']['payload']['request']): Promise<Subject['$meta']['payload']['response']>;
657
+ }
658
+ //#endregion
659
+ //#region packages/makaio-core/src/subject-helpers/nest-subject-definitions.d.ts
660
+ /**
661
+ * Recursively nests a flat record of dotted keys into a hierarchical object type.
662
+ *
663
+ * ```
664
+ * { 'assistant.text': SubjectDef, 'agent.tool.started': SubjectDef }
665
+ * → { assistant: { text: SubjectDef }, agent: { tool: { started: SubjectDef } } }
666
+ * ```
667
+ *
668
+ * Used to expose registered subjects as a nested accessor tree (e.g.
669
+ * `BootSubjects.service.ready`) without requiring callers to deal with
670
+ * flat dotted-key strings at the type level.
671
+ */
672
+ type NestedSubjectDefinitions<T extends Record<string, unknown> = Record<string, SubjectDefinition>> = { [K in ExtractPrefixes<keyof T & string>]: NestByPrefix<T, K> };
673
+ type ExtractPrefixes<Keys extends string> = Keys extends `${infer Prefix}.${string}` ? Prefix : Keys;
674
+ type StripPrefixMap<T, Prefix extends string> = { [K in keyof T as K extends `${Prefix}.${infer Rest}` ? Rest : never]: T[K] };
675
+ type NestByPrefix<T extends Record<string, unknown>, Prefix extends string> = Prefix extends keyof T ? T[Prefix] : NestedSubjectDefinitions<StripPrefixMap<T, Prefix>>;
676
+ /**
677
+ * Maps a flat schema record to a flat subject-definition record, attaching the
678
+ * correct `$meta` (namespace, isRequest, local, channel) and `subject` key for
679
+ * each entry.
680
+ *
681
+ * Intermediate type used by {@link nestSubjectDefinitions} before nesting.
682
+ * @typeParam Domain - Namespace domain string (e.g. `'boot'`)
683
+ * @typeParam Schemas - Flat record of raw Zod schemas keyed by dotted subject names
684
+ */
685
+ type FlatSubjectDefinitions<Domain extends string, Schemas extends Record<string, SubjectSchema>> = { [K in keyof Schemas & string]: {
686
+ $meta: InferSubjectMeta<Schemas[K], Domain>;
687
+ subject: K;
688
+ } };
689
+ /**
690
+ * Fully-nested subject accessor tree returned by `registerNamespace`.
691
+ *
692
+ * Combines the {@link NestedSubjectDefinitions} hierarchy with a `$all`
693
+ * wildcard that matches every subject in the namespace. Consumers use this
694
+ * type to write `SomeNamespace.subjects.foo.bar` instead of raw strings.
695
+ * @typeParam RecordOfSubjectDefinitions - Flat record of subject definitions
696
+ * @typeParam Domain - Namespace domain string used for `$all` wildcard typing
697
+ */
698
+ type BusSubjects<RecordOfSubjectDefinitions extends Record<string, unknown> = Record<string, SubjectDefinition>, Domain extends string = string> = NestedSubjectDefinitions<RecordOfSubjectDefinitions> & {
699
+ $all: WildcardSubjectDefinition<Domain>;
700
+ };
701
+ /**
702
+ * Nests flat dotted subject keys into a hierarchical structure.
703
+ * @param namespace - The domain/namespace for the subject definitions
704
+ * @param flat - Flat record of subject schemas with dotted keys
705
+ * @returns Nested subject definitions with hierarchical structure and a $all wildcard
706
+ */
707
+ declare function nestSubjectDefinitions<Domain extends string, T extends Record<string, SubjectSchema>>(namespace: Domain, flat: T): NestedSubjectDefinitions<FlatSubjectDefinitions<Domain, T>> & {
708
+ $all: WildcardSubjectDefinition<Domain>;
709
+ };
710
+ /**
711
+ * Gets the fully qualified subject name in namespace.subject format.
712
+ * @param subject - The subject definition to format
713
+ * @returns The full subject string in the format "namespace.subject"
714
+ */
715
+ declare function getFullSubjectForSubjectDefinition(subject: SubjectDefinition): string;
716
+ //#endregion
717
+ //#region packages/makaio-core/src/subject-helpers/is-request-schema.d.ts
718
+ /**
719
+ * Type guard to check if a schema is a request schema.
720
+ * @param schema - The schema to check
721
+ * @returns True if the schema is a RequestSchema, false otherwise
722
+ */
723
+ declare function isRequestSchema(schema: SubjectSchema): schema is RequestSchema;
724
+ //#endregion
725
+ //#region packages/makaio-core/src/subject-helpers/is-local-schema.d.ts
726
+ /**
727
+ * Check if a schema is wrapped as a local subject.
728
+ * @param schema - The schema to check
729
+ * @returns True if the schema is a LocalSubjectSchema wrapper
730
+ */
731
+ declare function isLocalSchema(schema: SubjectSchema): schema is LocalSubjectSchema;
732
+ /**
733
+ * Create a local-only subject schema wrapper.
734
+ *
735
+ * Local subjects are never sent to transports (SharedWorker, WebSocket, etc.).
736
+ * Use this for subjects whose payloads contain non-serializable data like
737
+ * React components or functions.
738
+ * @param schema - The event or request schema to mark as local
739
+ * @returns A LocalSubjectSchema wrapper
740
+ * @example
741
+ * ```typescript
742
+ * import { localSubject } from '@makaio/framework/core';
743
+ *
744
+ * const WidgetSchemas = {
745
+ * // Local event - contains React component, can't be serialized
746
+ * register: localSubject(widgetDefinitionSchema),
747
+ *
748
+ * // Local request - response contains functions
749
+ * getRenderer: localSubject({
750
+ * request: z.object({ widgetId: z.string() }),
751
+ * response: z.object({ render: z.function() }),
752
+ * }),
753
+ * };
754
+ * ```
755
+ */
756
+ declare function localSubject<T extends EventSchema | RequestSchema>(schema: T): LocalSubjectSchema<T>;
757
+ //#endregion
758
+ //#region packages/makaio-core/src/subject-helpers/is-channel-schema.d.ts
759
+ /**
760
+ * Check if a schema is wrapped as a channel subject.
761
+ * @param schema - The schema to check
762
+ * @returns True if the schema is a ChannelSubjectSchema wrapper
763
+ */
764
+ declare function isChannelSchema(schema: SubjectSchema): schema is ChannelSubjectSchema;
765
+ /**
766
+ * Create a channel-only subject schema wrapper.
767
+ *
768
+ * Channel subjects are rejected by public bus methods and are only
769
+ * routable through the DirectChannel encrypted point-to-point transport.
770
+ * Use this for subjects that must never travel over the public bus.
771
+ * @param schema - The event or request schema to mark as channel-only
772
+ * @returns A ChannelSubjectSchema wrapper
773
+ * @example
774
+ * ```typescript
775
+ * import { channelSubject } from '@makaio/framework/core';
776
+ *
777
+ * const DirectSchemas = {
778
+ * // Channel event - encrypted, point-to-point only
779
+ * message: channelSubject(z.object({ text: z.string() })),
780
+ *
781
+ * // Channel request - encrypted request-response pair
782
+ * ping: channelSubject({
783
+ * request: z.object({ ts: z.number() }),
784
+ * response: z.object({ ts: z.number() }),
785
+ * }),
786
+ * };
787
+ * ```
788
+ */
789
+ declare function channelSubject<T extends EventSchema | RequestSchema>(schema: T): ChannelSubjectSchema<T>;
790
+ //#endregion
791
+ //#region packages/makaio-core/src/subject-helpers/unwrap-schema.d.ts
792
+ /**
793
+ * Unwrap any subject schema wrapper (local or channel) to get the inner schema.
794
+ * Returns the schema as-is if not wrapped.
795
+ * @param schema - The schema to unwrap
796
+ * @returns The inner EventSchema or RequestSchema
797
+ */
798
+ declare function unwrapSchema(schema: SubjectSchema): EventSchema | RequestSchema;
799
+ //#endregion
800
+ //#region packages/makaio-core/src/bus-namespace-definition.d.ts
801
+ /**
802
+ * Report passed to the {@link NamespaceRegistrationOptions} `onSchemaViolation` callback
803
+ * when lenient validation detects a schema mismatch.
804
+ *
805
+ * Canonical owner: `@makaio/core`. `@makaio/bus-core` imports this type from core.
806
+ */
807
+ interface SchemaViolationReport {
808
+ /** Fully-qualified subject key (e.g., `"adapter:claude-code.sdk.event"`) */
809
+ subject: string;
810
+ /** Raw payload that failed validation */
811
+ payload: unknown;
812
+ /** Individual Zod issues from the failed parse */
813
+ issues: unknown[];
814
+ }
815
+ /**
816
+ * Options controlling runtime schema validation for a registered bus namespace.
817
+ *
818
+ * - `strict` (default) — throw `ValidationError` on schema mismatch
819
+ * - `lenient` — invoke `onSchemaViolation` callback, then deliver the event anyway
820
+ * - `skip` — no validation at all (for cross-Zod-version scenarios, e.g., SDK bundles Zod v3)
821
+ *
822
+ * Canonical owner: `@makaio/core`. `@makaio/bus-core` imports this type from core,
823
+ * not the other way around. Single source of truth — no mirroring.
824
+ */
825
+ type NamespaceRegistrationOptions = {
826
+ busValidationMode?: 'strict';
827
+ } | {
828
+ busValidationMode: 'lenient';
829
+ onSchemaViolation: (report: SchemaViolationReport) => void;
830
+ } | {
831
+ busValidationMode: 'skip';
832
+ };
833
+ /**
834
+ * A declarative bus namespace definition.
835
+ *
836
+ * Created by {@link createBusNamespace}. Carries typed subject tokens for
837
+ * immediate use in bus operations, plus the original schemas for deferred
838
+ * registration at boot time via `MakaioBus.registerNamespace()`.
839
+ *
840
+ * Does not include `scopedBus()` — that method requires a bus instance and
841
+ * is available on the `BusNamespace` object returned by `registerNamespace()`.
842
+ * @typeParam Domain - Namespace domain string (e.g. `'adapter'`, `'session'`)
843
+ * @typeParam Schemas - Schema record mapping subject keys to Zod schemas
844
+ */
845
+ interface BusNamespaceDefinition<Domain extends string = string, Schemas extends Record<string, SubjectSchema> = Record<string, SubjectSchema>> {
846
+ /** Namespace domain string (e.g., `'adapter'`, `'session'`) */
847
+ readonly name: Domain;
848
+ /**
849
+ * Typed subject tokens for bus operations — no registration needed to use
850
+ * these for `bus.on()`, `bus.emit()`, or `bus.request()`.
851
+ */
852
+ readonly subjects: BusSubjects<FlatSubjectDefinitions<Domain, Schemas>, Domain>;
853
+ /** Original Zod schemas — carried for deferred registration */
854
+ readonly schemas: Schemas;
855
+ /** Registration options (validation mode, violation callback) */
856
+ readonly options?: NamespaceRegistrationOptions;
857
+ /**
858
+ * Phantom field for type inference of filterable payload shape.
859
+ *
860
+ * Never set at runtime. Exists solely so TypeScript can infer the
861
+ * `FilterPayload` type parameter from the schema record without an
862
+ * explicit annotation at every callsite.
863
+ * @internal
864
+ */
865
+ readonly __filterPayload?: FilterablePayloadIntersection<SubjectRecordFromSchemaRecord<Schemas>>;
866
+ }
867
+ /**
868
+ * Namespace definition shape required for runtime registration.
869
+ *
870
+ * Structurally derived from {@link BusNamespaceDefinition} with the typed
871
+ * subject tree erased to `unknown`. Composition-root catalogs and extension
872
+ * manifests only need the namespace name, schemas, options, and the runtime
873
+ * subject tokens; keeping this structural type separate lets those catalogs
874
+ * contain heterogeneous namespace definitions without widening every subject
875
+ * tree to an unsafe index signature.
876
+ */
877
+ type RegistrableBusNamespaceDefinition = Omit<BusNamespaceDefinition, 'subjects' | '__filterPayload'> & {
878
+ /** Runtime subject token tree created by `createBusNamespace`. */readonly subjects: unknown;
879
+ };
880
+ /**
881
+ * Creates a bus namespace definition with typed subject tokens.
882
+ *
883
+ * Pure function — no side-effects, no bus singleton mutation. The returned
884
+ * definition can be used immediately for bus operations (`bus.on()`,
885
+ * `bus.emit()`, etc.) and registered later at boot time via
886
+ * `MakaioBus.registerNamespace(definition)`.
887
+ * @param name - Namespace domain string (e.g., `'adapter'`, `'session'`)
888
+ * @param schemas - Schema record mapping subject keys to Zod schemas
889
+ * @param options - Optional registration options (validation mode, violation callback)
890
+ * @returns Namespace definition with typed subject tokens and carried schemas
891
+ * @example
892
+ * ```typescript
893
+ * import { createBusNamespace } from '@makaio/framework/core';
894
+ * import { AdapterSchemas } from './schemas.js';
895
+ *
896
+ * export const AdapterNamespace = createBusNamespace('adapter', AdapterSchemas);
897
+ * export const AdapterSubjects = AdapterNamespace.subjects;
898
+ * ```
899
+ */
900
+ declare function createBusNamespace<Domain extends string, Schemas extends Record<string, SubjectSchema>>(name: Domain, schemas: Schemas, options?: NamespaceRegistrationOptions): BusNamespaceDefinition<Domain, Schemas>;
901
+ //#endregion
902
+ //#region packages/makaio-core/src/context/index.d.ts
903
+ /**
904
+ * Platform identifier for tool execution context.
905
+ * Used to determine platform-specific behavior in tools.
906
+ */
907
+ type Platform = 'posix' | 'windows';
908
+ /**
909
+ * Execution context passed to tool implementations.
910
+ *
911
+ * Provides tools with essential runtime information about the execution environment,
912
+ * including working directory, environment variables, platform, and cancellation support.
913
+ * @example
914
+ * ```typescript
915
+ * const result = await tool.execute(input, {
916
+ * cwd: '/path/to/project',
917
+ * env: { NODE_ENV: 'development' },
918
+ * platform: 'posix',
919
+ * signal: abortController.signal,
920
+ * });
921
+ * ```
922
+ */
923
+ interface MakaioContext {
924
+ /** Working directory for tool execution */
925
+ cwd: string;
926
+ /** Read-only environment variables available to the tool */
927
+ env: Readonly<Record<string, string>>;
928
+ /** Platform identifier for cross-platform compatibility */
929
+ platform: Platform;
930
+ /** Optional abort signal for cancellation support */
931
+ signal?: AbortSignal;
932
+ /** Optional constraints that tools can check for specific behaviors */
933
+ constraints?: Record<string, unknown>;
934
+ /** Session ID for the current execution context */
935
+ sessionId?: string;
936
+ /** Subagent ID if running as a subagent */
937
+ subagentId?: string;
938
+ /** Current nesting depth in subagent hierarchy (0 = root) */
939
+ subagentDepth?: number;
940
+ }
941
+ /**
942
+ * Creates a MakaioContext with sensible defaults and optional overrides.
943
+ *
944
+ * Default behavior:
945
+ * - `cwd`: Uses process.cwd() or '/' in non-Node environments
946
+ * - `env`: Sanitized process.env (filters undefined values)
947
+ * - `platform`: Auto-detected from process.platform
948
+ * @param overrides - Optional partial context to merge with defaults
949
+ * @returns Complete MakaioContext ready for tool execution
950
+ * @example
951
+ * ```typescript
952
+ * // Create context with all defaults
953
+ * const ctx = createMakaioContext();
954
+ *
955
+ * // Override specific values
956
+ * const ctx = createMakaioContext({
957
+ * cwd: '/custom/path',
958
+ * signal: abortController.signal,
959
+ * });
960
+ * ```
961
+ */
962
+ declare function createMakaioContext(overrides?: Partial<MakaioContext>): MakaioContext;
963
+ //#endregion
964
+ //#region packages/makaio-core/src/errors/index.d.ts
965
+ /**
966
+ * Base error class for all Makaio-related errors.
967
+ */
968
+ declare class MakaioError extends Error {
969
+ readonly subject?: string | undefined;
970
+ constructor(message: string, subject?: string | undefined);
971
+ }
972
+ declare class InvalidModelError extends MakaioError {
973
+ readonly subject?: string | undefined;
974
+ constructor(requestedModel: string, subject?: string | undefined);
975
+ }
976
+ declare class DirectoryNotFoundError extends MakaioError {
977
+ readonly subject?: string | undefined;
978
+ constructor(path: string, subject?: string | undefined);
979
+ }
980
+ declare class ConfigError extends MakaioError {
981
+ readonly subject?: string | undefined;
982
+ constructor(message: string, subject?: string | undefined);
983
+ }
984
+ /** Thrown when a provider rate-limits the request. */
985
+ declare class RateLimitError extends MakaioError {
986
+ readonly code: "rate_limit";
987
+ }
988
+ /** Thrown when authentication/authorization fails. */
989
+ declare class AuthenticationError extends MakaioError {
990
+ readonly code: "auth";
991
+ }
992
+ /** Thrown when the requested model is unavailable (deprecated, not found, etc.). */
993
+ declare class ModelUnavailableError extends MakaioError {
994
+ readonly code: "model_unavailable";
995
+ }
996
+ /** Thrown when a usage quota (tokens, requests) is exceeded. */
997
+ declare class QuotaExceededError extends MakaioError {
998
+ readonly code: "quota_exceeded";
999
+ }
1000
+ //#endregion
1001
+ export { type AnyHandler, type AnyMessageContext, AuthenticationError, type BaseSubjectSchema, type BusNamespaceDefinition, type BusSubjects, type ChannelSubjectSchema, ConfigError, type ContextForSubjectDefinition, 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 MessagePayload, ModelUnavailableError, type NamespaceRegistrationOptions, type NestedSubjectDefinitions, 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 TypedPayloadFilter, type WildcardContext, type WildcardSubject, type WildcardSubjectDefinition, WildcardSubjectKey, type WildcardUnifiedHandler, channelSubject, createBusNamespace, createMakaioContext, getFullSubjectForSubjectDefinition, isChannelSchema, isLocalSchema, isOperatorObject, isRequestSchema, localSubject, nestSubjectDefinitions, unwrapSchema };