@johpaz/hive-agents 0.0.35 → 0.0.36

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 (440) hide show
  1. package/README.md +64 -39
  2. package/dist/hive.js +3127 -3104
  3. package/dist/ui/assets/{AgentCreateForm-B4eK7efF.js → AgentCreateForm-tJZv9FZC.js} +1 -1
  4. package/dist/ui/assets/{AgentDetailPage-BD2uoJWk.js → AgentDetailPage-Du-mRcAX.js} +1 -1
  5. package/dist/ui/assets/AgentNewPage-DIFYd_Ys.js +1 -0
  6. package/dist/ui/assets/{AgentsPage-4JUZXvkA.js → AgentsPage-YvSgWRiw.js} +6 -6
  7. package/dist/ui/assets/CanvasPage-DtMwGvxf.js +33 -0
  8. package/dist/ui/assets/{ChannelsPage-BUn7-nhV.js → ChannelsPage-BdBXWHjj.js} +1 -1
  9. package/dist/ui/assets/DashboardPage-ghl1ZguH.js +6 -0
  10. package/dist/ui/assets/{LoginPage-C8j_urUD.js → LoginPage-CAmSI9Vy.js} +1 -1
  11. package/dist/ui/assets/LogsPage-DAPBHkwK.js +1 -0
  12. package/dist/ui/assets/MeetingPage-WjjGOqqU.js +1 -0
  13. package/dist/ui/assets/{NotFound-Drh-sJPN.js → NotFound-BMeQSGcG.js} +1 -1
  14. package/dist/ui/assets/ProvidersPage-Ct6HsAi1.js +1 -0
  15. package/dist/ui/assets/{RecoverPage-DNb1Pr8h.js → RecoverPage-DpW3l-yv.js} +1 -1
  16. package/dist/ui/assets/SettingsPage-DBJ7_E6C.js +9 -0
  17. package/dist/ui/assets/SetupPage-DKmLVUaj.js +1 -0
  18. package/dist/ui/assets/{WebChatPage-R-YOwA4F.js → WebChatPage-CVRcKept.js} +2 -2
  19. package/dist/ui/assets/accordion-C5d5Rm5z.js +1 -0
  20. package/dist/ui/assets/{alert-U8FsgWi7.js → alert-C-NE-P3s.js} +1 -1
  21. package/dist/ui/assets/{alert-dialog-CRdMkkmk.js → alert-dialog-C5mzbHdP.js} +1 -1
  22. package/dist/ui/assets/{badge-Cli1jnH5.js → badge-ChpACfWO.js} +1 -1
  23. package/dist/ui/assets/chevron-up-BYhk0K2J.js +1 -0
  24. package/dist/ui/assets/{dialog-DQ3s-LuO.js → dialog-QnZ0ad8O.js} +1 -1
  25. package/dist/ui/assets/dropdown-menu-BK-CO3Od.js +1 -0
  26. package/dist/ui/assets/{es-DcMjrpbA.js → es-NQNoaWDx.js} +1 -1
  27. package/dist/ui/assets/index-B2fCYtTS.css +2 -0
  28. package/dist/ui/assets/index-DMCjjdqf.js +116 -0
  29. package/dist/ui/assets/{label-0BvGVXvZ.js → label-D2H1IR_J.js} +1 -1
  30. package/dist/ui/assets/progress-BherYzY6.js +1 -0
  31. package/dist/ui/assets/scroll-area-DkeyX32e.js +1 -0
  32. package/dist/ui/assets/{slider-D47dOrRa.js → slider-CsiUDxc3.js} +1 -1
  33. package/dist/ui/assets/switch-BDwN8RYV.js +1 -0
  34. package/dist/ui/assets/{table-DhowbNxQ.js → table-CSc8ubon.js} +1 -1
  35. package/dist/ui/assets/terminal-DN38Q456.js +1 -0
  36. package/dist/ui/assets/useProviders-C6_QHsEi.js +1 -0
  37. package/dist/ui/assets/{vendor-radix-JY4ncZrD.js → vendor-radix-cw1bQaVC.js} +4 -4
  38. package/dist/ui/assets/{vendor-react-CscwQerf.js → vendor-react-D4s9E-zj.js} +1 -1
  39. package/dist/ui/dist/assets/AgentCreateForm-tJZv9FZC.js +1 -0
  40. package/dist/ui/dist/assets/AgentDetailPage-Du-mRcAX.js +1 -0
  41. package/dist/ui/dist/assets/AgentNewPage-DIFYd_Ys.js +1 -0
  42. package/dist/ui/dist/assets/AgentsPage-YvSgWRiw.js +10 -0
  43. package/dist/ui/dist/assets/CanvasPage-DtMwGvxf.js +33 -0
  44. package/dist/ui/dist/assets/ChannelsPage-BdBXWHjj.js +8 -0
  45. package/dist/ui/dist/assets/DashboardPage-ghl1ZguH.js +6 -0
  46. package/dist/ui/dist/assets/LoginPage-CAmSI9Vy.js +1 -0
  47. package/dist/ui/dist/assets/LogsPage-DAPBHkwK.js +1 -0
  48. package/dist/ui/dist/assets/MeetingPage-WjjGOqqU.js +1 -0
  49. package/dist/ui/dist/assets/NotFound-BMeQSGcG.js +1 -0
  50. package/dist/ui/dist/assets/ProvidersPage-Ct6HsAi1.js +1 -0
  51. package/dist/ui/dist/assets/RecoverPage-DpW3l-yv.js +1 -0
  52. package/dist/ui/dist/assets/SettingsPage-DBJ7_E6C.js +9 -0
  53. package/dist/ui/dist/assets/SetupPage-DKmLVUaj.js +1 -0
  54. package/dist/ui/dist/assets/WebChatPage-CVRcKept.js +16 -0
  55. package/dist/ui/dist/assets/accordion-C5d5Rm5z.js +1 -0
  56. package/dist/ui/dist/assets/activity-c3pNngT_.js +1 -0
  57. package/dist/ui/dist/assets/alert-C-NE-P3s.js +1 -0
  58. package/dist/ui/dist/assets/alert-dialog-C5mzbHdP.js +1 -0
  59. package/dist/ui/dist/assets/arrow-left-CBcbX5EZ.js +1 -0
  60. package/dist/ui/dist/assets/badge-ChpACfWO.js +1 -0
  61. package/dist/ui/dist/assets/calendar-B-KZ9RQO.js +1 -0
  62. package/dist/ui/dist/assets/card-CNf6BS2e.js +1 -0
  63. package/dist/ui/dist/assets/chevron-left-D4U-5A27.js +1 -0
  64. package/dist/ui/dist/assets/chevron-right-CR4Skrf3.js +1 -0
  65. package/dist/ui/dist/assets/chevron-up-BYhk0K2J.js +1 -0
  66. package/dist/ui/dist/assets/circle-alert-CyHDwUj8.js +1 -0
  67. package/dist/ui/dist/assets/circle-check-Bb54Ebmu.js +1 -0
  68. package/dist/ui/dist/assets/cpu-Cdgc_B1K.js +1 -0
  69. package/dist/ui/dist/assets/dialog-QnZ0ad8O.js +1 -0
  70. package/dist/ui/dist/assets/download-C3ifGMjJ.js +1 -0
  71. package/dist/ui/dist/assets/dropdown-menu-BK-CO3Od.js +1 -0
  72. package/dist/ui/dist/assets/es-NQNoaWDx.js +1 -0
  73. package/dist/ui/dist/assets/external-link-BvxYeTP1.js +1 -0
  74. package/dist/ui/dist/assets/eye-DqNTU_GD.js +1 -0
  75. package/dist/ui/dist/assets/file-text-BT_9S9SM.js +1 -0
  76. package/dist/ui/dist/assets/folder-open-BhH8y9ac.js +1 -0
  77. package/dist/ui/dist/assets/format-GVHeOyWI.js +1 -0
  78. package/dist/ui/dist/assets/gateway-url-COCbW0IR.js +1 -0
  79. package/dist/ui/dist/assets/gauge-D_TMa4i9.js +1 -0
  80. package/dist/ui/dist/assets/globe-DeCQTCDJ.js +1 -0
  81. package/dist/ui/dist/assets/hexagon-DsGOUl-H.js +1 -0
  82. package/dist/ui/dist/assets/history-BSG-Ypqf.js +1 -0
  83. package/dist/ui/dist/assets/index-B2fCYtTS.css +2 -0
  84. package/dist/ui/dist/assets/index-DMCjjdqf.js +116 -0
  85. package/dist/ui/dist/assets/info-NwLoa2Mj.js +1 -0
  86. package/dist/ui/dist/assets/key-3EP0dhkT.js +1 -0
  87. package/dist/ui/dist/assets/label-D2H1IR_J.js +1 -0
  88. package/dist/ui/dist/assets/loader-circle-CZNax6kS.js +1 -0
  89. package/dist/ui/dist/assets/lock-Ei1_J-Nq.js +1 -0
  90. package/dist/ui/dist/assets/pause-BUqah9Bi.js +1 -0
  91. package/dist/ui/dist/assets/play-NcZ4swwL.js +1 -0
  92. package/dist/ui/dist/assets/plus-CX1xyhp5.js +1 -0
  93. package/dist/ui/dist/assets/progress-BherYzY6.js +1 -0
  94. package/dist/ui/dist/assets/refresh-cw-DaYdjQFk.js +1 -0
  95. package/dist/ui/dist/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
  96. package/dist/ui/dist/assets/save-CUdYyHNy.js +1 -0
  97. package/dist/ui/dist/assets/scroll-area-DkeyX32e.js +1 -0
  98. package/dist/ui/dist/assets/send-B0H5SEIE.js +1 -0
  99. package/dist/ui/dist/assets/settings-Ds4SqD8s.js +1 -0
  100. package/dist/ui/dist/assets/slider-CsiUDxc3.js +14 -0
  101. package/dist/ui/dist/assets/sparkles-yUEb-7oH.js +1 -0
  102. package/dist/ui/dist/assets/square-BD81nFtN.js +1 -0
  103. package/dist/ui/dist/assets/switch-BDwN8RYV.js +1 -0
  104. package/dist/ui/dist/assets/table-CSc8ubon.js +1 -0
  105. package/dist/ui/dist/assets/terminal-DN38Q456.js +1 -0
  106. package/dist/ui/dist/assets/textarea-CXgXWKrT.js +1 -0
  107. package/dist/ui/dist/assets/trash-2-CNjMkoq6.js +1 -0
  108. package/dist/ui/dist/assets/triangle-alert-C9Y8Ub4X.js +1 -0
  109. package/dist/ui/dist/assets/useProviders-C6_QHsEi.js +1 -0
  110. package/dist/ui/dist/assets/utils-3pnRFmFe.js +1 -0
  111. package/dist/ui/dist/assets/vendor-charts-Bu2lyBKP.js +65 -0
  112. package/dist/ui/dist/assets/vendor-query-DsWPbQdG.js +1 -0
  113. package/dist/ui/dist/assets/vendor-radix-cw1bQaVC.js +63 -0
  114. package/dist/ui/dist/assets/vendor-react-D4s9E-zj.js +1 -0
  115. package/dist/ui/dist/assets/vendor-router-C9pIYwbJ.js +3 -0
  116. package/dist/ui/dist/assets/volume-2-CeSXNDv4.js +1 -0
  117. package/dist/ui/dist/assets/zap-hlXjpSeA.js +1 -0
  118. package/dist/ui/dist/favicon.ico +0 -0
  119. package/dist/ui/dist/index.html +40 -0
  120. package/dist/ui/dist/placeholder.svg +1 -0
  121. package/dist/ui/index.html +6 -6
  122. package/package.json +137 -13
  123. package/packages/cli/src/adapters/binary.ts +461 -0
  124. package/packages/cli/src/adapters/bun-global.ts +378 -0
  125. package/packages/cli/src/adapters/config.ts +314 -0
  126. package/packages/cli/src/adapters/docker.ts +308 -0
  127. package/packages/cli/src/adapters/factory.ts +168 -0
  128. package/packages/cli/src/adapters/index.ts +80 -0
  129. package/packages/cli/src/adapters/types.ts +218 -0
  130. package/packages/cli/src/commands/agent-run.ts +168 -0
  131. package/packages/cli/src/commands/agents.ts +398 -0
  132. package/packages/cli/src/commands/chat.ts +142 -0
  133. package/packages/cli/src/commands/config.ts +49 -0
  134. package/packages/cli/src/commands/cron.ts +487 -0
  135. package/packages/cli/src/commands/dev.ts +58 -0
  136. package/packages/cli/src/commands/doctor.ts +320 -0
  137. package/packages/cli/src/commands/gateway.ts +719 -0
  138. package/packages/cli/src/commands/logs.ts +57 -0
  139. package/packages/cli/src/commands/mcp.ts +175 -0
  140. package/packages/cli/src/commands/message.ts +77 -0
  141. package/packages/cli/src/commands/migrate.ts +90 -0
  142. package/packages/cli/src/commands/onboard.ts +1656 -0
  143. package/packages/cli/src/commands/security.ts +144 -0
  144. package/packages/cli/src/commands/service.ts +50 -0
  145. package/packages/cli/src/commands/sessions.ts +116 -0
  146. package/packages/cli/src/commands/skills.ts +215 -0
  147. package/packages/cli/src/commands/update.ts +203 -0
  148. package/packages/cli/src/index.ts +210 -0
  149. package/packages/cli/src/ui-bundle.generated.ts +3 -0
  150. package/packages/cli/src/utils/token.ts +6 -0
  151. package/packages/core/src/agent/agent-loop.ts +691 -0
  152. package/packages/core/src/agent/compaction.ts +240 -0
  153. package/packages/core/src/agent/context-compiler.ts +467 -0
  154. package/packages/core/src/agent/context-guard.ts +91 -0
  155. package/packages/core/src/agent/conversation-store.ts +244 -0
  156. package/packages/core/src/agent/curator.ts +158 -0
  157. package/packages/core/src/agent/hooks.ts +166 -0
  158. package/packages/core/src/agent/llm-client.ts +167 -0
  159. package/packages/core/src/agent/llm-providers/anthropic.ts +212 -0
  160. package/packages/core/src/agent/llm-providers/deepseek.ts +8 -0
  161. package/packages/core/src/agent/llm-providers/gemini.ts +215 -0
  162. package/packages/core/src/agent/llm-providers/groq.ts +5 -0
  163. package/packages/core/src/agent/llm-providers/interface.ts +195 -0
  164. package/packages/core/src/agent/llm-providers/kimi.ts +8 -0
  165. package/packages/core/src/agent/llm-providers/local-llama.ts +37 -0
  166. package/packages/core/src/agent/llm-providers/mistral.ts +5 -0
  167. package/packages/core/src/agent/llm-providers/nvidia.ts +5 -0
  168. package/packages/core/src/agent/llm-providers/ollama.ts +175 -0
  169. package/packages/core/src/agent/llm-providers/openai-compat-base.ts +379 -0
  170. package/packages/core/src/agent/llm-providers/openai.ts +5 -0
  171. package/packages/core/src/agent/llm-providers/openrouter.ts +5 -0
  172. package/packages/core/src/agent/llm-providers/qwen.ts +5 -0
  173. package/packages/core/src/agent/native-tools.ts +31 -0
  174. package/packages/core/src/agent/playbook-selector.ts +147 -0
  175. package/packages/core/src/agent/prompt-builder.ts +169 -0
  176. package/packages/core/src/agent/providers/index.ts +204 -0
  177. package/packages/core/src/agent/providers.ts +1 -0
  178. package/packages/core/src/agent/reflector.ts +200 -0
  179. package/packages/core/src/agent/service.ts +267 -0
  180. package/packages/core/src/agent/skill-selector.ts +479 -0
  181. package/packages/core/src/agent/stuck-loop.ts +133 -0
  182. package/packages/core/src/agent/tool-selector.ts +569 -0
  183. package/packages/core/src/agent/tracer.ts +100 -0
  184. package/packages/core/src/auth/auth.ts +108 -0
  185. package/packages/core/src/auth/index.ts +1 -0
  186. package/packages/core/src/canvas/a2ui-tools.ts +255 -0
  187. package/packages/core/src/canvas/canvas-manager.ts +390 -0
  188. package/packages/core/src/canvas/canvas-tools.ts +448 -0
  189. package/packages/core/src/canvas/emitter.ts +149 -0
  190. package/packages/core/src/canvas/index.ts +3 -0
  191. package/packages/core/src/channels/base.ts +154 -0
  192. package/packages/core/src/channels/discord.ts +273 -0
  193. package/packages/core/src/channels/index.ts +7 -0
  194. package/packages/core/src/channels/manager.ts +450 -0
  195. package/packages/core/src/channels/slack.ts +323 -0
  196. package/packages/core/src/channels/telegram.ts +612 -0
  197. package/packages/core/src/channels/webchat.ts +139 -0
  198. package/packages/core/src/channels/whatsapp.ts +548 -0
  199. package/packages/core/src/config/index.ts +12 -0
  200. package/packages/core/src/config/loader.ts +569 -0
  201. package/packages/core/src/events/agent-bus.ts +460 -0
  202. package/packages/core/src/events/event-bus.ts +169 -0
  203. package/packages/core/src/gateway/channel-notify.ts +64 -0
  204. package/packages/core/src/gateway/helpers/cors.ts +32 -0
  205. package/packages/core/src/gateway/helpers/index.ts +4 -0
  206. package/packages/core/src/gateway/helpers/narration.ts +57 -0
  207. package/packages/core/src/gateway/helpers/path.ts +13 -0
  208. package/packages/core/src/gateway/helpers/redact.ts +61 -0
  209. package/packages/core/src/gateway/index.ts +5 -0
  210. package/packages/core/src/gateway/initializer.ts +363 -0
  211. package/packages/core/src/gateway/lane-queue.ts +169 -0
  212. package/packages/core/src/gateway/llm-local/client.ts +94 -0
  213. package/packages/core/src/gateway/llm-local/detector.ts +321 -0
  214. package/packages/core/src/gateway/llm-local/downloader.ts +216 -0
  215. package/packages/core/src/gateway/llm-local/index.ts +34 -0
  216. package/packages/core/src/gateway/llm-local/manager.ts +186 -0
  217. package/packages/core/src/gateway/llm-local/models.ts +149 -0
  218. package/packages/core/src/gateway/llm-local/server.ts +179 -0
  219. package/packages/core/src/gateway/resolver.ts +108 -0
  220. package/packages/core/src/gateway/router.ts +124 -0
  221. package/packages/core/src/gateway/routes/agents.ts +210 -0
  222. package/packages/core/src/gateway/routes/auth.ts +244 -0
  223. package/packages/core/src/gateway/routes/channels.ts +484 -0
  224. package/packages/core/src/gateway/routes/chat.ts +241 -0
  225. package/packages/core/src/gateway/routes/config.ts +12 -0
  226. package/packages/core/src/gateway/routes/cron-api.ts +544 -0
  227. package/packages/core/src/gateway/routes/ethics.ts +46 -0
  228. package/packages/core/src/gateway/routes/llm-local.ts +271 -0
  229. package/packages/core/src/gateway/routes/mcp.ts +319 -0
  230. package/packages/core/src/gateway/routes/meeting.ts +232 -0
  231. package/packages/core/src/gateway/routes/models.ts +163 -0
  232. package/packages/core/src/gateway/routes/multimodal.ts +93 -0
  233. package/packages/core/src/gateway/routes/providers.ts +220 -0
  234. package/packages/core/src/gateway/routes/setup.ts +441 -0
  235. package/packages/core/src/gateway/routes/skills.ts +115 -0
  236. package/packages/core/src/gateway/routes/system.ts +469 -0
  237. package/packages/core/src/gateway/routes/tasks.ts +44 -0
  238. package/packages/core/src/gateway/routes/tools.ts +59 -0
  239. package/packages/core/src/gateway/routes/tts-local.ts +388 -0
  240. package/packages/core/src/gateway/routes/users.ts +122 -0
  241. package/packages/core/src/gateway/routes/voice.ts +189 -0
  242. package/packages/core/src/gateway/routes/workspace.ts +281 -0
  243. package/packages/core/src/gateway/server.ts +2744 -0
  244. package/packages/core/src/gateway/session.ts +95 -0
  245. package/packages/core/src/gateway/slash-commands.ts +207 -0
  246. package/packages/core/src/gateway/tts/README.md +94 -0
  247. package/packages/core/src/gateway/tts/package.json +25 -0
  248. package/packages/core/src/gateway/tts/src/client.ts +59 -0
  249. package/packages/core/src/gateway/tts/src/detect.ts +42 -0
  250. package/packages/core/src/gateway/tts/src/index.ts +15 -0
  251. package/packages/core/src/gateway/tts/src/install.ts +129 -0
  252. package/packages/core/src/gateway/tts/src/models.ts +50 -0
  253. package/packages/core/src/gateway/tts/src/server.ts +252 -0
  254. package/packages/core/src/gateway/tts/voices/.gitkeep +0 -0
  255. package/packages/core/src/heartbeat/index.ts +157 -0
  256. package/packages/core/src/index.ts +56 -0
  257. package/packages/core/src/mcp/hot-reload.ts +148 -0
  258. package/packages/core/src/mcp/singleton.ts +21 -0
  259. package/packages/core/src/mcp/tool-sync.ts +176 -0
  260. package/packages/core/src/multimodal/index.ts +2 -0
  261. package/packages/core/src/multimodal/types.ts +28 -0
  262. package/packages/core/src/multimodal/vision-service.ts +283 -0
  263. package/packages/core/src/plugins/api.ts +128 -0
  264. package/packages/core/src/plugins/index.ts +2 -0
  265. package/packages/core/src/plugins/loader.ts +365 -0
  266. package/packages/core/src/resilience/circuit-breaker.ts +225 -0
  267. package/packages/core/src/scheduler/CronScheduler.ts +699 -0
  268. package/packages/core/src/scheduler/dag/AgentExecutor.ts +53 -0
  269. package/packages/core/src/scheduler/dag/DAGScheduler.ts +250 -0
  270. package/packages/core/src/scheduler/dag/EventBridge.ts +122 -0
  271. package/packages/core/src/scheduler/dag/TaskGraph.ts +192 -0
  272. package/packages/core/src/scheduler/dag/TaskNode.ts +97 -0
  273. package/packages/core/src/scheduler/dag/TaskResult.ts +22 -0
  274. package/packages/core/src/scheduler/dag/errors.ts +37 -0
  275. package/packages/core/src/scheduler/dag/index.ts +26 -0
  276. package/packages/core/src/scheduler/dag/presets/ResearchPreset.ts +97 -0
  277. package/packages/core/src/scheduler/dag/strategies/ParallelStrategy.ts +21 -0
  278. package/packages/core/src/scheduler/dag/strategies/PriorityStrategy.ts +46 -0
  279. package/packages/core/src/scheduler/index.ts +22 -0
  280. package/packages/core/src/scheduler/integration.ts +237 -0
  281. package/packages/core/src/scheduler/types.ts +164 -0
  282. package/packages/core/src/security/google-chat.ts +269 -0
  283. package/packages/core/src/security/index.ts +192 -0
  284. package/packages/core/src/security/pairing.ts +250 -0
  285. package/packages/core/src/security/rate-limit.ts +270 -0
  286. package/packages/core/src/security/signal.ts +321 -0
  287. package/packages/core/src/state/store.ts +312 -0
  288. package/packages/core/src/storage/crypto.ts +197 -0
  289. package/packages/core/src/storage/migrate.ts +147 -0
  290. package/packages/core/src/storage/onboarding.ts +1506 -0
  291. package/packages/core/src/storage/schema.ts +666 -0
  292. package/packages/core/src/storage/seed.ts +628 -0
  293. package/packages/core/src/storage/sqlite.ts +407 -0
  294. package/packages/core/src/storage/usage.ts +374 -0
  295. package/packages/core/src/tool-runtime/index.ts +476 -0
  296. package/packages/core/src/tool-runtime/tool-worker.ts +125 -0
  297. package/packages/core/src/tools/agents/get-available-models.ts +118 -0
  298. package/packages/core/src/tools/agents/index.ts +610 -0
  299. package/packages/core/src/tools/canvas/index.ts +420 -0
  300. package/packages/core/src/tools/cli/index.ts +142 -0
  301. package/packages/core/src/tools/core/index.ts +478 -0
  302. package/packages/core/src/tools/cron/index.ts +635 -0
  303. package/packages/core/src/tools/filesystem/fs-delete.ts +78 -0
  304. package/packages/core/src/tools/filesystem/fs-edit.ts +106 -0
  305. package/packages/core/src/tools/filesystem/fs-exists.ts +63 -0
  306. package/packages/core/src/tools/filesystem/fs-glob.ts +108 -0
  307. package/packages/core/src/tools/filesystem/fs-list.ts +129 -0
  308. package/packages/core/src/tools/filesystem/fs-read.ts +72 -0
  309. package/packages/core/src/tools/filesystem/fs-write.ts +67 -0
  310. package/packages/core/src/tools/filesystem/index.ts +34 -0
  311. package/packages/core/src/tools/filesystem/workspace-guard.ts +62 -0
  312. package/packages/core/src/tools/index.ts +197 -0
  313. package/packages/core/src/tools/meeting/index.ts +363 -0
  314. package/packages/core/src/tools/office/index.ts +47 -0
  315. package/packages/core/src/tools/office/office-escribir-docx.ts +192 -0
  316. package/packages/core/src/tools/office/office-escribir-pdf.ts +172 -0
  317. package/packages/core/src/tools/office/office-escribir-pptx.ts +174 -0
  318. package/packages/core/src/tools/office/office-escribir-xlsx.ts +116 -0
  319. package/packages/core/src/tools/office/office-leer-docx.ts +93 -0
  320. package/packages/core/src/tools/office/office-leer-pdf.ts +114 -0
  321. package/packages/core/src/tools/office/office-leer-pptx.ts +136 -0
  322. package/packages/core/src/tools/office/office-leer-xlsx.ts +124 -0
  323. package/packages/core/src/tools/types.ts +39 -0
  324. package/packages/core/src/tools/voice/index.ts +104 -0
  325. package/packages/core/src/tools/web/browser-click.ts +78 -0
  326. package/packages/core/src/tools/web/browser-extract.ts +139 -0
  327. package/packages/core/src/tools/web/browser-navigate.ts +106 -0
  328. package/packages/core/src/tools/web/browser-screenshot.ts +87 -0
  329. package/packages/core/src/tools/web/browser-script.ts +88 -0
  330. package/packages/core/src/tools/web/browser-service.ts +554 -0
  331. package/packages/core/src/tools/web/browser-type.ts +101 -0
  332. package/packages/core/src/tools/web/browser-wait.ts +136 -0
  333. package/packages/core/src/tools/web/index.ts +41 -0
  334. package/packages/core/src/tools/web/web-fetch.ts +78 -0
  335. package/packages/core/src/tools/web/web-search.ts +123 -0
  336. package/packages/core/src/utils/benchmark.ts +80 -0
  337. package/packages/core/src/utils/crypto.ts +73 -0
  338. package/packages/core/src/utils/date.ts +42 -0
  339. package/packages/core/src/utils/index.ts +5 -0
  340. package/packages/core/src/utils/logger.ts +389 -0
  341. package/packages/core/src/utils/retry.ts +70 -0
  342. package/packages/core/src/utils/toon.ts +253 -0
  343. package/packages/core/src/voice/index.ts +643 -0
  344. package/packages/mcp/src/config.ts +13 -0
  345. package/packages/mcp/src/index.ts +1 -0
  346. package/packages/mcp/src/logger.ts +47 -0
  347. package/packages/mcp/src/manager.ts +439 -0
  348. package/packages/mcp/src/transports/index.ts +67 -0
  349. package/packages/mcp/src/transports/sse.ts +238 -0
  350. package/packages/mcp/src/transports/websocket.ts +159 -0
  351. package/packages/skills/src/bundled/agents/agent_spawner/SKILL.md +167 -0
  352. package/packages/skills/src/bundled/agents/code_delegator/SKILL.md +156 -0
  353. package/packages/skills/src/bundled/agents/memory_manager/SKILL.md +143 -0
  354. package/packages/skills/src/bundled/agents/research_and_remember/SKILL.md +139 -0
  355. package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +198 -0
  356. package/packages/skills/src/bundled/canvas/a2ui_dashboard/SKILL.md +176 -0
  357. package/packages/skills/src/bundled/canvas/a2ui_form/SKILL.md +202 -0
  358. package/packages/skills/src/bundled/canvas/a2ui_interactive/SKILL.md +206 -0
  359. package/packages/skills/src/bundled/canvas/canvas_dashboard/SKILL.md +146 -0
  360. package/packages/skills/src/bundled/canvas/canvas_interact/SKILL.md +148 -0
  361. package/packages/skills/src/bundled/canvas/canvas_report/SKILL.md +146 -0
  362. package/packages/skills/src/bundled/cli/cli_pipeline/SKILL.md +136 -0
  363. package/packages/skills/src/bundled/cli/cli_safe_exec/SKILL.md +125 -0
  364. package/packages/skills/src/bundled/cron_manager/SKILL.md +188 -0
  365. package/packages/skills/src/bundled/cron_reminder/SKILL.md +112 -0
  366. package/packages/skills/src/bundled/filesystem/file_manager/SKILL.md +118 -0
  367. package/packages/skills/src/bundled/filesystem/file_read_and_summarize/SKILL.md +108 -0
  368. package/packages/skills/src/bundled/filesystem/file_writer/SKILL.md +135 -0
  369. package/packages/skills/src/bundled/meeting/meeting_transcription/SKILL.md +213 -0
  370. package/packages/skills/src/bundled/office/office_document_manager/SKILL.md +262 -0
  371. package/packages/skills/src/bundled/search_knowledge/busqueda_fts5/SKILL.md +74 -0
  372. package/packages/skills/src/bundled/voice/voice_assistant/SKILL.md +174 -0
  373. package/packages/skills/src/bundled/voice/voice_input/SKILL.md +146 -0
  374. package/packages/skills/src/bundled/voice/voice_output/SKILL.md +151 -0
  375. package/packages/skills/src/bundled/web/browser_automate/SKILL.md +120 -0
  376. package/packages/skills/src/bundled/web/browser_scrape/SKILL.md +109 -0
  377. package/packages/skills/src/bundled/web/web_monitor/SKILL.md +127 -0
  378. package/packages/skills/src/bundled/web/web_research/SKILL.md +119 -0
  379. package/packages/skills/src/bundled-data.generated.ts +1964 -0
  380. package/packages/skills/src/index.ts +1 -0
  381. package/packages/skills/src/loader.ts +388 -0
  382. package/dist/ui/assets/AgentNewPage-GB-tVN50.js +0 -1
  383. package/dist/ui/assets/BridgePage-DDcDILKu.js +0 -1
  384. package/dist/ui/assets/CanvasPage-oOk2sGOD.js +0 -33
  385. package/dist/ui/assets/DashboardPage-DV_2qWYJ.js +0 -6
  386. package/dist/ui/assets/LogsPage-DayYjh01.js +0 -1
  387. package/dist/ui/assets/MeetingPage-C01uPuqj.js +0 -1
  388. package/dist/ui/assets/ProjectsPage-B8_am_Ib.js +0 -1
  389. package/dist/ui/assets/ProvidersPage-DBzi66e4.js +0 -1
  390. package/dist/ui/assets/SettingsPage-CFA_Tknl.js +0 -9
  391. package/dist/ui/assets/SetupPage-BrUWbhvT.js +0 -1
  392. package/dist/ui/assets/accordion-DdAEfIXR.js +0 -1
  393. package/dist/ui/assets/chevron-down-DIosfU_U.js +0 -1
  394. package/dist/ui/assets/chevron-up-CI-W21Fy.js +0 -1
  395. package/dist/ui/assets/circle-S0-ouLz-.js +0 -1
  396. package/dist/ui/assets/circle-minus-CE0iJrl8.js +0 -1
  397. package/dist/ui/assets/circle-x-jUJ5zZvQ.js +0 -1
  398. package/dist/ui/assets/dropdown-menu-C2CXM1VE.js +0 -1
  399. package/dist/ui/assets/index-BN0875JH.css +0 -2
  400. package/dist/ui/assets/index-CH6sBa3Q.js +0 -116
  401. package/dist/ui/assets/pencil-5VdSj-h5.js +0 -1
  402. package/dist/ui/assets/progress-JN30I5fF.js +0 -1
  403. package/dist/ui/assets/scroll-area-BQQPitM8.js +0 -1
  404. package/dist/ui/assets/search-ChPgnVKj.js +0 -1
  405. package/dist/ui/assets/switch-C7W2-KEx.js +0 -1
  406. package/dist/ui/assets/terminal-C-R5Fckz.js +0 -1
  407. package/dist/ui/assets/useProviders-TBnWn-Hq.js +0 -1
  408. /package/dist/ui/assets/{card-DFKnZ6ky.js → card-CNf6BS2e.js} +0 -0
  409. /package/dist/ui/assets/{circle-alert-KuAm2FWh.js → circle-alert-CyHDwUj8.js} +0 -0
  410. /package/dist/ui/assets/{circle-check-6Ard1-2z.js → circle-check-Bb54Ebmu.js} +0 -0
  411. /package/dist/ui/assets/{cpu-KDy6-FAI.js → cpu-Cdgc_B1K.js} +0 -0
  412. /package/dist/ui/assets/{download-Cjbk4Rek.js → download-C3ifGMjJ.js} +0 -0
  413. /package/dist/ui/assets/{external-link-HtrFM63g.js → external-link-BvxYeTP1.js} +0 -0
  414. /package/dist/ui/assets/{eye-D1dB40_o.js → eye-DqNTU_GD.js} +0 -0
  415. /package/dist/ui/assets/{file-text-CE58EfH0.js → file-text-BT_9S9SM.js} +0 -0
  416. /package/dist/ui/assets/{folder-open-DIPKeiI_.js → folder-open-BhH8y9ac.js} +0 -0
  417. /package/dist/ui/assets/{format-BwdV8bB5.js → format-GVHeOyWI.js} +0 -0
  418. /package/dist/ui/assets/{gateway-url-D5uj6Nxg.js → gateway-url-COCbW0IR.js} +0 -0
  419. /package/dist/ui/assets/{gauge-DmQmJHEg.js → gauge-D_TMa4i9.js} +0 -0
  420. /package/dist/ui/assets/{globe-_hUGxQF4.js → globe-DeCQTCDJ.js} +0 -0
  421. /package/dist/ui/assets/{hexagon-BaNGQlQj.js → hexagon-DsGOUl-H.js} +0 -0
  422. /package/dist/ui/assets/{history-BfZVGlZa.js → history-BSG-Ypqf.js} +0 -0
  423. /package/dist/ui/assets/{info-CBZ5-AlC.js → info-NwLoa2Mj.js} +0 -0
  424. /package/dist/ui/assets/{key-Bv5DdTPh.js → key-3EP0dhkT.js} +0 -0
  425. /package/dist/ui/assets/{loader-circle-C4hhXLgp.js → loader-circle-CZNax6kS.js} +0 -0
  426. /package/dist/ui/assets/{lock-CkZYexqw.js → lock-Ei1_J-Nq.js} +0 -0
  427. /package/dist/ui/assets/{pause-Bpy1_s7y.js → pause-BUqah9Bi.js} +0 -0
  428. /package/dist/ui/assets/{play-Cj4osqJZ.js → play-NcZ4swwL.js} +0 -0
  429. /package/dist/ui/assets/{plus-BQhgZN3A.js → plus-CX1xyhp5.js} +0 -0
  430. /package/dist/ui/assets/{refresh-cw-BfREHVQM.js → refresh-cw-DaYdjQFk.js} +0 -0
  431. /package/dist/ui/assets/{save-FFTD4dMp.js → save-CUdYyHNy.js} +0 -0
  432. /package/dist/ui/assets/{settings-BdHKUL92.js → settings-Ds4SqD8s.js} +0 -0
  433. /package/dist/ui/assets/{sparkles-r4uJbJAl.js → sparkles-yUEb-7oH.js} +0 -0
  434. /package/dist/ui/assets/{square-G7Hyufqm.js → square-BD81nFtN.js} +0 -0
  435. /package/dist/ui/assets/{textarea-5kyuD04X.js → textarea-CXgXWKrT.js} +0 -0
  436. /package/dist/ui/assets/{trash-2-DXVBRWfh.js → trash-2-CNjMkoq6.js} +0 -0
  437. /package/dist/ui/assets/{triangle-alert-Bu5seg9O.js → triangle-alert-C9Y8Ub4X.js} +0 -0
  438. /package/dist/ui/assets/{vendor-router-CCECILJ0.js → vendor-router-C9pIYwbJ.js} +0 -0
  439. /package/dist/ui/assets/{volume-2-s9DuS696.js → volume-2-CeSXNDv4.js} +0 -0
  440. /package/dist/ui/assets/{zap-BPHZzXKV.js → zap-hlXjpSeA.js} +0 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * fs_delete - Delete file or directory from workspace
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_delete
6
+ * @spanish eliminar archivo, borrar archivo, borrar carpeta
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace } from "./workspace-guard.ts";
12
+ import * as fs from "node:fs";
13
+
14
+ const log = logger.child("fs-delete");
15
+
16
+ export const fsDeleteTool: Tool = {
17
+ name: "fs_delete",
18
+ description: "Delete file or directory from workspace. Spanish: eliminar archivo, borrar archivo, borrar carpeta",
19
+ parameters: {
20
+ type: "object",
21
+ properties: {
22
+ path: {
23
+ type: "string",
24
+ description: "Path to the file or directory to delete",
25
+ },
26
+ recursive: {
27
+ type: "boolean",
28
+ description: "Delete recursively for directories (default: false)",
29
+ },
30
+ },
31
+ required: ["path"],
32
+ },
33
+ execute: async (params: Record<string, unknown>, config?: any) => {
34
+ const workspace = getWorkspace(config);
35
+ let targetPath: string;
36
+ try {
37
+ targetPath = resolveInWorkspace(params.path as string, workspace);
38
+ } catch (e) {
39
+ return { ok: false, error: (e as Error).message };
40
+ }
41
+ const recursive = (params.recursive as boolean) ?? false;
42
+
43
+ log.debug(`Deleting: ${targetPath}`);
44
+
45
+ try {
46
+ if (!fs.existsSync(targetPath)) {
47
+ return {
48
+ ok: false,
49
+ error: `Path not found: ${targetPath}`,
50
+ };
51
+ }
52
+
53
+ const stats = fs.statSync(targetPath);
54
+
55
+ if (stats.isDirectory()) {
56
+ if (recursive) {
57
+ fs.rmSync(targetPath, { recursive: true });
58
+ } else {
59
+ fs.rmdirSync(targetPath);
60
+ }
61
+ } else {
62
+ fs.unlinkSync(targetPath);
63
+ }
64
+
65
+ return {
66
+ ok: true,
67
+ path: targetPath,
68
+ deleted: true,
69
+ };
70
+ } catch (error) {
71
+ log.error(`Error deleting: ${(error as Error).message}`);
72
+ return {
73
+ ok: false,
74
+ error: `Failed to delete: ${(error as Error).message}`,
75
+ };
76
+ }
77
+ },
78
+ };
@@ -0,0 +1,106 @@
1
+ /**
2
+ * fs_edit - Edit specific lines or sections of a file
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_edit
6
+ * @spanish editar archivo, modificar líneas, actualizar contenido
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace } from "./workspace-guard.ts";
12
+ import * as fs from "node:fs";
13
+
14
+ const log = logger.child("fs-edit");
15
+
16
+ export const fsEditTool: Tool = {
17
+ name: "fs_edit",
18
+ description: "Edit specific lines or sections of a file. Spanish: editar archivo, modificar líneas, actualizar contenido",
19
+ parameters: {
20
+ type: "object",
21
+ properties: {
22
+ path: {
23
+ type: "string",
24
+ description: "Path to the file to edit",
25
+ },
26
+ oldString: {
27
+ type: "string",
28
+ description: "The text to search for and replace",
29
+ },
30
+ newString: {
31
+ type: "string",
32
+ description: "The text to replace with",
33
+ },
34
+ replaceAll: {
35
+ type: "boolean",
36
+ description: "Replace all occurrences (default: false)",
37
+ },
38
+ },
39
+ required: ["path", "oldString", "newString"],
40
+ },
41
+ execute: async (params: Record<string, unknown>, config?: any) => {
42
+ const workspace = getWorkspace(config);
43
+ let filePath: string;
44
+ try {
45
+ filePath = resolveInWorkspace(params.path as string, workspace);
46
+ } catch (e) {
47
+ return { ok: false, error: (e as Error).message };
48
+ }
49
+ const oldString = params.oldString as string;
50
+ const newString = params.newString as string;
51
+ const replaceAll = (params.replaceAll as boolean) ?? false;
52
+
53
+ log.debug(`Editing file: ${filePath}`);
54
+
55
+ try {
56
+ if (!fs.existsSync(filePath)) {
57
+ return {
58
+ ok: false,
59
+ error: `File not found: ${filePath}`,
60
+ };
61
+ }
62
+
63
+ const content = fs.readFileSync(filePath, "utf-8");
64
+
65
+ if (!content.includes(oldString)) {
66
+ return {
67
+ ok: false,
68
+ error: `String not found in file: ${oldString.substring(0, 50)}...`,
69
+ };
70
+ }
71
+
72
+ let newContent: string;
73
+ let occurrences = 0;
74
+ if (replaceAll) {
75
+ occurrences = content.split(oldString).length - 1;
76
+ newContent = content.split(oldString).join(newString);
77
+ } else {
78
+ const index = content.indexOf(oldString);
79
+ occurrences = content.split(oldString).length - 1;
80
+
81
+ if (occurrences > 1) {
82
+ return {
83
+ ok: false,
84
+ error: `Found ${occurrences} occurrences. Use replaceAll: true or provide more context.`,
85
+ };
86
+ }
87
+
88
+ newContent = content.replace(oldString, newString);
89
+ }
90
+
91
+ fs.writeFileSync(filePath, newContent, "utf-8");
92
+
93
+ return {
94
+ ok: true,
95
+ path: filePath,
96
+ replacements: replaceAll ? occurrences : 1,
97
+ };
98
+ } catch (error) {
99
+ log.error(`Error editing file: ${(error as Error).message}`);
100
+ return {
101
+ ok: false,
102
+ error: `Failed to edit file: ${(error as Error).message}`,
103
+ };
104
+ }
105
+ },
106
+ };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * fs_exists - Check if a file or directory exists
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_exists
6
+ * @spanish verificar archivo, comprobar, existe archivo
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace } from "./workspace-guard.ts";
12
+ import * as fs from "node:fs";
13
+
14
+ const log = logger.child("fs-exists");
15
+
16
+ export const fsExistsTool: Tool = {
17
+ name: "fs_exists",
18
+ description: "Check if a file or directory exists. Spanish: verificar archivo, comprobar, existe archivo",
19
+ parameters: {
20
+ type: "object",
21
+ properties: {
22
+ path: {
23
+ type: "string",
24
+ description: "Path to check for existence",
25
+ },
26
+ },
27
+ required: ["path"],
28
+ },
29
+ execute: async (params: Record<string, unknown>, config?: any) => {
30
+ const workspace = getWorkspace(config);
31
+ let filePath: string;
32
+ try {
33
+ filePath = resolveInWorkspace(params.path as string, workspace);
34
+ } catch (e) {
35
+ return { ok: false, error: (e as Error).message };
36
+ }
37
+
38
+ log.debug(`Checking existence: ${filePath}`);
39
+
40
+ try {
41
+ const exists = fs.existsSync(filePath);
42
+ let type: "file" | "directory" | "none" = "none";
43
+
44
+ if (exists) {
45
+ const stats = fs.statSync(filePath);
46
+ type = stats.isDirectory() ? "directory" : "file";
47
+ }
48
+
49
+ return {
50
+ ok: true,
51
+ path: filePath,
52
+ exists,
53
+ type,
54
+ };
55
+ } catch (error) {
56
+ log.error(`Error checking existence: ${(error as Error).message}`);
57
+ return {
58
+ ok: false,
59
+ error: `Failed to check existence: ${(error as Error).message}`,
60
+ };
61
+ }
62
+ },
63
+ };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * fs_glob - Find files matching wildcard patterns
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_glob
6
+ * @spanish buscar archivos, patrón, encontrar archivos
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace, expandPath } from "./workspace-guard.ts";
12
+ import * as fs from "node:fs";
13
+ import * as path from "node:path";
14
+
15
+ const log = logger.child("fs-glob");
16
+
17
+ export const fsGlobTool: Tool = {
18
+ name: "fs_glob",
19
+ description: "Find files matching wildcard patterns. Spanish: buscar archivos, patrón, encontrar archivos",
20
+ parameters: {
21
+ type: "object",
22
+ properties: {
23
+ pattern: {
24
+ type: "string",
25
+ description: "Glob pattern (e.g., '**/*.ts', 'src/**/*.js')",
26
+ },
27
+ basePath: {
28
+ type: "string",
29
+ description: "Base path to search from (default: current directory)",
30
+ },
31
+ },
32
+ required: ["pattern"],
33
+ },
34
+ execute: async (params: Record<string, unknown>, config?: any) => {
35
+ const workspace = getWorkspace(config);
36
+ const rawBase = (params.basePath as string) ?? (workspace ? expandPath(workspace) : ".");
37
+ let base: string;
38
+ try {
39
+ base = resolveInWorkspace(rawBase, workspace);
40
+ } catch (e) {
41
+ return { ok: false, error: (e as Error).message };
42
+ }
43
+ const pattern = params.pattern as string;
44
+
45
+ log.debug(`Globbing: ${pattern} in ${base}`);
46
+
47
+ try {
48
+ const results: string[] = [];
49
+
50
+ function matchGlob(dir: string, pat: string, depth: number): void {
51
+ if (depth > 10) return;
52
+
53
+ const parts = pat.split("/");
54
+ const firstPart = parts[0];
55
+ const remainingParts = parts.slice(1);
56
+
57
+ try {
58
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
59
+
60
+ for (const entry of entries) {
61
+ const fullPath = path.join(dir, entry.name);
62
+
63
+ if (firstPart === "**") {
64
+ if (entry.isDirectory()) {
65
+ matchGlob(fullPath, parts.slice(1).join("/"), depth + 1);
66
+ matchGlob(fullPath, pat, depth + 1);
67
+ }
68
+ if (remainingParts.length === 0 || matchesPattern(entry.name, remainingParts[0])) {
69
+ results.push(fullPath);
70
+ }
71
+ } else if (matchesPattern(entry.name, firstPart)) {
72
+ if (remainingParts.length === 0) {
73
+ results.push(fullPath);
74
+ } else if (entry.isDirectory()) {
75
+ matchGlob(fullPath, remainingParts.join("/"), depth + 1);
76
+ }
77
+ }
78
+ }
79
+ } catch {
80
+ // Ignore permission errors
81
+ }
82
+ }
83
+
84
+ function matchesPattern(name: string, pattern: string): boolean {
85
+ if (pattern === "*") return true;
86
+ if (pattern === "**") return true;
87
+ const regex = new RegExp("^" + pattern.replace(/\*/g, ".*").replace(/\?/g, ".") + "$");
88
+ return regex.test(name);
89
+ }
90
+
91
+ matchGlob(base, pattern, 0);
92
+
93
+ return {
94
+ ok: true,
95
+ pattern,
96
+ basePath: base,
97
+ files: results.slice(0, 100),
98
+ count: results.length,
99
+ };
100
+ } catch (error) {
101
+ log.error(`Error globbing: ${(error as Error).message}`);
102
+ return {
103
+ ok: false,
104
+ error: `Failed to glob: ${(error as Error).message}`,
105
+ };
106
+ }
107
+ },
108
+ };
@@ -0,0 +1,129 @@
1
+ /**
2
+ * fs_list - List files and directories in workspace
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_list
6
+ * @spanish listar archivos, ver carpeta, explorar directorio
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace, expandPath } from "./workspace-guard.ts";
12
+ import * as fs from "node:fs";
13
+ import * as path from "node:path";
14
+
15
+ const log = logger.child("fs-list");
16
+
17
+ export const fsListTool: Tool = {
18
+ name: "fs_list",
19
+ description: "List files and directories in workspace. Spanish: listar archivos, ver carpeta, explorar directorio",
20
+ parameters: {
21
+ type: "object",
22
+ properties: {
23
+ path: {
24
+ type: "string",
25
+ description: "Path to the directory to list (default: current directory)",
26
+ },
27
+ recursive: {
28
+ type: "boolean",
29
+ description: "List recursively (default: false)",
30
+ },
31
+ maxDepth: {
32
+ type: "number",
33
+ description: "Maximum depth for recursive listing (default: 3)",
34
+ },
35
+ },
36
+ required: [],
37
+ },
38
+ execute: async (params: Record<string, unknown>, config?: any) => {
39
+ const workspace = getWorkspace(config);
40
+ // Default to workspace root when no path given and workspace is configured
41
+ const rawPath = (params.path as string) ?? (workspace ? expandPath(workspace) : ".");
42
+ let dirPath: string;
43
+ try {
44
+ dirPath = resolveInWorkspace(rawPath, workspace);
45
+ } catch (e) {
46
+ return { ok: false, error: (e as Error).message };
47
+ }
48
+ const recursive = (params.recursive as boolean) ?? false;
49
+ const maxDepth = (params.maxDepth as number) ?? 3;
50
+
51
+ log.debug(`Listing directory: ${dirPath}`);
52
+
53
+ try {
54
+ if (!fs.existsSync(dirPath)) {
55
+ return {
56
+ ok: false,
57
+ error: `Directory not found: ${dirPath}`,
58
+ };
59
+ }
60
+
61
+ const stats = fs.statSync(dirPath);
62
+ if (!stats.isDirectory()) {
63
+ return {
64
+ ok: false,
65
+ error: `Not a directory: ${dirPath}`,
66
+ };
67
+ }
68
+
69
+ interface FileEntry {
70
+ name: string;
71
+ type: "file" | "directory";
72
+ path: string;
73
+ size?: number;
74
+ modified?: string;
75
+ children?: FileEntry[];
76
+ }
77
+
78
+ function listDir(dir: string, depth: number): FileEntry[] {
79
+ if (depth > maxDepth) return [];
80
+
81
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
82
+ return entries.map((entry) => {
83
+ const fullPath = path.join(dir, entry.name);
84
+ const result: FileEntry = {
85
+ name: entry.name,
86
+ type: entry.isDirectory() ? "directory" : "file",
87
+ path: fullPath,
88
+ };
89
+
90
+ if (entry.isDirectory() && recursive && depth < maxDepth) {
91
+ try {
92
+ const subStats = fs.statSync(fullPath);
93
+ result.size = subStats.size;
94
+ result.modified = subStats.mtime.toISOString();
95
+ result.children = listDir(fullPath, depth + 1);
96
+ } catch {
97
+ // Ignore permission errors
98
+ }
99
+ } else {
100
+ try {
101
+ const subStats = fs.statSync(fullPath);
102
+ result.size = subStats.size;
103
+ result.modified = subStats.mtime.toISOString();
104
+ } catch {
105
+ // Ignore permission errors
106
+ }
107
+ }
108
+
109
+ return result;
110
+ });
111
+ }
112
+
113
+ const entries = listDir(dirPath, 0);
114
+
115
+ return {
116
+ ok: true,
117
+ path: dirPath,
118
+ entries,
119
+ count: entries.length,
120
+ };
121
+ } catch (error) {
122
+ log.error(`Error listing directory: ${(error as Error).message}`);
123
+ return {
124
+ ok: false,
125
+ error: `Failed to list directory: ${(error as Error).message}`,
126
+ };
127
+ }
128
+ },
129
+ };
@@ -0,0 +1,72 @@
1
+ /**
2
+ * fs_read - Read file content from agent workspace
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_read
6
+ * @spanish leer archivo, ver contenido, abrir archivo
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace } from "./workspace-guard.ts";
12
+
13
+ const log = logger.child("fs-read");
14
+
15
+ export const fsReadTool: Tool = {
16
+ name: "fs_read",
17
+ description: "Read file content from agent workspace. Spanish: leer archivo, ver contenido, abrir archivo",
18
+ parameters: {
19
+ type: "object",
20
+ properties: {
21
+ path: {
22
+ type: "string",
23
+ description: "Path to the file to read",
24
+ },
25
+ offset: {
26
+ type: "number",
27
+ description: "Line number to start reading from (1-indexed, default: 1)",
28
+ },
29
+ limit: {
30
+ type: "number",
31
+ description: "Maximum number of lines to read (default: 2000)",
32
+ },
33
+ },
34
+ required: ["path"],
35
+ },
36
+ execute: async (params: Record<string, unknown>, config?: any) => {
37
+ const workspace = getWorkspace(config);
38
+ let filePath: string;
39
+ try {
40
+ filePath = resolveInWorkspace(params.path as string, workspace);
41
+ } catch (e) {
42
+ return { ok: false, error: (e as Error).message };
43
+ }
44
+ const offset = (params.offset as number) ?? 1;
45
+ const limit = (params.limit as number) ?? 2000;
46
+
47
+ log.debug(`Reading file: ${filePath}`);
48
+
49
+ try {
50
+ const content = await Bun.file(filePath).text();
51
+ const lines = content.split("\n");
52
+
53
+ const start = Math.max(0, offset - 1);
54
+ const end = Math.min(lines.length, start + limit);
55
+ const selected = lines.slice(start, end);
56
+
57
+ return {
58
+ ok: true,
59
+ path: filePath,
60
+ content: selected.map((line, i) => `${start + i + 1}: ${line}`).join("\n"),
61
+ totalLines: lines.length,
62
+ linesRead: selected.length,
63
+ };
64
+ } catch (error) {
65
+ log.error(`Error reading file: ${(error as Error).message}`);
66
+ return {
67
+ ok: false,
68
+ error: `Failed to read file: ${(error as Error).message}`,
69
+ };
70
+ }
71
+ },
72
+ };
@@ -0,0 +1,67 @@
1
+ /**
2
+ * fs_write - Create or overwrite file in agent workspace
3
+ *
4
+ * @category filesystem
5
+ * @seedId fs_write
6
+ * @spanish crear archivo, guardar archivo, escribir archivo
7
+ */
8
+
9
+ import type { Tool } from "../types.ts";
10
+ import { logger } from "../../utils/logger.ts";
11
+ import { resolveInWorkspace, getWorkspace } from "./workspace-guard.ts";
12
+ import * as path from "node:path";
13
+ import * as fs from "node:fs";
14
+
15
+ const log = logger.child("fs-write");
16
+
17
+ export const fsWriteTool: Tool = {
18
+ name: "fs_write",
19
+ description: "Create or overwrite file in agent workspace. Spanish: crear archivo, guardar archivo, escribir archivo",
20
+ parameters: {
21
+ type: "object",
22
+ properties: {
23
+ path: {
24
+ type: "string",
25
+ description: "Path to the file to write",
26
+ },
27
+ content: {
28
+ type: "string",
29
+ description: "Content to write to the file",
30
+ },
31
+ },
32
+ required: ["path", "content"],
33
+ },
34
+ execute: async (params: Record<string, unknown>, config?: any) => {
35
+ const workspace = getWorkspace(config);
36
+ let filePath: string;
37
+ try {
38
+ filePath = resolveInWorkspace(params.path as string, workspace);
39
+ } catch (e) {
40
+ return { ok: false, error: (e as Error).message };
41
+ }
42
+ const content = params.content as string;
43
+
44
+ log.debug(`Writing file: ${filePath}`);
45
+
46
+ try {
47
+ const dir = path.dirname(filePath);
48
+ if (!fs.existsSync(dir)) {
49
+ fs.mkdirSync(dir, { recursive: true });
50
+ }
51
+
52
+ await Bun.write(filePath, content);
53
+
54
+ return {
55
+ ok: true,
56
+ path: filePath,
57
+ bytesWritten: content.length,
58
+ };
59
+ } catch (error) {
60
+ log.error(`Error writing file: ${(error as Error).message}`);
61
+ return {
62
+ ok: false,
63
+ error: `Failed to write file: ${(error as Error).message}`,
64
+ };
65
+ }
66
+ },
67
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Filesystem Tools - 7 tools
3
+ *
4
+ * @category filesystem
5
+ */
6
+
7
+ import type { Tool } from "../types.ts";
8
+ import { fsReadTool } from "./fs-read.ts";
9
+ import { fsWriteTool } from "./fs-write.ts";
10
+ import { fsEditTool } from "./fs-edit.ts";
11
+ import { fsDeleteTool } from "./fs-delete.ts";
12
+ import { fsListTool } from "./fs-list.ts";
13
+ import { fsGlobTool } from "./fs-glob.ts";
14
+ import { fsExistsTool } from "./fs-exists.ts";
15
+
16
+ export function createTools(): Tool[] {
17
+ return [
18
+ fsReadTool,
19
+ fsWriteTool,
20
+ fsEditTool,
21
+ fsDeleteTool,
22
+ fsListTool,
23
+ fsGlobTool,
24
+ fsExistsTool,
25
+ ];
26
+ }
27
+
28
+ export * from "./fs-read.ts";
29
+ export * from "./fs-write.ts";
30
+ export * from "./fs-edit.ts";
31
+ export * from "./fs-delete.ts";
32
+ export * from "./fs-list.ts";
33
+ export * from "./fs-glob.ts";
34
+ export * from "./fs-exists.ts";