whale-code 6.5.5 → 6.5.6

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 (847) hide show
  1. package/README.md +39 -31
  2. package/bin/{swagmanager-mcp.js → whale-code.js} +17 -2
  3. package/dist/cli/app.js +148 -72
  4. package/dist/cli/app.js.map +1 -0
  5. package/dist/cli/chat/AgentSelector.js +105 -10
  6. package/dist/cli/chat/AgentSelector.js.map +1 -0
  7. package/dist/cli/chat/ChatApp.d.ts +31 -0
  8. package/dist/cli/chat/ChatApp.js +539 -286
  9. package/dist/cli/chat/ChatApp.js.map +1 -0
  10. package/dist/cli/chat/ChatInput.js +1088 -770
  11. package/dist/cli/chat/ChatInput.js.map +1 -0
  12. package/dist/cli/chat/MarkdownText.js +39 -14
  13. package/dist/cli/chat/MarkdownText.js.map +1 -0
  14. package/dist/cli/chat/MemoryManager.js +181 -46
  15. package/dist/cli/chat/MemoryManager.js.map +1 -0
  16. package/dist/cli/chat/MessageList.d.ts +2 -3
  17. package/dist/cli/chat/MessageList.js +186 -45
  18. package/dist/cli/chat/MessageList.js.map +1 -0
  19. package/dist/cli/chat/ModelSelector.js +282 -63
  20. package/dist/cli/chat/ModelSelector.js.map +1 -0
  21. package/dist/cli/chat/NodeManager.js +165 -75
  22. package/dist/cli/chat/NodeManager.js.map +1 -0
  23. package/dist/cli/chat/NodeSelector.js +171 -30
  24. package/dist/cli/chat/NodeSelector.js.map +1 -0
  25. package/dist/cli/chat/PlanApproval.js +281 -57
  26. package/dist/cli/chat/PlanApproval.js.map +1 -0
  27. package/dist/cli/chat/RewindViewer.js +559 -144
  28. package/dist/cli/chat/RewindViewer.js.map +1 -0
  29. package/dist/cli/chat/SessionManager.js +137 -30
  30. package/dist/cli/chat/SessionManager.js.map +1 -0
  31. package/dist/cli/chat/SlashMenu.js +293 -164
  32. package/dist/cli/chat/SlashMenu.js.map +1 -0
  33. package/dist/cli/chat/StatusBar.js +172 -9
  34. package/dist/cli/chat/StatusBar.js.map +1 -0
  35. package/dist/cli/chat/StoreSelector.js +147 -18
  36. package/dist/cli/chat/StoreSelector.js.map +1 -0
  37. package/dist/cli/chat/StreamingText.d.ts +1 -5
  38. package/dist/cli/chat/StreamingText.js +22 -7
  39. package/dist/cli/chat/StreamingText.js.map +1 -0
  40. package/dist/cli/chat/SubagentPanel.d.ts +1 -2
  41. package/dist/cli/chat/SubagentPanel.js +612 -72
  42. package/dist/cli/chat/SubagentPanel.js.map +1 -0
  43. package/dist/cli/chat/TeamPanel.d.ts +1 -0
  44. package/dist/cli/chat/TeamPanel.js +230 -30
  45. package/dist/cli/chat/TeamPanel.js.map +1 -0
  46. package/dist/cli/chat/ThemeSelector.js +84 -24
  47. package/dist/cli/chat/ThemeSelector.js.map +1 -0
  48. package/dist/cli/chat/ToolIndicator.js +1476 -371
  49. package/dist/cli/chat/ToolIndicator.js.map +1 -0
  50. package/dist/cli/chat/hooks/useAgentLoop.d.ts +1 -0
  51. package/dist/cli/chat/hooks/useAgentLoop.js +481 -367
  52. package/dist/cli/chat/hooks/useAgentLoop.js.map +1 -0
  53. package/dist/cli/chat/hooks/useSlashCommands.d.ts +3 -14
  54. package/dist/cli/chat/hooks/useSlashCommands.js +744 -572
  55. package/dist/cli/chat/hooks/useSlashCommands.js.map +1 -0
  56. package/dist/cli/commands/config-cmd.js +56 -57
  57. package/dist/cli/commands/config-cmd.js.map +1 -0
  58. package/dist/cli/commands/db.js +184 -169
  59. package/dist/cli/commands/db.js.map +1 -0
  60. package/dist/cli/commands/doctor.js +212 -122
  61. package/dist/cli/commands/doctor.js.map +1 -0
  62. package/dist/cli/commands/init.js +211 -244
  63. package/dist/cli/commands/init.js.map +1 -0
  64. package/dist/cli/commands/mcp.js +127 -122
  65. package/dist/cli/commands/mcp.js.map +1 -0
  66. package/dist/cli/login/LoginApp.js +355 -141
  67. package/dist/cli/login/LoginApp.js.map +1 -0
  68. package/dist/cli/print-mode.js +196 -177
  69. package/dist/cli/print-mode.js.map +1 -0
  70. package/dist/cli/serve-mode.js +615 -530
  71. package/dist/cli/serve-mode.js.map +1 -0
  72. package/dist/cli/services/agent-config.d.ts +5 -1
  73. package/dist/cli/services/agent-config.js +66 -36
  74. package/dist/cli/services/agent-config.js.map +1 -0
  75. package/dist/cli/services/agent-definitions.d.ts +4 -1
  76. package/dist/cli/services/agent-definitions.js +97 -56
  77. package/dist/cli/services/agent-definitions.js.map +1 -0
  78. package/dist/cli/services/agent-events.js +225 -162
  79. package/dist/cli/services/agent-events.js.map +1 -0
  80. package/dist/cli/services/agent-loop.js +976 -688
  81. package/dist/cli/services/agent-loop.js.map +1 -0
  82. package/dist/cli/services/agent-worker-base.d.ts +35 -5
  83. package/dist/cli/services/agent-worker-base.js +337 -153
  84. package/dist/cli/services/agent-worker-base.js.map +1 -0
  85. package/dist/cli/services/api-retry.js +69 -64
  86. package/dist/cli/services/api-retry.js.map +1 -0
  87. package/dist/cli/services/auth-service.d.ts +3 -3
  88. package/dist/cli/services/auth-service.js +209 -132
  89. package/dist/cli/services/auth-service.js.map +1 -0
  90. package/dist/cli/services/background-processes.js +343 -267
  91. package/dist/cli/services/background-processes.js.map +1 -0
  92. package/dist/cli/services/browser-auth.d.ts +2 -2
  93. package/dist/cli/services/browser-auth.js +159 -118
  94. package/dist/cli/services/browser-auth.js.map +1 -0
  95. package/dist/cli/services/claude-md-loader.js +40 -36
  96. package/dist/cli/services/claude-md-loader.js.map +1 -0
  97. package/dist/cli/services/config-store.d.ts +9 -4
  98. package/dist/cli/services/config-store.js +164 -117
  99. package/dist/cli/services/config-store.js.map +1 -0
  100. package/dist/cli/services/debug-log.d.ts +1 -1
  101. package/dist/cli/services/debug-log.js +34 -35
  102. package/dist/cli/services/debug-log.js.map +1 -0
  103. package/dist/cli/services/env-detect.d.ts +7 -0
  104. package/dist/cli/services/env-detect.js +9 -0
  105. package/dist/cli/services/env-detect.js.map +1 -0
  106. package/dist/cli/services/error-logger.js +187 -169
  107. package/dist/cli/services/error-logger.js.map +1 -0
  108. package/dist/cli/services/file-history.d.ts +1 -1
  109. package/dist/cli/services/file-history.js +50 -54
  110. package/dist/cli/services/file-history.js.map +1 -0
  111. package/dist/cli/services/format-server-response.js +332 -372
  112. package/dist/cli/services/format-server-response.js.map +1 -0
  113. package/dist/cli/services/git-context.js +61 -45
  114. package/dist/cli/services/git-context.js.map +1 -0
  115. package/dist/cli/services/hooks.d.ts +2 -2
  116. package/dist/cli/services/hooks.js +195 -180
  117. package/dist/cli/services/hooks.js.map +1 -0
  118. package/dist/cli/services/ink-incremental.d.ts +19 -0
  119. package/dist/cli/services/ink-incremental.js +59 -0
  120. package/dist/cli/services/ink-incremental.js.map +1 -0
  121. package/dist/cli/services/ink-resize-fix.js +54 -44
  122. package/dist/cli/services/ink-resize-fix.js.map +1 -0
  123. package/dist/cli/services/ink-sync-output.d.ts +12 -0
  124. package/dist/cli/services/ink-sync-output.js +16 -0
  125. package/dist/cli/services/ink-sync-output.js.map +1 -0
  126. package/dist/cli/services/interactive-tools.js +268 -212
  127. package/dist/cli/services/interactive-tools.js.map +1 -0
  128. package/dist/cli/services/keybinding-manager.d.ts +11 -1
  129. package/dist/cli/services/keybinding-manager.js +126 -63
  130. package/dist/cli/services/keybinding-manager.js.map +1 -0
  131. package/dist/cli/services/local-tools.d.ts +1 -1
  132. package/dist/cli/services/local-tools.js +939 -656
  133. package/dist/cli/services/local-tools.js.map +1 -0
  134. package/dist/cli/services/lsp-manager.js +757 -594
  135. package/dist/cli/services/lsp-manager.js.map +1 -0
  136. package/dist/cli/services/mcp-client.d.ts +1 -1
  137. package/dist/cli/services/mcp-client.js +173 -134
  138. package/dist/cli/services/mcp-client.js.map +1 -0
  139. package/dist/cli/services/memory-manager.js +53 -40
  140. package/dist/cli/services/memory-manager.js.map +1 -0
  141. package/dist/cli/services/model-manager.js +55 -40
  142. package/dist/cli/services/model-manager.js.map +1 -0
  143. package/dist/cli/services/model-router.js +115 -85
  144. package/dist/cli/services/model-router.js.map +1 -0
  145. package/dist/cli/services/paths.d.ts +30 -0
  146. package/dist/cli/services/paths.js +81 -0
  147. package/dist/cli/services/paths.js.map +1 -0
  148. package/dist/cli/services/permission-modes.js +32 -25
  149. package/dist/cli/services/permission-modes.js.map +1 -0
  150. package/dist/cli/services/rewind.js +182 -168
  151. package/dist/cli/services/rewind.js.map +1 -0
  152. package/dist/cli/services/ripgrep.js +115 -115
  153. package/dist/cli/services/ripgrep.js.map +1 -0
  154. package/dist/cli/services/sandbox.d.ts +1 -1
  155. package/dist/cli/services/sandbox.js +58 -37
  156. package/dist/cli/services/sandbox.js.map +1 -0
  157. package/dist/cli/services/server-tools.js +738 -565
  158. package/dist/cli/services/server-tools.js.map +1 -0
  159. package/dist/cli/services/session-persistence.js +69 -74
  160. package/dist/cli/services/session-persistence.js.map +1 -0
  161. package/dist/cli/services/subagent-worker.js +42 -27
  162. package/dist/cli/services/subagent-worker.js.map +1 -0
  163. package/dist/cli/services/subagent.d.ts +2 -0
  164. package/dist/cli/services/subagent.js +605 -433
  165. package/dist/cli/services/subagent.js.map +1 -0
  166. package/dist/cli/services/system-prompt.js +86 -78
  167. package/dist/cli/services/system-prompt.js.map +1 -0
  168. package/dist/cli/services/task-decomposer.d.ts +1 -1
  169. package/dist/cli/services/task-decomposer.js +172 -139
  170. package/dist/cli/services/task-decomposer.js.map +1 -0
  171. package/dist/cli/services/team-lead.d.ts +2 -2
  172. package/dist/cli/services/team-lead.js +727 -529
  173. package/dist/cli/services/team-lead.js.map +1 -0
  174. package/dist/cli/services/team-state.js +319 -319
  175. package/dist/cli/services/team-state.js.map +1 -0
  176. package/dist/cli/services/teammate.d.ts +8 -2
  177. package/dist/cli/services/teammate.js +857 -569
  178. package/dist/cli/services/teammate.js.map +1 -0
  179. package/dist/cli/services/telemetry.d.ts +6 -1
  180. package/dist/cli/services/telemetry.js +180 -157
  181. package/dist/cli/services/telemetry.js.map +1 -0
  182. package/dist/cli/services/tools/agent-tools.d.ts +3 -3
  183. package/dist/cli/services/tools/agent-tools.js +480 -322
  184. package/dist/cli/services/tools/agent-tools.js.map +1 -0
  185. package/dist/cli/services/tools/file-ops.js +563 -450
  186. package/dist/cli/services/tools/file-ops.js.map +1 -0
  187. package/dist/cli/services/tools/search-tools.js +231 -162
  188. package/dist/cli/services/tools/search-tools.js.map +1 -0
  189. package/dist/cli/services/tools/shell-exec.js +197 -151
  190. package/dist/cli/services/tools/shell-exec.js.map +1 -0
  191. package/dist/cli/services/tools/task-manager.js +206 -173
  192. package/dist/cli/services/tools/task-manager.js.map +1 -0
  193. package/dist/cli/services/tools/web-tools.js +388 -341
  194. package/dist/cli/services/tools/web-tools.js.map +1 -0
  195. package/dist/cli/setup/SetupApp.d.ts +2 -2
  196. package/dist/cli/setup/SetupApp.js +608 -160
  197. package/dist/cli/setup/SetupApp.js.map +1 -0
  198. package/dist/cli/shared/ErrorBoundary.d.ts +22 -0
  199. package/dist/cli/shared/ErrorBoundary.js +73 -0
  200. package/dist/cli/shared/ErrorBoundary.js.map +1 -0
  201. package/dist/cli/shared/MatrixIntro.js +66 -69
  202. package/dist/cli/shared/MatrixIntro.js.map +1 -0
  203. package/dist/cli/shared/SpinnerSlot.d.ts +14 -0
  204. package/dist/cli/shared/SpinnerSlot.js +63 -0
  205. package/dist/cli/shared/SpinnerSlot.js.map +1 -0
  206. package/dist/cli/shared/Theme.d.ts +1 -1
  207. package/dist/cli/shared/Theme.js +136 -92
  208. package/dist/cli/shared/Theme.js.map +1 -0
  209. package/dist/cli/shared/WhaleBanner.js +99 -11
  210. package/dist/cli/shared/WhaleBanner.js.map +1 -0
  211. package/dist/cli/shared/markdown.d.ts +3 -1
  212. package/dist/cli/shared/markdown.js +736 -674
  213. package/dist/cli/shared/markdown.js.map +1 -0
  214. package/dist/cli/shared/marked-terminal.d.js +2 -0
  215. package/dist/cli/shared/marked-terminal.d.js.map +1 -0
  216. package/dist/cli/shared/theme-manager.js +99 -90
  217. package/dist/cli/shared/theme-manager.js.map +1 -0
  218. package/dist/cli/shared/theme-presets.js +256 -254
  219. package/dist/cli/shared/theme-presets.js.map +1 -0
  220. package/dist/cli/status/StatusApp.js +235 -86
  221. package/dist/cli/status/StatusApp.js.map +1 -0
  222. package/dist/cli/stores/StoreApp.js +275 -65
  223. package/dist/cli/stores/StoreApp.js.map +1 -0
  224. package/dist/index.d.ts +2 -2
  225. package/dist/index.js +509 -396
  226. package/dist/index.js.map +1 -0
  227. package/dist/local-agent/connection.d.ts +2 -2
  228. package/dist/local-agent/connection.js +352 -293
  229. package/dist/local-agent/connection.js.map +1 -0
  230. package/dist/local-agent/discovery.js +259 -122
  231. package/dist/local-agent/discovery.js.map +1 -0
  232. package/dist/local-agent/executor.js +216 -193
  233. package/dist/local-agent/executor.js.map +1 -0
  234. package/dist/local-agent/index.d.ts +2 -2
  235. package/dist/local-agent/index.js +156 -156
  236. package/dist/local-agent/index.js.map +1 -0
  237. package/dist/node/adapters/base.js +18 -8
  238. package/dist/node/adapters/base.js.map +1 -0
  239. package/dist/node/adapters/discord.js +286 -275
  240. package/dist/node/adapters/discord.js.map +1 -0
  241. package/dist/node/adapters/email.js +189 -202
  242. package/dist/node/adapters/email.js.map +1 -0
  243. package/dist/node/adapters/imessage.js +145 -142
  244. package/dist/node/adapters/imessage.js.map +1 -0
  245. package/dist/node/adapters/slack.js +237 -236
  246. package/dist/node/adapters/slack.js.map +1 -0
  247. package/dist/node/adapters/sms.js +149 -151
  248. package/dist/node/adapters/sms.js.map +1 -0
  249. package/dist/node/adapters/telegram.js +88 -92
  250. package/dist/node/adapters/telegram.js.map +1 -0
  251. package/dist/node/adapters/webchat.js +160 -136
  252. package/dist/node/adapters/webchat.js.map +1 -0
  253. package/dist/node/adapters/whatsapp.js +212 -215
  254. package/dist/node/adapters/whatsapp.js.map +1 -0
  255. package/dist/node/cli.js +884 -653
  256. package/dist/node/cli.js.map +1 -0
  257. package/dist/node/config.js +20 -18
  258. package/dist/node/config.js.map +1 -0
  259. package/dist/node/gateway-client.js +191 -181
  260. package/dist/node/gateway-client.js.map +1 -0
  261. package/dist/node/portal/clipboard.js +161 -130
  262. package/dist/node/portal/clipboard.js.map +1 -0
  263. package/dist/node/portal/discovery.js +51 -45
  264. package/dist/node/portal/discovery.js.map +1 -0
  265. package/dist/node/portal/forward.js +64 -58
  266. package/dist/node/portal/forward.js.map +1 -0
  267. package/dist/node/portal/index.js +246 -221
  268. package/dist/node/portal/index.js.map +1 -0
  269. package/dist/node/portal/multiplexer.js +192 -182
  270. package/dist/node/portal/multiplexer.js.map +1 -0
  271. package/dist/node/portal/permissions.js +102 -70
  272. package/dist/node/portal/permissions.js.map +1 -0
  273. package/dist/node/portal/protocol.js +153 -116
  274. package/dist/node/portal/protocol.js.map +1 -0
  275. package/dist/node/portal/screen.js +80 -69
  276. package/dist/node/portal/screen.js.map +1 -0
  277. package/dist/node/portal/session.js +124 -117
  278. package/dist/node/portal/session.js.map +1 -0
  279. package/dist/node/portal/shell.js +140 -113
  280. package/dist/node/portal/shell.js.map +1 -0
  281. package/dist/node/portal/stream.js +77 -75
  282. package/dist/node/portal/stream.js.map +1 -0
  283. package/dist/node/portal/transfer.js +190 -167
  284. package/dist/node/portal/transfer.js.map +1 -0
  285. package/dist/node/portal/ui.js +124 -99
  286. package/dist/node/portal/ui.js.map +1 -0
  287. package/dist/node/remote-desktop/compile-helper.js +50 -45
  288. package/dist/node/remote-desktop/compile-helper.js.map +1 -0
  289. package/dist/node/remote-desktop/index.js +215 -187
  290. package/dist/node/remote-desktop/index.js.map +1 -0
  291. package/dist/node/remote-desktop/protocol.js +45 -29
  292. package/dist/node/remote-desktop/protocol.js.map +1 -0
  293. package/dist/node/runtime.js +493 -410
  294. package/dist/node/runtime.js.map +1 -0
  295. package/dist/server/handlers/__test-utils__/test-db.js +39 -89
  296. package/dist/server/handlers/__test-utils__/test-db.js.map +1 -0
  297. package/dist/server/handlers/analytics.js +467 -261
  298. package/dist/server/handlers/analytics.js.map +1 -0
  299. package/dist/server/handlers/api-docs.js +1030 -895
  300. package/dist/server/handlers/api-docs.js.map +1 -0
  301. package/dist/server/handlers/api-keys.js +291 -242
  302. package/dist/server/handlers/api-keys.js.map +1 -0
  303. package/dist/server/handlers/billing.js +330 -239
  304. package/dist/server/handlers/billing.js.map +1 -0
  305. package/dist/server/handlers/browser.js +468 -395
  306. package/dist/server/handlers/browser.js.map +1 -0
  307. package/dist/server/handlers/catalog.js +1377 -978
  308. package/dist/server/handlers/catalog.js.map +1 -0
  309. package/dist/server/handlers/clickhouse.js +157 -109
  310. package/dist/server/handlers/clickhouse.js.map +1 -0
  311. package/dist/server/handlers/comms.js +1439 -984
  312. package/dist/server/handlers/comms.js.map +1 -0
  313. package/dist/server/handlers/creations.js +461 -394
  314. package/dist/server/handlers/creations.js.map +1 -0
  315. package/dist/server/handlers/crm.js +1082 -791
  316. package/dist/server/handlers/crm.js.map +1 -0
  317. package/dist/server/handlers/discovery.js +251 -232
  318. package/dist/server/handlers/discovery.js.map +1 -0
  319. package/dist/server/handlers/embeddings.js +241 -164
  320. package/dist/server/handlers/embeddings.js.map +1 -0
  321. package/dist/server/handlers/enrichment.js +887 -718
  322. package/dist/server/handlers/enrichment.js.map +1 -0
  323. package/dist/server/handlers/image-gen.js +467 -376
  324. package/dist/server/handlers/image-gen.js.map +1 -0
  325. package/dist/server/handlers/inventory.js +797 -424
  326. package/dist/server/handlers/inventory.js.map +1 -0
  327. package/dist/server/handlers/kali.js +272 -230
  328. package/dist/server/handlers/kali.js.map +1 -0
  329. package/dist/server/handlers/llm-providers.js +803 -580
  330. package/dist/server/handlers/llm-providers.js.map +1 -0
  331. package/dist/server/handlers/local-agent.js +133 -105
  332. package/dist/server/handlers/local-agent.js.map +1 -0
  333. package/dist/server/handlers/media.js +1179 -857
  334. package/dist/server/handlers/media.js.map +1 -0
  335. package/dist/server/handlers/meta-ads.js +2669 -2093
  336. package/dist/server/handlers/meta-ads.js.map +1 -0
  337. package/dist/server/handlers/nodes.js +1321 -913
  338. package/dist/server/handlers/nodes.js.map +1 -0
  339. package/dist/server/handlers/operations.js +183 -157
  340. package/dist/server/handlers/operations.js.map +1 -0
  341. package/dist/server/handlers/platform.js +346 -210
  342. package/dist/server/handlers/platform.js.map +1 -0
  343. package/dist/server/handlers/remove-bg.js +118 -86
  344. package/dist/server/handlers/remove-bg.js.map +1 -0
  345. package/dist/server/handlers/storefront.js +586 -446
  346. package/dist/server/handlers/storefront.js.map +1 -0
  347. package/dist/server/handlers/supply-chain.js +546 -326
  348. package/dist/server/handlers/supply-chain.js.map +1 -0
  349. package/dist/server/handlers/transcription.js +106 -97
  350. package/dist/server/handlers/transcription.js.map +1 -0
  351. package/dist/server/handlers/video-gen.js +593 -424
  352. package/dist/server/handlers/video-gen.js.map +1 -0
  353. package/dist/server/handlers/voice.js +1458 -1039
  354. package/dist/server/handlers/voice.js.map +1 -0
  355. package/dist/server/handlers/workflow-steps.js +2837 -2116
  356. package/dist/server/handlers/workflow-steps.js.map +1 -0
  357. package/dist/server/handlers/workflows.js +1630 -933
  358. package/dist/server/handlers/workflows.js.map +1 -0
  359. package/dist/server/index.js +3167 -2422
  360. package/dist/server/index.js.map +1 -0
  361. package/dist/server/lib/batch-client.js +471 -409
  362. package/dist/server/lib/batch-client.js.map +1 -0
  363. package/dist/server/lib/clickhouse-buffer.js +118 -104
  364. package/dist/server/lib/clickhouse-buffer.js.map +1 -0
  365. package/dist/server/lib/clickhouse-client.js +107 -107
  366. package/dist/server/lib/clickhouse-client.js.map +1 -0
  367. package/dist/server/lib/coa-renderer.js +1786 -356
  368. package/dist/server/lib/coa-renderer.js.map +1 -0
  369. package/dist/server/lib/code-worker-pool.js +227 -177
  370. package/dist/server/lib/code-worker-pool.js.map +1 -0
  371. package/dist/server/lib/code-worker.js +174 -164
  372. package/dist/server/lib/code-worker.js.map +1 -0
  373. package/dist/server/lib/compaction-service.d.ts +2 -12
  374. package/dist/server/lib/compaction-service.js +74 -184
  375. package/dist/server/lib/compaction-service.js.map +1 -0
  376. package/dist/server/lib/logger.js +36 -24
  377. package/dist/server/lib/logger.js.map +1 -0
  378. package/dist/server/lib/otel.js +101 -80
  379. package/dist/server/lib/otel.js.map +1 -0
  380. package/dist/server/lib/pdf-renderer.js +952 -788
  381. package/dist/server/lib/pdf-renderer.js.map +1 -0
  382. package/dist/server/lib/prompt-sanitizer.js +188 -108
  383. package/dist/server/lib/prompt-sanitizer.js.map +1 -0
  384. package/dist/server/lib/provider-capabilities.js +136 -138
  385. package/dist/server/lib/provider-capabilities.js.map +1 -0
  386. package/dist/server/lib/provider-failover.js +190 -168
  387. package/dist/server/lib/provider-failover.js.map +1 -0
  388. package/dist/server/lib/rate-limiter.js +186 -117
  389. package/dist/server/lib/rate-limiter.js.map +1 -0
  390. package/dist/server/lib/react-pdf-layout.js +551 -382
  391. package/dist/server/lib/react-pdf-layout.js.map +1 -0
  392. package/dist/server/lib/server-agent-loop.d.ts +4 -1
  393. package/dist/server/lib/server-agent-loop.js +906 -634
  394. package/dist/server/lib/server-agent-loop.js.map +1 -0
  395. package/dist/server/lib/server-subagent.js +260 -164
  396. package/dist/server/lib/server-subagent.js.map +1 -0
  397. package/dist/server/lib/session-checkpoint.js +105 -96
  398. package/dist/server/lib/session-checkpoint.js.map +1 -0
  399. package/dist/server/lib/ssrf-guard.js +193 -184
  400. package/dist/server/lib/ssrf-guard.js.map +1 -0
  401. package/dist/server/lib/supabase-client.js +94 -82
  402. package/dist/server/lib/supabase-client.js.map +1 -0
  403. package/dist/server/lib/template-resolver.js +154 -176
  404. package/dist/server/lib/template-resolver.js.map +1 -0
  405. package/dist/server/lib/utils.js +242 -133
  406. package/dist/server/lib/utils.js.map +1 -0
  407. package/dist/server/local-agent-gateway.d.ts +2 -2
  408. package/dist/server/local-agent-gateway.js +785 -627
  409. package/dist/server/local-agent-gateway.js.map +1 -0
  410. package/dist/server/providers/anthropic.js +250 -172
  411. package/dist/server/providers/anthropic.js.map +1 -0
  412. package/dist/server/providers/bedrock.js +217 -158
  413. package/dist/server/providers/bedrock.js.map +1 -0
  414. package/dist/server/providers/gemini.js +548 -418
  415. package/dist/server/providers/gemini.js.map +1 -0
  416. package/dist/server/providers/openai.js +571 -437
  417. package/dist/server/providers/openai.js.map +1 -0
  418. package/dist/server/providers/registry.js +23 -18
  419. package/dist/server/providers/registry.js.map +1 -0
  420. package/dist/server/providers/shared.js +123 -95
  421. package/dist/server/providers/shared.js.map +1 -0
  422. package/dist/server/providers/types.js +1 -11
  423. package/dist/server/providers/types.js.map +1 -0
  424. package/dist/server/proxy-handlers.js +209 -165
  425. package/dist/server/proxy-handlers.js.map +1 -0
  426. package/dist/server/tool-router.js +959 -599
  427. package/dist/server/tool-router.js.map +1 -0
  428. package/dist/server/validation.js +248 -188
  429. package/dist/server/validation.js.map +1 -0
  430. package/dist/server/worker.js +202 -133
  431. package/dist/server/worker.js.map +1 -0
  432. package/dist/setup.d.ts +2 -2
  433. package/dist/setup.js +151 -147
  434. package/dist/setup.js.map +1 -0
  435. package/dist/shared/agent-core.d.ts +115 -26
  436. package/dist/shared/agent-core.js +956 -522
  437. package/dist/shared/agent-core.js.map +1 -0
  438. package/dist/shared/anthropic-types.js +1 -6
  439. package/dist/shared/anthropic-types.js.map +1 -0
  440. package/dist/shared/api-client.d.ts +16 -9
  441. package/dist/shared/api-client.js +419 -327
  442. package/dist/shared/api-client.js.map +1 -0
  443. package/dist/shared/compaction.d.ts +36 -0
  444. package/dist/shared/compaction.js +138 -0
  445. package/dist/shared/compaction.js.map +1 -0
  446. package/dist/shared/constants.js +67 -64
  447. package/dist/shared/constants.js.map +1 -0
  448. package/dist/shared/sse-parser.js +221 -219
  449. package/dist/shared/sse-parser.js.map +1 -0
  450. package/dist/shared/tool-dispatch.d.ts +4 -0
  451. package/dist/shared/tool-dispatch.js +226 -165
  452. package/dist/shared/tool-dispatch.js.map +1 -0
  453. package/dist/shared/types.js +1 -6
  454. package/dist/shared/types.js.map +1 -0
  455. package/dist/types/cli-highlight.d.js +2 -0
  456. package/dist/types/cli-highlight.d.js.map +1 -0
  457. package/dist/types/diff.d.js +2 -0
  458. package/dist/types/diff.d.js.map +1 -0
  459. package/dist/types/pdf-parse.d.js +2 -0
  460. package/dist/types/pdf-parse.d.js.map +1 -0
  461. package/dist/updater.d.ts +1 -1
  462. package/dist/updater.js +118 -92
  463. package/dist/updater.js.map +1 -0
  464. package/dist/webchat/widget.js +227 -380
  465. package/dist/webchat/widget.js.map +1 -0
  466. package/package.json +22 -10
  467. package/vendor/ink/build/ansi-tokenizer.d.ts +38 -0
  468. package/vendor/ink/build/ansi-tokenizer.js +316 -0
  469. package/vendor/ink/build/ansi-tokenizer.js.map +1 -0
  470. package/vendor/ink/build/apply-styles.js +175 -0
  471. package/vendor/ink/build/build-layout.js +77 -0
  472. package/vendor/ink/build/calculate-wrapped-text.js +53 -0
  473. package/vendor/ink/build/colorize.d.ts +3 -0
  474. package/vendor/ink/build/colorize.js +48 -0
  475. package/vendor/ink/build/colorize.js.map +1 -0
  476. package/vendor/ink/build/components/AccessibilityContext.d.ts +3 -0
  477. package/vendor/ink/build/components/AccessibilityContext.js +5 -0
  478. package/vendor/ink/build/components/AccessibilityContext.js.map +1 -0
  479. package/vendor/ink/build/components/App.d.ts +18 -0
  480. package/vendor/ink/build/components/App.js +351 -0
  481. package/vendor/ink/build/components/App.js.map +1 -0
  482. package/vendor/ink/build/components/AppContext.d.ts +15 -0
  483. package/vendor/ink/build/components/AppContext.js +11 -0
  484. package/vendor/ink/build/components/AppContext.js.map +1 -0
  485. package/vendor/ink/build/components/BackgroundContext.d.ts +4 -0
  486. package/vendor/ink/build/components/BackgroundContext.js +3 -0
  487. package/vendor/ink/build/components/BackgroundContext.js.map +1 -0
  488. package/vendor/ink/build/components/Box.d.ts +117 -0
  489. package/vendor/ink/build/components/Box.js +34 -0
  490. package/vendor/ink/build/components/Box.js.map +1 -0
  491. package/vendor/ink/build/components/Color.js +62 -0
  492. package/vendor/ink/build/components/Cursor.d.ts +83 -0
  493. package/vendor/ink/build/components/Cursor.js +53 -0
  494. package/vendor/ink/build/components/Cursor.js.map +1 -0
  495. package/vendor/ink/build/components/CursorContext.d.ts +11 -0
  496. package/vendor/ink/build/components/CursorContext.js +8 -0
  497. package/vendor/ink/build/components/CursorContext.js.map +1 -0
  498. package/vendor/ink/build/components/ErrorBoundary.d.ts +18 -0
  499. package/vendor/ink/build/components/ErrorBoundary.js +23 -0
  500. package/vendor/ink/build/components/ErrorBoundary.js.map +1 -0
  501. package/vendor/ink/build/components/ErrorOverview.d.ts +6 -0
  502. package/vendor/ink/build/components/ErrorOverview.js +84 -0
  503. package/vendor/ink/build/components/ErrorOverview.js.map +1 -0
  504. package/vendor/ink/build/components/FocusContext.d.ts +16 -0
  505. package/vendor/ink/build/components/FocusContext.js +17 -0
  506. package/vendor/ink/build/components/FocusContext.js.map +1 -0
  507. package/vendor/ink/build/components/Newline.d.ts +13 -0
  508. package/vendor/ink/build/components/Newline.js +8 -0
  509. package/vendor/ink/build/components/Newline.js.map +1 -0
  510. package/vendor/ink/build/components/Spacer.d.ts +7 -0
  511. package/vendor/ink/build/components/Spacer.js +11 -0
  512. package/vendor/ink/build/components/Spacer.js.map +1 -0
  513. package/vendor/ink/build/components/Static.d.ts +24 -0
  514. package/vendor/ink/build/components/Static.js +28 -0
  515. package/vendor/ink/build/components/Static.js.map +1 -0
  516. package/vendor/ink/build/components/StderrContext.d.ts +15 -0
  517. package/vendor/ink/build/components/StderrContext.js +13 -0
  518. package/vendor/ink/build/components/StderrContext.js.map +1 -0
  519. package/vendor/ink/build/components/StdinContext.d.ts +22 -0
  520. package/vendor/ink/build/components/StdinContext.js +19 -0
  521. package/vendor/ink/build/components/StdinContext.js.map +1 -0
  522. package/vendor/ink/build/components/StdoutContext.d.ts +15 -0
  523. package/vendor/ink/build/components/StdoutContext.js +13 -0
  524. package/vendor/ink/build/components/StdoutContext.js.map +1 -0
  525. package/vendor/ink/build/components/Text.d.ts +55 -0
  526. package/vendor/ink/build/components/Text.js +50 -0
  527. package/vendor/ink/build/components/Text.js.map +1 -0
  528. package/vendor/ink/build/components/Transform.d.ts +16 -0
  529. package/vendor/ink/build/components/Transform.js +15 -0
  530. package/vendor/ink/build/components/Transform.js.map +1 -0
  531. package/vendor/ink/build/cursor-helpers.d.ts +38 -0
  532. package/vendor/ink/build/cursor-helpers.js +56 -0
  533. package/vendor/ink/build/cursor-helpers.js.map +1 -0
  534. package/vendor/ink/build/devtools-window-polyfill.d.ts +1 -0
  535. package/vendor/ink/build/devtools-window-polyfill.js +65 -0
  536. package/vendor/ink/build/devtools-window-polyfill.js.map +1 -0
  537. package/vendor/ink/build/devtools.d.ts +1 -0
  538. package/vendor/ink/build/devtools.js +11 -0
  539. package/vendor/ink/build/devtools.js.map +1 -0
  540. package/vendor/ink/build/dom.d.ts +56 -0
  541. package/vendor/ink/build/dom.js +124 -0
  542. package/vendor/ink/build/dom.js.map +1 -0
  543. package/vendor/ink/build/experimental/apply-style.js +140 -0
  544. package/vendor/ink/build/experimental/dom.js +123 -0
  545. package/vendor/ink/build/experimental/output.js +91 -0
  546. package/vendor/ink/build/experimental/reconciler.js +141 -0
  547. package/vendor/ink/build/experimental/renderer.js +81 -0
  548. package/vendor/ink/build/get-max-width.d.ts +3 -0
  549. package/vendor/ink/build/get-max-width.js +10 -0
  550. package/vendor/ink/build/get-max-width.js.map +1 -0
  551. package/vendor/ink/build/hooks/use-app.d.ts +5 -0
  552. package/vendor/ink/build/hooks/use-app.js +8 -0
  553. package/vendor/ink/build/hooks/use-app.js.map +1 -0
  554. package/vendor/ink/build/hooks/use-cursor.d.ts +12 -0
  555. package/vendor/ink/build/hooks/use-cursor.js +29 -0
  556. package/vendor/ink/build/hooks/use-cursor.js.map +1 -0
  557. package/vendor/ink/build/hooks/use-focus-manager.d.ts +28 -0
  558. package/vendor/ink/build/hooks/use-focus-manager.js +17 -0
  559. package/vendor/ink/build/hooks/use-focus-manager.js.map +1 -0
  560. package/vendor/ink/build/hooks/use-focus.d.ts +29 -0
  561. package/vendor/ink/build/hooks/use-focus.js +42 -0
  562. package/vendor/ink/build/hooks/use-focus.js.map +1 -0
  563. package/vendor/ink/build/hooks/use-input.d.ts +131 -0
  564. package/vendor/ink/build/hooks/use-input.js +124 -0
  565. package/vendor/ink/build/hooks/use-input.js.map +1 -0
  566. package/vendor/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
  567. package/vendor/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
  568. package/vendor/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
  569. package/vendor/ink/build/hooks/use-stderr.d.ts +5 -0
  570. package/vendor/ink/build/hooks/use-stderr.js +8 -0
  571. package/vendor/ink/build/hooks/use-stderr.js.map +1 -0
  572. package/vendor/ink/build/hooks/use-stdin.d.ts +5 -0
  573. package/vendor/ink/build/hooks/use-stdin.js +8 -0
  574. package/vendor/ink/build/hooks/use-stdin.js.map +1 -0
  575. package/vendor/ink/build/hooks/use-stdout.d.ts +5 -0
  576. package/vendor/ink/build/hooks/use-stdout.js +8 -0
  577. package/vendor/ink/build/hooks/use-stdout.js.map +1 -0
  578. package/vendor/ink/build/hooks/useInput.js +38 -0
  579. package/vendor/ink/build/index.d.ts +34 -0
  580. package/vendor/ink/build/index.js +20 -0
  581. package/vendor/ink/build/index.js.map +1 -0
  582. package/vendor/ink/build/ink.d.ts +90 -0
  583. package/vendor/ink/build/ink.js +654 -0
  584. package/vendor/ink/build/ink.js.map +1 -0
  585. package/vendor/ink/build/input-parser.d.ts +7 -0
  586. package/vendor/ink/build/input-parser.js +154 -0
  587. package/vendor/ink/build/input-parser.js.map +1 -0
  588. package/vendor/ink/build/instance.js +205 -0
  589. package/vendor/ink/build/instances.d.ts +3 -0
  590. package/vendor/ink/build/instances.js +8 -0
  591. package/vendor/ink/build/instances.js.map +1 -0
  592. package/vendor/ink/build/kitty-keyboard.d.ts +23 -0
  593. package/vendor/ink/build/kitty-keyboard.js +32 -0
  594. package/vendor/ink/build/kitty-keyboard.js.map +1 -0
  595. package/vendor/ink/build/layout.d.ts +7 -0
  596. package/vendor/ink/build/layout.js +33 -0
  597. package/vendor/ink/build/layout.js.map +1 -0
  598. package/vendor/ink/build/log-update.d.ts +19 -0
  599. package/vendor/ink/build/log-update.js +243 -0
  600. package/vendor/ink/build/log-update.js.map +1 -0
  601. package/vendor/ink/build/measure-element.d.ts +16 -0
  602. package/vendor/ink/build/measure-element.js +9 -0
  603. package/vendor/ink/build/measure-element.js.map +1 -0
  604. package/vendor/ink/build/measure-text.d.ts +6 -0
  605. package/vendor/ink/build/measure-text.js +21 -0
  606. package/vendor/ink/build/measure-text.js.map +1 -0
  607. package/vendor/ink/build/options.d.ts +52 -0
  608. package/vendor/ink/build/options.js +2 -0
  609. package/vendor/ink/build/options.js.map +1 -0
  610. package/vendor/ink/build/output.d.ts +35 -0
  611. package/vendor/ink/build/output.js +183 -0
  612. package/vendor/ink/build/output.js.map +1 -0
  613. package/vendor/ink/build/parse-keypress.d.ts +22 -0
  614. package/vendor/ink/build/parse-keypress.js +493 -0
  615. package/vendor/ink/build/parse-keypress.js.map +1 -0
  616. package/vendor/ink/build/reconciler.d.ts +4 -0
  617. package/vendor/ink/build/reconciler.js +274 -0
  618. package/vendor/ink/build/reconciler.js.map +1 -0
  619. package/vendor/ink/build/render-background.d.ts +4 -0
  620. package/vendor/ink/build/render-background.js +25 -0
  621. package/vendor/ink/build/render-background.js.map +1 -0
  622. package/vendor/ink/build/render-border.d.ts +4 -0
  623. package/vendor/ink/build/render-border.js +73 -0
  624. package/vendor/ink/build/render-border.js.map +1 -0
  625. package/vendor/ink/build/render-node-to-output.d.ts +14 -0
  626. package/vendor/ink/build/render-node-to-output.js +147 -0
  627. package/vendor/ink/build/render-node-to-output.js.map +1 -0
  628. package/vendor/ink/build/render-to-string.d.ts +38 -0
  629. package/vendor/ink/build/render-to-string.js +115 -0
  630. package/vendor/ink/build/render-to-string.js.map +1 -0
  631. package/vendor/ink/build/render.d.ts +121 -0
  632. package/vendor/ink/build/render.js +55 -0
  633. package/vendor/ink/build/render.js.map +1 -0
  634. package/vendor/ink/build/renderer.d.ts +8 -0
  635. package/vendor/ink/build/renderer.js +55 -0
  636. package/vendor/ink/build/renderer.js.map +1 -0
  637. package/vendor/ink/build/sanitize-ansi.d.ts +2 -0
  638. package/vendor/ink/build/sanitize-ansi.js +27 -0
  639. package/vendor/ink/build/sanitize-ansi.js.map +1 -0
  640. package/vendor/ink/build/screen-reader-update.d.ts +13 -0
  641. package/vendor/ink/build/screen-reader-update.js +38 -0
  642. package/vendor/ink/build/screen-reader-update.js.map +1 -0
  643. package/vendor/ink/build/squash-text-nodes.d.ts +3 -0
  644. package/vendor/ink/build/squash-text-nodes.js +36 -0
  645. package/vendor/ink/build/squash-text-nodes.js.map +1 -0
  646. package/vendor/ink/build/styles.d.ts +240 -0
  647. package/vendor/ink/build/styles.js +232 -0
  648. package/vendor/ink/build/styles.js.map +1 -0
  649. package/vendor/ink/build/utils.d.ts +2 -0
  650. package/vendor/ink/build/utils.js +4 -0
  651. package/vendor/ink/build/utils.js.map +1 -0
  652. package/vendor/ink/build/wrap-text.d.ts +3 -0
  653. package/vendor/ink/build/wrap-text.js +31 -0
  654. package/vendor/ink/build/wrap-text.js.map +1 -0
  655. package/vendor/ink/build/write-synchronized.d.ts +4 -0
  656. package/vendor/ink/build/write-synchronized.js +7 -0
  657. package/vendor/ink/build/write-synchronized.js.map +1 -0
  658. package/vendor/ink/license +10 -0
  659. package/vendor/ink/node_modules/@types/node/LICENSE +21 -0
  660. package/vendor/ink/node_modules/@types/node/README.md +15 -0
  661. package/vendor/ink/node_modules/@types/node/assert/strict.d.ts +105 -0
  662. package/vendor/ink/node_modules/@types/node/assert.d.ts +955 -0
  663. package/vendor/ink/node_modules/@types/node/async_hooks.d.ts +623 -0
  664. package/vendor/ink/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  665. package/vendor/ink/node_modules/@types/node/buffer.d.ts +1810 -0
  666. package/vendor/ink/node_modules/@types/node/child_process.d.ts +1428 -0
  667. package/vendor/ink/node_modules/@types/node/cluster.d.ts +486 -0
  668. package/vendor/ink/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  669. package/vendor/ink/node_modules/@types/node/console.d.ts +151 -0
  670. package/vendor/ink/node_modules/@types/node/constants.d.ts +20 -0
  671. package/vendor/ink/node_modules/@types/node/crypto.d.ts +4065 -0
  672. package/vendor/ink/node_modules/@types/node/dgram.d.ts +564 -0
  673. package/vendor/ink/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
  674. package/vendor/ink/node_modules/@types/node/dns/promises.d.ts +503 -0
  675. package/vendor/ink/node_modules/@types/node/dns.d.ts +922 -0
  676. package/vendor/ink/node_modules/@types/node/domain.d.ts +166 -0
  677. package/vendor/ink/node_modules/@types/node/events.d.ts +1054 -0
  678. package/vendor/ink/node_modules/@types/node/fs/promises.d.ts +1329 -0
  679. package/vendor/ink/node_modules/@types/node/fs.d.ts +4676 -0
  680. package/vendor/ink/node_modules/@types/node/globals.d.ts +150 -0
  681. package/vendor/ink/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  682. package/vendor/ink/node_modules/@types/node/http.d.ts +2167 -0
  683. package/vendor/ink/node_modules/@types/node/http2.d.ts +2480 -0
  684. package/vendor/ink/node_modules/@types/node/https.d.ts +405 -0
  685. package/vendor/ink/node_modules/@types/node/index.d.ts +115 -0
  686. package/vendor/ink/node_modules/@types/node/inspector/promises.d.ts +41 -0
  687. package/vendor/ink/node_modules/@types/node/inspector.d.ts +224 -0
  688. package/vendor/ink/node_modules/@types/node/inspector.generated.d.ts +4226 -0
  689. package/vendor/ink/node_modules/@types/node/module.d.ts +819 -0
  690. package/vendor/ink/node_modules/@types/node/net.d.ts +933 -0
  691. package/vendor/ink/node_modules/@types/node/os.d.ts +507 -0
  692. package/vendor/ink/node_modules/@types/node/package.json +155 -0
  693. package/vendor/ink/node_modules/@types/node/path/posix.d.ts +8 -0
  694. package/vendor/ink/node_modules/@types/node/path/win32.d.ts +8 -0
  695. package/vendor/ink/node_modules/@types/node/path.d.ts +187 -0
  696. package/vendor/ink/node_modules/@types/node/perf_hooks.d.ts +643 -0
  697. package/vendor/ink/node_modules/@types/node/process.d.ts +2156 -0
  698. package/vendor/ink/node_modules/@types/node/punycode.d.ts +117 -0
  699. package/vendor/ink/node_modules/@types/node/querystring.d.ts +152 -0
  700. package/vendor/ink/node_modules/@types/node/quic.d.ts +910 -0
  701. package/vendor/ink/node_modules/@types/node/readline/promises.d.ts +161 -0
  702. package/vendor/ink/node_modules/@types/node/readline.d.ts +541 -0
  703. package/vendor/ink/node_modules/@types/node/repl.d.ts +415 -0
  704. package/vendor/ink/node_modules/@types/node/sea.d.ts +162 -0
  705. package/vendor/ink/node_modules/@types/node/sqlite.d.ts +955 -0
  706. package/vendor/ink/node_modules/@types/node/stream/consumers.d.ts +38 -0
  707. package/vendor/ink/node_modules/@types/node/stream/promises.d.ts +211 -0
  708. package/vendor/ink/node_modules/@types/node/stream/web.d.ts +296 -0
  709. package/vendor/ink/node_modules/@types/node/stream.d.ts +1760 -0
  710. package/vendor/ink/node_modules/@types/node/string_decoder.d.ts +67 -0
  711. package/vendor/ink/node_modules/@types/node/test/reporters.d.ts +96 -0
  712. package/vendor/ink/node_modules/@types/node/test.d.ts +2240 -0
  713. package/vendor/ink/node_modules/@types/node/timers/promises.d.ts +108 -0
  714. package/vendor/ink/node_modules/@types/node/timers.d.ts +159 -0
  715. package/vendor/ink/node_modules/@types/node/tls.d.ts +1198 -0
  716. package/vendor/ink/node_modules/@types/node/trace_events.d.ts +197 -0
  717. package/vendor/ink/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  718. package/vendor/ink/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  719. package/vendor/ink/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  720. package/vendor/ink/node_modules/@types/node/ts5.6/index.d.ts +117 -0
  721. package/vendor/ink/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  722. package/vendor/ink/node_modules/@types/node/ts5.7/index.d.ts +117 -0
  723. package/vendor/ink/node_modules/@types/node/tty.d.ts +250 -0
  724. package/vendor/ink/node_modules/@types/node/url.d.ts +519 -0
  725. package/vendor/ink/node_modules/@types/node/util/types.d.ts +558 -0
  726. package/vendor/ink/node_modules/@types/node/util.d.ts +1662 -0
  727. package/vendor/ink/node_modules/@types/node/v8.d.ts +983 -0
  728. package/vendor/ink/node_modules/@types/node/vm.d.ts +1208 -0
  729. package/vendor/ink/node_modules/@types/node/wasi.d.ts +202 -0
  730. package/vendor/ink/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  731. package/vendor/ink/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  732. package/vendor/ink/node_modules/@types/node/web-globals/console.d.ts +9 -0
  733. package/vendor/ink/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  734. package/vendor/ink/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  735. package/vendor/ink/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  736. package/vendor/ink/node_modules/@types/node/web-globals/events.d.ts +106 -0
  737. package/vendor/ink/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  738. package/vendor/ink/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  739. package/vendor/ink/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  740. package/vendor/ink/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  741. package/vendor/ink/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  742. package/vendor/ink/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  743. package/vendor/ink/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  744. package/vendor/ink/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  745. package/vendor/ink/node_modules/@types/node/web-globals/url.d.ts +24 -0
  746. package/vendor/ink/node_modules/@types/node/worker_threads.d.ts +717 -0
  747. package/vendor/ink/node_modules/@types/node/zlib.d.ts +618 -0
  748. package/vendor/ink/node_modules/node-pty/LICENSE +69 -0
  749. package/vendor/ink/node_modules/node-pty/README.md +164 -0
  750. package/vendor/ink/node_modules/node-pty/binding.gyp +150 -0
  751. package/vendor/ink/node_modules/node-pty/lib/conpty_console_list_agent.js +25 -0
  752. package/vendor/ink/node_modules/node-pty/lib/eventEmitter2.js +47 -0
  753. package/vendor/ink/node_modules/node-pty/lib/index.js +52 -0
  754. package/vendor/ink/node_modules/node-pty/lib/interfaces.js +7 -0
  755. package/vendor/ink/node_modules/node-pty/lib/shared/conout.js +11 -0
  756. package/vendor/ink/node_modules/node-pty/lib/terminal.js +190 -0
  757. package/vendor/ink/node_modules/node-pty/lib/types.js +7 -0
  758. package/vendor/ink/node_modules/node-pty/lib/unixTerminal.js +349 -0
  759. package/vendor/ink/node_modules/node-pty/lib/utils.js +39 -0
  760. package/vendor/ink/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
  761. package/vendor/ink/node_modules/node-pty/lib/windowsPtyAgent.js +287 -0
  762. package/vendor/ink/node_modules/node-pty/lib/windowsTerminal.js +201 -0
  763. package/vendor/ink/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  764. package/vendor/ink/node_modules/node-pty/package.json +65 -0
  765. package/vendor/ink/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  766. package/vendor/ink/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  767. package/vendor/ink/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  768. package/vendor/ink/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  769. package/vendor/ink/node_modules/node-pty/prebuilds/linux-arm64/pty.node +0 -0
  770. package/vendor/ink/node_modules/node-pty/prebuilds/linux-x64/pty.node +0 -0
  771. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  772. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  773. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  774. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
  775. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  776. package/vendor/ink/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
  777. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  778. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  779. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  780. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
  781. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  782. package/vendor/ink/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
  783. package/vendor/ink/node_modules/node-pty/scripts/post-install.js +76 -0
  784. package/vendor/ink/node_modules/node-pty/scripts/prebuild.js +34 -0
  785. package/vendor/ink/node_modules/node-pty/src/unix/pty.cc +875 -0
  786. package/vendor/ink/node_modules/node-pty/src/unix/spawn-helper.cc +23 -0
  787. package/vendor/ink/node_modules/node-pty/src/win/conpty.cc +582 -0
  788. package/vendor/ink/node_modules/node-pty/src/win/conpty.h +41 -0
  789. package/vendor/ink/node_modules/node-pty/src/win/conpty_console_list.cc +44 -0
  790. package/vendor/ink/node_modules/node-pty/src/win/path_util.cc +95 -0
  791. package/vendor/ink/node_modules/node-pty/src/win/path_util.h +26 -0
  792. package/vendor/ink/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
  793. package/vendor/ink/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
  794. package/vendor/ink/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
  795. package/vendor/ink/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
  796. package/vendor/ink/node_modules/node-pty/typings/node-pty.d.ts +215 -0
  797. package/vendor/ink/node_modules/undici-types/LICENSE +21 -0
  798. package/vendor/ink/node_modules/undici-types/README.md +6 -0
  799. package/vendor/ink/node_modules/undici-types/agent.d.ts +32 -0
  800. package/vendor/ink/node_modules/undici-types/api.d.ts +43 -0
  801. package/vendor/ink/node_modules/undici-types/balanced-pool.d.ts +30 -0
  802. package/vendor/ink/node_modules/undici-types/cache-interceptor.d.ts +173 -0
  803. package/vendor/ink/node_modules/undici-types/cache.d.ts +36 -0
  804. package/vendor/ink/node_modules/undici-types/client-stats.d.ts +15 -0
  805. package/vendor/ink/node_modules/undici-types/client.d.ts +108 -0
  806. package/vendor/ink/node_modules/undici-types/connector.d.ts +34 -0
  807. package/vendor/ink/node_modules/undici-types/content-type.d.ts +21 -0
  808. package/vendor/ink/node_modules/undici-types/cookies.d.ts +30 -0
  809. package/vendor/ink/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  810. package/vendor/ink/node_modules/undici-types/dispatcher.d.ts +276 -0
  811. package/vendor/ink/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  812. package/vendor/ink/node_modules/undici-types/errors.d.ts +161 -0
  813. package/vendor/ink/node_modules/undici-types/eventsource.d.ts +66 -0
  814. package/vendor/ink/node_modules/undici-types/fetch.d.ts +211 -0
  815. package/vendor/ink/node_modules/undici-types/formdata.d.ts +108 -0
  816. package/vendor/ink/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  817. package/vendor/ink/node_modules/undici-types/global-origin.d.ts +7 -0
  818. package/vendor/ink/node_modules/undici-types/h2c-client.d.ts +73 -0
  819. package/vendor/ink/node_modules/undici-types/handlers.d.ts +15 -0
  820. package/vendor/ink/node_modules/undici-types/header.d.ts +160 -0
  821. package/vendor/ink/node_modules/undici-types/index.d.ts +88 -0
  822. package/vendor/ink/node_modules/undici-types/interceptors.d.ts +73 -0
  823. package/vendor/ink/node_modules/undici-types/mock-agent.d.ts +68 -0
  824. package/vendor/ink/node_modules/undici-types/mock-call-history.d.ts +111 -0
  825. package/vendor/ink/node_modules/undici-types/mock-client.d.ts +27 -0
  826. package/vendor/ink/node_modules/undici-types/mock-errors.d.ts +12 -0
  827. package/vendor/ink/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  828. package/vendor/ink/node_modules/undici-types/mock-pool.d.ts +27 -0
  829. package/vendor/ink/node_modules/undici-types/package.json +55 -0
  830. package/vendor/ink/node_modules/undici-types/patch.d.ts +29 -0
  831. package/vendor/ink/node_modules/undici-types/pool-stats.d.ts +19 -0
  832. package/vendor/ink/node_modules/undici-types/pool.d.ts +41 -0
  833. package/vendor/ink/node_modules/undici-types/proxy-agent.d.ts +29 -0
  834. package/vendor/ink/node_modules/undici-types/readable.d.ts +68 -0
  835. package/vendor/ink/node_modules/undici-types/retry-agent.d.ts +8 -0
  836. package/vendor/ink/node_modules/undici-types/retry-handler.d.ts +125 -0
  837. package/vendor/ink/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  838. package/vendor/ink/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  839. package/vendor/ink/node_modules/undici-types/util.d.ts +18 -0
  840. package/vendor/ink/node_modules/undici-types/utility.d.ts +7 -0
  841. package/vendor/ink/node_modules/undici-types/webidl.d.ts +341 -0
  842. package/vendor/ink/node_modules/undici-types/websocket.d.ts +186 -0
  843. package/vendor/ink/package.json +201 -0
  844. package/vendor/ink/readme.md +2636 -0
  845. package/bin/swag-agent.js +0 -9
  846. package/dist/server/lib/pg-rate-limiter.d.ts +0 -21
  847. package/dist/server/lib/pg-rate-limiter.js +0 -86
