@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,825 @@
1
+ import { z } from "zod";
2
+ import { MakaioContext } from "@makaio/framework/core";
3
+ import { IMakaioBus } from "@makaio/framework/bus";
4
+ import { ToolAnnotations, ToolAnnotations as ToolAnnotations$1 } from "@makaio/framework/contracts";
5
+ import * as zCore from "zod/v4/core";
6
+
7
+ //#region packages/tools-core/src/types.d.ts
8
+ /**
9
+ * Type alias for the bus interface used in tool execution contexts.
10
+ *
11
+ * Tools receive IMakaioBus instances for type-safe event communication.
12
+ * This ensures full type safety with typed subjects from `@makaio/contracts`.
13
+ */
14
+ type BusLike = IMakaioBus;
15
+ /**
16
+ * Extended execution context for tools that need session and bus access.
17
+ *
18
+ * Extends MakaioContext with optional sessionId and bus properties for tools
19
+ * that need to:
20
+ * - Correlate operations with a specific session (sessionId)
21
+ * - Emit events or make requests during execution (bus)
22
+ * @example
23
+ * ```typescript
24
+ * const result = await tool.execute(input, {
25
+ * cwd: '/workspace',
26
+ * env: { NODE_ENV: 'development' },
27
+ * platform: 'posix',
28
+ * sessionId: 'session-123',
29
+ * bus: makaioBus,
30
+ * });
31
+ * ```
32
+ */
33
+ interface ToolExecutionContext extends MakaioContext {
34
+ /**
35
+ * Session identifier for multi-session task correlation.
36
+ * Tools can use this to associate work with a specific session.
37
+ */
38
+ sessionId?: string;
39
+ /**
40
+ * Agent identifier for attribution (optional).
41
+ * Provided when tool execution is tied to a specific agent.
42
+ */
43
+ agentId?: string;
44
+ /**
45
+ * Adapter identifier for adapter-scoped runtime behavior.
46
+ * Provided when the caller knows the concrete runtime adapter instance.
47
+ */
48
+ adapterId?: string;
49
+ /**
50
+ * Adapter name for adapter-scoped runtime behavior.
51
+ * Preferred when the caller wants stable logical adapter identity.
52
+ */
53
+ adapterName?: string;
54
+ /**
55
+ * Turn identifier for attribution (optional).
56
+ * Provided when tool execution occurs within a specific turn.
57
+ */
58
+ turnId?: string;
59
+ /**
60
+ * Turn-scoped context contributed by PreUserMessage hooks.
61
+ * Toolsets can use this for session-bound execution metadata.
62
+ */
63
+ turnContext?: Record<string, unknown>;
64
+ /**
65
+ * Tool call ID for the current invocation.
66
+ * Provided when the tool is executed as part of a structured tool call
67
+ * (e.g., from an LLM response). Allows tools to correlate their execution
68
+ * with the originating tool call in the adapter.
69
+ */
70
+ toolCallId?: string;
71
+ /**
72
+ * Bus instance for event communication.
73
+ * Tools can use this to emit events (e.g., task.created, task.updated).
74
+ */
75
+ bus?: BusLike;
76
+ }
77
+ /**
78
+ * Tool metadata containing descriptive information.
79
+ */
80
+ interface ToolMetadata {
81
+ /** Unique tool name (identifier) */
82
+ name: string;
83
+ /** Human-readable description */
84
+ description: string;
85
+ /** Optional behavior annotations */
86
+ annotations?: ToolAnnotations$1;
87
+ }
88
+ /**
89
+ * Structured error returned from failed tool executions.
90
+ */
91
+ interface ToolError {
92
+ /** Error code for programmatic handling */
93
+ code: string;
94
+ /** Human-readable error message */
95
+ message: string;
96
+ /** Optional additional error context */
97
+ details?: unknown;
98
+ }
99
+ /**
100
+ * Successful tool execution result.
101
+ * @typeParam T - Type of the success data
102
+ */
103
+ type ToolSuccess<T> = {
104
+ success: true;
105
+ data: T;
106
+ };
107
+ /**
108
+ * Failed tool execution result.
109
+ * Used for functions that always return an error (like toolError, errorToToolResult).
110
+ */
111
+ type ToolFailure = {
112
+ success: false;
113
+ error: ToolError;
114
+ };
115
+ /**
116
+ * Discriminated union result type for tool executions.
117
+ * Always returns either success with data or failure with error.
118
+ * @typeParam T - Type of the success data
119
+ * @example
120
+ * ```typescript
121
+ * const result: ToolResult<string> = await tool.execute(input, context);
122
+ * if (result.success) {
123
+ * console.debug(result.data); // string
124
+ * } else {
125
+ * console.error(result.error.message);
126
+ * }
127
+ * ```
128
+ */
129
+ type ToolResult<T> = ToolSuccess<T> | ToolFailure;
130
+ /**
131
+ * Base tool definition interface with erased type parameters.
132
+ *
133
+ * Use this type for collections (arrays, records) where specific input/output
134
+ * types are not needed. For type-safe individual tools, use ToolDefinition.
135
+ */
136
+ interface AnyToolDefinition {
137
+ /** Tool metadata (name, description, annotations) */
138
+ metadata: ToolMetadata;
139
+ /** Zod schema for input validation */
140
+ inputSchema: z.ZodTypeAny;
141
+ /** Zod schema for output validation */
142
+ outputSchema: z.ZodTypeAny;
143
+ /**
144
+ * Execute the tool with validated input.
145
+ * Method syntax enables bivariant checking, allowing ToolDefinition<T>
146
+ * to be assignable to AnyToolDefinition for use in collections.
147
+ * @param input - Validated input matching inputSchema
148
+ * @param context - Execution context with cwd, env, platform, sessionId, adapter identity, bus, etc.
149
+ * @returns Promise resolving to success with data or failure with error
150
+ */
151
+ execute(input: unknown, context: ToolExecutionContext): Promise<ToolResult<unknown>>;
152
+ }
153
+ /**
154
+ * Core tool definition interface.
155
+ *
156
+ * A tool is a pure function with validated input/output schemas.
157
+ * Tools receive a MakaioContext for execution environment information.
158
+ *
159
+ * For collections of tools (toolsets, arrays), use AnyToolDefinition which
160
+ * erases the type parameters to avoid TypeScript variance issues.
161
+ * @typeParam TInput - Zod schema for input validation
162
+ * @typeParam TOutput - Zod schema for output validation
163
+ * @example
164
+ * ```typescript
165
+ * const readFileTool: ToolDefinition<typeof ReadFileInputSchema, typeof ReadFileOutputSchema> = {
166
+ * metadata: {
167
+ * name: 'readFile',
168
+ * description: 'Reads a file from the filesystem',
169
+ * annotations: { readOnly: true },
170
+ * },
171
+ * inputSchema: ReadFileInputSchema,
172
+ * outputSchema: ReadFileOutputSchema,
173
+ * execute: async (input, context) => {
174
+ * // Implementation...
175
+ * return { success: true, data: content };
176
+ * },
177
+ * };
178
+ * ```
179
+ */
180
+ interface ToolDefinition<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny> {
181
+ /** Tool metadata (name, description, annotations) */
182
+ metadata: ToolMetadata;
183
+ /** Zod schema for input validation */
184
+ inputSchema: TInput;
185
+ /** Zod schema for output validation */
186
+ outputSchema: TOutput;
187
+ /**
188
+ * Execute the tool with validated input.
189
+ * Method syntax enables bivariant checking, allowing ToolDefinition<T>
190
+ * to be assignable to AnyToolDefinition for use in collections.
191
+ * @param input - Validated input matching inputSchema
192
+ * @param context - Execution context with cwd, env, platform, sessionId, adapter identity, bus, etc.
193
+ * @returns Promise resolving to success with data or failure with error
194
+ */
195
+ execute(input: z.infer<TInput>, context: ToolExecutionContext): Promise<ToolResult<z.infer<TOutput>>>;
196
+ }
197
+ /**
198
+ * Toolset metadata for grouping related tools.
199
+ */
200
+ interface ToolsetMetadata {
201
+ /** Unique toolset name */
202
+ name: string;
203
+ /** Human-readable description */
204
+ description: string;
205
+ /** Semantic version string */
206
+ version: string;
207
+ }
208
+ /**
209
+ * A collection of related tools with shared metadata.
210
+ *
211
+ * Toolsets provide logical grouping and versioning for tools.
212
+ * Uses AnyToolDefinition to avoid TypeScript variance issues with
213
+ * heterogeneous tool collections.
214
+ * @typeParam TTools - Record type mapping tool names to definitions
215
+ * @example
216
+ * ```typescript
217
+ * const filesystemToolset: Toolset = {
218
+ * metadata: {
219
+ * name: 'filesystem',
220
+ * description: 'File system operations',
221
+ * version: '1.0.0',
222
+ * },
223
+ * tools: {
224
+ * readFile: readFileTool,
225
+ * writeFile: writeFileTool,
226
+ * },
227
+ * };
228
+ * ```
229
+ */
230
+ interface Toolset<TTools extends Record<string, AnyToolDefinition> = Record<string, AnyToolDefinition>> {
231
+ /** Toolset metadata */
232
+ metadata: ToolsetMetadata;
233
+ /** Map of tool names to definitions */
234
+ tools: TTools;
235
+ /** Optional Zod schema for toolset configuration (used for UI generation) */
236
+ configSchema?: z.ZodTypeAny;
237
+ }
238
+ /**
239
+ * Info structure returned from registry list operations.
240
+ * Includes inputSchema as JSON Schema for format conversion (e.g., OpenAI).
241
+ */
242
+ interface ToolInfo {
243
+ /** Tool name */
244
+ name: string;
245
+ /** Tool description */
246
+ description: string;
247
+ /** Toolset this tool belongs to */
248
+ toolsetName: string;
249
+ /** Optional behavior annotations */
250
+ annotations?: ToolAnnotations$1;
251
+ /** JSON Schema for input parameters (for format conversion) */
252
+ inputSchema?: Record<string, unknown>;
253
+ }
254
+ //#endregion
255
+ //#region packages/tools-core/src/errors.d.ts
256
+ /**
257
+ * Standard error codes for tool execution failures.
258
+ * Use these codes for consistent error handling across tools.
259
+ */
260
+ declare const ToolErrorCodes: {
261
+ /** Tool not found in registry */readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND"; /** Input validation failed against schema */
262
+ readonly VALIDATION_FAILED: "VALIDATION_FAILED"; /** Tool execution not permitted */
263
+ readonly PERMISSION_DENIED: "PERMISSION_DENIED"; /** Tool execution timed out */
264
+ readonly TIMEOUT: "TIMEOUT"; /** Tool was aborted via signal */
265
+ readonly ABORTED: "ABORTED"; /** Generic execution error */
266
+ readonly EXECUTION_ERROR: "EXECUTION_ERROR"; /** Tool returned invalid output */
267
+ readonly INVALID_OUTPUT: "INVALID_OUTPUT"; /** Required resource not found */
268
+ readonly RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND"; /** Resource limit exceeded (e.g., max concurrent shells) */
269
+ readonly RESOURCE_EXHAUSTED: "RESOURCE_EXHAUSTED"; /** Internal tool error */
270
+ readonly INTERNAL_ERROR: "INTERNAL_ERROR";
271
+ };
272
+ type ToolErrorCode = (typeof ToolErrorCodes)[keyof typeof ToolErrorCodes];
273
+ /**
274
+ * Error class for tool execution failures.
275
+ * Provides structured error information and conversion to ToolError format.
276
+ * @example
277
+ * ```typescript
278
+ * throw new ToolExecutionError(
279
+ * ToolErrorCodes.VALIDATION_FAILED,
280
+ * 'Input path must be absolute',
281
+ * { path: input.path }
282
+ * );
283
+ * ```
284
+ */
285
+ declare class ToolExecutionError extends Error {
286
+ readonly code: string;
287
+ readonly details?: unknown | undefined;
288
+ /**
289
+ * Creates a new ToolExecutionError.
290
+ * @param code - Error code from ToolErrorCodes
291
+ * @param message - Human-readable error message
292
+ * @param details - Optional additional error context
293
+ */
294
+ constructor(code: string, message: string, details?: unknown | undefined);
295
+ /**
296
+ * Converts the error to a ToolError object for result formatting.
297
+ * @returns ToolError suitable for ToolResult
298
+ */
299
+ toToolError(): ToolError;
300
+ }
301
+ /**
302
+ * Creates a failed ToolResult from error parameters.
303
+ * @param code - Error code
304
+ * @param message - Error message
305
+ * @param details - Optional error details
306
+ * @returns Failed ToolResult with error information
307
+ * @example
308
+ * ```typescript
309
+ * if (!fileExists) {
310
+ * return toolError(
311
+ * ToolErrorCodes.RESOURCE_NOT_FOUND,
312
+ * `File not found: ${path}`
313
+ * );
314
+ * }
315
+ * ```
316
+ */
317
+ declare function toolError(code: string, message: string, details?: unknown): ToolFailure;
318
+ /**
319
+ * Creates a successful ToolResult with data.
320
+ * @typeParam T - Type of the success data
321
+ * @param data - Success data to wrap
322
+ * @returns Successful ToolResult with data
323
+ * @example
324
+ * ```typescript
325
+ * const content = await fs.readFile(path, 'utf-8');
326
+ * return toolSuccess({ content });
327
+ * ```
328
+ */
329
+ declare function toolSuccess<T>(data: T): ToolSuccess<T>;
330
+ /**
331
+ * Converts an unknown error to a ToolResult.
332
+ * Preserves ToolExecutionError details or wraps other errors.
333
+ * @param error - Error to convert
334
+ * @param defaultCode - Error code to use for non-ToolExecutionError
335
+ * @returns Failed ToolResult with error information
336
+ */
337
+ declare function errorToToolResult(error: unknown, defaultCode?: string): ToolFailure;
338
+ //#endregion
339
+ //#region packages/tools-core/src/define-tool.d.ts
340
+ /**
341
+ * Configuration object for defining a tool.
342
+ * Provides ergonomic API for creating ToolDefinition instances.
343
+ * @typeParam TInput - Zod schema type for input validation
344
+ * @typeParam TOutput - Zod schema type for output validation
345
+ */
346
+ interface DefineToolConfig<TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny> {
347
+ /** Unique tool name (identifier) */
348
+ name: string;
349
+ /** Human-readable description of what the tool does */
350
+ description: string;
351
+ /** Optional behavior annotations for consumers */
352
+ annotations?: ToolAnnotations$1;
353
+ /** Zod schema for input validation */
354
+ inputSchema: TInput;
355
+ /** Zod schema for output validation */
356
+ outputSchema: TOutput;
357
+ /**
358
+ * Tool execution function.
359
+ * @param input - Validated input matching inputSchema
360
+ * @param context - Execution context with cwd, env, platform, sessionId, bus, etc.
361
+ * @returns Promise resolving to success with data or failure with error
362
+ */
363
+ execute: (input: z.infer<TInput>, context: ToolExecutionContext) => Promise<ToolResult<z.infer<TOutput>>>;
364
+ }
365
+ /**
366
+ * Creates a ToolDefinition from a configuration object.
367
+ *
368
+ * Provides a clean builder API for defining tools with full type inference.
369
+ * The returned ToolDefinition can be used directly or registered with a toolset.
370
+ * @typeParam TInput - Zod schema type for input validation
371
+ * @typeParam TOutput - Zod schema type for output validation
372
+ * @param config - Tool configuration
373
+ * @returns Fully typed ToolDefinition
374
+ * @example
375
+ * ```typescript
376
+ * import { z } from 'zod';
377
+ * import { defineTool, toolSuccess, toolError, ToolErrorCodes } from '@makaio/framework/tools';
378
+ *
379
+ * const ReadFileInputSchema = z.object({
380
+ * path: z.string().describe('File path to read'),
381
+ * encoding: z.enum(['utf-8', 'base64']).default('utf-8'),
382
+ * });
383
+ *
384
+ * const ReadFileOutputSchema = z.object({
385
+ * content: z.string(),
386
+ * size: z.number(),
387
+ * });
388
+ *
389
+ * const readFileTool = defineTool({
390
+ * name: 'readFile',
391
+ * description: 'Reads a file from the filesystem',
392
+ * annotations: { readOnly: true },
393
+ * inputSchema: ReadFileInputSchema,
394
+ * outputSchema: ReadFileOutputSchema,
395
+ * execute: async (input, context) => {
396
+ * const fullPath = path.resolve(context.cwd, input.path);
397
+ *
398
+ * try {
399
+ * const content = await fs.readFile(fullPath, input.encoding);
400
+ * const stats = await fs.stat(fullPath);
401
+ * return toolSuccess({ content, size: stats.size });
402
+ * } catch (err) {
403
+ * return toolError(
404
+ * ToolErrorCodes.RESOURCE_NOT_FOUND,
405
+ * `Failed to read file: ${fullPath}`
406
+ * );
407
+ * }
408
+ * },
409
+ * });
410
+ * ```
411
+ */
412
+ declare function defineTool<TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny>(config: DefineToolConfig<TInput, TOutput>): ToolDefinition<TInput, TOutput>;
413
+ //#endregion
414
+ //#region packages/tools-core/src/define-toolset.d.ts
415
+ /**
416
+ * Input type for tools parameter in defineToolset.
417
+ * Accepts a record, single tool, or array of tools for flexibility.
418
+ * Uses AnyToolDefinition to avoid TypeScript variance issues.
419
+ */
420
+ type ToolsInput = Record<string, AnyToolDefinition> | AnyToolDefinition | AnyToolDefinition[];
421
+ /**
422
+ * Configuration object for defining a toolset.
423
+ */
424
+ interface DefineToolsetConfig<TTools extends ToolsInput> {
425
+ /** Unique toolset name */
426
+ name: string;
427
+ /** Human-readable description */
428
+ description: string;
429
+ /** Semantic version string */
430
+ version: string;
431
+ /**
432
+ * Tools to include in the toolset.
433
+ * Can be:
434
+ * - A record of named tools
435
+ * - A single tool (uses tool.metadata.name as key)
436
+ * - An array of tools (uses each tool.metadata.name as key)
437
+ */
438
+ tools: TTools;
439
+ /** Optional Zod schema for toolset configuration (used for UI generation) */
440
+ configSchema?: z.ZodTypeAny;
441
+ }
442
+ /**
443
+ * Extracts the Record type from various tools input formats.
444
+ * Used for type inference in defineToolset return type.
445
+ */
446
+ type ExtractToolsRecord<T extends ToolsInput> = T extends Record<string, AnyToolDefinition> ? T : T extends AnyToolDefinition ? Record<string, AnyToolDefinition> : T extends AnyToolDefinition[] ? Record<string, AnyToolDefinition> : Record<string, AnyToolDefinition>;
447
+ /**
448
+ * Creates a Toolset from a configuration object.
449
+ *
450
+ * Provides flexibility in how tools are specified:
451
+ * - As a record with explicit keys
452
+ * - As a single tool (uses tool name as key)
453
+ * - As an array of tools (uses each tool name as key)
454
+ * @typeParam TTools - Input tools type (record, single, or array)
455
+ * @param config - Toolset configuration
456
+ * @returns Toolset with normalized tools record
457
+ * @example
458
+ * ```typescript
459
+ * // With a record (explicit keys)
460
+ * const fsToolset = defineToolset({
461
+ * name: 'filesystem',
462
+ * description: 'File system operations',
463
+ * version: '1.0.0',
464
+ * tools: {
465
+ * read: readFileTool,
466
+ * write: writeFileTool,
467
+ * delete: deleteFileTool,
468
+ * },
469
+ * });
470
+ *
471
+ * // With a single tool
472
+ * const singleToolset = defineToolset({
473
+ * name: 'echo',
474
+ * description: 'Echo utility',
475
+ * version: '1.0.0',
476
+ * tools: echoTool,
477
+ * });
478
+ *
479
+ * // With an array
480
+ * const arrayToolset = defineToolset({
481
+ * name: 'utilities',
482
+ * description: 'Utility tools',
483
+ * version: '1.0.0',
484
+ * tools: [echoTool, sleepTool, dateTool],
485
+ * });
486
+ * ```
487
+ */
488
+ declare function defineToolset<TTools extends ToolsInput>(config: DefineToolsetConfig<TTools>): Toolset<ExtractToolsRecord<TTools>>;
489
+ //#endregion
490
+ //#region packages/tools-core/src/export.d.ts
491
+ type JSONSchema = zCore.JSONSchema.JSONSchema;
492
+ /**
493
+ * MCP (Model Context Protocol) tool definition.
494
+ * @see https://spec.modelcontextprotocol.io/specification/server/tools/
495
+ */
496
+ interface McpToolDefinition {
497
+ /** Tool name (unique identifier) */
498
+ name: string;
499
+ /** Human-readable description */
500
+ description: string;
501
+ /** JSON Schema for input parameters */
502
+ inputSchema: JSONSchema;
503
+ /**
504
+ * Optional annotations providing hints about tool behavior.
505
+ * MCP clients may use these to optimize tool usage.
506
+ */
507
+ annotations?: {
508
+ /** Tool only reads data, doesn't modify anything */readOnly?: boolean; /** Tool may permanently delete or modify data */
509
+ destructive?: boolean; /** Calling the tool multiple times with same input has same effect */
510
+ idempotent?: boolean; /** Execution may take a long time */
511
+ openWorldHint?: boolean;
512
+ };
513
+ }
514
+ /**
515
+ * OpenAI function calling definition.
516
+ * @see https://platform.openai.com/docs/guides/function-calling
517
+ */
518
+ interface OpenAIFunctionDefinition {
519
+ /** Function name */
520
+ name: string;
521
+ /** Human-readable description */
522
+ description: string;
523
+ /** JSON Schema for function parameters */
524
+ parameters: JSONSchema;
525
+ }
526
+ /** Valid target formats for JSON Schema generation */
527
+ type SchemaTarget = 'jsonSchema7' | 'jsonSchema2019-09' | 'openApi3' | 'openAi';
528
+ /**
529
+ * Options for schema conversion.
530
+ */
531
+ interface ExportOptions {
532
+ /**
533
+ * Target schema version.
534
+ * - 'jsonSchema7' (default): JSON Schema Draft-07
535
+ * - 'jsonSchema2019-09': JSON Schema 2019-09
536
+ * - 'openApi3': OpenAPI 3.0 compatible
537
+ * - 'openAi': OpenAI function calling compatible
538
+ */
539
+ schemaTarget?: SchemaTarget;
540
+ /**
541
+ * Whether to remove $schema property from output.
542
+ * Default is true for cleaner output.
543
+ */
544
+ removeSchema?: boolean;
545
+ }
546
+ /**
547
+ * Converts a ToolDefinition to MCP tool format.
548
+ * @param tool - Makaio tool definition
549
+ * @returns MCP-compatible tool definition
550
+ * @example
551
+ * ```typescript
552
+ * const mcpTool = toMcpTool(readFileTool);
553
+ * // Result:
554
+ * // {
555
+ * // name: 'readFile',
556
+ * // description: 'Reads a file from the filesystem',
557
+ * // inputSchema: { type: 'object', properties: { path: { type: 'string' } }, ... },
558
+ * // annotations: { readOnly: true }
559
+ * // }
560
+ * ```
561
+ */
562
+ declare function toMcpTool(tool: AnyToolDefinition): McpToolDefinition;
563
+ /**
564
+ * Converts a ToolDefinition to OpenAI function format.
565
+ * @param tool - Makaio tool definition
566
+ * @returns OpenAI-compatible function definition
567
+ * @example
568
+ * ```typescript
569
+ * const openAIFunc = toOpenAIFunction(readFileTool);
570
+ * // Result:
571
+ * // {
572
+ * // name: 'readFile',
573
+ * // description: 'Reads a file from the filesystem',
574
+ * // parameters: { type: 'object', properties: { path: { type: 'string' } }, ... }
575
+ * // }
576
+ * ```
577
+ */
578
+ declare function toOpenAIFunction(tool: AnyToolDefinition): OpenAIFunctionDefinition;
579
+ /**
580
+ * Converts all tools in a Toolset to MCP format.
581
+ * @param toolset - Makaio toolset
582
+ * @returns Array of MCP-compatible tool definitions
583
+ * @example
584
+ * ```typescript
585
+ * const mcpTools = toolsetToMcpTools(filesystemToolset);
586
+ * // Returns array of MCP tool definitions for all tools in the toolset
587
+ * ```
588
+ */
589
+ declare function toolsetToMcpTools(toolset: Toolset): McpToolDefinition[];
590
+ /**
591
+ * Converts all tools in a Toolset to OpenAI function format.
592
+ * @param toolset - Makaio toolset
593
+ * @returns Array of OpenAI-compatible function definitions
594
+ * @example
595
+ * ```typescript
596
+ * const openAIFunctions = toolsetToOpenAIFunctions(filesystemToolset);
597
+ * // Returns array of OpenAI function definitions for all tools in the toolset
598
+ * ```
599
+ */
600
+ declare function toolsetToOpenAIFunctions(toolset: Toolset): OpenAIFunctionDefinition[];
601
+ //#endregion
602
+ //#region packages/tools-core/src/memory-store.d.ts
603
+ /**
604
+ * Generic memory store for managing working memory instances across sessions.
605
+ *
606
+ * Provides session-keyed isolation for state when tool instances are
607
+ * singleton in the registry.
608
+ *
609
+ * Type Parameters:
610
+ * - T: The working memory class type
611
+ * - TArgs: Constructor arguments for the working memory class
612
+ * @example
613
+ * ```typescript
614
+ * class MyMemoryStore extends MemoryStore<MyWorkingMemory, [string]> {
615
+ * constructor() {
616
+ * super((sessionId) => new MyWorkingMemory(sessionId));
617
+ * }
618
+ * }
619
+ *
620
+ * const store = new MyMemoryStore();
621
+ * const memory = store.get('session-123');
622
+ * store.delete('session-123');
623
+ * ```
624
+ */
625
+ declare class MemoryStore<T, TArgs extends unknown[]> {
626
+ private factory;
627
+ private sessions;
628
+ /**
629
+ * Creates a new memory store.
630
+ * @param factory - Factory function to create new memory instances
631
+ */
632
+ constructor(factory: (sessionId: string, ...args: TArgs) => T);
633
+ /**
634
+ * Gets or creates working memory for a session.
635
+ * Returns the same instance for the same sessionId.
636
+ * @param sessionId - Session identifier
637
+ * @param args - Additional arguments passed to the factory
638
+ * @returns Working memory instance for the session
639
+ */
640
+ get(sessionId: string, ...args: TArgs): T;
641
+ /**
642
+ * Checks if a session has working memory.
643
+ * @param sessionId - Session identifier
644
+ * @returns true if session exists
645
+ */
646
+ has(sessionId: string): boolean;
647
+ /**
648
+ * Deletes session memory (for cleanup on session close).
649
+ * @param sessionId - Session identifier
650
+ * @returns true if deleted, false if not found
651
+ */
652
+ delete(sessionId: string): boolean;
653
+ /**
654
+ * Iterates over all session memories.
655
+ * @returns Iterator of [sessionId, memory] pairs
656
+ */
657
+ entries(): IterableIterator<[string, T]>;
658
+ /**
659
+ * Returns all session IDs with active memory.
660
+ * @returns Array of session IDs
661
+ */
662
+ sessionIds(): string[];
663
+ /**
664
+ * Returns the number of sessions with active memory.
665
+ * @returns Session count
666
+ */
667
+ get size(): number;
668
+ }
669
+ //#endregion
670
+ //#region packages/tools-core/src/tool-utils.d.ts
671
+ /**
672
+ * Validates that sessionId is present in the context.
673
+ * @param context - Tool execution context
674
+ * @param entityName - Name of entity for error message (e.g., 'artifact', 'task')
675
+ * @returns Session ID if valid, or error result
676
+ */
677
+ declare function validateSessionId(context: ToolExecutionContext, entityName?: string): {
678
+ valid: true;
679
+ sessionId: string;
680
+ } | {
681
+ valid: false;
682
+ error: ToolResult<never>;
683
+ };
684
+ /**
685
+ * Emits an event on the bus if available.
686
+ *
687
+ * The subject must be a properly typed subject definition from a registered namespace.
688
+ * Type inference ensures the payload matches the subject's schema at compile time.
689
+ * @param context - Tool execution context
690
+ * @param subject - Typed subject definition from a registered namespace
691
+ * @param payload - Event payload matching the subject's schema
692
+ * @example
693
+ * ```typescript
694
+ * import { TaskSubjects } from '@makaio/tools-tasks/subjects';
695
+ *
696
+ * await emitEvent(context, TaskSubjects.created, {
697
+ * taskId: '123',
698
+ * title: 'Fix bug',
699
+ * });
700
+ * ```
701
+ */
702
+ declare function emitEvent<S extends {
703
+ $meta: {
704
+ payload: unknown;
705
+ };
706
+ }>(context: ToolExecutionContext, subject: S, payload: S['$meta']['payload']): Promise<void>;
707
+ /**
708
+ * Operation handler function type for CRUD tools.
709
+ *
710
+ * Handler functions receive the operation-specific input, validated sessionId,
711
+ * and execution context.
712
+ *
713
+ * Type parameters:
714
+ * - TInput: The operation-specific input type (extracted from discriminated union)
715
+ * - TOutput: The tool's output type
716
+ */
717
+ type OperationHandler<TInput, TOutput> = (input: TInput, sessionId: string, context: ToolExecutionContext) => Promise<ToolResult<TOutput>>;
718
+ /**
719
+ * Handler map for discriminated union CRUD operations.
720
+ *
721
+ * Maps operation names (discriminator values) to their handler functions.
722
+ *
723
+ * Type parameters:
724
+ * - TInput: The full discriminated union input type
725
+ * - TOutput: The tool's output type
726
+ */
727
+ type OperationHandlers<TInput extends {
728
+ op: string;
729
+ }, TOutput> = { [K in TInput['op']]: OperationHandler<Extract<TInput, {
730
+ op: K;
731
+ }>, TOutput> };
732
+ /**
733
+ * Executes a CRUD tool operation with session validation and operation routing.
734
+ *
735
+ * This helper consolidates the common pattern of:
736
+ * 1. Validating sessionId from context
737
+ * 2. Routing to operation-specific handlers based on discriminated union
738
+ *
739
+ * The input type must be a discriminated union with an `op` field.
740
+ * Handler functions are provided in a map keyed by operation name.
741
+ *
742
+ * Type parameters:
743
+ * - TInput: Discriminated union input type with `op` field
744
+ * - TOutput: Tool output type
745
+ * @param input - The tool input with operation discriminator
746
+ * @param context - Tool execution context
747
+ * @param entityName - Entity name for validation error messages (e.g., 'task', 'artifact')
748
+ * @param handlers - Map of operation names to handler functions
749
+ * @returns Tool result from the appropriate operation handler
750
+ * @example
751
+ * ```typescript
752
+ * export const myTool = defineTool({
753
+ * name: 'my_tool',
754
+ * inputSchema: z.discriminatedUnion('op', [
755
+ * z.object({ op: z.literal('create'), data: z.string() }),
756
+ * z.object({ op: z.literal('list') }),
757
+ * ]),
758
+ * execute: async (input, context) => {
759
+ * return executeCrudOperation(input, context, 'item', {
760
+ * create: async (input, sessionId, context) => {
761
+ * // Handle create...
762
+ * },
763
+ * list: async (input, sessionId, context) => {
764
+ * // Handle list...
765
+ * },
766
+ * });
767
+ * },
768
+ * });
769
+ * ```
770
+ */
771
+ declare function executeCrudOperation<TInput extends {
772
+ op: string;
773
+ }, TOutput>(input: TInput, context: ToolExecutionContext, entityName: string, handlers: OperationHandlers<TInput, TOutput>): Promise<ToolResult<TOutput>>;
774
+ //#endregion
775
+ //#region packages/tools-core/src/widen-tool.d.ts
776
+ /**
777
+ * Widens a strongly-typed tool definition for use in heterogeneous collections.
778
+ *
779
+ * Tool definitions are invariant in their input/output generic parameters. This
780
+ * helper provides a single canonical widening point for `defineToolset({ tools: [...] })`
781
+ * call sites that need `AnyToolDefinition`.
782
+ * @param tool - Strongly-typed tool definition
783
+ * @returns The same tool typed as AnyToolDefinition
784
+ */
785
+ declare function widenTool<TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny>(tool: ToolDefinition<TInput, TOutput>): AnyToolDefinition;
786
+ //#endregion
787
+ //#region packages/tools-core/src/file-access.d.ts
788
+ /**
789
+ * Compiled file access rules injected into tool execution context constraints.
790
+ */
791
+ interface FileAccessRules {
792
+ /**
793
+ * Directory allow-list.
794
+ * - `undefined`: no directory restriction
795
+ * - `[]`: deny all filesystem paths
796
+ * - non-empty array: allow-list to these directories
797
+ */
798
+ readonly allowedDirectories?: readonly string[];
799
+ /**
800
+ * Sync predicate that returns true when the absolute path is denied.
801
+ * @param absolutePath - Normalized absolute path to test
802
+ */
803
+ readonly isDenied: (absolutePath: string) => boolean;
804
+ }
805
+ /**
806
+ * Provides filesystem access rules for a given working directory.
807
+ * @param cwd - Absolute working directory
808
+ * @param allowedDirectories - Directory allow-list from the active execution policy
809
+ */
810
+ type FileAccessRuleProvider = (cwd: string, allowedDirectories?: readonly string[]) => Promise<FileAccessRules>;
811
+ /** Constraints key for FileAccessRules in MakaioContext.constraints. */
812
+ declare const FILE_ACCESS_RULES_KEY: "fileAccessRules";
813
+ /**
814
+ * Extract the target file path from a filesystem tool call's arguments.
815
+ *
816
+ * Returns the resolved absolute path, or `null` if the tool is not a known
817
+ * filesystem tool or the args don't contain the expected path field.
818
+ * @param toolName - Name of the tool being called
819
+ * @param args - Tool arguments record
820
+ * @param cwd - Working directory to resolve relative paths against
821
+ * @returns Absolute path to the target file, or `null` if not applicable
822
+ */
823
+ declare function extractToolFilePath(toolName: string | undefined, args: Record<string, unknown> | undefined, cwd: string): string | null;
824
+ //#endregion
825
+ export { type AnyToolDefinition, type BusLike, type DefineToolConfig, type DefineToolsetConfig, type ExportOptions, FILE_ACCESS_RULES_KEY, type FileAccessRuleProvider, type FileAccessRules, type McpToolDefinition, MemoryStore, type OpenAIFunctionDefinition, type ToolAnnotations, type ToolDefinition, type ToolError, type ToolErrorCode, ToolErrorCodes, type ToolExecutionContext, ToolExecutionError, type ToolFailure, type ToolInfo, type ToolMetadata, type ToolResult, type ToolSuccess, type Toolset, type ToolsetMetadata, defineTool, defineToolset, emitEvent, errorToToolResult, executeCrudOperation, extractToolFilePath, toMcpTool, toOpenAIFunction, toolError, toolSuccess, toolsetToMcpTools, toolsetToOpenAIFunctions, validateSessionId, widenTool };