@makaio/framework 1.0.0-dev-1779051654000 → 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 (419) hide show
  1. package/LICENSE +1 -1
  2. package/dist/.makaio-build.json +5 -0
  3. package/dist/account-identity-DT5NOtFi.mjs +1 -0
  4. package/dist/adapter-C1eI-fGV.mjs +1 -0
  5. package/dist/adapters/acp-client/index.d.mts +6013 -14
  6. package/dist/adapters/acp-client/index.mjs +3 -1
  7. package/dist/adapters/config/index.d.mts +1 -1
  8. package/dist/adapters/config/index.mjs +1 -1
  9. package/dist/adapters/index.d.mts +47 -20
  10. package/dist/adapters/index.mjs +13 -6
  11. package/dist/adapters/node.d.mts +4 -4
  12. package/dist/adapters/node.mjs +4 -4
  13. package/dist/adapters/stream-session/index.d.mts +30 -0
  14. package/dist/adapters/stream-session/index.mjs +1 -1
  15. package/dist/artifact-B3npq1cy.mjs +1 -0
  16. package/dist/bus/index.d.mts +866 -203
  17. package/dist/bus/index.mjs +1 -1
  18. package/dist/bus-Caz3Jpbc.mjs +1 -0
  19. package/dist/bus-Hb-LGzgb.mjs +2 -0
  20. package/dist/chunk-DTipWd-i.mjs +1 -0
  21. package/dist/client-bx74gm4R.mjs +1 -0
  22. package/dist/clients/index.d.mts +113 -35
  23. package/dist/clients/index.mjs +2 -2
  24. package/dist/{clients-namespace-UHj5wt-l.d.mts → clients-namespace-GmSJpBUV.d.mts} +8 -8
  25. package/dist/{config-namespace-ChZOpi1W.d.mts → config-namespace-CPY9YsR8.d.mts} +4 -4
  26. package/dist/contracts/adapter/index.d.mts +3 -3
  27. package/dist/contracts/adapter/index.mjs +1 -1
  28. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  29. package/dist/contracts/artifact/index.d.mts +2 -0
  30. package/dist/contracts/artifact/index.mjs +1 -0
  31. package/dist/contracts/client/index.d.mts +2 -2
  32. package/dist/contracts/client/index.mjs +1 -1
  33. package/dist/contracts/common/index.d.mts +1 -1
  34. package/dist/contracts/config/index.d.mts +8 -8
  35. package/dist/contracts/config/index.mjs +1 -1
  36. package/dist/contracts/extension/index.d.mts +4 -3
  37. package/dist/contracts/extension/index.mjs +1 -1
  38. package/dist/contracts/facet/index.d.mts +2 -0
  39. package/dist/contracts/facet/index.mjs +1 -0
  40. package/dist/contracts/harness/index.d.mts +1 -1
  41. package/dist/contracts/harness/index.mjs +1 -1
  42. package/dist/contracts/host/index.d.mts +1 -1
  43. package/dist/contracts/host/index.mjs +1 -1
  44. package/dist/contracts/index.d.mts +12370 -1990
  45. package/dist/contracts/index.mjs +1 -1
  46. package/dist/contracts/materialization/index.d.mts +4 -0
  47. package/dist/contracts/materialization/index.mjs +1 -0
  48. package/dist/contracts/model-registry/index.d.mts +1 -1
  49. package/dist/contracts/model-registry/index.mjs +1 -1
  50. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  51. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  52. package/dist/contracts/platform/index.d.mts +1 -1
  53. package/dist/contracts/platform/index.mjs +1 -1
  54. package/dist/contracts/provider/index.d.mts +2 -2
  55. package/dist/contracts/provider/index.mjs +1 -1
  56. package/dist/contracts/session/index.d.mts +3 -3
  57. package/dist/contracts/session/index.mjs +1 -1
  58. package/dist/contracts/shared/index.d.mts +2 -2
  59. package/dist/contracts/shared/index.mjs +1 -1
  60. package/dist/contracts/skill/index.d.mts +1 -1
  61. package/dist/contracts/skill/index.mjs +1 -1
  62. package/dist/contracts/telemetry/index.d.mts +2 -0
  63. package/dist/contracts/telemetry/index.mjs +1 -0
  64. package/dist/contracts/timeout/index.d.mts +1 -1
  65. package/dist/contracts/timeout/index.mjs +1 -1
  66. package/dist/contracts/toast/index.d.mts +2 -2
  67. package/dist/contracts/toast/index.mjs +1 -1
  68. package/dist/contracts/variant/index.d.mts +1 -1
  69. package/dist/contracts/variant/index.mjs +1 -1
  70. package/dist/core/index.d.mts +296 -34
  71. package/dist/core/index.mjs +1 -1
  72. package/dist/{credential-ref-DLCsoKVZ.mjs → credential-ref-YWQQENEo.mjs} +1 -1
  73. package/dist/cursor-storage-CtVJ3JzB.mjs +1 -0
  74. package/dist/{definition-DB7bbFSa.d.mts → definition-BLCdXGzh.d.mts} +17 -3
  75. package/dist/definition-CrgHIpTK.d.mts +60 -0
  76. package/dist/{definition-DkYy1PZz.mjs → definition-DZMXOnjX.mjs} +1 -1
  77. package/dist/{definition-DtUNiGom.d.mts → definition-pkJ6szUl.d.mts} +1 -1
  78. package/dist/drizzle-Eq8W1EbD.mjs +1 -0
  79. package/dist/event-Ca2yUf5i.mjs +1 -0
  80. package/dist/execution-target-CRPTfZlc.mjs +1 -0
  81. package/dist/extension-C-4BHMRI.mjs +1 -0
  82. package/dist/extension-CpIUgBKI.mjs +1 -0
  83. package/dist/facet-BuwhrThl.mjs +1 -0
  84. package/dist/filesystem-service-B8rhBRgB.mjs +1 -0
  85. package/dist/filesystem-service-p_iJVHd4.d.mts +66 -0
  86. package/dist/git/index.d.mts +210 -0
  87. package/dist/git/index.mjs +18 -0
  88. package/dist/globby-rtWVaFHv.mjs +41 -0
  89. package/dist/{handlers-DR_4_rAT.mjs → handlers-CkTsQLra.mjs} +3 -3
  90. package/dist/{harness-B6lGP9rm.mjs → harness-BRCMcvQN.mjs} +1 -1
  91. package/dist/{host-CvEht5RT.mjs → host-Br9VuOyr.mjs} +1 -1
  92. package/dist/{index-WKjrpcA_.d.mts → index-472sOmsW.d.mts} +6 -6
  93. package/dist/index-8SZkg7s6.d.mts +353 -0
  94. package/dist/index-B3PK4FIn.d.mts +5116 -0
  95. package/dist/{index-D2jejYlV.d.mts → index-B80L4YqA.d.mts} +3 -3
  96. package/dist/index-BFg9BUpx.d.mts +355 -0
  97. package/dist/index-BGfWS6GE.d.mts +483 -0
  98. package/dist/{index-DQRsGXb5.d.mts → index-BVgfS-AJ.d.mts} +2 -2
  99. package/dist/{index-CnmPtjnA.d.mts → index-B_zQC98V.d.mts} +16 -16
  100. package/dist/{index-DaEp4UWW.d.mts → index-Bh_Ne7LF.d.mts} +54 -42
  101. package/dist/{index-yvN8UcEH.d.mts → index-Bvb2mMH6.d.mts} +109 -109
  102. package/dist/{index-tKvu34DJ2.d.mts → index-CCGVh9BF2.d.mts} +242 -28
  103. package/dist/{index-C-myW_aK.d.mts → index-CGmcS0Ma.d.mts} +2 -2
  104. package/dist/{index-DEw90pa2.d.mts → index-CLpjm52M.d.mts} +3 -3
  105. package/dist/{index-DQWMu5fS.d.mts → index-Caig6TeF.d.mts} +85 -99
  106. package/dist/{index-DwCA1HWa.d.mts → index-CelJCBjk.d.mts} +15 -15
  107. package/dist/{index-ESSDWIB7.d.mts → index-ChunCFu4.d.mts} +1 -1
  108. package/dist/{index-e5C62_M3.d.mts → index-Cm0dUkWL.d.mts} +819 -85
  109. package/dist/{index-N5K1NOYs.d.mts → index-CokQYGVP.d.mts} +4 -4
  110. package/dist/{index-Bigx81Kr.d.mts → index-Cs0kZXIz2.d.mts} +1 -1
  111. package/dist/{index-6lyShOoU.d.mts → index-D5d5HeWI2.d.mts} +34 -0
  112. package/dist/{index-sBob9D25.d.mts → index-D90OmGmV.d.mts} +3 -3
  113. package/dist/{index-D1T-PPqF.d.mts → index-D9MwJ2Q8.d.mts} +3 -3
  114. package/dist/{index-BePI0ckL.d.mts → index-DANINzMu.d.mts} +1 -1
  115. package/dist/{index-BnSQE7z7.d.mts → index-DBw-89vC2.d.mts} +129 -1332
  116. package/dist/{index-C_kS2aqV2.d.mts → index-DGBu6bHi2.d.mts} +14 -14
  117. package/dist/index-DKC62dY5.d.mts +146 -0
  118. package/dist/{index-7sXlairn2.d.mts → index-DKia0MX1.d.mts} +1 -1
  119. package/dist/{index-E8d_RwaF.d.mts → index-DMKnON5s.d.mts} +1 -1
  120. package/dist/{index-Cq8B7cwK.d.mts → index-DUaw0Dw8.d.mts} +1524 -369
  121. package/dist/{index-Dd5s4MSm.d.mts → index-De3kPhlN.d.mts} +2 -2
  122. package/dist/{index-DGTFJB_8.d.mts → index-L4GjJDKb.d.mts} +116 -23
  123. package/dist/{index-iID2R9G1.d.mts → index-U-A8eyGT.d.mts} +7 -7
  124. package/dist/{index-D7T8XCku.d.mts → index-eemAKwsB.d.mts} +23 -2
  125. package/dist/{index-BXP9GK5q.d.mts → index-mNec7V-9.d.mts} +27 -27
  126. package/dist/{index-CnZOKNjU.d.mts → index-soFznFCy2.d.mts} +2 -2
  127. package/dist/{index-Ch3ph52M2.d.mts → index-vtXJuwrz.d.mts} +2 -2
  128. package/dist/{index-BnNqbx2I.d.mts → index-x_lVDp_J.d.mts} +2 -2
  129. package/dist/json-value-CmhSGMLv.mjs +1 -0
  130. package/dist/kernel/cli/index.d.mts +4 -2
  131. package/dist/kernel/cli/index.mjs +1 -1
  132. package/dist/kernel/cli/schemas.d.mts +1 -0
  133. package/dist/kernel/cli/schemas.mjs +1 -1
  134. package/dist/kernel/extension/index.d.mts +1 -1
  135. package/dist/kernel/extension/index.mjs +1 -1
  136. package/dist/kernel/index.d.mts +5 -5
  137. package/dist/kernel/index.mjs +1 -1
  138. package/dist/kernel/namespace/index.d.mts +1 -1
  139. package/dist/kernel/namespace/index.mjs +1 -1
  140. package/dist/kernel/observability/index.d.mts +1 -1
  141. package/dist/kernel/observability/index.mjs +1 -1
  142. package/dist/kernel/providers/index.d.mts +1 -1
  143. package/dist/kernel/providers/index.mjs +1 -1
  144. package/dist/kernel/window/index.d.mts +1 -1
  145. package/dist/kernel/window/index.mjs +1 -1
  146. package/dist/materialization-CuUBu4XI.mjs +1 -0
  147. package/dist/{namespace-BpIE-jQW.d.mts → namespace-5QQqbF-B.d.mts} +1018 -111
  148. package/dist/{namespace-DwCyOaZn2.d.mts → namespace-BM7Djng9.d.mts} +3 -3
  149. package/dist/namespace-BwzZJqTV.mjs +1 -0
  150. package/dist/{namespace-DZcuLwEA.d.mts → namespace-CTm3nEvh.d.mts} +1 -1
  151. package/dist/{namespace-BK2erxpV.d.mts → namespace-CaaNnKcR.d.mts} +3 -3
  152. package/dist/{namespace-GLGGcWPH.d.mts → namespace-CaoZ3S78.d.mts} +1 -1
  153. package/dist/{namespace-DXnMk3U8.d.mts → namespace-CxhsoFUP.d.mts} +27 -31
  154. package/dist/{namespace-B1E57soL.d.mts → namespace-DD8Oiqo7.d.mts} +23 -23
  155. package/dist/{namespace-BCRNwPnw.d.mts → namespace-DLovh2Ws.d.mts} +21 -21
  156. package/dist/{namespace-Ysg1N6rR.d.mts → namespace-DgqkaOVu.d.mts} +26 -25
  157. package/dist/{namespace-B5ZCshBw.d.mts → namespace-Dr8K0MCp.d.mts} +82 -81
  158. package/dist/{namespace-DGMO2E8f.mjs → namespace-DuXK5AYN.mjs} +1 -1
  159. package/dist/{namespace-ZbthBQVt.d.mts → namespace-EQniz-Aw.d.mts} +14 -14
  160. package/dist/{namespace-C54Oj025.d.mts → namespace-IV1QK__V.d.mts} +1 -1
  161. package/dist/{namespace-BKrV_2gZ.d.mts → namespace-TyiTsLFv.d.mts} +46 -45
  162. package/dist/{namespace-OwAf1Brw.mjs → namespace-xcmbQlxh.mjs} +1 -1
  163. package/dist/{native-session-supervisor-zPt624Tp.mjs → native-session-supervisor-B1TnaPUF.mjs} +1 -1
  164. package/dist/node/bus-server/index.d.mts +1 -1
  165. package/dist/node/bus-server/index.mjs +1 -1
  166. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  167. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  168. package/dist/node/machine-identity/index.mjs +2 -2
  169. package/dist/node/transports/index.d.mts +200 -7
  170. package/dist/node/transports/index.mjs +2 -2
  171. package/dist/{orchestrator-shared-D2txLAUs.mjs → orchestrator-shared-CIDiFJMD.mjs} +1 -1
  172. package/dist/{orchestrator-shared-DrjtTXYh.d.mts → orchestrator-shared-Dfa7FMyw.d.mts} +5 -5
  173. package/dist/package-DKVlsMP3.mjs +1 -0
  174. package/dist/{profile-Cq4A7kQa.mjs → profile-6ynCD5k3.mjs} +1 -1
  175. package/dist/{provider-context-BB4eD8ON.mjs → provider-context-CK6B4X_8.mjs} +1 -1
  176. package/dist/providers/index.mjs +1 -1
  177. package/dist/{providers-namespace-CDwxY_DV.d.mts → providers-namespace-DSEpli4A.d.mts} +1 -1
  178. package/dist/{schema-B295yplx.d.mts → schema-M5YTvSAG.d.mts} +114 -2
  179. package/dist/{schema-C4iznV0q.mjs → schema-e0wU_lcV.mjs} +1 -1
  180. package/dist/{schema-introspection-DCYC47_d.mjs → schema-introspection-Dn1jWQs1.mjs} +1 -1
  181. package/dist/{schemas-C5xtVqdb.d.mts → schemas-Bd0OjRQf.d.mts} +1 -1
  182. package/dist/{schemas-Ra8pz5M-.d.mts → schemas-C46QfKzv.d.mts} +24 -28
  183. package/dist/{schemas-sshQEF3l.d.mts → schemas-CDBSjg7o.d.mts} +1 -1
  184. package/dist/schemas-CR1Rripy.mjs +1 -0
  185. package/dist/schemas-CVvwIfG4.mjs +1 -0
  186. package/dist/schemas-CaLhkkLn.mjs +1 -0
  187. package/dist/{schemas-DYqKRNju.d.mts → schemas-ClOOT1W6.d.mts} +4 -4
  188. package/dist/{schemas-BfMZAwff.d.mts → schemas-DATniTHb.d.mts} +8 -8
  189. package/dist/{schemas-BWvuaL0w.d.mts → schemas-DVF1A4DF.d.mts} +4 -4
  190. package/dist/{schemas-Di0XnnMX.d.mts → schemas-DaRSfYLf.d.mts} +1 -1
  191. package/dist/{schemas-C31qbb0s.d.mts → schemas-DiYVzG6e.d.mts} +51 -48
  192. package/dist/{schemas-KMA1efQg.d.mts → schemas-j7ivZ2HI.d.mts} +3 -3
  193. package/dist/schemas-wg_6PAdV.d.mts +153 -0
  194. package/dist/scoped-bus-04pwo1uM.mjs +1 -0
  195. package/dist/service-base/index.d.mts +1 -1
  196. package/dist/services/adapter-runtime/index.d.mts +3 -3
  197. package/dist/services/adapter-runtime/index.mjs +1 -1
  198. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  199. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  200. package/dist/services/adapter-subsystem/index.d.mts +2 -2
  201. package/dist/services/adapter-subsystem/index.mjs +1 -1
  202. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  203. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  204. package/dist/services/agent-runtime/index.d.mts +2 -2
  205. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  206. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  207. package/dist/services/capability/index.d.mts +1 -1
  208. package/dist/services/capability/index.mjs +1 -1
  209. package/dist/services/cli-detection/namespace.d.mts +1 -1
  210. package/dist/services/codebase/index.d.mts +2 -2
  211. package/dist/services/codebase/namespace.d.mts +1 -1
  212. package/dist/services/codebase/schemas.d.mts +1 -1
  213. package/dist/services/compression/index.d.mts +2 -2
  214. package/dist/services/compression/namespace.d.mts +1 -1
  215. package/dist/services/compression/schemas.d.mts +1 -1
  216. package/dist/services/context-rules/index.d.mts +4 -4
  217. package/dist/services/context-rules/index.mjs +1 -1
  218. package/dist/services/credential-change/index.d.mts +1 -1
  219. package/dist/services/definition/namespace.d.mts +1 -1
  220. package/dist/services/definition/schemas.d.mts +1 -1
  221. package/dist/services/dialog/namespace.d.mts +1 -1
  222. package/dist/services/dialog/schemas.d.mts +1 -1
  223. package/dist/services/execution-target/index.d.mts +4 -4
  224. package/dist/services/execution-target/index.mjs +1 -1
  225. package/dist/services/execution-target/namespace.d.mts +1 -1
  226. package/dist/services/execution-target/schemas.d.mts +1 -1
  227. package/dist/services/execution-target/schemas.mjs +1 -1
  228. package/dist/services/filesystem/index.d.mts +3 -0
  229. package/dist/services/filesystem/index.mjs +1 -0
  230. package/dist/services/filesystem/namespace.d.mts +7 -7
  231. package/dist/services/filesystem/schemas.d.mts +4 -4
  232. package/dist/services/git/namespace.d.mts +1163 -0
  233. package/dist/services/git/namespace.mjs +1 -0
  234. package/dist/services/git/schemas.d.mts +932 -0
  235. package/dist/services/git/schemas.mjs +1 -0
  236. package/dist/services/harness/index.d.mts +35 -35
  237. package/dist/services/harness/index.mjs +1 -1
  238. package/dist/services/harness/storage/schema.d.mts +5 -5
  239. package/dist/services/index.d.mts +1411 -928
  240. package/dist/services/index.mjs +1 -1
  241. package/dist/services/local-notification/index.d.mts +1 -1
  242. package/dist/services/local-notification/namespace.d.mts +1 -1
  243. package/dist/services/local-notification/schemas.d.mts +1 -1
  244. package/dist/services/log-import/browser.d.mts +2 -2
  245. package/dist/services/log-import/index.d.mts +23 -24
  246. package/dist/services/log-import/index.mjs +2 -2
  247. package/dist/services/log-import/log-import.d.mts +1 -1
  248. package/dist/services/log-import/log-import.mjs +1 -1
  249. package/dist/services/log-import/namespace.d.mts +1 -1
  250. package/dist/services/log-import/namespace.mjs +1 -1
  251. package/dist/services/log-import/schemas.d.mts +1 -1
  252. package/dist/services/log-import/schemas.mjs +1 -1
  253. package/dist/services/model-registry/index.d.mts +1 -1
  254. package/dist/services/model-registry/index.mjs +1 -1
  255. package/dist/services/preferences/index.d.mts +2 -2
  256. package/dist/services/preferences/schemas.d.mts +1 -1
  257. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  258. package/dist/services/provider-context/index.d.mts +1 -1
  259. package/dist/services/provider-context/index.mjs +1 -1
  260. package/dist/services/provider-runtime/index.d.mts +1 -1
  261. package/dist/services/provider-runtime/index.mjs +1 -1
  262. package/dist/services/session/handlers/index.d.mts +1 -1
  263. package/dist/services/session/handlers/index.mjs +1 -1
  264. package/dist/services/session/index.d.mts +10 -10
  265. package/dist/services/session/index.mjs +1 -1
  266. package/dist/services/session/messages/namespace.d.mts +1 -1
  267. package/dist/services/session/messages/namespace.mjs +1 -1
  268. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  269. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  270. package/dist/services/session/session-events/namespace.d.mts +1 -1
  271. package/dist/services/session/session-events/namespace.mjs +1 -1
  272. package/dist/services/session/storage/namespace.d.mts +1 -1
  273. package/dist/services/session/storage/schema.d.mts +1 -1
  274. package/dist/services/session/storage/schema.mjs +1 -1
  275. package/dist/services/session/testing/index.d.mts +2 -2
  276. package/dist/services/session/testing/index.mjs +16 -3
  277. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  278. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  279. package/dist/services/session/turns/namespace.d.mts +1 -1
  280. package/dist/services/session/turns/namespace.mjs +1 -1
  281. package/dist/services/session-editor/index.d.mts +3 -3
  282. package/dist/services/session-editor/index.mjs +1 -1
  283. package/dist/services/settings/index.d.mts +4 -4
  284. package/dist/services/settings/index.mjs +1 -1
  285. package/dist/services/settings/namespace.d.mts +19 -18
  286. package/dist/services/settings/namespace.mjs +1 -1
  287. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  288. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  289. package/dist/services/settings/storage/extension-configs/namespace.d.mts +4 -4
  290. package/dist/services/settings/storage/index.d.mts +3 -3
  291. package/dist/services/settings/storage/index.mjs +1 -1
  292. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  293. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  294. package/dist/services/subagent/index.d.mts +2 -0
  295. package/dist/services/subagent/index.mjs +1 -0
  296. package/dist/services/subagent-template/index.d.mts +3 -0
  297. package/dist/services/subagent-template/index.mjs +1 -0
  298. package/dist/services/subagent-template/namespace.d.mts +2 -0
  299. package/dist/services/subagent-template/namespace.mjs +1 -0
  300. package/dist/services/subagent-template/schemas.d.mts +2 -0
  301. package/dist/services/subagent-template/schemas.mjs +1 -0
  302. package/dist/services/tool-approval/index.d.mts +1 -1
  303. package/dist/services/tool-approval/index.mjs +1 -1
  304. package/dist/services/tools/index.d.mts +1 -1
  305. package/dist/services/tools/index.mjs +1 -1
  306. package/dist/services/tray-menu/index.d.mts +3 -3
  307. package/dist/services/tray-menu/index.mjs +1 -1
  308. package/dist/services/tray-menu/namespace.d.mts +1 -1
  309. package/dist/services/tray-menu/schemas.d.mts +1 -1
  310. package/dist/services/turn/index.d.mts +1 -1
  311. package/dist/services/turn/namespace.d.mts +1 -1
  312. package/dist/services/turn/schemas.d.mts +12 -12
  313. package/dist/session-BoldSdNZ2.mjs +134 -0
  314. package/dist/session-DuVOYctZ.mjs +1 -0
  315. package/dist/{session-lineage-B0cpHfuc.d.mts → session-lineage-CRsc9g1x.d.mts} +1 -1
  316. package/dist/shared-DpOEfD8F.mjs +1 -0
  317. package/dist/{skill-20_SBXaI.mjs → skill-CQO4mDqK.mjs} +1 -1
  318. package/dist/storage/drizzle/client.d.mts +2 -2
  319. package/dist/storage/drizzle/client.mjs +1 -1
  320. package/dist/storage/drizzle/index.d.mts +49 -10
  321. package/dist/storage/drizzle/index.mjs +1 -1
  322. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  323. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  324. package/dist/storage/handlers/index.d.mts +2 -2
  325. package/dist/storage/handlers/index.mjs +1 -1
  326. package/dist/storage/index.d.mts +4 -4
  327. package/dist/{storage-namespace-DoH-Wkjp.d.mts → storage-namespace-BXkoh5Sy.d.mts} +11 -11
  328. package/dist/storage-namespace-DWsYLAXa.mjs +1 -0
  329. package/dist/{storage-namespace-definition-CJgqyXH1.d.mts → storage-namespace-definition-Bkx5rSto.d.mts} +1 -1
  330. package/dist/style.css +540 -540
  331. package/dist/telemetry-CvdLBWuk.mjs +1 -0
  332. package/dist/testing/drizzle-harness.mjs +1 -1
  333. package/dist/testing/index.mjs +1 -1
  334. package/dist/tool-approval-service-BvZWhYZp.mjs +1 -0
  335. package/dist/tools/index.d.mts +20 -10
  336. package/dist/tools/index.mjs +1 -1
  337. package/dist/tools/testing/index.d.mts +1 -1
  338. package/dist/tools-D-luYcDw.mjs +1431 -0
  339. package/dist/{types-C11LvekX.d.mts → types-BCMUtBj1.d.mts} +117 -20
  340. package/dist/{types-vNpkAe4Y.d.mts → types-C2Ob9zz_.d.mts} +1 -1
  341. package/dist/{types-t295YC6T.d.mts → types-CCdqjeuH.d.mts} +2 -2
  342. package/dist/{types-Cvrj2ogm.d.mts → types-DZHvOc_Q.d.mts} +4 -4
  343. package/dist/{types--nrtGZ1V.d.mts → types-Dy3YTcTF.d.mts} +255 -97
  344. package/dist/{types-DYF5LxZY.d.mts → types-MfJZ67e9.d.mts} +91 -9
  345. package/dist/{types-6WxLfoM3.d.mts → types-dyP-bXXE.d.mts} +1 -1
  346. package/dist/ui-components/index.mjs +2 -2
  347. package/dist/ui-hooks/index.d.mts +111 -1
  348. package/dist/ui-hooks/index.mjs +1 -1
  349. package/dist/ui-kernel/index.d.mts +4 -4
  350. package/dist/ui-kernel/pages/namespace.d.mts +4 -4
  351. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  352. package/dist/ui-views/index.mjs +2 -2
  353. package/dist/utils/index.d.mts +36 -1
  354. package/dist/utils/index.mjs +2 -2
  355. package/dist/utils/project-manifest.d.mts +130 -0
  356. package/dist/utils/project-manifest.mjs +1 -0
  357. package/dist/utils/scope-paths.d.mts +33 -0
  358. package/dist/utils/scope-paths.mjs +1 -0
  359. package/dist/utils/workspace-packages.d.mts +59 -0
  360. package/dist/utils/workspace-packages.mjs +1 -0
  361. package/dist/utils/workspace-root.d.mts +6 -9
  362. package/dist/utils/workspace-root.mjs +1 -1
  363. package/dist/{version-D8S4O22A.mjs → version-BeT3ASEe.mjs} +1 -1
  364. package/package.json +55 -2
  365. package/dist/account-identity-Bg_vKkcs.mjs +0 -1
  366. package/dist/adapter-CpF2aK_-.mjs +0 -1
  367. package/dist/bus-B1seC4M_.mjs +0 -2
  368. package/dist/chunk-Dc06z0qk.mjs +0 -1
  369. package/dist/client-DMWXCWhM.mjs +0 -1
  370. package/dist/cursor-storage-BoNI7OAR.mjs +0 -1
  371. package/dist/drizzle-Bn2GtW8c.mjs +0 -1
  372. package/dist/execution-target-D6MgthYs.mjs +0 -1
  373. package/dist/extension-53GerdGg.mjs +0 -1
  374. package/dist/extension-fJmv8Yri.mjs +0 -1
  375. package/dist/namespace-C_h7scWx2.mjs +0 -1
  376. package/dist/schemas-Bn8aqDIE.mjs +0 -1
  377. package/dist/services/worker/index.d.mts +0 -3
  378. package/dist/services/worker/index.mjs +0 -1
  379. package/dist/services/worker/namespace.d.mts +0 -2
  380. package/dist/services/worker/namespace.mjs +0 -1
  381. package/dist/services/worker/schemas.d.mts +0 -2
  382. package/dist/services/worker/schemas.mjs +0 -1
  383. package/dist/session-BCSf-Fgj.mjs +0 -1
  384. package/dist/session-BNo_cIiz.mjs +0 -123
  385. package/dist/shared-BhuSHZXH.mjs +0 -1
  386. package/dist/storage-namespace-BIDs9LPb.mjs +0 -1
  387. package/dist/tool-approval-service-CZCPfvVy.mjs +0 -1
  388. package/dist/tools-Cid9D99F.mjs +0 -1
  389. /package/dist/{base-orchestrator-BOAPgqF7.d.mts → base-orchestrator-wyumsn3b.d.mts} +0 -0
  390. /package/dist/{capability-service-DV32ecwR.mjs → capability-service-CJbmhfv9.mjs} +0 -0
  391. /package/dist/{cleanEnvForAdapter-hTPNvPU5.mjs → cleanEnvForAdapter-KkYzQa1f.mjs} +0 -0
  392. /package/dist/{config-namespace-wJ2CakDB.mjs → config-namespace-ncYg2ct_.mjs} +0 -0
  393. /package/dist/{extension-namespace-CTd9kOtt.mjs → extension-namespace-cMh_mMiL.mjs} +0 -0
  394. /package/dist/{identity-DBST3-XO.mjs → identity-Cz2IeEtm.mjs} +0 -0
  395. /package/dist/{index-SzSiyG61.d.mts → index-CHQ1SqT0.d.mts} +0 -0
  396. /package/dist/{model-registry-xINyxQUT.mjs → model-registry-CfXytvzx.mjs} +0 -0
  397. /package/dist/{model-registry-Dzpssh9j.mjs → model-registry-Scn_MC2d.mjs} +0 -0
  398. /package/dist/{namespace-DBw9BYr8.mjs → namespace-BoD94mrN.mjs} +0 -0
  399. /package/dist/{namespace-DUVgMfTR.mjs → namespace-CFLAmQfh.mjs} +0 -0
  400. /package/dist/{namespace-aALq9tnE.mjs → namespace-DkRgbZYn.mjs} +0 -0
  401. /package/dist/{namespace-yxIxUsjo.mjs → namespace-LViZ-EQk.mjs} +0 -0
  402. /package/dist/{namespace-Zb8HAbyF.mjs → namespace-Yna5-Pws.mjs} +0 -0
  403. /package/dist/{platform-BMFUpmTA.mjs → platform-DZ7z-wXD.mjs} +0 -0
  404. /package/dist/{providers-DhiW_fx4.mjs → providers-u8i15co9.mjs} +0 -0
  405. /package/dist/{schema-D3ZG13h9.mjs → schema-CoyE6mPt.mjs} +0 -0
  406. /package/dist/{schemas-CEBe89yE.mjs → schemas-DE-GNmSD.mjs} +0 -0
  407. /package/dist/{schemas-COnLJnt_.mjs → schemas-hSrzflwZ.mjs} +0 -0
  408. /package/dist/{schemas-CrnlCRep.mjs → schemas-jFe1AuI-.mjs} +0 -0
  409. /package/dist/{server-lifecycle-Dx5WgfoS.mjs → server-lifecycle-FXTPW39-.mjs} +0 -0
  410. /package/dist/{server-lifecycle-BC6FRn86.d.mts → server-lifecycle-YoSGFGnU.d.mts} +0 -0
  411. /package/dist/{shared-schemas-Byah36lG.mjs → shared-schemas-CPShiLNp.mjs} +0 -0
  412. /package/dist/{storage-namespace-definition-BjK9nZAN.mjs → storage-namespace-definition-CqSdsuCC.mjs} +0 -0
  413. /package/dist/{timeout-D33CUZ0M.mjs → timeout-XsYIOKrc.mjs} +0 -0
  414. /package/dist/{tray-menu-service-BAYtLdAg.mjs → tray-menu-service-DuXq5k22.mjs} +0 -0
  415. /package/dist/{ui-config-zawaoEfB.mjs → ui-config-9bDRwFZr.mjs} +0 -0
  416. /package/dist/{variant-BZWfmS0q.mjs → variant-CT6XBP6T.mjs} +0 -0
  417. /package/dist/{visibility-CZu8ooOA.mjs → visibility-Cb62p9bv.mjs} +0 -0
  418. /package/dist/{window-registry-C_IJmY8_.d.mts → window-registry-CBcrGTv4.d.mts} +0 -0
  419. /package/dist/{window-registry-B_-hBEcV.mjs → window-registry-DW-dKRjQ.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { ZodType, z } from "zod";
2
2
  import { Paths, Simplify, UnknownRecord } from "type-fest";
3
3
 
4
- //#region packages/makaio-core/src/types/config-storage.d.ts
4
+ //#region core/makaio-core/src/types/config-storage.d.ts
5
5
  /**
6
6
  * Storage interface for config persistence.
7
7
  *
@@ -46,7 +46,7 @@ interface IConfigStorage<TConfig = unknown> {
46
46
  saveConfig(config: TConfig): Promise<void>;
47
47
  }
48
48
  //#endregion
49
- //#region packages/makaio-core/src/types/message.d.ts
49
+ //#region core/makaio-core/src/types/message.d.ts
50
50
  /**
51
51
  * Host-agnostic principal attached by a trusted local transport.
52
52
  *
@@ -92,6 +92,18 @@ interface TransportReceiveContext {
92
92
  /** Optional host-agnostic principal resolved for this connection. */
93
93
  readonly principal?: PrincipalContext;
94
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
+ }
95
107
  /**
96
108
  * Base message context interface for both events and requests.
97
109
  *
@@ -143,6 +155,16 @@ interface BaseMessageContext {
143
155
  * context. Never trust similarly named fields in payloads or wire messages.
144
156
  */