@@ -4,8 +4,10 @@
4
4
  * This is a thin facade: tool implementations live in `./tools/`.
5
5
  * All consumers import from this file for backward compatibility.
6
6
  */
7
+
7
8
  // Re-export task persistence API (used by ChatApp, agent-loop)
8
9
  export { loadTodos, setTodoSessionId, getTodoState } from "./tools/task-manager.js";
10
+
9
11
  // Import tool implementations from extracted modules
10
12
  import { readFile, writeFile, editFile, multiEdit, notebookEdit, listDirectory, searchFiles, searchContent, resolvePath } from "./tools/file-ops.js";
11
13
  import { readFileSync, existsSync, statSync } from "fs";
@@ -15,716 +17,997 @@ import { runCommand, bashOutput, killShell, listShellsFn } from "./tools/shell-e
15
17
  import { webFetch, webSearch } from "./tools/web-tools.js";
16
18
  import { tasksTool } from "./tools/task-manager.js";
17
19
  import { taskTool, teamCreateTool, teamAutoTool, taskOutput, taskStop, configTool, askUser, lspTool, skillTool } from "./tools/agent-tools.js";
20
+
21
+ // ============================================================================
22
+ // TYPES
23
+ // ============================================================================
24
+
18
25
  // ============================================================================
19
26
  // TOOL NAMES
20
27
  // ============================================================================
28
+
21
29
  export const LOCAL_TOOL_NAMES = new Set([
22
- // Original
23
- "read_file",
24
- "read_many_files",
25
- "write_file",
26
- "edit_file",
27
- "list_directory",
28
- "search_files",
29
- "search_content",
30
- "run_command",
31
- // New (Claude Code parity)
32
- "glob",
33
- "grep",
34
- "notebook_edit",
35
- "web_fetch",
36
- "tasks", // Replaces todo_write — action-based CRUD with IDs, deps
37
- "multi_edit", // Multi-edit tool
38
- "task", // Subagent tool
39
- "team_create", // Agent team tool (explicit tasks)
40
- "team_auto", // Auto-decompose + parallel team + review
41
- // Background process tools
42
- "bash_output",
43
- "kill_shell",
44
- "list_shells",
45
- // Background task tools (shells + agents)
46
- "task_output",
47
- "task_stop",
48
- // Web search
49
- "web_search",
50
- // Claude Code parity — consolidated tools
51
- "config", // Settings + plan mode
52
- "ask_user", // Structured questions
53
- // Code intelligence
54
- "lsp",
55
- // Skills
56
- "skill",
57
- ]);
30
+ // Original
31
+ "read_file", "read_many_files", "write_file", "edit_file", "list_directory", "search_files", "search_content", "run_command",
32
+ // New (Claude Code parity)
33
+ "glob", "grep", "notebook_edit", "web_fetch", "tasks",
34
+ // Replaces todo_write — action-based CRUD with IDs, deps
35
+ "multi_edit",
36
+ // Multi-edit tool
37
+ "task",
38
+ // Subagent tool
39
+ "team_create",
40
+ // Agent team tool (explicit tasks)
41
+ "team_auto",
42
+ // Auto-decompose + parallel team + review
43
+ // Background process tools
44
+ "bash_output", "kill_shell", "list_shells",
45
+ // Background task tools (shells + agents)
46
+ "task_output", "task_stop",
47
+ // Web search
48
+ "web_search",
49
+ // Claude Code parity — consolidated tools
50
+ "config",
51
+ // Settings + plan mode
52
+ "ask_user",
53
+ // Structured questions
54
+ // Code intelligence
55
+ "lsp",
56
+ // Skills
57
+ "skill"]);
58
58
  export function isLocalTool(name) {
59
- return LOCAL_TOOL_NAMES.has(name);
59
+ return LOCAL_TOOL_NAMES.has(name);
60
60
  }