145
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;
146
168
  isRequest: boolean;
147
169
  }
148
170
  type EventMessagePayload<Payload extends UnknownRecord = UnknownRecord> = Payload & {
@@ -155,7 +177,7 @@ type RequestMessagePayload<Request extends UnknownRecord = UnknownRecord, Respon
155
177
  };
156
178
  type MessagePayload = RequestMessagePayload | EventMessagePayload;
157
179
  //#endregion
158
- //#region packages/makaio-core/src/types/context.d.ts
180
+ //#region core/makaio-core/src/types/context.d.ts
159
181
  /**
160
182
  * Context object passed to event handlers when using wildcard patterns.
161
183
  *
@@ -182,6 +204,7 @@ interface EventContext<Payload> extends BaseMessageContext {
182
204
  * - `next`: Function to call the next handler in the middleware chain
183
205
  * - `replacePayload`: Function to transform the payload for subsequent handlers
184
206
  * - `identify`: Optional function to identify the handler for broadcast aggregation
207
+ * - `signal`: Optional AbortSignal from the originating request
185
208
  * - Message tracking fields from BaseMessage (messageId, correlationId)
186
209
  */
187
210
  interface RequestContext<Payload, Response> extends BaseMessageContext {
@@ -189,6 +212,8 @@ interface RequestContext<Payload, Response> extends BaseMessageContext {
189
212
  isRequest: true;
190
213
  /** The request payload */
191
214
  payload: Payload;
215
+ /** AbortSignal supplied by the originating request, if any. */
216
+ signal?: AbortSignal;
192
217
  /** Set the response value (ends the handler chain) */
193
218
  setResult: (result: Response) => void;
194
219
  /**
@@ -244,7 +269,7 @@ interface RequestContext<Payload, Response> extends BaseMessageContext {
244
269
  */
245
270
  type WildcardContext<Payload = unknown, Response = unknown> = EventContext<Payload> | RequestContext<Payload, Response>;
246
271
  //#endregion
247
- //#region packages/makaio-core/src/types/filter.d.ts
272
+ //#region core/makaio-core/src/types/filter.d.ts
248
273
  type Primitive = string | number | boolean | null;
249
274
  /**
250
275
  * Filter operators for payload field matching.
@@ -320,7 +345,7 @@ declare function isOperatorObject(value: FilterOperator): value is {
320
345
  $endsWith: string;
321
346
  };
322
347
  //#endregion
323
- //#region packages/makaio-core/src/types/schema.d.ts
348
+ //#region core/makaio-core/src/types/schema.d.ts
324
349
  /**
325
350
  * Schema definition for event subjects (fire-and-forget).
326
351
  * Events have only a payload schema, no response.
@@ -353,6 +378,17 @@ type LocalSubjectSchema<T extends EventSchema | RequestSchema = EventSchema | Re
353
378
  readonly __local: true;
354
379
  readonly schema: T;
355
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
+ };
356
392
  /**
357
393
  * Wrapper to mark a subject as channel-only (encrypted point-to-point).
358
394
  *
@@ -376,31 +412,46 @@ type ChannelSubjectSchema<T extends EventSchema | RequestSchema = EventSchema |
376
412
  readonly __channel: true;
377
413
  readonly schema: T;
378
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
+ };
379
425
  /**
380
426
  * Base schema types (unwrapped).
381
427
  */
382
428
  type BaseSubjectSchema = EventSchema | RequestSchema;
383
429
  /**
384
- * Union of all subject schema types (including local and channel wrappers).
430
+ * Union of all subject schema types (including metadata wrappers).
385
431
  */
386
- type SubjectSchema = BaseSubjectSchema | LocalSubjectSchema | ChannelSubjectSchema;
432
+ type SubjectSchema = BaseSubjectSchema | LocalSubjectSchema | CollectorOnlySubjectSchema | ChannelSubjectSchema | DefaultTransportsSubjectSchema;
387
433
  type SchemaRecord = Record<string, SubjectSchema>;
388
434
  //#endregion
389
- //#region packages/makaio-core/src/types/type-helpers.d.ts
435
+ //#region core/makaio-core/src/types/type-helpers.d.ts
390
436
  /**
391
- * Unwrap LocalSubjectSchema or ChannelSubjectSchema wrappers if present.
392
- * Returns the inner schema for wrapped subjects, or the schema as-is otherwise.
437
+ * Unwrap subject schema wrappers if present. Returns the inner schema for
438
+ * wrapped subjects, or the schema as-is otherwise.
393
439
  */
394
440
  type UnwrapSchema<S> = S extends {
395
441
  readonly __local: true;
396
442
  readonly schema: infer Inner;
443
+ } ? Inner : S extends {
444
+ readonly __collectorOnly: true;
445
+ readonly schema: infer Inner;
397
446
  } ? Inner : S extends {
398
447
  readonly __channel: true;
399
448
  readonly schema: infer Inner;
449
+ } ? Inner : S extends {
450
+ readonly __defaultTransports: TransportRoutingDefault;
451
+ readonly schema: infer Inner;
400
452
  } ? Inner : S;
401
453
  /**
402
- * Infer payload type from schema (handles EventSchema, RequestSchema,
403
- * LocalSubjectSchema, and ChannelSubjectSchema).
454
+ * Infer payload type from schema, including subject metadata wrappers.
404
455
  *
405
456
  * For requests:
406
457
  * - Uses z.input for request (what callers pass before validation/defaults)
@@ -409,8 +460,7 @@ type UnwrapSchema<S> = S extends {
409
460
  * This allows schemas with .default() to have optional fields in the caller API
410
461
  * while the response type reflects the validated output.
411
462
  *
412
- * LocalSubjectSchema and ChannelSubjectSchema wrappers are automatically
413
- * unwrapped before inference.
463
+ * Subject schema wrappers are automatically unwrapped before inference.
414
464
  *
415
465
  * Idempotent: Returns already-inferred types as-is.
416
466
  */
@@ -426,7 +476,7 @@ type InferSchemaPayloadInner<S> = S extends {
426
476
  * Compute all subject meta from the original schema in one place.
427
477
  *
428
478
  * Resolves payload, locality, channel membership, request/event discriminator,
429
- * and namespace from a raw SubjectSchema.
479
+ * default transport routing, and namespace from a raw SubjectSchema.
430
480
  * @typeParam S - The subject schema type
431
481
  * @typeParam Ns - The namespace string
432
482
  */
@@ -439,10 +489,23 @@ type InferSubjectMeta<S extends SubjectSchema, Ns extends string> = {
439
489
  channel: S extends ChannelSubjectSchema ? true : false; /** Inferred payload type (request/response pair or event payload). */
440
490
  payload: InferSchemaPayload<S>; /** The namespace this subject belongs to. */
441
491
  namespace: Ns;
442
- };
492
+ } & (S extends DefaultTransportsSubjectSchema<EventSchema | RequestSchema, infer Default> ? {
493
+ defaultTransports: Default;
494
+ } : {
495
+ defaultTransports?: TransportRoutingDefault;
496
+ });
443
497
  //#endregion
444
- //#region packages/makaio-core/src/types/subjects.d.ts
498
+ //#region core/makaio-core/src/types/subjects.d.ts
445
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';
446
509
  type SubjectRecordFromSchemaRecord<SchemaRecord extends Record<string, SubjectSchema>> = { [K in keyof SchemaRecord & string]: Simplify<InferSchemaPayload<SchemaRecord[K]>> };
447
510
  type SubjectDefinitionMeta<Subject extends SubjectRecord = SubjectRecord<'default'>, K extends keyof Subject = keyof Subject, Namespace extends string = string> = {
448
511
  isRequest: Subject extends SubjectRecord<'default'> ? boolean : Subject[K] extends RequestMessagePayload ? true : false;
@@ -458,6 +521,17 @@ type SubjectDefinitionMeta<Subject extends SubjectRecord = SubjectRecord<'defaul
458
521
  * DirectChannel encrypted point-to-point transport.
459
522
  */
460
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;
461
535
  };
462
536
  type SubjectDefinition<Subject extends SubjectRecord = SubjectRecord, SubjectKey extends keyof Subject = keyof Subject, Namespace extends string = string> = {
463
537
  $meta: SubjectDefinitionMeta<Subject, SubjectKey, Namespace>;
@@ -526,12 +600,12 @@ type FilterablePayloadIntersection<Subjects extends SubjectRecord> = Simplify<Al
526
600
  */
527
601
  type FilterPayloadFromSchemas<Schemas extends Record<string, SubjectSchema>> = Simplify<AllPropertiesOfUnion<{ [K in keyof Schemas]: FilterablePayload<InferSchemaPayload<Schemas[K]>> }[keyof Schemas]>>;
528
602
  //#endregion
529
- //#region packages/makaio-core/src/types/wildcards.d.ts
603
+ //#region core/makaio-core/src/types/wildcards.d.ts
530
604
  type WildcardSubject = '*';
531
605
  declare const WildcardSubjectKey = "*";
532
606
  type WildcardSubjectDefinition<Namespace extends string = string> = SubjectDefinition<Record<'*', MessagePayload>, WildcardSubject, Namespace>;
533
607
  //#endregion
534
- //#region packages/makaio-core/src/types/handler-types.d.ts
608
+ //#region core/makaio-core/src/types/handler-types.d.ts
535
609
  type EventHandler<T> = (context: EventContext<T>) => void | Promise<void>;
536
610
  type RequestHandler<Payload, Response> = (context: RequestContext<Payload, Response>) => void | Promise<void>;
537
611
  /**
@@ -599,7 +673,7 @@ type HandlerForSubjectDefinition<T extends SubjectDefinition> = T['subject'] ext
599
673
  */
600
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;
601
675
  //#endregion
602
- //#region packages/makaio-core/src/types/result.d.ts
676
+ //#region core/makaio-core/src/types/result.d.ts
603
677
  /**
604
678
  * Result types for optional request handling.
605
679
  *
@@ -628,7 +702,7 @@ type OptionalResult<T> = {
628
702
  handled: false;
629
703
  };
630
704
  //#endregion
631
- //#region packages/makaio-core/src/types/bus-like.d.ts
705
+ //#region core/makaio-core/src/types/bus-like.d.ts
632
706
  type EventSubjectLike = SubjectDefinition & {
633
707
  readonly $meta: {
634
708
  readonly isRequest: false;
@@ -656,7 +730,7 @@ interface MakaioBusLike {
656
730
  request<Subject extends RequestSubjectLike>(subject: Subject, payload: Subject['$meta']['payload']['request']): Promise<Subject['$meta']['payload']['response']>;
657
731
  }
658
732
  //#endregion
659
- //#region packages/makaio-core/src/subject-helpers/nest-subject-definitions.d.ts
733
+ //#region core/makaio-core/src/subject-helpers/nest-subject-definitions.d.ts
660
734
  /**
661
735
  * Recursively nests a flat record of dotted keys into a hierarchical object type.
662
736
  *
@@ -702,9 +776,12 @@ type BusSubjects<RecordOfSubjectDefinitions extends Record<string, unknown> = Re
702
776
  * Nests flat dotted subject keys into a hierarchical structure.
703
777
  * @param namespace - The domain/namespace for the subject definitions
704
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()`.
705
782
  * @returns Nested subject definitions with hierarchical structure and a $all wildcard
706
783
  */
707
- declare function nestSubjectDefinitions<Domain extends string, T extends Record<string, SubjectSchema>>(namespace: Domain, flat: T): NestedSubjectDefinitions<FlatSubjectDefinitions<Domain, T>> & {
784
+ declare function nestSubjectDefinitions<Domain extends string, T extends Record<string, SubjectSchema>>(namespace: Domain, flat: T, namespaceDefaultTransports?: TransportRoutingDefault): NestedSubjectDefinitions<FlatSubjectDefinitions<Domain, T>> & {
708
785
  $all: WildcardSubjectDefinition<Domain>;
709
786
  };
710
787
  /**
@@ -714,7 +791,7 @@ declare function nestSubjectDefinitions<Domain extends string, T extends Record<
714
791
  */
715
792
  declare function getFullSubjectForSubjectDefinition(subject: SubjectDefinition): string;
716
793
  //#endregion
717
- //#region packages/makaio-core/src/subject-helpers/is-request-schema.d.ts
794
+ //#region core/makaio-core/src/subject-helpers/is-request-schema.d.ts
718
795
  /**
719
796
  * Type guard to check if a schema is a request schema.
720
797
  * @param schema - The schema to check
@@ -722,7 +799,7 @@ declare function getFullSubjectForSubjectDefinition(subject: SubjectDefinition):
722
799
  */
723
800
  declare function isRequestSchema(schema: SubjectSchema): schema is RequestSchema;
724
801
  //#endregion
725
- //#region packages/makaio-core/src/subject-helpers/is-local-schema.d.ts
802
+ //#region core/makaio-core/src/subject-helpers/is-local-schema.d.ts
726
803
  /**
727
804
  * Check if a schema is wrapped as a local subject.
728
805
  * @param schema - The schema to check
@@ -755,7 +832,25 @@ declare function isLocalSchema(schema: SubjectSchema): schema is LocalSubjectSch
755
832
  */
756
833
  declare function localSubject<T extends EventSchema | RequestSchema>(schema: T): LocalSubjectSchema<T>;
757
834
  //#endregion
758
- //#region packages/makaio-core/src/subject-helpers/is-channel-schema.d.ts
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
759
854
  /**
760
855
  * Check if a schema is wrapped as a channel subject.
761
856
  * @param schema - The schema to check
@@ -788,16 +883,43 @@ declare function isChannelSchema(schema: SubjectSchema): schema is ChannelSubjec
788
883
  */
789
884
  declare function channelSubject<T extends EventSchema | RequestSchema>(schema: T): ChannelSubjectSchema<T>;
790
885
  //#endregion
791
- //#region packages/makaio-core/src/subject-helpers/unwrap-schema.d.ts
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
792
914
  /**
793
- * Unwrap any subject schema wrapper (local or channel) to get the inner schema.
915
+ * Unwrap any subject schema wrapper to get the inner schema.
794
916
  * Returns the schema as-is if not wrapped.
795
917
  * @param schema - The schema to unwrap
796
918
  * @returns The inner EventSchema or RequestSchema
797
919
  */
798
920
  declare function unwrapSchema(schema: SubjectSchema): EventSchema | RequestSchema;
799
921
  //#endregion
800
- //#region packages/makaio-core/src/bus-namespace-definition.d.ts
922
+ //#region core/makaio-core/src/bus-namespace-definition.d.ts
801
923
  /**
802
924
  * Report passed to the {@link NamespaceRegistrationOptions} `onSchemaViolation` callback
803
925
  * when lenient validation detects a schema mismatch.
@@ -854,6 +976,19 @@ interface BusNamespaceDefinition<Domain extends string = string, Schemas extends
854
976
  readonly schemas: Schemas;
855
977
  /** Registration options (validation mode, violation callback) */
856
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;
857
992
  /**
858
993
  * Phantom field for type inference of filterable payload shape.
859
994
  *
@@ -877,6 +1012,26 @@ interface BusNamespaceDefinition<Domain extends string = string, Schemas extends
877
1012
  type RegistrableBusNamespaceDefinition = Omit<BusNamespaceDefinition, 'subjects' | '__filterPayload'> & {
878
1013
  /** Runtime subject token tree created by `createBusNamespace`. */readonly subjects: unknown;
879
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
+ };
880
1035
  /**
881
1036
  * Creates a bus namespace definition with typed subject tokens.
882
1037
  *
@@ -886,7 +1041,7 @@ type RegistrableBusNamespaceDefinition = Omit<BusNamespaceDefinition, 'subjects'
886
1041
  * `MakaioBus.registerNamespace(definition)`.
887
1042
  * @param name - Namespace domain string (e.g., `'adapter'`, `'session'`)
888
1043
  * @param schemas - Schema record mapping subject keys to Zod schemas
889
- * @param options - Optional registration options (validation mode, violation callback)
1044
+ * @param options - Optional registration and routing options
890
1045
  * @returns Namespace definition with typed subject tokens and carried schemas
891
1046
  * @example
892
1047
  * ```typescript
@@ -897,9 +1052,9 @@ type RegistrableBusNamespaceDefinition = Omit<BusNamespaceDefinition, 'subjects'
897
1052
  * export const AdapterSubjects = AdapterNamespace.subjects;
898
1053
  * ```
899
1054
  */
900
- declare function createBusNamespace<Domain extends string, Schemas extends Record<string, SubjectSchema>>(name: Domain, schemas: Schemas, options?: NamespaceRegistrationOptions): BusNamespaceDefinition<Domain, Schemas>;
1055
+ declare function createBusNamespace<Domain extends string, Schemas extends Record<string, SubjectSchema>>(name: Domain, schemas: Schemas, options?: CreateBusNamespaceOptions): BusNamespaceDefinition<Domain, Schemas>;
901
1056
  //#endregion
902
- //#region packages/makaio-core/src/context/index.d.ts
1057
+ //#region core/makaio-core/src/context/index.d.ts
903
1058
  /**
904
1059
  * Platform identifier for tool execution context.
905
1060
  * Used to determine platform-specific behavior in tools.
@@ -961,7 +1116,7 @@ interface MakaioContext {
961
1116
  */
962
1117
  declare function createMakaioContext(overrides?: Partial<MakaioContext>): MakaioContext;
963
1118
  //#endregion
964
- //#region packages/makaio-core/src/errors/index.d.ts
1119
+ //#region core/makaio-core/src/errors/index.d.ts
965
1120
  /**
966
1121
  * Base error class for all Makaio-related errors.
967
1122
  */
@@ -998,4 +1153,111 @@ declare class QuotaExceededError extends MakaioError {
998
1153
  readonly code: "quota_exceeded";
999
1154
  }
1000
1155
  //#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 };
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 };
@@ -1 +1 @@
1
- import{z as e}from"zod";function t(e){if(typeof e!=`object`||!e)return!1;let t=e;return`$in`in t||`$ne`in t||`$exists`in t||`$startsWith`in t||`$endsWith`in t}const n=`*`;function r(t){return typeof t==`object`&&!!t&&`request`in t&&`response`in t&&t.request instanceof e.ZodType&&t.response instanceof e.ZodType}function i(e){return typeof e==`object`&&!!e&&`__channel`in e&&e.__channel===!0&&`schema`in e}function a(e){return{__channel:!0,schema:e}}function o(e){return typeof e==`object`&&!!e&&`__local`in e&&e.__local===!0&&`schema`in e}function s(e){return{__local:!0,schema:e}}function c(e){return o(e)||i(e)?e.schema:e}function l(e,t){let n={};for(let[a,s]of Object.entries(t)){let t=a.split(`.`),l=n;for(let e=0;e<t.length-1;e++)l[t[e]]??={},l=l[t[e]];let u=o(s),d=i(s),f={subject:a,$meta:{namespace:e,isRequest:r(c(s)),local:u,channel:d}};l[t[t.length-1]]=f}return n.$all={subject:`*`,$meta:{namespace:e,isRequest:!1,local:!1,channel:!1}},n}function u(e){return`${e.$meta.namespace}.${e.subject}`}function d(e,t,n){return{name:e,subjects:l(e,t),schemas:t,...n?{options:n}:{}}}e.object({cwd:e.string(),env:e.record(e.string(),e.string()),platform:e.enum([`posix`,`windows`]),signal:e.custom().optional(),constraints:e.record(e.string(),e.unknown()).optional(),sessionId:e.string().optional(),subagentId:e.string().optional(),subagentDepth:e.number().optional()});function f(){return typeof process>`u`?`posix`:process.platform===`win32`?`windows`:`posix`}const p=[`API_KEY`,`APIKEY`,`SECRET`,`TOKEN`,`PASSWORD`,`CREDENTIAL`,`PRIVATE_KEY`,`PRIVATEKEY`,`AUTH`,`BEARER`,`ACCESS_KEY`,`ACCESSKEY`];function m(e){let t=e.toUpperCase();return p.some(e=>t.includes(e))}function h(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&!m(n)&&(t[n]=r);return t}function g(e){let t=typeof process<`u`?process.cwd():`/`,n=typeof process<`u`?h(process.env):{};return{cwd:e?.cwd??t,env:e?.env??n,platform:e?.platform??f(),signal:e?.signal,constraints:e?.constraints,sessionId:e?.sessionId,subagentId:e?.subagentId,subagentDepth:e?.subagentDepth}}var _=class extends Error{subject;constructor(e,t){super(e),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},v=class extends _{subject;constructor(e,t){super(`Invalid model specified: ${e}`),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},y=class extends _{subject;constructor(e,t){super(`Directory does not exist: ${e}`),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},b=class extends _{subject;constructor(e,t){super(e),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},x=class extends _{code=`rate_limit`},S=class extends _{code=`auth`},C=class extends _{code=`model_unavailable`},w=class extends _{code=`quota_exceeded`};export{S as AuthenticationError,b as ConfigError,y as DirectoryNotFoundError,v as InvalidModelError,_ as MakaioError,C as ModelUnavailableError,w as QuotaExceededError,x as RateLimitError,n as WildcardSubjectKey,a as channelSubject,d as createBusNamespace,g as createMakaioContext,u as getFullSubjectForSubjectDefinition,i as isChannelSchema,o as isLocalSchema,t as isOperatorObject,r as isRequestSchema,s as localSubject,l as nestSubjectDefinitions,c as unwrapSchema};
1
+ import{z as e}from"zod";function t(e){if(typeof e!=`object`||!e)return!1;let t=e;return`$in`in t||`$ne`in t||`$exists`in t||`$startsWith`in t||`$endsWith`in t}const n=`*`;function r(t){return typeof t==`object`&&!!t&&`request`in t&&`response`in t&&t.request instanceof e.ZodType&&t.response instanceof e.ZodType}function i(e){return typeof e==`object`&&!!e&&`__channel`in e&&e.__channel===!0&&`schema`in e}function a(e){return{__channel:!0,schema:e}}function o(e){return typeof e==`object`&&!!e&&`__local`in e&&e.__local===!0&&`schema`in e}function s(e){return{__local:!0,schema:e}}function c(e){return typeof e==`object`&&!!e&&`__defaultTransports`in e&&(e.__defaultTransports===`all`||e.__defaultTransports===`local-only`)&&`schema`in e}function l(e,t){return{__defaultTransports:t,schema:e}}function u(e){return typeof e==`object`&&!!e&&`__collectorOnly`in e&&e.__collectorOnly===!0&&`schema`in e}function d(e){return{__collectorOnly:!0,schema:e}}function f(e){return o(e)||u(e)||i(e)||c(e)?e.schema:e}function p(e,t,n){let a={};for(let[s,l]of Object.entries(t)){let t=s.split(`.`),u=a;for(let e=0;e<t.length-1;e++)u[t[e]]??={},u=u[t[e]];let d=o(l),p=i(l),m=c(l)?l.__defaultTransports:n,h={subject:s,$meta:{namespace:e,isRequest:r(f(l)),local:d,channel:p,...m!==void 0&&{defaultTransports:m}}};u[t[t.length-1]]=h}return a.$all={subject:`*`,$meta:{namespace:e,isRequest:!1,local:!1,channel:!1}},a}function m(e){return`${e.$meta.namespace}.${e.subject}`}function h(e,t,n){let r=n?.defaultTransports,i;if(n!==void 0){let{defaultTransports:e,...t}=n;i=Object.keys(t).length>0?t:void 0}return{name:e,subjects:p(e,t,r),schemas:t,...i===void 0?{}:{options:i},...r===void 0?{}:{defaultTransports:r}}}e.object({cwd:e.string(),env:e.record(e.string(),e.string()),platform:e.enum([`posix`,`windows`]),signal:e.custom().optional(),constraints:e.record(e.string(),e.unknown()).optional(),sessionId:e.string().optional(),subagentId:e.string().optional(),subagentDepth:e.number().optional()});function g(){return typeof process>`u`?`posix`:process.platform===`win32`?`windows`:`posix`}const _=[`API_KEY`,`APIKEY`,`SECRET`,`TOKEN`,`PASSWORD`,`CREDENTIAL`,`PRIVATE_KEY`,`PRIVATEKEY`,`AUTH`,`BEARER`,`ACCESS_KEY`,`ACCESSKEY`];function v(e){let t=e.toUpperCase();return _.some(e=>t.includes(e))}function y(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&!v(n)&&(t[n]=r);return t}function b(e){let t=typeof process<`u`?process.cwd():`/`,n=typeof process<`u`?y(process.env):{};return{cwd:e?.cwd??t,env:e?.env??n,platform:e?.platform??g(),signal:e?.signal,constraints:e?.constraints,sessionId:e?.sessionId,subagentId:e?.subagentId,subagentDepth:e?.subagentDepth}}var x=class extends Error{subject;constructor(e,t){super(e),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},S=class extends x{subject;constructor(e,t){super(`Invalid model specified: ${e}`),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},C=class extends x{subject;constructor(e,t){super(`Directory does not exist: ${e}`),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},w=class extends x{subject;constructor(e,t){super(e),this.subject=t,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},T=class extends x{code=`rate_limit`},E=class extends x{code=`auth`},D=class extends x{code=`model_unavailable`},O=class extends x{code=`quota_exceeded`};const k=`makaio.observability`;function A(e){let t=e.meta()?.[k];if(typeof t!=`object`||!t)return;let n=t;return n.kind===`schema`||n.kind===`field`?n:void 0}function j(e,t){return e.meta({...e.meta(),[k]:t})}function M(t){if(t instanceof e.ZodOptional||t instanceof e.ZodNullable||t instanceof e.ZodDefault||t instanceof e.ZodCatch||t instanceof e.ZodReadonly)return t.unwrap()}function N(e){let t=e;for(;t;){let e=A(t);if(e?.kind===`field`)return e;t=M(t)}}function P(e){let t=A(e);if(t?.kind===`schema`)return{traceAll:t.traceAll}}function F(e){let t=N(e);if(t)return{visibility:t.visibility,attributeName:t.attributeName}}const I={schema(e,t){return j(e,{kind:`schema`,traceAll:t.traceAll})},field(e,t){return j(e,{kind:`field`,visibility:t.visibility,attributeName:t.attributeName})},hidden(e){return j(e,{kind:`field`,visibility:`hidden`})},count(e,t){return j(e,{kind:`field`,visibility:`count`,attributeName:t})},attribute(e,t){return j(e,{kind:`field`,visibility:`attribute`,attributeName:t})}};export{E as AuthenticationError,w as ConfigError,C as DirectoryNotFoundError,S as InvalidModelError,x as MakaioError,D as ModelUnavailableError,k as OBSERVABILITY_META_KEY,O as QuotaExceededError,T as RateLimitError,n as WildcardSubjectKey,a as channelSubject,d as collectorOnlySubject,h as createBusNamespace,b as createMakaioContext,l as defaultTransports,m as getFullSubjectForSubjectDefinition,F as getObservabilityFieldPolicy,P as getObservabilitySchemaPolicy,i as isChannelSchema,u as isCollectorOnlySchema,c as isDefaultTransportsSchema,o as isLocalSchema,t as isOperatorObject,r as isRequestSchema,s as localSubject,p as nestSubjectDefinitions,I as observability,f as unwrapSchema};
@@ -1 +1 @@
1
- import"./visibility-CZu8ooOA.mjs";import{z as e}from"zod";const t=`stored:providerConfig:`,n=`account-manager:`;function r(e){if(!e.startsWith(t))return null;let n=e.slice(22),r=n.lastIndexOf(`:`);if(r===-1)return null;let i=n.slice(0,r),a=n.slice(r+1);return!i||!a||a.includes(`:`)?null:{configId:i,key:a}}function i(e,t){if(!e.startsWith(t))return!1;let n=e.slice(t.length),r=n.indexOf(`:`);return!(r<=0||r>=n.length-1)}function a(e){if(!e.startsWith(n))return null;try{let t=JSON.parse(e.slice(16));return!Array.isArray(t)||t.length!==2||typeof t[0]!=`string`||typeof t[1]!=`string`||t[0].length===0||t[1].length===0?null:{clientId:t[0],accountId:t[1]}}catch{return null}}function o(e){if(r(e))return!0;if(e.startsWith(`env:`)){let t=e.slice(4);return/^[A-Za-z_][A-Za-z0-9_]*$/.test(t)}return e.startsWith(`file:`)?e.length>5:!!(i(e,`keychain:`)||a(e))}function s(e){return a(e)!==null}const c=e.string().refine(o,{message:`Invalid credential reference format.`}).brand();function l(e,n){if(n.includes(`:`))throw Error(`Credential key must not contain colons: "${n}"`);return c.parse(`${t}${e}:${n}`)}function u(e,t){return c.parse(`${n}${JSON.stringify([e,t])}`)}function d(e){return r(e)}function f(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=c.parse(r);return t}function p(e){if(e)return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t]))}export{s as a,l as i,f as n,d as o,u as r,p as s,c as t};
1
+ import"./visibility-Cb62p9bv.mjs";import{z as e}from"zod";const t=`stored:providerConfig:`,n=`account-manager:`;function r(e){if(!e.startsWith(t))return null;let n=e.slice(22),r=n.lastIndexOf(`:`);if(r===-1)return null;let i=n.slice(0,r),a=n.slice(r+1);return!i||!a||a.includes(`:`)?null:{configId:i,key:a}}function i(e,t){if(!e.startsWith(t))return!1;let n=e.slice(t.length),r=n.indexOf(`:`);return!(r<=0||r>=n.length-1)}function a(e){if(!e.startsWith(n))return null;try{let t=JSON.parse(e.slice(16));return!Array.isArray(t)||t.length!==2||typeof t[0]!=`string`||typeof t[1]!=`string`||t[0].length===0||t[1].length===0?null:{clientId:t[0],accountId:t[1]}}catch{return null}}function o(e){if(r(e))return!0;if(e.startsWith(`env:`)){let t=e.slice(4);return/^[A-Za-z_][A-Za-z0-9_]*$/.test(t)}return e.startsWith(`file:`)?e.length>5:!!(i(e,`keychain:`)||a(e))}function s(e){return a(e)!==null}const c=e.string().refine(o,{message:`Invalid credential reference format.`}).brand();function l(e,n){if(n.includes(`:`))throw Error(`Credential key must not contain colons: "${n}"`);return c.parse(`${t}${e}:${n}`)}function u(e,t){return c.parse(`${n}${JSON.stringify([e,t])}`)}function d(e){return r(e)}function f(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=c.parse(r);return t}function p(e){if(e)return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t]))}export{s as a,l as i,f as n,d as o,u as r,p as s,c as t};
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import{createStorageNamespaceDefinition as t}from"@makaio/framework/storage";const n=new WeakMap,r=new WeakMap,i=new WeakMap,a=Symbol(`anyProducer`),o=Promise.resolve(),s=Symbol(`listenerAdded`),c=Symbol(`listenerRemoved`);let l=!1,u=!1;const d=e=>typeof e==`string`||typeof e==`symbol`||typeof e==`number`;function f(e){if(!d(e))throw TypeError("`eventName` must be a string, symbol, or number")}function p(e){if(typeof e!=`function`)throw TypeError(`listener must be a function`)}function m(e,t){let n=r.get(e);if(n.has(t))return n.get(t)}function h(e,t){let n=d(t)?t:a,r=i.get(e);if(r.has(n))return r.get(n)}function g(e,t,n){let r=i.get(e);if(r.has(t))for(let e of r.get(t))e.enqueue(n);if(r.has(a)){let e=Promise.all([t,n]);for(let t of r.get(a))t.enqueue(e)}}function _(e,t){t=Array.isArray(t)?t:[t];let n=!1,r=()=>{},a=[],o={enqueue(e){a.push(e),r()},finish(){n=!0,r()}};for(let n of t){let t=h(e,n);t||(t=new Set,i.get(e).set(n,t)),t.add(o)}return{async next(){return a?a.length===0?n?(a=void 0,this.next()):(await new Promise(e=>{r=e}),this.next()):{done:!1,value:await a.shift()}:{done:!0}},async return(n){a=void 0;for(let n of t){let t=h(e,n);t&&(t.delete(o),t.size===0&&i.get(e).delete(n))}return r(),arguments.length>0?{done:!0,value:await n}:{done:!0}},[Symbol.asyncIterator](){return this}}}function v(e){if(e===void 0)return S;if(!Array.isArray(e))throw TypeError("`methodNames` must be an array of strings");for(let t of e)if(!S.includes(t))throw typeof t==`string`?Error(`${t} is not Emittery method`):TypeError("`methodNames` element must be a string");return e}const y=e=>e===s||e===c;function b(e,t,n){if(y(t))try{l=!0,e.emit(t,n)}finally{l=!1}}var x=class e{static mixin(t,n){return n=v(n),r=>{if(typeof r!=`function`)throw TypeError("`target` must be function");for(let e of n)if(r.prototype[e]!==void 0)throw Error(`The property \`${e}\` already exists on \`target\``);function i(){return Object.defineProperty(this,t,{enumerable:!1,value:new e}),this[t]}Object.defineProperty(r.prototype,t,{enumerable:!1,get:i});let a=e=>function(...n){return this[t][e](...n)};for(let e of n)Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)});return r}}static get isDebugEnabled(){if(typeof globalThis.process?.env!=`object`)return u;let{env:e}=globalThis.process??{env:{}};return e.DEBUG===`emittery`||e.DEBUG===`*`||u}static set isDebugEnabled(e){u=e}constructor(e={}){n.set(this,new Set),r.set(this,new Map),i.set(this,new Map),i.get(this).set(a,new Set),this.debug=e.debug??{},this.debug.enabled===void 0&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch{r=`Object with the following keys failed to stringify: ${Object.keys(r).join(`,`)}`}(typeof n==`symbol`||typeof n==`number`)&&(n=n.toString());let i=new Date,a=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${a}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(t,n,r){(e.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,n,r)}on(e,t,{signal:n}={}){p(t),e=Array.isArray(e)?e:[e];for(let n of e){f(n);let e=m(this,n);e||(e=new Set,r.get(this).set(n,e)),e.add(t),this.logIfDebugEnabled(`subscribe`,n,void 0),y(n)||b(this,s,{eventName:n,listener:t})}let i=()=>{this.off(e,t),n?.removeEventListener(`abort`,i)};return n?.addEventListener(`abort`,i,{once:!0}),n?.aborted&&i(),i}off(e,t){p(t),e=Array.isArray(e)?e:[e];for(let n of e){f(n);let e=m(this,n);e&&(e.delete(t),e.size===0&&r.get(this).delete(n)),this.logIfDebugEnabled(`unsubscribe`,n,void 0),y(n)||b(this,c,{eventName:n,listener:t})}}once(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`predicate must be a function`);let n,r=new Promise(r=>{n=this.on(e,e=>{t&&!t(e)||(n(),r(e))})});return r.off=n,r}events(e){e=Array.isArray(e)?e:[e];for(let t of e)f(t);return _(this,e)}async emit(e,t){if(f(e),y(e)&&!l)throw TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled(`emit`,e,t),g(this,e,t);let r=m(this,e)??new Set,i=n.get(this),a=[...r],s=y(e)?[]:[...i];await o,await Promise.all([...a.map(async e=>{if(r.has(e))return e(t)}),...s.map(async n=>{if(i.has(n))return n(e,t)})])}async emitSerial(e,t){if(f(e),y(e)&&!l)throw TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled(`emitSerial`,e,t),g(this,e,t);let r=m(this,e)??new Set,i=n.get(this),a=[...r],s=y(e)?[]:[...i];await o;for(let e of a)r.has(e)&&await e(t);for(let n of s)i.has(n)&&await n(e,t)}onAny(e,{signal:t}={}){p(e),this.logIfDebugEnabled(`subscribeAny`,void 0,void 0),n.get(this).add(e),b(this,s,{listener:e});let r=()=>{this.offAny(e),t?.removeEventListener(`abort`,r)};return t?.addEventListener(`abort`,r,{once:!0}),t?.aborted&&r(),r}anyEvent(){return _(this)}offAny(e){p(e),this.logIfDebugEnabled(`unsubscribeAny`,void 0,void 0),b(this,c,{listener:e}),n.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(let t of e)if(this.logIfDebugEnabled(`clear`,t,void 0),d(t)){let e=m(this,t);e&&e.clear();let n=h(this,t);if(n){for(let e of n)e.finish();n.clear()}}else{n.get(this).clear();for(let[e,t]of r.get(this).entries())t.clear(),r.get(this).delete(e);for(let[e,t]of i.get(this).entries()){for(let e of t)e.finish();t.clear(),i.get(this).delete(e)}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(let a of e){if(d(a)){t+=n.get(this).size+(m(this,a)?.size??0)+(h(this,a)?.size??0)+(h(this)?.size??0);continue}a!==void 0&&f(a),t+=n.get(this).size;for(let e of r.get(this).values())t+=e.size;for(let e of i.get(this).values())t+=e.size}return t}bindMethods(e,t){if(typeof e!=`object`||!e)throw TypeError("`target` must be an object");t=v(t);for(let n of t){if(e[n]!==void 0)throw Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}};const S=Object.getOwnPropertyNames(x.prototype).filter(e=>e!==`constructor`);Object.defineProperty(x,`listenerAdded`,{value:s,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(x,`listenerRemoved`,{value:c,writable:!1,enumerable:!0,configurable:!1});const C=e.custom(()=>!0),w=e.object({filePath:e.string(),bytesRead:e.number(),lastModified:e.string(),sessionContext:C.optional()}),T=t(`importCursor`,{schemas:{get:{request:e.object({filePath:e.string()}),response:e.object({cursor:w.nullable()})},set:{request:w,response:e.object({success:e.boolean()})},delete:{request:e.object({filePath:e.string()}),response:e.object({success:e.boolean()})}}}),E=T.subjects;export{x as i,T as n,E as r,w as t};