61
+
61
62
  // ============================================================================
62
63
  // TOOL DEFINITIONS (for Anthropic API)
63
64
  // ============================================================================
65
+
64
66
  export const LOCAL_TOOL_DEFINITIONS = [
65
- // ------------------------------------------------------------------
66
- // ENHANCED ORIGINALS
67
- // ------------------------------------------------------------------
68
- {
69
- name: "read_file",
70
- description: "Read file contents. Supports line-based pagination for large files. Reads images (png/jpg/gif/webp) as visual content. Reads audio files (mp3/wav/aiff/aac/ogg/flac/m4a) as audio content. Extracts text from PDFs. For multiple files, emit all read_file calls in one response — they execute in parallel.",
71
- input_schema: {
72
- type: "object",
73
- properties: {
74
- path: { type: "string", description: "Absolute or relative path to the file" },
75
- offset: { type: "number", description: "Line number to start reading from (1-based). Omit to read from start." },
76
- limit: { type: "number", description: "Max number of lines to read. Omit to read all." },
77
- pages: { type: "string", description: "Page range for PDFs (e.g. '1-5', '3', '10-20'). Only for .pdf files." },
78
- },
79
- required: ["path"],
80
- },
67
+ // ------------------------------------------------------------------
68
+ // ENHANCED ORIGINALS
69
+ // ------------------------------------------------------------------
70
+ {
71
+ name: "read_file",
72
+ description: "Read file contents. Supports line-based pagination for large files. Reads images (png/jpg/gif/webp) as visual content. Reads audio files (mp3/wav/aiff/aac/ogg/flac/m4a) as audio content. Extracts text from PDFs. For multiple files, emit all read_file calls in one response — they execute in parallel. IMPORTANT: when reading files in an unfamiliar directory, first use list_directory or glob to confirm exact paths — do NOT guess paths, especially in projects with nested structures (e.g. Xcode, Gradle).",
73
+ input_schema: {
74
+ type: "object",
75
+ properties: {
76
+ path: {
77
+ type: "string",
78
+ description: "Absolute or relative path to the file"
79
+ },
80
+ offset: {
81
+ type: "number",
82
+ description: "Line number to start reading from (1-based). Omit to read from start."
83
+ },
84
+ limit: {
85
+ type: "number",
86
+ description: "Max number of lines to read. Omit to read all."
87
+ },
88
+ pages: {
89
+ type: "string",
90
+ description: "Page range for PDFs (e.g. '1-5', '3', '10-20'). Only for .pdf files."
91
+ }
81
92
  },
82
- {
83
- name: "read_many_files",
84
- description: "Read multiple files matching glob patterns in a single call. More efficient than multiple read_file calls. Returns concatenated content with file headers. Files >500 lines are truncated to first 100 lines.",
85
- input_schema: {
86
- type: "object",
87
- properties: {
88
- pattern: { type: "string", description: "Glob pattern like 'src/**/*.ts' or '*.json'" },
89
- path: { type: "string", description: "Base directory to search in (defaults to cwd)" },
90
- limit: { type: "number", description: "Max files to read (default 20, max 50)" },
91
- },
92
- required: ["pattern"],
93
- },
93
+ required: ["path"]
94
+ }
95
+ }, {
96
+ name: "read_many_files",
97
+ description: "Read multiple files matching glob patterns in a single call. More efficient than multiple read_file calls. Returns concatenated content with file headers. Files >500 lines are truncated to first 100 lines.",
98
+ input_schema: {
99
+ type: "object",
100
+ properties: {
101
+ pattern: {
102
+ type: "string",
103
+ description: "Glob pattern like 'src/**/*.ts' or '*.json'"
104
+ },
105
+ path: {
106
+ type: "string",
107
+ description: "Base directory to search in (defaults to cwd)"
108
+ },
109
+ limit: {
110
+ type: "number",
111
+ description: "Max files to read (default 20, max 50)"
112
+ }
94
113
  },
95
- {
96
- name: "write_file",
97
- description: "Write content to a file, creating it and parent directories if needed. For multiple independent files, emit all write_file calls in one response.",
98
- input_schema: {
99
- type: "object",
100
- properties: {
101
- path: { type: "string", description: "Absolute or relative path to the file" },
102
- content: { type: "string", description: "Content to write to the file" },
103
- },
104
- required: ["path", "content"],
105
- },
114
+ required: ["pattern"]
115
+ }
116
+ }, {
117
+ name: "write_file",
118
+ description: "Write content to a file, creating it and parent directories if needed. For multiple independent files, emit all write_file calls in one response.",
119
+ input_schema: {
120
+ type: "object",
121
+ properties: {
122
+ path: {
123
+ type: "string",
124
+ description: "Absolute or relative path to the file"
125
+ },
126
+ content: {
127
+ type: "string",
128
+ description: "Content to write to the file"
129
+ }
106
130
  },
107
- {
108
- name: "edit_file",
109
- description: "Edit a file by replacing an exact string match. Supports replacing all occurrences.",
110
- input_schema: {
111
- type: "object",
112
- properties: {
113
- path: { type: "string", description: "Absolute or relative path to the file" },
114
- old_string: { type: "string", description: "Exact text to find in the file" },
115
- new_string: { type: "string", description: "Text to replace old_string with" },
116
- replace_all: { type: "boolean", description: "Replace ALL occurrences (default false — replaces first only)" },
117
- },
118
- required: ["path", "old_string", "new_string"],
119
- },
131
+ required: ["path", "content"]
132
+ }
133
+ }, {
134
+ name: "edit_file",
135
+ description: "Edit a file by replacing an exact string match. Supports replacing all occurrences.",
136
+ input_schema: {
137
+ type: "object",
138
+ properties: {
139
+ path: {
140
+ type: "string",
141
+ description: "Absolute or relative path to the file"
142
+ },
143
+ old_string: {
144
+ type: "string",
145
+ description: "Exact text to find in the file"
146
+ },
147
+ new_string: {
148
+ type: "string",
149
+ description: "Text to replace old_string with"
150
+ },
151
+ replace_all: {
152
+ type: "boolean",
153
+ description: "Replace ALL occurrences (default false — replaces first only)"
154
+ }
120
155
  },
121
- {
122
- name: "list_directory",
123
- description: "List files and directories at the specified path",
124
- input_schema: {
125
- type: "object",
126
- properties: {
127
- path: { type: "string", description: "Absolute or relative path to the directory" },
128
- recursive: { type: "boolean", description: "List recursively (default false, max 200 entries)" },
129
- },
130
- required: ["path"],
131
- },
156
+ required: ["path", "old_string", "new_string"]
157
+ }
158
+ }, {
159
+ name: "list_directory",
160
+ description: "List files and directories at the specified path",
161
+ input_schema: {
162
+ type: "object",
163
+ properties: {
164
+ path: {
165
+ type: "string",
166
+ description: "Absolute or relative path to the directory"
167
+ },
168
+ recursive: {
169
+ type: "boolean",
170
+ description: "List recursively (default false, max 200 entries)"
171
+ }
132
172
  },
133
- {
134
- name: "search_files",
135
- description: "Search for files matching a name pattern using find",
136
- input_schema: {
137
- type: "object",
138
- properties: {
139
- pattern: { type: "string", description: "File name pattern (e.g. *.ts, *.swift)" },
140
- path: { type: "string", description: "Directory to search in" },
141
- },
142
- required: ["pattern", "path"],
143
- },
173
+ required: ["path"]
174
+ }
175
+ }, {
176
+ name: "search_files",
177
+ description: "Search for files matching a name pattern using find",
178
+ input_schema: {
179
+ type: "object",
180
+ properties: {
181
+ pattern: {
182
+ type: "string",
183
+ description: "File name pattern (e.g. *.ts, *.swift)"
184
+ },
185
+ path: {
186
+ type: "string",
187
+ description: "Directory to search in"
188
+ }
144
189
  },
145
- {
146
- name: "search_content",
147
- description: "Search for text content in files (grep-like). For advanced search, use the 'grep' tool.",
148
- input_schema: {
149
- type: "object",
150
- properties: {
151
- query: { type: "string", description: "Text or regex pattern to search for" },
152
- path: { type: "string", description: "Directory to search in" },
153
- file_pattern: { type: "string", description: "Optional file glob filter (e.g. *.ts)" },
154
- },
155
- required: ["query", "path"],
156
- },
190
+ required: ["pattern", "path"]
191
+ }
192
+ }, {
193
+ name: "search_content",
194
+ description: "Search for text content in files (grep-like). For advanced search, use the 'grep' tool.",
195
+ input_schema: {
196
+ type: "object",
197
+ properties: {
198
+ query: {
199
+ type: "string",
200
+ description: "Text or regex pattern to search for"
201
+ },
202
+ path: {
203
+ type: "string",
204
+ description: "Directory to search in"
205
+ },
206
+ file_pattern: {
207
+ type: "string",
208
+ description: "Optional file glob filter (e.g. *.ts)"
209
+ }
157
210
  },
158
- {
159
- name: "run_command",
160
- description: "Execute a shell command. Output streams live. Use run_in_background:true for dev servers/watchers — after starting, use bash_output to verify. On macOS use python3 not python.",
161
- input_schema: {
162
- type: "object",
163
- properties: {
164
- command: { type: "string", description: "Shell command to execute" },
165
- working_directory: { type: "string", description: "Working directory for the command" },
166
- timeout: { type: "number", description: "Timeout in milliseconds (default 30000, max 300000)" },
167
- description: { type: "string", description: "Short description of what this command does" },
168
- run_in_background: { type: "boolean", description: "Run in background (for dev servers, watchers). Returns process ID immediately." },
169
- },
170
- required: ["command"],
171
- },
211
+ required: ["query", "path"]
212
+ }
213
+ }, {
214
+ name: "run_command",
215
+ description: "Execute a shell command. Output streams live. Use run_in_background:true for dev servers/watchers — after starting, use bash_output to verify. On macOS use python3 not python.",
216
+ input_schema: {
217
+ type: "object",
218
+ properties: {
219
+ command: {
220
+ type: "string",
221
+ description: "Shell command to execute"
222
+ },
223
+ working_directory: {
224
+ type: "string",
225
+ description: "Working directory for the command"
226
+ },
227
+ timeout: {
228
+ type: "number",
229
+ description: "Timeout in milliseconds (default 30000, max 300000)"
230
+ },
231
+ description: {
232
+ type: "string",
233
+ description: "Short description of what this command does"
234
+ },
235
+ run_in_background: {
236
+ type: "boolean",
237
+ description: "Run in background (for dev servers, watchers). Returns process ID immediately."
238
+ }
172
239
  },
173
- // ------------------------------------------------------------------
174
- // NEW: GLOB — pattern-based file finder
175
- // ------------------------------------------------------------------
176
- {
177
- name: "glob",
178
- description: "Fast file pattern matching. Use glob patterns like '**/*.ts' or 'src/**/*.tsx'. Returns matching file paths. For multiple patterns, emit all glob calls in one response — they execute in parallel.",
179
- input_schema: {
180
- type: "object",
181
- properties: {
182
- pattern: { type: "string", description: "Glob pattern (e.g. '**/*.ts', 'src/**/*.tsx', '*.json')" },
183
- path: { type: "string", description: "Base directory to search in (defaults to cwd)" },
184
- },
185
- required: ["pattern"],
186
- },
240
+ required: ["command"]
241
+ }
242
+ },
243
+ // ------------------------------------------------------------------
244
+ // NEW: GLOB — pattern-based file finder
245
+ // ------------------------------------------------------------------
246
+ {
247
+ name: "glob",
248
+ description: "Fast file pattern matching. Use glob patterns like '**/*.ts' or 'src/**/*.tsx'. Returns matching file paths. For multiple patterns, emit all glob calls in one response — they execute in parallel.",
249
+ input_schema: {
250
+ type: "object",
251
+ properties: {
252
+ pattern: {
253
+ type: "string",
254
+ description: "Glob pattern (e.g. '**/*.ts', 'src/**/*.tsx', '*.json')"
255
+ },
256
+ path: {
257
+ type: "string",
258
+ description: "Base directory to search in (defaults to cwd)"
259
+ }
187
260
  },
188
- // ------------------------------------------------------------------
189
- // NEW: GREP — advanced content search
190
- // ------------------------------------------------------------------
191
- {
192
- name: "grep",
193
- description: "Search file contents with regex, context lines, and multiple output modes. More powerful than search_content. For multiple patterns, emit all grep calls in one response — they execute in parallel.",
194
- input_schema: {
195
- type: "object",
196
- properties: {
197
- pattern: { type: "string", description: "Regex pattern to search for" },
198
- path: { type: "string", description: "File or directory to search in (defaults to cwd)" },
199
- glob: { type: "string", description: "Glob pattern to filter files (e.g. '*.ts', '*.{ts,tsx}')" },
200
- output_mode: {
201
- type: "string",
202
- enum: ["content", "files_with_matches", "count"],
203
- description: "Output mode: 'content' shows matching lines, 'files_with_matches' shows file paths (default), 'count' shows match counts",
204
- },
205
- context: { type: "number", description: "Lines of context before and after each match" },
206
- before: { type: "number", description: "Lines to show before each match (-B)" },
207
- after: { type: "number", description: "Lines to show after each match (-A)" },
208
- case_insensitive: { type: "boolean", description: "Case insensitive search (default false)" },
209
- type: { type: "string", description: "File type shorthand: js, ts, py, go, rust, java, etc." },
210
- head_limit: { type: "number", description: "Max results to return (default 200)" },
211
- offset: { type: "number", description: "Skip first N entries before applying head_limit (default 0)" },
212
- multiline: { type: "boolean", description: "Enable multiline mode where . matches newlines (requires rg)" },
213
- },
214
- required: ["pattern"],
215
- },
261
+ required: ["pattern"]
262
+ }
263
+ },
264
+ // ------------------------------------------------------------------
265
+ // NEW: GREP — advanced content search
266
+ // ------------------------------------------------------------------
267
+ {
268
+ name: "grep",
269
+ description: "Search file contents with regex, context lines, and multiple output modes. More powerful than search_content. For multiple patterns, emit all grep calls in one response — they execute in parallel.",
270
+ input_schema: {
271
+ type: "object",
272
+ properties: {
273
+ pattern: {
274
+ type: "string",
275
+ description: "Regex pattern to search for"
276
+ },
277
+ path: {
278
+ type: "string",
279
+ description: "File or directory to search in (defaults to cwd)"
280
+ },
281
+ glob: {
282
+ type: "string",
283
+ description: "Glob pattern to filter files (e.g. '*.ts', '*.{ts,tsx}')"
284
+ },
285
+ output_mode: {
286
+ type: "string",
287
+ enum: ["content", "files_with_matches", "count"],
288
+ description: "Output mode: 'content' shows matching lines, 'files_with_matches' shows file paths (default), 'count' shows match counts"
289
+ },
290
+ context: {
291
+ type: "number",
292
+ description: "Lines of context before and after each match"
293
+ },
294
+ before: {
295
+ type: "number",
296
+ description: "Lines to show before each match (-B)"
297
+ },
298
+ after: {
299
+ type: "number",
300
+ description: "Lines to show after each match (-A)"
301
+ },
302
+ case_insensitive: {
303
+ type: "boolean",
304
+ description: "Case insensitive search (default false)"
305
+ },
306
+ type: {
307
+ type: "string",
308
+ description: "File type shorthand: js, ts, py, go, rust, java, etc."
309
+ },
310
+ head_limit: {
311
+ type: "number",
312
+ description: "Max results to return (default 200)"
313
+ },
314
+ offset: {
315
+ type: "number",
316
+ description: "Skip first N entries before applying head_limit (default 0)"
317
+ },
318
+ multiline: {
319
+ type: "boolean",
320
+ description: "Enable multiline mode where . matches newlines (requires rg)"
321
+ }
216
322
  },
217
- // ------------------------------------------------------------------
218
- // NEW: NOTEBOOK_EDIT — Jupyter notebook cell editing
219
- // ------------------------------------------------------------------
220
- {
221
- name: "notebook_edit",
222
- description: "Edit Jupyter notebook (.ipynb) cells: replace, insert, or delete cells.",
223
- input_schema: {
224
- type: "object",
225
- properties: {
226
- notebook_path: { type: "string", description: "Path to the .ipynb file" },
227
- cell_id: { type: "string", description: "Cell ID or 0-based index. For insert, new cell goes after this." },
228
- new_source: { type: "string", description: "New source code/markdown for the cell" },
229
- cell_type: { type: "string", enum: ["code", "markdown"], description: "Cell type (required for insert)" },
230
- edit_mode: { type: "string", enum: ["replace", "insert", "delete"], description: "Edit mode (default: replace)" },
231
- },
232
- required: ["notebook_path", "new_source"],
233
- },
323
+ required: ["pattern"]
324
+ }
325
+ },
326
+ // ------------------------------------------------------------------
327
+ // NEW: NOTEBOOK_EDIT — Jupyter notebook cell editing
328
+ // ------------------------------------------------------------------
329
+ {
330
+ name: "notebook_edit",
331
+ description: "Edit Jupyter notebook (.ipynb) cells: replace, insert, or delete cells.",
332
+ input_schema: {
333
+ type: "object",
334
+ properties: {
335
+ notebook_path: {
336
+ type: "string",
337
+ description: "Path to the .ipynb file"
338
+ },
339
+ cell_id: {
340
+ type: "string",
341
+ description: "Cell ID or 0-based index. For insert, new cell goes after this."
342
+ },
343
+ new_source: {
344
+ type: "string",
345
+ description: "New source code/markdown for the cell"
346
+ },
347
+ cell_type: {
348
+ type: "string",
349
+ enum: ["code", "markdown"],
350
+ description: "Cell type (required for insert)"
351
+ },
352
+ edit_mode: {
353
+ type: "string",
354
+ enum: ["replace", "insert", "delete"],
355
+ description: "Edit mode (default: replace)"
356
+ }
234
357
  },
235
- // ------------------------------------------------------------------
236
- // NEW: WEB_FETCH — fetch URL content
237
- // ------------------------------------------------------------------
238
- {
239
- name: "web_fetch",
240
- description: "Fetch content from a URL and return as cleaned text/markdown. Strips HTML, scripts, styles.",
241
- input_schema: {
242
- type: "object",
243
- properties: {
244
- url: { type: "string", description: "URL to fetch" },
245
- prompt: { type: "string", description: "What to extract from the page (used for context)" },
246
- },
247
- required: ["url"],
248
- },
358
+ required: ["notebook_path", "new_source"]
359
+ }
360
+ },
361
+ // ------------------------------------------------------------------
362
+ // NEW: WEB_FETCH — fetch URL content
363
+ // ------------------------------------------------------------------
364
+ {
365
+ name: "web_fetch",
366
+ description: "Fetch content from a URL and return as cleaned text/markdown. Strips HTML, scripts, styles.",
367
+ input_schema: {
368
+ type: "object",
369
+ properties: {
370
+ url: {
371
+ type: "string",
372
+ description: "URL to fetch"
373
+ },
374
+ prompt: {
375
+ type: "string",
376
+ description: "What to extract from the page (used for context)"
377
+ }
249
378
  },
250
- // ------------------------------------------------------------------
251
- // NEW: WEB_SEARCH — search the web via Exa API
252
- // ------------------------------------------------------------------
253
- {
254
- name: "web_search",
255
- description: "Search the web for current information. Returns titles, URLs, and snippets.",
256
- input_schema: {
257
- type: "object",
258
- properties: {
259
- query: { type: "string", description: "Search query" },
260
- allowed_domains: { type: "array", items: { type: "string" }, description: "Only include results from these domains" },
261
- blocked_domains: { type: "array", items: { type: "string" }, description: "Exclude results from these domains" },
262
- },
263
- required: ["query"],
379
+ required: ["url"]
380
+ }
381
+ },
382
+ // ------------------------------------------------------------------
383
+ // NEW: WEB_SEARCH — search the web via Exa API
384
+ // ------------------------------------------------------------------
385
+ {
386
+ name: "web_search",
387
+ description: "Search the web for current information. Returns titles, URLs, and snippets.",
388
+ input_schema: {
389
+ type: "object",
390
+ properties: {
391
+ query: {
392
+ type: "string",
393
+ description: "Search query"
394
+ },
395
+ allowed_domains: {
396
+ type: "array",
397
+ items: {
398
+ type: "string"
264
399
  },
265
- },
266
- // ------------------------------------------------------------------
267
- // TASKS — action-based CRUD for structured task tracking
268
- // ------------------------------------------------------------------
269
- {
270
- name: "tasks",
271
- description: "Track tasks for the current session. Actions: create (returns ID), update (status/deps), list (summary), get (full details). Supports dependencies via blocks/blockedBy.",
272
- input_schema: {
273
- type: "object",
274
- properties: {
275
- action: {
276
- type: "string",
277
- enum: ["create", "update", "list", "get"],
278
- description: "Action to perform",
279
- },
280
- // For create:
281
- subject: { type: "string", description: "Brief title in imperative form (create)" },
282
- description: { type: "string", description: "Detailed description (create/update)" },
283
- activeForm: { type: "string", description: "Present continuous spinner text (create/update)" },
284
- metadata: { type: "object", description: "Arbitrary metadata (create/update)" },
285
- // For update/get:
286
- taskId: { type: "string", description: "Task ID (update/get)" },
287
- status: { type: "string", enum: ["pending", "in_progress", "completed", "deleted"], description: "New status (update)" },
288
- subject_update: { type: "string", description: "New subject (update)" },
289
- addBlocks: { type: "array", items: { type: "string" }, description: "Task IDs this task blocks (update)" },
290
- addBlockedBy: { type: "array", items: { type: "string" }, description: "Task IDs that block this task (update)" },
291
- owner: { type: "string", description: "Task owner (update)" },
292
- },
293
- required: ["action"],
400
+ description: "Only include results from these domains"
401
+ },
402
+ blocked_domains: {
403
+ type: "array",
404
+ items: {
405
+ type: "string"
294
406
  },
407
+ description: "Exclude results from these domains"
408
+ }
295
409
  },
296
- // ------------------------------------------------------------------
297
- // NEW: MULTI_EDIT — multiple edits to one file in a single call
298
- // ------------------------------------------------------------------
299
- {
300
- name: "multi_edit",
301
- description: "Apply multiple edits to one file in a single call. Edits applied sequentially. Fails if any old_string not found.",
302
- input_schema: {
303
- type: "object",
304
- properties: {
305
- file_path: { type: "string", description: "Absolute or relative path to the file" },
306
- edits: {
307
- type: "array",
308
- description: "Array of edits to apply sequentially",
309
- items: {
310
- type: "object",
311
- properties: {
312
- old_string: { type: "string", description: "Exact text to find" },
313
- new_string: { type: "string", description: "Text to replace with" },
314
- },
315
- required: ["old_string", "new_string"],
316
- },
317
- },
318
- },
319
- required: ["file_path", "edits"],
410
+ required: ["query"]
411
+ }
412
+ },
413
+ // ------------------------------------------------------------------
414
+ // TASKS — action-based CRUD for structured task tracking
415
+ // ------------------------------------------------------------------
416
+ {
417
+ name: "tasks",
418
+ description: "Track tasks for the current session. Actions: create (returns ID), update (status/deps), list (summary), get (full details). Supports dependencies via blocks/blockedBy.",
419
+ input_schema: {
420
+ type: "object",
421
+ properties: {
422
+ action: {
423
+ type: "string",
424
+ enum: ["create", "update", "list", "get"],
425
+ description: "Action to perform"
426
+ },
427
+ // For create:
428
+ subject: {
429
+ type: "string",
430
+ description: "Brief title in imperative form (create)"
431
+ },
432
+ description: {
433
+ type: "string",
434
+ description: "Detailed description (create/update)"
435
+ },
436
+ activeForm: {
437
+ type: "string",
438
+ description: "Present continuous spinner text (create/update)"
439
+ },
440
+ metadata: {
441
+ type: "object",
442
+ description: "Arbitrary metadata (create/update)"
443
+ },
444
+ // For update/get:
445
+ taskId: {
446
+ type: "string",
447
+ description: "Task ID (update/get)"
448
+ },
449
+ status: {
450
+ type: "string",
451
+ enum: ["pending", "in_progress", "completed", "deleted"],
452
+ description: "New status (update)"
453
+ },
454
+ subject_update: {
455
+ type: "string",
456
+ description: "New subject (update)"
457
+ },
458
+ addBlocks: {
459
+ type: "array",
460
+ items: {
461
+ type: "string"
320
462
  },
321
- },
322
- // ------------------------------------------------------------------
323
- // TASK — subagent for discrete tasks
324
- // ------------------------------------------------------------------
325
- {
326
- name: "task",
327
- description: "Launch a subagent in isolated context. Subagents have full tool access and batch multiple tool calls per turn (glob + grep + read_file in parallel). Launch multiple task calls in one response for parallel execution. Use for any work requiring 3+ tool calls. Subagents complete in 2-8 turns autonomously.",
328
- input_schema: {
329
- type: "object",
330
- properties: {
331
- prompt: { type: "string", description: "Specific task with clear completion criteria" },
332
- subagent_type: {
333
- type: "string",
334
- enum: ["explore", "plan", "general-purpose", "research"],
335
- description: "Agent type: explore=find, plan=design, general-purpose=do, research=lookup",
336
- },
337
- model: {
338
- type: "string",
339
- enum: ["sonnet", "opus", "haiku"],
340
- description: "Haiku for quick tasks, Sonnet (default) for most, Opus for complex",
341
- },
342
- run_in_background: {
343
- type: "boolean",
344
- description: "Run agent in background. Returns output_file path to check progress via task_output.",
345
- },
346
- max_turns: {
347
- type: "number",
348
- description: "Max agentic turns (1-50). Default 8.",
349
- },
350
- name: {
351
- type: "string",
352
- description: "Display name for the agent.",
353
- },
354
- description: {
355
- type: "string",
356
- description: "Short 3-5 word description of the task.",
357
- },
358
- team_name: {
359
- type: "string",
360
- description: "Team name for spawning. Uses current team context if omitted.",
361
- },
362
- mode: {
363
- type: "string",
364
- enum: ["default", "plan", "yolo"],
365
- description: "Permission mode for spawned agent (default inherits parent).",
366
- },
367
- },
368
- required: ["prompt", "subagent_type"],
463
+ description: "Task IDs this task blocks (update)"
464
+ },
465
+ addBlockedBy: {
466
+ type: "array",
467
+ items: {
468
+ type: "string"
369
469
  },
470
+ description: "Task IDs that block this task (update)"
471
+ },
472
+ owner: {
473
+ type: "string",
474
+ description: "Task owner (update)"
475
+ }
370
476
  },
371
- // ------------------------------------------------------------------
372
- // TEAM — parallel agent team for large tasks
373
- // ------------------------------------------------------------------
374
- {
375
- name: "team_create",
376
- description: "Create an Agent Team — multiple full Claude instances in parallel. Each teammate has full tool access, can spawn subagents via 'task' tool, and batches tool calls. Teammates → subagents → batch tools. Size tasks for 5-6 items per teammate. Include file lists to prevent conflicts.",
377
- input_schema: {
378
- type: "object",
379
- properties: {
380
- name: {
381
- type: "string",
382
- description: "Team name (e.g., 'Feature Implementation Team')",
383
- },
384
- teammate_count: {
385
- type: "number",
386
- description: "Number of teammates to spawn (2-5 recommended)",
387
- },
388
- model: {
389
- type: "string",
390
- enum: ["sonnet", "opus", "haiku"],
391
- description: "Model for all teammates (default: sonnet)",
392
- },
393
- tasks: {
394
- type: "array",
395
- description: "Tasks for the team to complete",
396
- items: {
397
- type: "object",
398
- properties: {
399
- description: {
400
- type: "string",
401
- description: "Clear task description with completion criteria",
402
- },
403
- model: {
404
- type: "string",
405
- description: "Model for this task: haiku (lookups), sonnet (analysis), opus (complex reasoning). Overrides team default.",
406
- },
407
- files: {
408
- type: "array",
409
- items: { type: "string" },
410
- description: "Files this task will modify (for conflict prevention)",
411
- },
412
- dependencies: {
413
- type: "array",
414
- items: { type: "string" },
415
- description: "Task descriptions that must complete first",
416
- },
417
- },
418
- required: ["description"],
419
- },
420
- },
477
+ required: ["action"]
478
+ }
479
+ },
480
+ // ------------------------------------------------------------------
481
+ // NEW: MULTI_EDIT — multiple edits to one file in a single call
482
+ // ------------------------------------------------------------------
483
+ {
484
+ name: "multi_edit",
485
+ description: "Apply multiple edits to one file in a single call. Edits applied sequentially. Fails if any old_string not found.",
486
+ input_schema: {
487
+ type: "object",
488
+ properties: {
489
+ file_path: {
490
+ type: "string",
491
+ description: "Absolute or relative path to the file"
492
+ },
493
+ edits: {
494
+ type: "array",
495
+ description: "Array of edits to apply sequentially",
496
+ items: {
497
+ type: "object",
498
+ properties: {
499
+ old_string: {
500
+ type: "string",
501
+ description: "Exact text to find"
421
502
  },
422
- required: ["name", "teammate_count", "tasks"],
423
- },
503
+ new_string: {
504
+ type: "string",
505
+ description: "Text to replace with"
506
+ }
507
+ },
508
+ required: ["old_string", "new_string"]
509
+ }
510
+ }
424
511
  },
425
- {
426
- name: "team_auto",
427
- description: "Auto-decompose a task and run it as a parallel agent team. AI breaks the task into sub-tasks with file ownership, spawns teammates, executes in parallel, and reviews results. Use this for large tasks where you don't want to manually plan the decomposition.",
428
- input_schema: {
429
- type: "object",
430
- properties: {
431
- task: {
432
- type: "string",
433
- description: "The task to decompose and execute (e.g., 'Refactor all components to use TypeScript strict mode')",
434
- },
435
- max_teammates: {
436
- type: "number",
437
- description: "Maximum number of parallel teammates (default: 4, max: 6)",
438
- },
439
- model: {
440
- type: "string",
441
- enum: ["sonnet", "opus", "haiku"],
442
- description: "Model for teammates (default: sonnet)",
443
- },
444
- working_directory: {
445
- type: "string",
446
- description: "Project directory to work in (default: cwd)",
447
- },
448
- review: {
449
- type: "boolean",
450
- description: "Run a review pass after completion (default: true)",
451
- },
452
- },
453
- required: ["task"],
454
- },
512
+ required: ["file_path", "edits"]
513
+ }
514
+ },
515
+ // ------------------------------------------------------------------
516
+ // TASK — subagent for discrete tasks
517
+ // ------------------------------------------------------------------
518
+ {
519
+ name: "task",
520
+ description: "Launch a subagent in isolated context. Subagents have full tool access and batch multiple tool calls per turn (glob + grep + read_file in parallel). Launch multiple task calls in one response for parallel execution. Use for any work requiring 3+ tool calls. Subagents complete in 2-8 turns autonomously.",
521
+ input_schema: {
522
+ type: "object",
523
+ properties: {
524
+ prompt: {
525
+ type: "string",
526
+ description: "Specific task with clear completion criteria"
527
+ },
528
+ subagent_type: {
529
+ type: "string",
530
+ enum: ["explore", "plan", "general-purpose", "research"],
531
+ description: "Agent type: explore=find, plan=design, general-purpose=do, research=lookup"
532
+ },
533
+ model: {
534
+ type: "string",
535
+ enum: ["sonnet", "opus", "haiku"],
536
+ description: "Haiku for quick tasks, Sonnet (default) for most, Opus for complex"
537
+ },
538
+ run_in_background: {
539
+ type: "boolean",
540
+ description: "Run agent in background. Returns output_file path to check progress via task_output."
541
+ },
542
+ max_turns: {
543
+ type: "number",
544
+ description: "Max agentic turns (1-50). Default 8."
545
+ },
546
+ name: {
547
+ type: "string",
548
+ description: "Display name for the agent."
549
+ },
550
+ description: {
551
+ type: "string",
552
+ description: "Short 3-5 word description of the task."
553
+ },
554
+ team_name: {
555
+ type: "string",
556
+ description: "Team name for spawning. Uses current team context if omitted."
557
+ },
558
+ mode: {
559
+ type: "string",
560
+ enum: ["default", "plan", "yolo"],
561
+ description: "Permission mode for spawned agent (default inherits parent)."
562
+ }
455
563
  },
456
- // ------------------------------------------------------------------
457
- // BACKGROUND PROCESS TOOLS
458
- // ------------------------------------------------------------------
459
- {
460
- name: "bash_output",
461
- description: "Read output from a running or completed background shell process. Returns only NEW output since the last read.",
462
- input_schema: {
463
- type: "object",
464
- properties: {
465
- bash_id: { type: "string", description: "The process ID returned when starting the background process" },
466
- filter: { type: "string", description: "Optional regex to filter output lines" },
564
+ required: ["prompt", "subagent_type"]
565
+ }
566
+ },
567
+ // ------------------------------------------------------------------
568
+ // TEAM — parallel agent team for large tasks
569
+ // ------------------------------------------------------------------
570
+ {
571
+ name: "team_create",
572
+ description: "Create an Agent Team — multiple full Claude instances in parallel. Each teammate has full tool access, can spawn subagents via 'task' tool, and batches tool calls. Teammates → subagents → batch tools. Size tasks for 5-6 items per teammate. Include file lists to prevent conflicts.",
573
+ input_schema: {
574
+ type: "object",
575
+ properties: {
576
+ name: {
577
+ type: "string",
578
+ description: "Team name (e.g., 'Feature Implementation Team')"
579
+ },
580
+ teammate_count: {
581
+ type: "number",
582
+ description: "Number of teammates to spawn (2-5 recommended)"
583
+ },
584
+ model: {
585
+ type: "string",
586
+ enum: ["sonnet", "opus", "haiku"],
587
+ description: "Model for all teammates (default: sonnet)"
588
+ },
589
+ tasks: {
590
+ type: "array",
591
+ description: "Tasks for the team to complete",
592
+ items: {
593
+ type: "object",
594
+ properties: {
595
+ description: {
596
+ type: "string",
597
+ description: "Clear task description with completion criteria"
467
598
  },
468
- required: ["bash_id"],
469
- },
470
- },
471
- {
472
- name: "kill_shell",
473
- description: "Terminate a running background shell process",
474
- input_schema: {
475
- type: "object",
476
- properties: {
477
- shell_id: { type: "string", description: "The process ID to kill" },
599
+ model: {
600
+ type: "string",
601
+ description: "Model for this task: haiku (lookups), sonnet (analysis), opus (complex reasoning). Overrides team default."
478
602
  },
479
- required: ["shell_id"],
480
- },
603
+ files: {
604
+ type: "array",
605
+ items: {
606
+ type: "string"
607
+ },
608
+ description: "Files this task will modify (for conflict prevention)"
609
+ },
610
+ dependencies: {
611
+ type: "array",
612
+ items: {
613
+ type: "string"
614
+ },
615
+ description: "Task descriptions that must complete first"
616
+ }
617
+ },
618
+ required: ["description"]
619
+ }
620
+ }
481
621
  },
482
- {
483
- name: "list_shells",
484
- description: "List all background shell processes (running and recent completed)",
485
- input_schema: {
486
- type: "object",
487
- properties: {},
488
- required: [],
489
- },
622
+ required: ["name", "teammate_count", "tasks"]
623
+ }
624
+ }, {
625
+ name: "team_auto",
626
+ description: "Auto-decompose a task and run it as a parallel agent team. AI breaks the task into sub-tasks with file ownership, spawns teammates, executes in parallel, and reviews results. Use this for large tasks where you don't want to manually plan the decomposition.",
627
+ input_schema: {
628
+ type: "object",
629
+ properties: {
630
+ task: {
631
+ type: "string",
632
+ description: "The task to decompose and execute (e.g., 'Refactor all components to use TypeScript strict mode')"
633
+ },
634
+ max_teammates: {
635
+ type: "number",
636
+ description: "Maximum number of parallel teammates (default: 4, max: 6)"
637
+ },
638
+ model: {
639
+ type: "string",
640
+ enum: ["sonnet", "opus", "haiku"],
641
+ description: "Model for teammates (default: sonnet)"
642
+ },
643
+ working_directory: {
644
+ type: "string",
645
+ description: "Project directory to work in (default: cwd)"
646
+ },
647
+ review: {
648
+ type: "boolean",
649
+ description: "Run a review pass after completion (default: true)"
650
+ }
490
651
  },
491
- // ------------------------------------------------------------------
492
- // TASK OUTPUT / TASK STOP — unified background task management
493
- // ------------------------------------------------------------------
494
- {
495
- name: "task_output",
496
- description: "Get output from a background task (shell or agent). Returns status and output content.",
497
- input_schema: {
498
- type: "object",
499
- properties: {
500
- task_id: { type: "string", description: "The task/agent ID (e.g. shell-xxx or agent-xxx)" },
501
- block: { type: "boolean", description: "Wait for completion (default: true)" },
502
- timeout: { type: "number", description: "Max wait time in ms (default: 30000)" },
503
- },
504
- required: ["task_id"],
505
- },
652
+ required: ["task"]
653
+ }
654
+ },
655
+ // ------------------------------------------------------------------
656
+ // BACKGROUND PROCESS TOOLS
657
+ // ------------------------------------------------------------------
658
+ {
659
+ name: "bash_output",
660
+ description: "Read output from a running or completed background shell process. Returns only NEW output since the last read.",
661
+ input_schema: {
662
+ type: "object",
663
+ properties: {
664
+ bash_id: {
665
+ type: "string",
666
+ description: "The process ID returned when starting the background process"
667
+ },
668
+ filter: {
669
+ type: "string",
670
+ description: "Optional regex to filter output lines"
671
+ }
506
672
  },
507
- {
508
- name: "task_stop",
509
- description: "Stop a running background task (shell or agent) by ID.",
510
- input_schema: {
511
- type: "object",
512
- properties: {
513
- task_id: { type: "string", description: "The task ID to stop" },
514
- },
515
- required: ["task_id"],
516
- },
673
+ required: ["bash_id"]
674
+ }
675
+ }, {
676
+ name: "kill_shell",
677
+ description: "Terminate a running background shell process",
678
+ input_schema: {
679
+ type: "object",
680
+ properties: {
681
+ shell_id: {
682
+ type: "string",
683
+ description: "The process ID to kill"
684
+ }
517
685
  },
518
- // ------------------------------------------------------------------
519
- // CONFIG — runtime settings + mode control (consolidated)
520
- // ------------------------------------------------------------------
521
- {
522
- name: "config",
523
- description: "Read or write CLI settings. Omit value to read. Keys: model (sonnet/opus/haiku), mode (default/plan/yolo — plan restricts to read-only tools), memory. Use mode=plan before non-trivial tasks to explore first, mode=default to resume full access.",
524
- input_schema: {
525
- type: "object",
526
- properties: {
527
- setting: { type: "string", description: "Setting key: 'model', 'mode', 'memory'" },
528
- value: { type: "string", description: "New value. Omit to read current value." },
529
- },
530
- required: ["setting"],
531
- },
686
+ required: ["shell_id"]
687
+ }
688
+ }, {
689
+ name: "list_shells",
690
+ description: "List all background shell processes (running and recent completed)",
691
+ input_schema: {
692
+ type: "object",
693
+ properties: {},
694
+ required: []
695
+ }
696
+ },
697
+ // ------------------------------------------------------------------
698
+ // TASK OUTPUT / TASK STOP — unified background task management
699
+ // ------------------------------------------------------------------
700
+ {
701
+ name: "task_output",
702
+ description: "Get output from a background task (shell or agent). Returns status and output content.",
703
+ input_schema: {
704
+ type: "object",
705
+ properties: {
706
+ task_id: {
707
+ type: "string",
708
+ description: "The task/agent ID (e.g. shell-xxx or agent-xxx)"
709
+ },
710
+ block: {
711
+ type: "boolean",
712
+ description: "Wait for completion (default: true)"
713
+ },
714
+ timeout: {
715
+ type: "number",
716
+ description: "Max wait time in ms (default: 30000)"
717
+ }
532
718
  },
533
- // ------------------------------------------------------------------
534
- // LSP — Language Server Protocol code intelligence
535
- // ------------------------------------------------------------------
536
- {
537
- name: "lsp",
538
- description: "Code intelligence via Language Server Protocol. Supports: goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol, goToImplementation, prepareCallHierarchy, incomingCalls, outgoingCalls. Requires a language server installed for the file type.",
539
- input_schema: {
540
- type: "object",
541
- properties: {
542
- operation: {
543
- type: "string",
544
- enum: [
545
- "goToDefinition",
546
- "findReferences",
547
- "hover",
548
- "documentSymbol",
549
- "workspaceSymbol",
550
- "goToImplementation",
551
- "prepareCallHierarchy",
552
- "incomingCalls",
553
- "outgoingCalls",
554
- ],
555
- description: "LSP operation to perform",
556
- },
557
- filePath: { type: "string", description: "Absolute or relative path to the file" },
558
- line: { type: "number", description: "Line number (1-based, as shown in editors)" },
559
- character: { type: "number", description: "Character offset (1-based, as shown in editors)" },
560
- query: { type: "string", description: "Search query for workspaceSymbol operation (optional, defaults to all symbols)" },
561
- },
562
- required: ["operation", "filePath", "line", "character"],
563
- },
719
+ required: ["task_id"]
720
+ }
721
+ }, {
722
+ name: "task_stop",
723
+ description: "Stop a running background task (shell or agent) by ID.",
724
+ input_schema: {
725
+ type: "object",
726
+ properties: {
727
+ task_id: {
728
+ type: "string",
729
+ description: "The task ID to stop"
730
+ }
564
731
  },
565
- // ------------------------------------------------------------------
566
- // ASK_USER — structured multi-choice question
567
- // ------------------------------------------------------------------
568
- {
569
- name: "ask_user",
570
- description: "Ask the user a structured question with predefined options. Use to gather preferences, clarify requirements, or get decisions during execution. The user can always type a custom answer.",
571
- input_schema: {
572
- type: "object",
573
- properties: {
574
- question: { type: "string", description: "The question to ask" },
575
- options: {
576
- type: "array",
577
- description: "2-4 options for the user to choose from",
578
- items: {
579
- type: "object",
580
- properties: {
581
- label: { type: "string", description: "Short option label (1-5 words)" },
582
- description: { type: "string", description: "Explanation of what this option means" },
583
- },
584
- required: ["label", "description"],
585
- },
586
- },
587
- },
588
- required: ["question", "options"],
589
- },
732
+ required: ["task_id"]
733
+ }
734
+ },
735
+ // ------------------------------------------------------------------
736
+ // CONFIG — runtime settings + mode control (consolidated)
737
+ // ------------------------------------------------------------------
738
+ {
739
+ name: "config",
740
+ description: "Read or write CLI settings. Omit value to read. Keys: model (sonnet/opus/haiku), mode (default/plan/yolo — plan restricts to read-only tools), memory. Use mode=plan before non-trivial tasks to explore first, mode=default to resume full access.",
741
+ input_schema: {
742
+ type: "object",
743
+ properties: {
744
+ setting: {
745
+ type: "string",
746
+ description: "Setting key: 'model', 'mode', 'memory'"
747
+ },
748
+ value: {
749
+ type: "string",
750
+ description: "New value. Omit to read current value."
751
+ }
752
+ },
753
+ required: ["setting"]
754
+ }
755
+ },
756
+ // ------------------------------------------------------------------
757
+ // LSP — Language Server Protocol code intelligence
758
+ // ------------------------------------------------------------------
759
+ {
760
+ name: "lsp",
761
+ description: "Code intelligence via Language Server Protocol. Supports: goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol, goToImplementation, prepareCallHierarchy, incomingCalls, outgoingCalls. Requires a language server installed for the file type.",
762
+ input_schema: {
763
+ type: "object",
764
+ properties: {
765
+ operation: {
766
+ type: "string",
767
+ enum: ["goToDefinition", "findReferences", "hover", "documentSymbol", "workspaceSymbol", "goToImplementation", "prepareCallHierarchy", "incomingCalls", "outgoingCalls"],
768
+ description: "LSP operation to perform"
769
+ },
770
+ filePath: {
771
+ type: "string",
772
+ description: "Absolute or relative path to the file"
773
+ },
774
+ line: {
775
+ type: "number",
776
+ description: "Line number (1-based, as shown in editors)"
777
+ },
778
+ character: {
779
+ type: "number",
780
+ description: "Character offset (1-based, as shown in editors)"
781
+ },
782
+ query: {
783
+ type: "string",
784
+ description: "Search query for workspaceSymbol operation (optional, defaults to all symbols)"
785
+ }
590
786
  },
591
- // ------------------------------------------------------------------
592
- // SKILL — invoke named skills (model-callable)
593
- // ------------------------------------------------------------------
594
- {
595
- name: "skill",
596
- description: "Invoke a named skill. Skills provide specialized workflows like committing code, reviewing PRs, etc. Built-in skills: commit, review, review-pr. Custom skills from .whale/commands/ and ~/.swagmanager/commands/.",
597
- input_schema: {
598
- type: "object",
599
- properties: {
600
- skill: { type: "string", description: "Skill name (e.g., 'commit', 'review-pr')" },
601
- args: { type: "string", description: "Optional arguments for the skill" },
787
+ required: ["operation", "filePath", "line", "character"]
788
+ }
789
+ },
790
+ // ------------------------------------------------------------------
791
+ // ASK_USER — structured multi-choice question
792
+ // ------------------------------------------------------------------
793
+ {
794
+ name: "ask_user",
795
+ description: "Ask the user a structured question with predefined options. Use to gather preferences, clarify requirements, or get decisions during execution. The user can always type a custom answer.",
796
+ input_schema: {
797
+ type: "object",
798
+ properties: {
799
+ question: {
800
+ type: "string",
801
+ description: "The question to ask"
802
+ },
803
+ options: {
804
+ type: "array",
805
+ description: "2-4 options for the user to choose from",
806
+ items: {
807
+ type: "object",
808
+ properties: {
809
+ label: {
810
+ type: "string",
811
+ description: "Short option label (1-5 words)"
602
812
  },
603
- required: ["skill"],
604
- },
813
+ description: {
814
+ type: "string",
815
+ description: "Explanation of what this option means"
816
+ }
817
+ },
818
+ required: ["label", "description"]
819
+ }
820
+ }
605
821
  },
606
- ];
822
+ required: ["question", "options"]
823
+ }
824
+ },
825
+ // ------------------------------------------------------------------
826
+ // SKILL — invoke named skills (model-callable)
827
+ // ------------------------------------------------------------------
828
+ {
829
+ name: "skill",
830
+ description: "Invoke a named skill. Skills provide specialized workflows like committing code, reviewing PRs, etc. Built-in skills: commit, review, review-pr. Custom skills from .whale/commands/ and ~/.whale/commands/.",
831
+ input_schema: {
832
+ type: "object",
833
+ properties: {
834
+ skill: {
835
+ type: "string",
836
+ description: "Skill name (e.g., 'commit', 'review-pr')"
837
+ },
838
+ args: {
839
+ type: "string",
840
+ description: "Optional arguments for the skill"
841
+ }
842
+ },
843
+ required: ["skill"]
844
+ }
845
+ }];
846
+
607
847
  // ============================================================================
608
848
  // READ MANY FILES — reads multiple files matching glob patterns
609
849
  // ============================================================================
610
- const BINARY_EXTENSIONS = new Set([
611
- "png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "svg",
612
- "mp3", "wav", "aiff", "aac", "ogg", "flac", "m4a",
613
- "mp4", "mov", "avi", "mkv", "webm",
614
- "zip", "tar", "gz", "bz2", "7z", "rar",
615
- "exe", "dll", "so", "dylib", "o", "a",
616
- "woff", "woff2", "ttf", "otf", "eot",
617
- "pdf",
618
- ]);
850
+
851
+ const BINARY_EXTENSIONS = new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "ico", "svg", "mp3", "wav", "aiff", "aac", "ogg", "flac", "m4a", "mp4", "mov", "avi", "mkv", "webm", "zip", "tar", "gz", "bz2", "7z", "rar", "exe", "dll", "so", "dylib", "o", "a", "woff", "woff2", "ttf", "otf", "eot", "pdf"]);
619
852
  const READ_MANY_TRUNCATE_LINES = 2000;
620
853
  const READ_MANY_SHOW_LINES = 500;
621
854
  async function readManyFiles(input) {
622
- const pattern = input.pattern;
623
- const basePath = input.path || process.cwd();
624
- const limit = Math.min(Math.max(input.limit || 20, 1), 50);
625
- // Use globSearch to find matching files
626
- const globResult = globSearch({ pattern, path: basePath });
627
- if (!globResult.success) {
628
- return { success: false, output: globResult.output };
855
+ const pattern = input.pattern;
856
+ const basePath = input.path || process.cwd();
857
+ const limit = Math.min(Math.max(input.limit || 20, 1), 50);
858
+
859
+ // Use globSearch to find matching files
860
+ const globResult = globSearch({
861
+ pattern,
862
+ path: basePath
863
+ });
864
+ if (!globResult.success) {
865
+ return {
866
+ success: false,
867
+ output: globResult.output
868
+ };
869
+ }
870
+
871
+ // Parse file paths from globSearch output (format: "N files:\npath1\npath2\n...")
872
+ const outputLines = globResult.output.split("\n");
873
+ if (outputLines[0] === "No files found") {
874
+ return {
875
+ success: true,
876
+ output: "No files matched the pattern."
877
+ };
878
+ }
879
+
880
+ // First line is "N files:", rest are paths
881
+ const allFiles = outputLines.slice(1).filter(Boolean);
882
+ const totalFound = allFiles.length;
883
+ const filesToRead = allFiles.slice(0, limit);
884
+ const parts = [];
885
+ let filesRead = 0;
886
+ let skipped = 0;
887
+ for (const filePath of filesToRead) {
888
+ const ext = filePath.split(".").pop()?.toLowerCase() || "";
889
+
890
+ // Skip binary files (images, audio, video, archives, etc.)
891
+ if (BINARY_EXTENSIONS.has(ext)) {
892
+ parts.push(`=== ${filePath} ===\n[Binary file — ${ext}]\n`);
893
+ skipped++;
894
+ continue;
629
895
  }
630
- // Parse file paths from globSearch output (format: "N files:\npath1\npath2\n...")
631
- const outputLines = globResult.output.split("\n");
632
- if (outputLines[0] === "No files found") {
633
- return { success: true, output: "No files matched the pattern." };
896
+ const absPath = resolve(resolvePath(basePath), resolvePath(filePath));
897
+ const targetPath = existsSync(absPath) ? absPath : filePath;
898
+ if (!existsSync(targetPath)) {
899
+ parts.push(`=== ${filePath} ===\n[File not found]\n`);
900
+ skipped++;
901
+ continue;
634
902
  }
635
- // First line is "N files:", rest are paths
636
- const allFiles = outputLines.slice(1).filter(Boolean);
637
- const totalFound = allFiles.length;
638
- const filesToRead = allFiles.slice(0, limit);
639
- const parts = [];
640
- let filesRead = 0;
641
- let skipped = 0;
642
- for (const filePath of filesToRead) {
643
- const ext = filePath.split(".").pop()?.toLowerCase() || "";
644
- // Skip binary files (images, audio, video, archives, etc.)
645
- if (BINARY_EXTENSIONS.has(ext)) {
646
- parts.push(`=== ${filePath} ===\n[Binary file — ${ext}]\n`);
647
- skipped++;
648
- continue;
649
- }
650
- const absPath = resolve(resolvePath(basePath), resolvePath(filePath));
651
- const targetPath = existsSync(absPath) ? absPath : filePath;
652
- if (!existsSync(targetPath)) {
653
- parts.push(`=== ${filePath} ===\n[File not found]\n`);
654
- skipped++;
655
- continue;
656
- }
657
- try {
658
- const stat = statSync(targetPath);
659
- // Skip files > 1MB
660
- if (stat.size > 1_000_000) {
661
- parts.push(`=== ${filePath} ===\n[File too large: ${(stat.size / 1024).toFixed(0)}KB]\n`);
662
- skipped++;
663
- continue;
664
- }
665
- const content = readFileSync(targetPath, "utf-8");
666
- const lines = content.split("\n");
667
- if (lines.length > READ_MANY_TRUNCATE_LINES) {
668
- const truncated = lines.slice(0, READ_MANY_SHOW_LINES).join("\n");
669
- parts.push(`=== ${filePath} ===\n${truncated}\n[... truncated — ${lines.length} total lines, showing first ${READ_MANY_SHOW_LINES}]\n`);
670
- }
671
- else {
672
- parts.push(`=== ${filePath} ===\n${content}\n`);
673
- }
674
- filesRead++;
675
- }
676
- catch (err) {
677
- parts.push(`=== ${filePath} ===\n[Error reading file: ${err}]\n`);
678
- skipped++;
679
- }
903
+ try {
904
+ const stat = statSync(targetPath);
905
+ // Skip files > 1MB
906
+ if (stat.size > 1_000_000) {
907
+ parts.push(`=== ${filePath} ===\n[File too large: ${(stat.size / 1024).toFixed(0)}KB]\n`);
908
+ skipped++;
909
+ continue;
910
+ }
911
+ const content = readFileSync(targetPath, "utf-8");
912
+ const lines = content.split("\n");
913
+ if (lines.length > READ_MANY_TRUNCATE_LINES) {
914
+ const truncated = lines.slice(0, READ_MANY_SHOW_LINES).join("\n");
915
+ parts.push(`=== ${filePath} ===\n${truncated}\n[... truncated — ${lines.length} total lines, showing first ${READ_MANY_SHOW_LINES}]\n`);
916
+ } else {
917
+ parts.push(`=== ${filePath} ===\n${content}\n`);
918
+ }
919
+ filesRead++;
920
+ } catch (err) {
921
+ parts.push(`=== ${filePath} ===\n[Error reading file: ${err}]\n`);
922
+ skipped++;
680
923
  }
681
- const summary = `Read ${filesRead} files, skipped ${skipped}${totalFound > limit ? `, ${totalFound - limit} more matched but not read (limit: ${limit})` : ""} — ${totalFound} total matches`;
682
- parts.push(summary);
683
- return { success: true, output: parts.join("\n") };
924
+ }
925
+ const summary = `Read ${filesRead} files, skipped ${skipped}${totalFound > limit ? `, ${totalFound - limit} more matched but not read (limit: ${limit})` : ""} — ${totalFound} total matches`;
926
+ parts.push(summary);
927
+ return {
928
+ success: true,
929
+ output: parts.join("\n")
930
+ };
684
931
  }
932
+
685
933
  // ============================================================================
686
934
  // EXECUTOR — dispatches to tool implementations in ./tools/
687
935
  // ============================================================================
688
- export async function executeLocalTool(name, input) {
689
- try {
690
- switch (name) {
691
- // File operations (tools/file-ops.ts)
692
- case "read_file": return await readFile(input);
693
- case "read_many_files": return await readManyFiles(input);
694
- case "write_file": return writeFile(input);
695
- case "edit_file": return editFile(input);
696
- case "list_directory": return listDirectory(input);
697
- case "search_files": return searchFiles(input);
698
- case "search_content": return searchContent(input);
699
- case "multi_edit": return multiEdit(input);
700
- case "notebook_edit": return notebookEdit(input);
701
- // Search (tools/search-tools.ts)
702
- case "glob": return globSearch(input);
703
- case "grep": return grepSearch(input);
704
- // Shell execution (tools/shell-exec.ts)
705
- case "run_command": return await runCommand(input);
706
- case "bash_output": return bashOutput(input);
707
- case "kill_shell": return killShell(input);
708
- case "list_shells": return listShellsFn();
709
- // Web (tools/web-tools.ts)
710
- case "web_fetch": return await webFetch(input);
711
- case "web_search": return await webSearch(input);
712
- // Tasks (tools/task-manager.ts)
713
- case "tasks": return tasksTool(input);
714
- // Agent tools (tools/agent-tools.ts)
715
- case "task": return await taskTool(input);
716
- case "team_create": return await teamCreateTool(input);
717
- case "team_auto": return await teamAutoTool(input);
718
- case "task_output": return await taskOutput(input);
719
- case "task_stop": return taskStop(input);
720
- case "config": return configTool(input);
721
- case "ask_user": return askUser(input);
722
- case "lsp": return await lspTool(input);
723
- case "skill": return skillTool(input);
724
- default: return { success: false, output: `Unknown local tool: ${name}` };
725
- }
726
- }
727
- catch (err) {
728
- return { success: false, output: `Error: ${err}` };
936
+
937
+ export async function executeLocalTool(name, input, signal) {
938
+ try {
939
+ switch (name) {
940
+ // File operations (tools/file-ops.ts)
941
+ case "read_file":
942
+ return await readFile(input);
943
+ case "read_many_files":
944
+ return await readManyFiles(input);
945
+ case "write_file":
946
+ return writeFile(input);
947
+ case "edit_file":
948
+ return editFile(input);
949
+ case "list_directory":
950
+ return listDirectory(input);
951
+ case "search_files":
952
+ return searchFiles(input);
953
+ case "search_content":
954
+ return searchContent(input);
955
+ case "multi_edit":
956
+ return multiEdit(input);
957
+ case "notebook_edit":
958
+ return notebookEdit(input);
959
+ // Search (tools/search-tools.ts)
960
+ case "glob":
961
+ return globSearch(input);
962
+ case "grep":
963
+ return grepSearch(input);
964
+ // Shell execution (tools/shell-exec.ts)
965
+ case "run_command":
966
+ return await runCommand(input);
967
+ case "bash_output":
968
+ return bashOutput(input);
969
+ case "kill_shell":
970
+ return killShell(input);
971
+ case "list_shells":
972
+ return listShellsFn();
973
+ // Web (tools/web-tools.ts)
974
+ case "web_fetch":
975
+ return await webFetch(input);
976
+ case "web_search":
977
+ return await webSearch(input);
978
+ // Tasks (tools/task-manager.ts)
979
+ case "tasks":
980
+ return tasksTool(input);
981
+ // Agent tools (tools/agent-tools.ts)
982
+ case "task":
983
+ return await taskTool(input, signal);
984
+ case "team_create":
985
+ return await teamCreateTool(input, signal);
986
+ case "team_auto":
987
+ return await teamAutoTool(input, signal);
988
+ case "task_output":
989
+ return await taskOutput(input);
990
+ case "task_stop":
991
+ return taskStop(input);
992
+ case "config":
993
+ return configTool(input);
994
+ case "ask_user":
995
+ return askUser(input);
996
+ case "lsp":
997
+ return await lspTool(input);
998
+ case "skill":
999
+ return skillTool(input);
1000
+ default:
1001
+ return {
1002
+ success: false,
1003
+ output: `Unknown local tool: ${name}`
1004
+ };
729
1005
  }
1006
+ } catch (err) {
1007
+ return {
1008
+ success: false,
1009
+ output: `Error: ${err}`
1010
+ };
1011
+ }
730
1012
  }
1013
+ //# sourceMappingURL=local-tools.js.map