@within-7/minto 0.4.1 → 0.4.2

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 (391) hide show
  1. package/dist/Tool.js +7 -0
  2. package/dist/Tool.js.map +2 -2
  3. package/dist/commands/agents/AgentsCommand.js +1 -1
  4. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  5. package/dist/commands/agents/constants.js +2 -2
  6. package/dist/commands/agents/constants.js.map +2 -2
  7. package/dist/commands/clear.js +4 -3
  8. package/dist/commands/clear.js.map +2 -2
  9. package/dist/commands/compact.js +2 -2
  10. package/dist/commands/compact.js.map +1 -1
  11. package/dist/commands/context.js +3 -1
  12. package/dist/commands/context.js.map +2 -2
  13. package/dist/commands/login.js +128 -0
  14. package/dist/commands/login.js.map +7 -0
  15. package/dist/commands/memory.js +33 -82
  16. package/dist/commands/memory.js.map +2 -2
  17. package/dist/commands/quit.js +3 -1
  18. package/dist/commands/quit.js.map +2 -2
  19. package/dist/commands/resume.js +39 -239
  20. package/dist/commands/resume.js.map +2 -2
  21. package/dist/commands/tasks.js +1 -1
  22. package/dist/commands/tasks.js.map +2 -2
  23. package/dist/commands/terminalSetup.js +6 -2
  24. package/dist/commands/terminalSetup.js.map +2 -2
  25. package/dist/commands.js +2 -0
  26. package/dist/commands.js.map +2 -2
  27. package/dist/components/AgentDetailView.js +126 -0
  28. package/dist/components/AgentDetailView.js.map +7 -0
  29. package/dist/components/AgentThinkingBlock.js +1 -1
  30. package/dist/components/AgentThinkingBlock.js.map +2 -2
  31. package/dist/components/AgentViewBanner.js +22 -0
  32. package/dist/components/AgentViewBanner.js.map +7 -0
  33. package/dist/components/HeaderBar.js +1 -1
  34. package/dist/components/HeaderBar.js.map +2 -2
  35. package/dist/components/Help.js +8 -1
  36. package/dist/components/Help.js.map +2 -2
  37. package/dist/components/HotkeyHelpPanel.js +26 -8
  38. package/dist/components/HotkeyHelpPanel.js.map +2 -2
  39. package/dist/components/IdleNotificationBar.js +10 -0
  40. package/dist/components/IdleNotificationBar.js.map +7 -0
  41. package/dist/components/ModelSelector/ModelSelector.js +55 -20
  42. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  43. package/dist/components/PromptInput.js +186 -115
  44. package/dist/components/PromptInput.js.map +2 -2
  45. package/dist/components/RewindPanel.js +272 -0
  46. package/dist/components/RewindPanel.js.map +7 -0
  47. package/dist/components/Spinner.js +10 -21
  48. package/dist/components/Spinner.js.map +2 -2
  49. package/dist/components/StreamingTextPreview.js +29 -0
  50. package/dist/components/StreamingTextPreview.js.map +7 -0
  51. package/dist/components/SubagentBlock.js +3 -2
  52. package/dist/components/SubagentBlock.js.map +2 -2
  53. package/dist/components/SubagentProgress.js +4 -4
  54. package/dist/components/SubagentProgress.js.map +2 -2
  55. package/dist/components/TabbedListView/SearchInput.js +1 -1
  56. package/dist/components/TabbedListView/SearchInput.js.map +2 -2
  57. package/dist/components/TabbedListView/TabbedListView.js +87 -41
  58. package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
  59. package/dist/components/TaskCard.js +4 -4
  60. package/dist/components/TaskCard.js.map +2 -2
  61. package/dist/components/TeamMemberPanel.js +107 -0
  62. package/dist/components/TeamMemberPanel.js.map +7 -0
  63. package/dist/components/ThinkingSelector.js +84 -0
  64. package/dist/components/ThinkingSelector.js.map +7 -0
  65. package/dist/components/TitledDivider.js +26 -0
  66. package/dist/components/TitledDivider.js.map +7 -0
  67. package/dist/components/TodoPanel.js +31 -30
  68. package/dist/components/TodoPanel.js.map +2 -2
  69. package/dist/components/TokenWarning.js +28 -7
  70. package/dist/components/TokenWarning.js.map +2 -2
  71. package/dist/components/messages/AssistantTextMessage.js +5 -2
  72. package/dist/components/messages/AssistantTextMessage.js.map +2 -2
  73. package/dist/components/messages/AssistantToolUseMessage.js +9 -1
  74. package/dist/components/messages/AssistantToolUseMessage.js.map +2 -2
  75. package/dist/components/messages/DefaultToolResultFallback.js +11 -0
  76. package/dist/components/messages/DefaultToolResultFallback.js.map +7 -0
  77. package/dist/components/messages/ParallelTasksGroupView.js +14 -6
  78. package/dist/components/messages/ParallelTasksGroupView.js.map +2 -2
  79. package/dist/components/messages/TaskInModuleView.js +27 -27
  80. package/dist/components/messages/TaskInModuleView.js.map +2 -2
  81. package/dist/components/messages/UserGuidanceMessage.js +26 -0
  82. package/dist/components/messages/UserGuidanceMessage.js.map +7 -0
  83. package/dist/components/messages/UserPromptMessage.js +2 -1
  84. package/dist/components/messages/UserPromptMessage.js.map +2 -2
  85. package/dist/components/messages/UserTeamNotificationMessage.js +91 -0
  86. package/dist/components/messages/UserTeamNotificationMessage.js.map +7 -0
  87. package/dist/components/messages/UserTextMessage.js +8 -0
  88. package/dist/components/messages/UserTextMessage.js.map +2 -2
  89. package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js +4 -2
  90. package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js.map +2 -2
  91. package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js +18 -1
  92. package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js.map +2 -2
  93. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +12 -1
  94. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +2 -2
  95. package/dist/components/permissions/PermissionRequest.js +4 -0
  96. package/dist/components/permissions/PermissionRequest.js.map +2 -2
  97. package/dist/components/permissions/PlanApprovalRequest.js +164 -0
  98. package/dist/components/permissions/PlanApprovalRequest.js.map +7 -0
  99. package/dist/constants/agentTeams.js +17 -0
  100. package/dist/constants/agentTeams.js.map +7 -0
  101. package/dist/constants/macros.js +2 -1
  102. package/dist/constants/macros.js.map +2 -2
  103. package/dist/constants/prompts/agentPrompt.js +1 -0
  104. package/dist/constants/prompts/agentPrompt.js.map +2 -2
  105. package/dist/constants/prompts/autoMemory.js +39 -0
  106. package/dist/constants/prompts/autoMemory.js.map +7 -0
  107. package/dist/constants/prompts/codeConventions.js +1 -13
  108. package/dist/constants/prompts/codeConventions.js.map +2 -2
  109. package/dist/constants/prompts/doingTasks.js +21 -2
  110. package/dist/constants/prompts/doingTasks.js.map +2 -2
  111. package/dist/constants/prompts/envInfo.js +6 -7
  112. package/dist/constants/prompts/envInfo.js.map +2 -2
  113. package/dist/constants/prompts/index.js +27 -5
  114. package/dist/constants/prompts/index.js.map +2 -2
  115. package/dist/constants/prompts/taskManagement.js +2 -43
  116. package/dist/constants/prompts/taskManagement.js.map +2 -2
  117. package/dist/constants/prompts/teamOverlays.js +50 -0
  118. package/dist/constants/prompts/teamOverlays.js.map +7 -0
  119. package/dist/constants/prompts/toneAndStyle.js +4 -29
  120. package/dist/constants/prompts/toneAndStyle.js.map +2 -2
  121. package/dist/constants/prompts/toolUsagePolicy.js +7 -22
  122. package/dist/constants/prompts/toolUsagePolicy.js.map +2 -2
  123. package/dist/constants/toolInputExamples.js +2 -2
  124. package/dist/constants/toolInputExamples.js.map +2 -2
  125. package/dist/context.js +39 -6
  126. package/dist/context.js.map +2 -2
  127. package/dist/core/backupManager.js +1 -1
  128. package/dist/core/backupManager.js.map +2 -2
  129. package/dist/core/permissions/rules/planModeRule.js +1 -1
  130. package/dist/core/permissions/rules/planModeRule.js.map +1 -1
  131. package/dist/core/permissions/rules/safeModeRule.js +1 -1
  132. package/dist/core/permissions/rules/safeModeRule.js.map +1 -1
  133. package/dist/engine/AgentEngine.js +902 -0
  134. package/dist/engine/AgentEngine.js.map +7 -0
  135. package/dist/engine/EngineRegistry.js +89 -0
  136. package/dist/engine/EngineRegistry.js.map +7 -0
  137. package/dist/engine/foregroundAdapter.js +191 -0
  138. package/dist/engine/foregroundAdapter.js.map +7 -0
  139. package/dist/engine/index.js +15 -0
  140. package/dist/engine/index.js.map +7 -0
  141. package/dist/engine/types.js +1 -0
  142. package/dist/engine/types.js.map +7 -0
  143. package/dist/entrypoints/cli.js +410 -79
  144. package/dist/entrypoints/cli.js.map +3 -3
  145. package/dist/hooks/useAgentEngine.js +129 -0
  146. package/dist/hooks/useAgentEngine.js.map +7 -0
  147. package/dist/hooks/useAgentTokenStats.js +0 -16
  148. package/dist/hooks/useAgentTokenStats.js.map +2 -2
  149. package/dist/hooks/useCanUseTool.js +47 -2
  150. package/dist/hooks/useCanUseTool.js.map +2 -2
  151. package/dist/hooks/useDeferredLoading.js +4 -1
  152. package/dist/hooks/useDeferredLoading.js.map +2 -2
  153. package/dist/hooks/useIdleNotifications.js +66 -0
  154. package/dist/hooks/useIdleNotifications.js.map +7 -0
  155. package/dist/hooks/useSessionTracking.js +9 -7
  156. package/dist/hooks/useSessionTracking.js.map +2 -2
  157. package/dist/hooks/useTeamMembers.js +51 -0
  158. package/dist/hooks/useTeamMembers.js.map +7 -0
  159. package/dist/i18n/locales/en.js +77 -12
  160. package/dist/i18n/locales/en.js.map +2 -2
  161. package/dist/i18n/locales/zh-CN.js +77 -12
  162. package/dist/i18n/locales/zh-CN.js.map +2 -2
  163. package/dist/i18n/types.js.map +1 -1
  164. package/dist/messages.js.map +2 -2
  165. package/dist/permissions.js +113 -7
  166. package/dist/permissions.js.map +2 -2
  167. package/dist/query.js +135 -37
  168. package/dist/query.js.map +2 -2
  169. package/dist/screens/REPL.js +504 -361
  170. package/dist/screens/REPL.js.map +3 -3
  171. package/dist/screens/ResumeConversation.js +199 -14
  172. package/dist/screens/ResumeConversation.js.map +2 -2
  173. package/dist/services/adapters/base.js.map +1 -1
  174. package/dist/services/agentTeams/backends/headless.js +108 -0
  175. package/dist/services/agentTeams/backends/headless.js.map +7 -0
  176. package/dist/services/agentTeams/backends/inProcess.js +102 -0
  177. package/dist/services/agentTeams/backends/inProcess.js.map +7 -0
  178. package/dist/services/agentTeams/backends/resolver.js +18 -0
  179. package/dist/services/agentTeams/backends/resolver.js.map +7 -0
  180. package/dist/services/agentTeams/backends/tmux.js +168 -0
  181. package/dist/services/agentTeams/backends/tmux.js.map +7 -0
  182. package/dist/services/agentTeams/backends/types.js +1 -0
  183. package/dist/services/agentTeams/backends/types.js.map +7 -0
  184. package/dist/services/agentTeams/heartbeat.js +88 -0
  185. package/dist/services/agentTeams/heartbeat.js.map +7 -0
  186. package/dist/services/agentTeams/index.js +42 -2
  187. package/dist/services/agentTeams/index.js.map +2 -2
  188. package/dist/services/agentTeams/injectionChannel.js +105 -0
  189. package/dist/services/agentTeams/injectionChannel.js.map +7 -0
  190. package/dist/services/agentTeams/mailbox.js +410 -30
  191. package/dist/services/agentTeams/mailbox.js.map +2 -2
  192. package/dist/services/agentTeams/messageFormatter.js +80 -0
  193. package/dist/services/agentTeams/messageFormatter.js.map +7 -0
  194. package/dist/services/agentTeams/permissionDelegation.js +71 -0
  195. package/dist/services/agentTeams/permissionDelegation.js.map +7 -0
  196. package/dist/services/agentTeams/teamEvents.js +45 -0
  197. package/dist/services/agentTeams/teamEvents.js.map +7 -0
  198. package/dist/services/agentTeams/teamManager.js +251 -34
  199. package/dist/services/agentTeams/teamManager.js.map +2 -2
  200. package/dist/services/agentTeams/teamTaskStore.js +290 -61
  201. package/dist/services/agentTeams/teamTaskStore.js.map +2 -2
  202. package/dist/services/agentTeams/teammateSpawner.js +99 -18
  203. package/dist/services/agentTeams/teammateSpawner.js.map +2 -2
  204. package/dist/services/hookExecutor.js +51 -8
  205. package/dist/services/hookExecutor.js.map +2 -2
  206. package/dist/services/llm/anthropicProvider.js +56 -59
  207. package/dist/services/llm/anthropicProvider.js.map +2 -2
  208. package/dist/services/llm/dispatch.js +24 -5
  209. package/dist/services/llm/dispatch.js.map +2 -2
  210. package/dist/services/llm/openaiProvider.js +115 -136
  211. package/dist/services/llm/openaiProvider.js.map +3 -3
  212. package/dist/services/llm/types.js +89 -15
  213. package/dist/services/llm/types.js.map +2 -2
  214. package/dist/services/mcpClient.js +80 -4
  215. package/dist/services/mcpClient.js.map +2 -2
  216. package/dist/services/mintoAuth.js +299 -0
  217. package/dist/services/mintoAuth.js.map +7 -0
  218. package/dist/services/oauth.js +3 -3
  219. package/dist/services/oauth.js.map +2 -2
  220. package/dist/services/openai.js +91 -20
  221. package/dist/services/openai.js.map +2 -2
  222. package/dist/services/plugins/pluginRuntime.js +11 -5
  223. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  224. package/dist/services/plugins/pluginValidation.js +4 -2
  225. package/dist/services/plugins/pluginValidation.js.map +2 -2
  226. package/dist/services/sandbox/sandboxController.js +11 -3
  227. package/dist/services/sandbox/sandboxController.js.map +2 -2
  228. package/dist/services/sessionMemoryInjector.js +77 -0
  229. package/dist/services/sessionMemoryInjector.js.map +7 -0
  230. package/dist/services/systemReminder.js +130 -8
  231. package/dist/services/systemReminder.js.map +2 -2
  232. package/dist/services/taskStore.js +199 -8
  233. package/dist/services/taskStore.js.map +3 -3
  234. package/dist/services/topicDetector.js +169 -0
  235. package/dist/services/topicDetector.js.map +7 -0
  236. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +0 -13
  237. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +2 -2
  238. package/dist/tools/BashTool/BashTool.js +51 -28
  239. package/dist/tools/BashTool/BashTool.js.map +2 -2
  240. package/dist/tools/BashTool/prompt.js +95 -118
  241. package/dist/tools/BashTool/prompt.js.map +2 -2
  242. package/dist/tools/BashTool/utils.js +39 -1
  243. package/dist/tools/BashTool/utils.js.map +2 -2
  244. package/dist/tools/EnterWorktreeTool/EnterWorktreeTool.js +121 -0
  245. package/dist/tools/EnterWorktreeTool/EnterWorktreeTool.js.map +7 -0
  246. package/dist/tools/EnterWorktreeTool/prompt.js +22 -0
  247. package/dist/tools/EnterWorktreeTool/prompt.js.map +7 -0
  248. package/dist/tools/FileEditTool/FileEditTool.js +9 -4
  249. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  250. package/dist/tools/FileEditTool/prompt.js +3 -7
  251. package/dist/tools/FileEditTool/prompt.js.map +2 -2
  252. package/dist/tools/FileReadTool/FileReadTool.js +125 -3
  253. package/dist/tools/FileReadTool/FileReadTool.js.map +2 -2
  254. package/dist/tools/FileReadTool/prompt.js +1 -2
  255. package/dist/tools/FileReadTool/prompt.js.map +2 -2
  256. package/dist/tools/FileWriteTool/prompt.js +3 -5
  257. package/dist/tools/FileWriteTool/prompt.js.map +2 -2
  258. package/dist/tools/GlobTool/GlobTool.js +3 -2
  259. package/dist/tools/GlobTool/GlobTool.js.map +2 -2
  260. package/dist/tools/GrepTool/GrepTool.js +16 -5
  261. package/dist/tools/GrepTool/GrepTool.js.map +2 -2
  262. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +2 -2
  263. package/dist/tools/MCPSearchTool/MCPSearchTool.js +172 -0
  264. package/dist/tools/MCPSearchTool/MCPSearchTool.js.map +7 -0
  265. package/dist/tools/MCPSearchTool/prompt.js +77 -0
  266. package/dist/tools/MCPSearchTool/prompt.js.map +7 -0
  267. package/dist/tools/MultiEditTool/prompt.js +4 -7
  268. package/dist/tools/MultiEditTool/prompt.js.map +2 -2
  269. package/dist/tools/PlanModeTool/EnterPlanModeTool.js +12 -8
  270. package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
  271. package/dist/tools/PlanModeTool/ExitPlanModeTool.js +54 -1
  272. package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
  273. package/dist/tools/PlanModeTool/prompt.js +23 -74
  274. package/dist/tools/PlanModeTool/prompt.js.map +2 -2
  275. package/dist/tools/SendMessageTool/SendMessageTool.js +341 -0
  276. package/dist/tools/SendMessageTool/SendMessageTool.js.map +7 -0
  277. package/dist/tools/SendMessageTool/prompt.js +44 -0
  278. package/dist/tools/SendMessageTool/prompt.js.map +7 -0
  279. package/dist/tools/TaskCreateTool/prompt.js +15 -4
  280. package/dist/tools/TaskCreateTool/prompt.js.map +2 -2
  281. package/dist/tools/TaskListTool/prompt.js +18 -3
  282. package/dist/tools/TaskListTool/prompt.js.map +2 -2
  283. package/dist/tools/TaskOutputTool/prompt.js +4 -3
  284. package/dist/tools/TaskOutputTool/prompt.js.map +2 -2
  285. package/dist/tools/TaskTool/TaskTool.js +762 -98
  286. package/dist/tools/TaskTool/TaskTool.js.map +3 -3
  287. package/dist/tools/TaskTool/constants.js +8 -2
  288. package/dist/tools/TaskTool/constants.js.map +2 -2
  289. package/dist/tools/TaskTool/prompt.js +74 -70
  290. package/dist/tools/TaskTool/prompt.js.map +2 -2
  291. package/dist/tools/TaskUpdateTool/TaskUpdateTool.js +15 -1
  292. package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +2 -2
  293. package/dist/tools/TeamCreateTool/TeamCreateTool.js +129 -0
  294. package/dist/tools/TeamCreateTool/TeamCreateTool.js.map +7 -0
  295. package/dist/tools/TeamCreateTool/prompt.js +58 -0
  296. package/dist/tools/TeamCreateTool/prompt.js.map +7 -0
  297. package/dist/tools/TeamDeleteTool/TeamDeleteTool.js +151 -0
  298. package/dist/tools/TeamDeleteTool/TeamDeleteTool.js.map +7 -0
  299. package/dist/tools/TeamDeleteTool/prompt.js +16 -0
  300. package/dist/tools/TeamDeleteTool/prompt.js.map +7 -0
  301. package/dist/tools/URLFetcherTool/URLFetcherTool.js +106 -15
  302. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +2 -2
  303. package/dist/tools/URLFetcherTool/prompt.js +3 -2
  304. package/dist/tools/URLFetcherTool/prompt.js.map +2 -2
  305. package/dist/tools/WebSearchTool/WebSearchTool.js +2 -1
  306. package/dist/tools/WebSearchTool/WebSearchTool.js.map +2 -2
  307. package/dist/tools/WebSearchTool/prompt.js +5 -4
  308. package/dist/tools/WebSearchTool/prompt.js.map +2 -2
  309. package/dist/tools.js +100 -20
  310. package/dist/tools.js.map +2 -2
  311. package/dist/types/PermissionMode.js +35 -6
  312. package/dist/types/PermissionMode.js.map +2 -2
  313. package/dist/types/hooks.js +2 -0
  314. package/dist/types/hooks.js.map +2 -2
  315. package/dist/types/plugin.js +2 -0
  316. package/dist/types/plugin.js.map +3 -3
  317. package/dist/utils/CircuitBreaker.js +15 -9
  318. package/dist/utils/CircuitBreaker.js.map +2 -2
  319. package/dist/utils/agentLoader.js +249 -112
  320. package/dist/utils/agentLoader.js.map +2 -2
  321. package/dist/utils/animationManager.js +40 -3
  322. package/dist/utils/animationManager.js.map +2 -2
  323. package/dist/utils/ask.js +7 -6
  324. package/dist/utils/ask.js.map +2 -2
  325. package/dist/utils/atomicWrite.js +23 -0
  326. package/dist/utils/atomicWrite.js.map +7 -0
  327. package/dist/utils/autoCompactCore.js +73 -56
  328. package/dist/utils/autoCompactCore.js.map +2 -2
  329. package/dist/utils/autoMemoryPaths.js +89 -0
  330. package/dist/utils/autoMemoryPaths.js.map +7 -0
  331. package/dist/utils/config.js +63 -38
  332. package/dist/utils/config.js.map +2 -2
  333. package/dist/utils/configSchema.js +13 -8
  334. package/dist/utils/configSchema.js.map +2 -2
  335. package/dist/utils/credentials/index.js +14 -0
  336. package/dist/utils/credentials/index.js.map +2 -2
  337. package/dist/utils/dualPath.js +24 -0
  338. package/dist/utils/dualPath.js.map +7 -0
  339. package/dist/utils/exit.js +66 -7
  340. package/dist/utils/exit.js.map +2 -2
  341. package/dist/utils/externalEditor.js +155 -0
  342. package/dist/utils/externalEditor.js.map +7 -0
  343. package/dist/utils/fileLock.js +67 -0
  344. package/dist/utils/fileLock.js.map +7 -0
  345. package/dist/utils/format.js +24 -14
  346. package/dist/utils/format.js.map +2 -2
  347. package/dist/utils/globalErrorHandler.js +5 -96
  348. package/dist/utils/globalErrorHandler.js.map +3 -3
  349. package/dist/utils/groupHandlers/parallelTasksHandler.js +5 -3
  350. package/dist/utils/groupHandlers/parallelTasksHandler.js.map +2 -2
  351. package/dist/utils/groupHandlers/taskHandler.js +2 -2
  352. package/dist/utils/groupHandlers/taskHandler.js.map +2 -2
  353. package/dist/utils/hookManager.js +64 -6
  354. package/dist/utils/hookManager.js.map +2 -2
  355. package/dist/utils/log.js +6 -2
  356. package/dist/utils/log.js.map +2 -2
  357. package/dist/utils/markdown.js +237 -19
  358. package/dist/utils/markdown.js.map +2 -2
  359. package/dist/utils/messageContextManager.js +18 -5
  360. package/dist/utils/messageContextManager.js.map +2 -2
  361. package/dist/utils/messageGroupManager.js +1 -1
  362. package/dist/utils/messageGroupManager.js.map +2 -2
  363. package/dist/utils/messages.js +104 -46
  364. package/dist/utils/messages.js.map +2 -2
  365. package/dist/utils/model.js +2 -2
  366. package/dist/utils/model.js.map +2 -2
  367. package/dist/utils/pasteCache.js +8 -4
  368. package/dist/utils/pasteCache.js.map +2 -2
  369. package/dist/utils/pluginLoader.js +18 -0
  370. package/dist/utils/pluginLoader.js.map +2 -2
  371. package/dist/utils/secureKeyStorage.js +36 -7
  372. package/dist/utils/secureKeyStorage.js.map +2 -2
  373. package/dist/utils/simpleMode.js +7 -0
  374. package/dist/utils/simpleMode.js.map +7 -0
  375. package/dist/utils/streamingState.js +11 -1
  376. package/dist/utils/streamingState.js.map +2 -2
  377. package/dist/utils/taskDisplayUtils.js +2 -1
  378. package/dist/utils/taskDisplayUtils.js.map +2 -2
  379. package/dist/utils/teamConfig.js +2 -2
  380. package/dist/utils/teamConfig.js.map +2 -2
  381. package/dist/utils/thinking.js +6 -2
  382. package/dist/utils/thinking.js.map +3 -3
  383. package/dist/utils/tokenProgress.js +55 -0
  384. package/dist/utils/tokenProgress.js.map +7 -0
  385. package/dist/utils/toolRiskClassification.js +26 -17
  386. package/dist/utils/toolRiskClassification.js.map +2 -2
  387. package/dist/utils/tooling/toolError.js +12 -0
  388. package/dist/utils/tooling/toolError.js.map +7 -0
  389. package/dist/version.js +2 -2
  390. package/dist/version.js.map +1 -1
  391. package/package.json +10 -8
@@ -1,12 +1,16 @@
1
1
  import { getTools, getReadOnlyTools } from "../../tools.js";
2
- import { TaskTool } from "./TaskTool.js";
3
- import { FileWriteTool } from "../FileWriteTool/FileWriteTool.js";
4
- import { GlobTool } from "../GlobTool/GlobTool.js";
5
- import { FileReadTool } from "../FileReadTool/FileReadTool.js";
6
2
  import { getActiveAgents } from "../../utils/agentLoader.js";
3
+ const EXCLUDED_AGENT_TOOLS = /* @__PURE__ */ new Set([
4
+ "Agent",
5
+ // Prevent recursive TaskTool calls (unless explicitly allowed via toolFilter)
6
+ "TeamCreate",
7
+ // Team management is leader-only
8
+ "TeamDelete"
9
+ // Team management is leader-only
10
+ ]);
7
11
  async function getTaskTools(safeMode) {
8
12
  return (await (!safeMode ? getTools() : getReadOnlyTools())).filter(
9
- (_) => _.name !== TaskTool.name
13
+ (_) => !EXCLUDED_AGENT_TOOLS.has(_.name)
10
14
  );
11
15
  }
12
16
  async function getPrompt(safeMode) {
@@ -15,100 +19,100 @@ async function getPrompt(safeMode) {
15
19
  const toolsStr = Array.isArray(agent.tools) ? agent.tools.join(", ") : "*";
16
20
  return `- ${agent.agentType}: ${agent.whenToUse} (Tools: ${toolsStr})`;
17
21
  }).join("\n");
18
- return `Launch a new agent to handle complex, multi-step tasks autonomously.
22
+ return `Launch a new agent to handle complex, multi-step tasks autonomously.
23
+
24
+ The Agent tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.
19
25
 
20
26
  Available agent types and the tools they have access to:
21
27
  ${agentDescriptions}
22
28
 
23
- When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.
29
+ When using the Agent tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.
24
30
 
25
- \u{1F6A8} CRITICAL: You MUST use the EXACT agent type name from the list above. Common mistakes to avoid:
31
+ When to use the Agent tool:
32
+ - When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Agent(description="Check the file", prompt="/check-file path/to/file.py")
26
33
 
27
- NAMING FORMAT:
28
- - \u2705 ALWAYS use hyphens (-): "strategic-market-analyzer", "business-analyst", "qa-engineer"
29
- - \u274C NEVER use underscores (_): "strategic_market_analyzer", "business_analyst"
30
- - \u274C NEVER use spaces: "strategic market analyzer", "business analyst"
31
- - \u274C NEVER invent names: "researcher", "analyst", "data_analyst"
34
+ When NOT to use the Agent tool:
35
+ - If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
36
+ - If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
37
+ - If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
38
+ - Other tasks that are not related to the agent descriptions above
32
39
 
33
- SELECTION RULES:
34
- 1. For market/business analysis \u2192 use "strategic-market-analyzer" or "business-analyst"
35
- 2. For data analysis \u2192 use "data-scientist"
36
- 3. For general tasks \u2192 use "general-purpose"
37
- 4. For code/QA tasks \u2192 use "qa-engineer" or "code-reviewer"
40
+ ## Parallel Tasks vs Agent Teams \u2014 Decision Framework
38
41
 
39
- If unsure, use "general-purpose" - it has access to all tools.
42
+ **USER INTENT OVERRIDE: If the user explicitly asks for a team, swarm, or multi-agent group, ALWAYS use Agent Teams regardless of the heuristics below.**
40
43
 
41
- When to use the Agent tool:
42
- - When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file", prompt="/check-file path/to/file.py")
44
+ You have TWO ways to run multiple agents. Choose the right one:
43
45
 
44
- When NOT to use the Agent tool:
45
- - If you want to read a specific file path, use the ${FileReadTool.name} or ${GlobTool.name} tool instead of the Agent tool, to find the match more quickly
46
- - If you are searching for a specific class definition like "class Foo", use the ${GlobTool.name} tool instead, to find the match more quickly
47
- - If you are searching for code within a specific file or set of 2-3 files, use the ${FileReadTool.name} tool instead of the Agent tool, to find the match more quickly
48
- - Other tasks that are not related to the agent descriptions above
46
+ ### Parallel Tasks (multiple Agent calls in one message) \u2014 DEFAULT CHOICE
47
+ Use when tasks are **independent and fire-and-forget**:
48
+ - Each agent works alone, returns a result, and is done
49
+ - No agent needs to see another agent's output to do its work
50
+ - You (the orchestrator) synthesize all results after they return
51
+
52
+ Examples: analyze 3 files, search 5 code patterns, run independent checks
53
+
54
+ ### Agent Teams (TeamCreate + SendMessage) \u2014 for collaboration or user-requested teams
55
+ Use when agents **must communicate with each other** during execution, or when the user explicitly requests a team:
56
+ - Agent A's output feeds into Agent B's work (and B may send findings back to A)
57
+ - Agents need a shared task board to coordinate who does what
58
+ - The work requires multiple rounds of back-and-forth between agents
59
+ - Agents need to persist across rounds and be reassigned new tasks
60
+
61
+ **Important**: Teammates in a team automatically run in background, so you (the team-lead) remain available to process messages and coordinate work.
62
+
63
+ Examples: researcher finds info \u2192 implementer codes it \u2192 tester validates \u2192 implementer fixes issues
64
+
65
+ ### Decision Checklist
66
+ Ask yourself: "Did the user ask for a team, OR do agents need to TALK TO EACH OTHER?"
67
+ - **User asked for a team** \u2192 Use Agent Teams (always honor explicit requests)
68
+ - **No communication needed** \u2192 Use parallel Agent calls (simple, fast, no overhead)
69
+ - **Agents must communicate** \u2192 Use Agent Teams (TeamCreate + spawn teammates + SendMessage)
70
+
71
+ **Efficiency tip:** For independent tasks, parallel Agent calls are simpler and faster. But always defer to user intent \u2014 if they ask for a team, create one.
49
72
 
50
73
  Usage notes:
51
74
  - Always include a short description (3-5 words) summarizing what the agent will do
52
75
  - Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
53
76
  - When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
54
- - You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, the tool result will include an output_file path. To check on the agent's progress or retrieve its results, use the Read tool to read the output file, or use Bash with \`tail\` to see recent output. You can continue working while background agents run.
77
+ - **Foreground tasks return results directly** \u2014 when a foreground Agent (including parallel Agents) completes, its result and agentId are returned inline in the tool result. Do NOT call TaskOutput for foreground tasks; their results are already in your context. TaskOutput is ONLY for background tasks started with \`run_in_background: true\`.
78
+ - You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, you will be automatically notified when it completes \u2014 do NOT sleep, poll, or proactively check on its progress. Continue with other work or respond to the user instead.
79
+ - **Foreground vs background**: Use foreground (default) when you need the agent's results before you can proceed \u2014 e.g., research agents whose findings inform your next steps. Use background when you have genuinely independent work to do in parallel.
80
+ - When using Agent Teams (TeamCreate), teammates automatically run in background so you remain available to coordinate. After spawning all teammates, respond to the user with a brief status (e.g., "Agents are working...") and STOP \u2014 do NOT manually read files, check inboxes, or use TaskOutput. Teammate results are delivered to you automatically as new messages.
55
81
  - Agents can be resumed using the \`resume\` parameter by passing the agent ID from a previous invocation. When resumed, the agent continues with its full previous context preserved. When NOT resuming, each invocation starts fresh and you should provide a detailed task description with all necessary context.
56
82
  - When the agent is done, it will return a single message back to you along with its agent ID. You can use this ID to resume the agent later if needed for follow-up work.
57
83
  - Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.
58
- - Agents with "access to current context" can see the full conversation history before the tool call. When using these agents, you can write concise prompts that reference earlier context (e.g., "investigate the error discussed above") instead of repeating information. The agent will receive all prior messages and understand the context.
59
84
  - The agent's outputs should generally be trusted
60
85
  - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
61
86
  - If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
62
- - If the user specifies that they want you to run agents "in parallel", you MUST send a single message with multiple Task tool use content blocks.
87
+ - If the user specifies that they want you to run agents "in parallel", you MUST send a single message with multiple Agent tool use content blocks.
63
88
 
64
89
  Example usage:
65
90
 
66
91
  <example>
67
- <scenario>Market research analysis with multiple files</scenario>
68
- user: "Analyze these 3 market research reports and summarize findings"
69
- assistant: I'll use multiple subagents to analyze the reports in parallel.
70
- <uses Task tool>
71
- subagent_type: "strategic-market-analyzer"
72
- prompt: "Analyze market_report_1.md and provide key insights..."
73
- </uses Task tool>
74
- <uses Task tool>
75
- subagent_type: "strategic-market-analyzer"
76
- prompt: "Analyze market_report_2.md and provide key insights..."
77
- </uses Task tool>
78
- <uses Task tool>
79
- subagent_type: "business-analyst"
80
- prompt: "Analyze financial_report.md and provide key insights..."
81
- </uses Task tool>
82
- </example>
83
-
84
- <example>
85
- <scenario>Code review after implementation</scenario>
86
92
  user: "Please write a function that checks if a number is prime"
87
- assistant: First let me use the ${FileWriteTool.name} tool to write the function
88
- <writes code>
89
- assistant: Now let me use the code-reviewer agent to review the code
90
- <uses Task tool>
91
- subagent_type: "code-reviewer"
92
- prompt: "Review the isPrime function in utils.js for correctness and performance"
93
- </uses Task tool>
93
+ assistant: I'm going to use the Write tool to write the following code:
94
+ <code>
95
+ function isPrime(n) {
96
+ if (n <= 1) return false
97
+ for (let i = 2; i * i <= n; i++) {
98
+ if (n % i === 0) return false
99
+ }
100
+ return true
101
+ }
102
+ </code>
103
+ <commentary>
104
+ Since a significant piece of code was written and the task was completed, now use the test-runner agent to run the tests
105
+ </commentary>
106
+ assistant: Uses the Agent tool to launch the test-runner agent
94
107
  </example>
95
108
 
96
109
  <example>
97
- <scenario>Data analysis task</scenario>
98
- user: "Analyze the CSV data in sales.csv and find trends"
99
- assistant: I'll use the data-scientist agent to analyze this data
100
- <uses Task tool>
101
- subagent_type: "data-scientist"
102
- prompt: "Analyze sales.csv and identify trends, patterns, and anomalies"
103
- </uses Task tool>
104
- </example>
105
-
106
- \u274C WRONG EXAMPLES (DO NOT DO THIS):
107
- <wrong_example>
108
- subagent_type: "researcher" \u2190 WRONG! This agent type doesn't exist
109
- subagent_type: "market_analyzer" \u2190 WRONG! Uses underscore instead of hyphen
110
- subagent_type: "data analyst" \u2190 WRONG! Uses space instead of hyphen
111
- </wrong_example>`;
110
+ user: "Hello"
111
+ <commentary>
112
+ Since the user is greeting, use the greeting-responder agent to respond with a friendly joke
113
+ </commentary>
114
+ assistant: "I'm going to use the Agent tool to launch the greeting-responder agent"
115
+ </example>`;
112
116
  }
113
117
  export {
114
118
  getPrompt,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/TaskTool/prompt.ts"],
4
- "sourcesContent": ["import { type Tool } from '@tool'\nimport { getTools, getReadOnlyTools } from '@tools'\nimport { TaskTool } from './TaskTool'\nimport { BashTool } from '@tools/BashTool/BashTool'\nimport { FileWriteTool } from '@tools/FileWriteTool/FileWriteTool'\nimport { FileEditTool } from '@tools/FileEditTool/FileEditTool'\nimport { NotebookEditTool } from '@tools/NotebookEditTool/NotebookEditTool'\nimport { GlobTool } from '@tools/GlobTool/GlobTool'\nimport { FileReadTool } from '@tools/FileReadTool/FileReadTool'\nimport { getModelManager } from '@utils/model'\nimport { getActiveAgents } from '@utils/agentLoader'\n\nexport async function getTaskTools(safeMode: boolean): Promise<Tool[]> {\n // No recursive tasks, yet..\n return (await (!safeMode ? getTools() : getReadOnlyTools())).filter(\n _ => _.name !== TaskTool.name,\n )\n}\n\nexport async function getPrompt(safeMode: boolean): Promise<string> {\n const agents = await getActiveAgents()\n\n // Format: (Tools: tool1, tool2)\n const agentDescriptions = agents\n .map(agent => {\n const toolsStr = Array.isArray(agent.tools) ? agent.tools.join(', ') : '*'\n return `- ${agent.agentType}: ${agent.whenToUse} (Tools: ${toolsStr})`\n })\n .join('\\n')\n\n return `Launch a new agent to handle complex, multi-step tasks autonomously. \n\nAvailable agent types and the tools they have access to:\n${agentDescriptions}\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\n\uD83D\uDEA8 CRITICAL: You MUST use the EXACT agent type name from the list above. Common mistakes to avoid:\n\nNAMING FORMAT:\n- \u2705 ALWAYS use hyphens (-): \"strategic-market-analyzer\", \"business-analyst\", \"qa-engineer\"\n- \u274C NEVER use underscores (_): \"strategic_market_analyzer\", \"business_analyst\"\n- \u274C NEVER use spaces: \"strategic market analyzer\", \"business analyst\"\n- \u274C NEVER invent names: \"researcher\", \"analyst\", \"data_analyst\"\n\nSELECTION RULES:\n1. For market/business analysis \u2192 use \"strategic-market-analyzer\" or \"business-analyst\"\n2. For data analysis \u2192 use \"data-scientist\"\n3. For general tasks \u2192 use \"general-purpose\"\n4. For code/QA tasks \u2192 use \"qa-engineer\" or \"code-reviewer\"\n\nIf unsure, use \"general-purpose\" - it has access to all tools.\n\nWhen to use the Agent tool:\n- When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description=\"Check the file\", prompt=\"/check-file path/to/file.py\")\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the ${FileReadTool.name} or ${GlobTool.name} tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the ${GlobTool.name} tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the ${FileReadTool.name} tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\nUsage notes:\n- Always include a short description (3-5 words) summarizing what the agent will do\n- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n- You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, the tool result will include an output_file path. To check on the agent's progress or retrieve its results, use the Read tool to read the output file, or use Bash with \\`tail\\` to see recent output. You can continue working while background agents run.\n- Agents can be resumed using the \\`resume\\` parameter by passing the agent ID from a previous invocation. When resumed, the agent continues with its full previous context preserved. When NOT resuming, each invocation starts fresh and you should provide a detailed task description with all necessary context.\n- When the agent is done, it will return a single message back to you along with its agent ID. You can use this ID to resume the agent later if needed for follow-up work.\n- Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.\n- Agents with \"access to current context\" can see the full conversation history before the tool call. When using these agents, you can write concise prompts that reference earlier context (e.g., \"investigate the error discussed above\") instead of repeating information. The agent will receive all prior messages and understand the context.\n- The agent's outputs should generally be trusted\n- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n- If the user specifies that they want you to run agents \"in parallel\", you MUST send a single message with multiple Task tool use content blocks.\n\nExample usage:\n\n<example>\n<scenario>Market research analysis with multiple files</scenario>\nuser: \"Analyze these 3 market research reports and summarize findings\"\nassistant: I'll use multiple subagents to analyze the reports in parallel.\n<uses Task tool>\nsubagent_type: \"strategic-market-analyzer\"\nprompt: \"Analyze market_report_1.md and provide key insights...\"\n</uses Task tool>\n<uses Task tool>\nsubagent_type: \"strategic-market-analyzer\"\nprompt: \"Analyze market_report_2.md and provide key insights...\"\n</uses Task tool>\n<uses Task tool>\nsubagent_type: \"business-analyst\"\nprompt: \"Analyze financial_report.md and provide key insights...\"\n</uses Task tool>\n</example>\n\n<example>\n<scenario>Code review after implementation</scenario>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: First let me use the ${FileWriteTool.name} tool to write the function\n<writes code>\nassistant: Now let me use the code-reviewer agent to review the code\n<uses Task tool>\nsubagent_type: \"code-reviewer\"\nprompt: \"Review the isPrime function in utils.js for correctness and performance\"\n</uses Task tool>\n</example>\n\n<example>\n<scenario>Data analysis task</scenario>\nuser: \"Analyze the CSV data in sales.csv and find trends\"\nassistant: I'll use the data-scientist agent to analyze this data\n<uses Task tool>\nsubagent_type: \"data-scientist\"\nprompt: \"Analyze sales.csv and identify trends, patterns, and anomalies\"\n</uses Task tool>\n</example>\n\n\u274C WRONG EXAMPLES (DO NOT DO THIS):\n<wrong_example>\nsubagent_type: \"researcher\" \u2190 WRONG! This agent type doesn't exist\nsubagent_type: \"market_analyzer\" \u2190 WRONG! Uses underscore instead of hyphen\nsubagent_type: \"data analyst\" \u2190 WRONG! Uses space instead of hyphen\n</wrong_example>`\n}\n"],
5
- "mappings": "AACA,SAAS,UAAU,wBAAwB;AAC3C,SAAS,gBAAgB;AAEzB,SAAS,qBAAqB;AAG9B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;AAEhC,eAAsB,aAAa,UAAoC;AAErE,UAAQ,OAAO,CAAC,WAAW,SAAS,IAAI,iBAAiB,IAAI;AAAA,IAC3D,OAAK,EAAE,SAAS,SAAS;AAAA,EAC3B;AACF;AAEA,eAAsB,UAAU,UAAoC;AAClE,QAAM,SAAS,MAAM,gBAAgB;AAGrC,QAAM,oBAAoB,OACvB,IAAI,WAAS;AACZ,UAAM,WAAW,MAAM,QAAQ,MAAM,KAAK,IAAI,MAAM,MAAM,KAAK,IAAI,IAAI;AACvE,WAAO,KAAK,MAAM,SAAS,KAAK,MAAM,SAAS,YAAY,QAAQ;AAAA,EACrE,CAAC,EACA,KAAK,IAAI;AAEZ,SAAO;AAAA;AAAA;AAAA,EAGP,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sDAwBmC,aAAa,IAAI,OAAO,SAAS,IAAI;AAAA,mFACR,SAAS,IAAI;AAAA,sFACV,aAAa,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAwCrE,cAAc,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBpD;",
4
+ "sourcesContent": ["import { type Tool } from '@tool'\nimport { getTools, getReadOnlyTools } from '@tools'\nimport { TaskTool } from './TaskTool'\nimport { getModelManager } from '@utils/model'\nimport { getActiveAgents } from '@utils/agentLoader'\n\n/**\n * Agent-internal tools that should never be exposed to subagents.\n * These are either recursive (TaskTool itself) or admin-only.\n */\nconst EXCLUDED_AGENT_TOOLS = new Set([\n 'Agent', // Prevent recursive TaskTool calls (unless explicitly allowed via toolFilter)\n 'TeamCreate', // Team management is leader-only\n 'TeamDelete', // Team management is leader-only\n])\n\nexport async function getTaskTools(safeMode: boolean): Promise<Tool[]> {\n return (await (!safeMode ? getTools() : getReadOnlyTools())).filter(\n _ => !EXCLUDED_AGENT_TOOLS.has(_.name),\n )\n}\n\nexport async function getPrompt(safeMode: boolean): Promise<string> {\n const agents = await getActiveAgents()\n\n // Format: (Tools: tool1, tool2)\n const agentDescriptions = agents\n .map(agent => {\n const toolsStr = Array.isArray(agent.tools) ? agent.tools.join(', ') : '*'\n return `- ${agent.agentType}: ${agent.whenToUse} (Tools: ${toolsStr})`\n })\n .join('\\n')\n\n return `Launch a new agent to handle complex, multi-step tasks autonomously.\n\nThe Agent tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types and the tools they have access to:\n${agentDescriptions}\n\nWhen using the Agent tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.\n\nWhen to use the Agent tool:\n- When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Agent(description=\"Check the file\", prompt=\"/check-file path/to/file.py\")\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n## Parallel Tasks vs Agent Teams \u2014 Decision Framework\n\n**USER INTENT OVERRIDE: If the user explicitly asks for a team, swarm, or multi-agent group, ALWAYS use Agent Teams regardless of the heuristics below.**\n\nYou have TWO ways to run multiple agents. Choose the right one:\n\n### Parallel Tasks (multiple Agent calls in one message) \u2014 DEFAULT CHOICE\nUse when tasks are **independent and fire-and-forget**:\n- Each agent works alone, returns a result, and is done\n- No agent needs to see another agent's output to do its work\n- You (the orchestrator) synthesize all results after they return\n\nExamples: analyze 3 files, search 5 code patterns, run independent checks\n\n### Agent Teams (TeamCreate + SendMessage) \u2014 for collaboration or user-requested teams\nUse when agents **must communicate with each other** during execution, or when the user explicitly requests a team:\n- Agent A's output feeds into Agent B's work (and B may send findings back to A)\n- Agents need a shared task board to coordinate who does what\n- The work requires multiple rounds of back-and-forth between agents\n- Agents need to persist across rounds and be reassigned new tasks\n\n**Important**: Teammates in a team automatically run in background, so you (the team-lead) remain available to process messages and coordinate work.\n\nExamples: researcher finds info \u2192 implementer codes it \u2192 tester validates \u2192 implementer fixes issues\n\n### Decision Checklist\nAsk yourself: \"Did the user ask for a team, OR do agents need to TALK TO EACH OTHER?\"\n- **User asked for a team** \u2192 Use Agent Teams (always honor explicit requests)\n- **No communication needed** \u2192 Use parallel Agent calls (simple, fast, no overhead)\n- **Agents must communicate** \u2192 Use Agent Teams (TeamCreate + spawn teammates + SendMessage)\n\n**Efficiency tip:** For independent tasks, parallel Agent calls are simpler and faster. But always defer to user intent \u2014 if they ask for a team, create one.\n\nUsage notes:\n- Always include a short description (3-5 words) summarizing what the agent will do\n- Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n- **Foreground tasks return results directly** \u2014 when a foreground Agent (including parallel Agents) completes, its result and agentId are returned inline in the tool result. Do NOT call TaskOutput for foreground tasks; their results are already in your context. TaskOutput is ONLY for background tasks started with \\`run_in_background: true\\`.\n- You can optionally run agents in the background using the run_in_background parameter. When an agent runs in the background, you will be automatically notified when it completes \u2014 do NOT sleep, poll, or proactively check on its progress. Continue with other work or respond to the user instead.\n- **Foreground vs background**: Use foreground (default) when you need the agent's results before you can proceed \u2014 e.g., research agents whose findings inform your next steps. Use background when you have genuinely independent work to do in parallel.\n- When using Agent Teams (TeamCreate), teammates automatically run in background so you remain available to coordinate. After spawning all teammates, respond to the user with a brief status (e.g., \"Agents are working...\") and STOP \u2014 do NOT manually read files, check inboxes, or use TaskOutput. Teammate results are delivered to you automatically as new messages.\n- Agents can be resumed using the \\`resume\\` parameter by passing the agent ID from a previous invocation. When resumed, the agent continues with its full previous context preserved. When NOT resuming, each invocation starts fresh and you should provide a detailed task description with all necessary context.\n- When the agent is done, it will return a single message back to you along with its agent ID. You can use this ID to resume the agent later if needed for follow-up work.\n- Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need.\n- The agent's outputs should generally be trusted\n- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n- If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n- If the user specifies that they want you to run agents \"in parallel\", you MUST send a single message with multiple Agent tool use content blocks.\n\nExample usage:\n\n<example>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: I'm going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince a significant piece of code was written and the task was completed, now use the test-runner agent to run the tests\n</commentary>\nassistant: Uses the Agent tool to launch the test-runner agent\n</example>\n\n<example>\nuser: \"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: \"I'm going to use the Agent tool to launch the greeting-responder agent\"\n</example>`\n}\n"],
5
+ "mappings": "AACA,SAAS,UAAU,wBAAwB;AAG3C,SAAS,uBAAuB;AAMhC,MAAM,uBAAuB,oBAAI,IAAI;AAAA,EACnC;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF,CAAC;AAED,eAAsB,aAAa,UAAoC;AACrE,UAAQ,OAAO,CAAC,WAAW,SAAS,IAAI,iBAAiB,IAAI;AAAA,IAC3D,OAAK,CAAC,qBAAqB,IAAI,EAAE,IAAI;AAAA,EACvC;AACF;AAEA,eAAsB,UAAU,UAAoC;AAClE,QAAM,SAAS,MAAM,gBAAgB;AAGrC,QAAM,oBAAoB,OACvB,IAAI,WAAS;AACZ,UAAM,WAAW,MAAM,QAAQ,MAAM,KAAK,IAAI,MAAM,MAAM,KAAK,IAAI,IAAI;AACvE,WAAO,KAAK,MAAM,SAAS,KAAK,MAAM,SAAS,YAAY,QAAQ;AAAA,EACrE,CAAC,EACA,KAAK,IAAI;AAEZ,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKP,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyFnB;",
6
6
  "names": []
7
7
  }
@@ -89,7 +89,7 @@ const TaskUpdateTool = {
89
89
  async *call(input) {
90
90
  try {
91
91
  const isDeleting = input.status === "deleted";
92
- const task = updateTask({
92
+ const task = await updateTask({
93
93
  taskId: input.taskId,
94
94
  status: input.status,
95
95
  subject: input.subject,
@@ -108,6 +108,20 @@ const TaskUpdateTool = {
108
108
  };
109
109
  return;
110
110
  }
111
+ if (task.metadata?._hookRejected) {
112
+ const feedback = task.metadata._hookFeedback || "Blocked by hook";
113
+ yield {
114
+ type: "result",
115
+ data: {
116
+ taskId: task.id,
117
+ status: task.status,
118
+ hookBlocked: true,
119
+ hookFeedback: feedback
120
+ },
121
+ resultForAssistant: `Task #${task.id} completion was blocked by a hook. Status reverted to in_progress. Feedback: ${feedback}`
122
+ };
123
+ return;
124
+ }
111
125
  const result = {
112
126
  taskId: task.id,
113
127
  status: task.status,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/TaskUpdateTool/TaskUpdateTool.tsx"],
4
- "sourcesContent": ["import { Box, Text } from 'ink'\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { FallbackToolUseRejectedMessage } from '@components/FallbackToolUseRejectedMessage'\nimport { Tool } from '@tool'\nimport { updateTask, getTaskById } from '@services/taskStore'\nimport { DESCRIPTION, PROMPT } from './prompt'\nimport { getTheme } from '@utils/theme'\n\nconst inputSchema = z.strictObject({\n taskId: z.string().describe('The ID of the task to update'),\n status: z\n .enum(['pending', 'in_progress', 'completed', 'deleted'])\n .optional()\n .describe('New status for the task'),\n subject: z.string().optional().describe('New subject for the task'),\n description: z.string().optional().describe('New description for the task'),\n activeForm: z\n .string()\n .optional()\n .describe(\n 'Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")',\n ),\n owner: z.string().optional().describe('New owner for the task'),\n metadata: z\n .record(z.unknown())\n .optional()\n .describe(\n 'Metadata keys to merge into the task. Set a key to null to delete it.',\n ),\n addBlocks: z\n .array(z.string())\n .optional()\n .describe('Task IDs that this task blocks'),\n addBlockedBy: z\n .array(z.string())\n .optional()\n .describe('Task IDs that block this task'),\n})\n\nexport const TaskUpdateTool = {\n name: 'TaskUpdate',\n async description() {\n return DESCRIPTION\n },\n async prompt() {\n return PROMPT\n },\n inputSchema,\n userFacingName() {\n return 'Update Task'\n },\n async isEnabled() {\n return true\n },\n isReadOnly() {\n return false\n },\n isConcurrencySafe() {\n return false\n },\n needsPermissions() {\n return false\n },\n renderToolUseMessage(input: z.infer<typeof inputSchema>) {\n const parts: string[] = [`taskId: ${input.taskId}`]\n if (input.status) {\n parts.push(`status: ${input.status}`)\n }\n return parts.join(', ')\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n renderToolResultMessage(output: {\n taskId: string\n status?: string\n deleted?: boolean\n }) {\n if (!output || !output.taskId) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text>Task updated</Text>\n </Box>\n )\n }\n\n if (output.deleted) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={getTheme().secondaryText}>\n Task #{output.taskId} deleted\n </Text>\n </Box>\n )\n }\n\n const statusColor =\n output.status === 'completed'\n ? getTheme().success\n : output.status === 'in_progress'\n ? getTheme().warning\n : getTheme().secondaryText\n\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text>\n Updated task #{output.taskId}\n {output.status && <Text color={statusColor}> \u2192 {output.status}</Text>}\n </Text>\n </Box>\n )\n },\n renderResultForAssistant(result: {\n taskId: string\n status?: string\n deleted?: boolean\n }) {\n if (result.deleted) {\n return `Task #${result.taskId} has been deleted`\n }\n return `Updated task #${result.taskId}${result.status ? ` status` : ''}`\n },\n async validateInput({ taskId }: z.infer<typeof inputSchema>) {\n if (!taskId?.trim()) {\n return {\n result: false,\n message: 'Task ID is required',\n }\n }\n\n const task = getTaskById(taskId)\n if (!task) {\n return {\n result: false,\n message: `Task with ID '${taskId}' not found`,\n }\n }\n\n return { result: true }\n },\n async *call(input: z.infer<typeof inputSchema>) {\n try {\n const isDeleting = input.status === 'deleted'\n\n const task = updateTask({\n taskId: input.taskId,\n status: input.status,\n subject: input.subject,\n description: input.description,\n activeForm: input.activeForm,\n owner: input.owner,\n metadata: input.metadata,\n addBlocks: input.addBlocks,\n addBlockedBy: input.addBlockedBy,\n })\n\n if (!task) {\n yield {\n type: 'result',\n data: { error: 'Task not found' },\n resultForAssistant: `Error: Task with ID '${input.taskId}' not found`,\n }\n return\n }\n\n const result = {\n taskId: task.id,\n status: task.status,\n deleted: isDeleting,\n }\n\n yield {\n type: 'result',\n data: result,\n resultForAssistant: this.renderResultForAssistant(result),\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'Unknown error occurred'\n yield {\n type: 'result',\n data: { error: errorMessage },\n resultForAssistant: `Error updating task: ${errorMessage}`,\n }\n }\n },\n} satisfies Tool\n"],
5
- "mappings": "AAAA,SAAS,KAAK,YAAY;AAC1B,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,sCAAsC;AAE/C,SAAS,YAAY,mBAAmB;AACxC,SAAS,aAAa,cAAc;AACpC,SAAS,gBAAgB;AAEzB,MAAM,cAAc,EAAE,aAAa;AAAA,EACjC,QAAQ,EAAE,OAAO,EAAE,SAAS,8BAA8B;AAAA,EAC1D,QAAQ,EACL,KAAK,CAAC,WAAW,eAAe,aAAa,SAAS,CAAC,EACvD,SAAS,EACT,SAAS,yBAAyB;AAAA,EACrC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0BAA0B;AAAA,EAClE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,8BAA8B;AAAA,EAC1E,YAAY,EACT,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,wBAAwB;AAAA,EAC9D,UAAU,EACP,OAAO,EAAE,QAAQ,CAAC,EAClB,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,WAAW,EACR,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,gCAAgC;AAAA,EAC5C,cAAc,EACX,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,+BAA+B;AAC7C,CAAC;AAEM,MAAM,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM,cAAc;AAClB,WAAO;AAAA,EACT;AAAA,EACA,MAAM,SAAS;AACb,WAAO;AAAA,EACT;AAAA,EACA;AAAA,EACA,iBAAiB;AACf,WAAO;AAAA,EACT;AAA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'\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { FallbackToolUseRejectedMessage } from '@components/FallbackToolUseRejectedMessage'\nimport { Tool } from '@tool'\nimport { updateTask, getTaskById } from '@services/taskStore'\nimport { DESCRIPTION, PROMPT } from './prompt'\nimport { getTheme } from '@utils/theme'\n\nconst inputSchema = z.strictObject({\n taskId: z.string().describe('The ID of the task to update'),\n status: z\n .enum(['pending', 'in_progress', 'completed', 'deleted'])\n .optional()\n .describe('New status for the task'),\n subject: z.string().optional().describe('New subject for the task'),\n description: z.string().optional().describe('New description for the task'),\n activeForm: z\n .string()\n .optional()\n .describe(\n 'Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")',\n ),\n owner: z.string().optional().describe('New owner for the task'),\n metadata: z\n .record(z.unknown())\n .optional()\n .describe(\n 'Metadata keys to merge into the task. Set a key to null to delete it.',\n ),\n addBlocks: z\n .array(z.string())\n .optional()\n .describe('Task IDs that this task blocks'),\n addBlockedBy: z\n .array(z.string())\n .optional()\n .describe('Task IDs that block this task'),\n})\n\nexport const TaskUpdateTool = {\n name: 'TaskUpdate',\n async description() {\n return DESCRIPTION\n },\n async prompt() {\n return PROMPT\n },\n inputSchema,\n userFacingName() {\n return 'Update Task'\n },\n async isEnabled() {\n return true\n },\n isReadOnly() {\n return false\n },\n isConcurrencySafe() {\n return false\n },\n needsPermissions() {\n return false\n },\n renderToolUseMessage(input: z.infer<typeof inputSchema>) {\n const parts: string[] = [`taskId: ${input.taskId}`]\n if (input.status) {\n parts.push(`status: ${input.status}`)\n }\n return parts.join(', ')\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n renderToolResultMessage(output: {\n taskId: string\n status?: string\n deleted?: boolean\n }) {\n if (!output || !output.taskId) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text>Task updated</Text>\n </Box>\n )\n }\n\n if (output.deleted) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={getTheme().secondaryText}>\n Task #{output.taskId} deleted\n </Text>\n </Box>\n )\n }\n\n const statusColor =\n output.status === 'completed'\n ? getTheme().success\n : output.status === 'in_progress'\n ? getTheme().warning\n : getTheme().secondaryText\n\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text>\n Updated task #{output.taskId}\n {output.status && <Text color={statusColor}> \u2192 {output.status}</Text>}\n </Text>\n </Box>\n )\n },\n renderResultForAssistant(result: {\n taskId: string\n status?: string\n deleted?: boolean\n }) {\n if (result.deleted) {\n return `Task #${result.taskId} has been deleted`\n }\n return `Updated task #${result.taskId}${result.status ? ` status` : ''}`\n },\n async validateInput({ taskId }: z.infer<typeof inputSchema>) {\n if (!taskId?.trim()) {\n return {\n result: false,\n message: 'Task ID is required',\n }\n }\n\n const task = getTaskById(taskId)\n if (!task) {\n return {\n result: false,\n message: `Task with ID '${taskId}' not found`,\n }\n }\n\n return { result: true }\n },\n async *call(input: z.infer<typeof inputSchema>) {\n try {\n const isDeleting = input.status === 'deleted'\n\n const task = await updateTask({\n taskId: input.taskId,\n status: input.status,\n subject: input.subject,\n description: input.description,\n activeForm: input.activeForm,\n owner: input.owner,\n metadata: input.metadata,\n addBlocks: input.addBlocks,\n addBlockedBy: input.addBlockedBy,\n })\n\n if (!task) {\n yield {\n type: 'result',\n data: { error: 'Task not found' },\n resultForAssistant: `Error: Task with ID '${input.taskId}' not found`,\n }\n return\n }\n\n // Check if hook blocked task completion\n if (task.metadata?._hookRejected) {\n const feedback = task.metadata._hookFeedback || 'Blocked by hook'\n yield {\n type: 'result',\n data: {\n taskId: task.id,\n status: task.status,\n hookBlocked: true,\n hookFeedback: feedback,\n },\n resultForAssistant: `Task #${task.id} completion was blocked by a hook. Status reverted to in_progress. Feedback: ${feedback}`,\n }\n return\n }\n\n const result = {\n taskId: task.id,\n status: task.status,\n deleted: isDeleting,\n }\n\n yield {\n type: 'result',\n data: result,\n resultForAssistant: this.renderResultForAssistant(result),\n }\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'Unknown error occurred'\n yield {\n type: 'result',\n data: { error: errorMessage },\n resultForAssistant: `Error updating task: ${errorMessage}`,\n }\n }\n },\n} satisfies Tool\n"],
5
+ "mappings": "AAAA,SAAS,KAAK,YAAY;AAC1B,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,sCAAsC;AAE/C,SAAS,YAAY,mBAAmB;AACxC,SAAS,aAAa,cAAc;AACpC,SAAS,gBAAgB;AAEzB,MAAM,cAAc,EAAE,aAAa;AAAA,EACjC,QAAQ,EAAE,OAAO,EAAE,SAAS,8BAA8B;AAAA,EAC1D,QAAQ,EACL,KAAK,CAAC,WAAW,eAAe,aAAa,SAAS,CAAC,EACvD,SAAS,EACT,SAAS,yBAAyB;AAAA,EACrC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0BAA0B;AAAA,EAClE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,8BAA8B;AAAA,EAC1E,YAAY,EACT,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,wBAAwB;AAAA,EAC9D,UAAU,EACP,OAAO,EAAE,QAAQ,CAAC,EAClB,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,WAAW,EACR,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,gCAAgC;AAAA,EAC5C,cAAc,EACX,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,EACT,SAAS,+BAA+B;AAC7C,CAAC;AAEM,MAAM,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM,cAAc;AAClB,WAAO;AAAA,EACT;AAAA,EACA,MAAM,SAAS;AACb,WAAO;AAAA,EACT;AAAA,EACA;AAAA,EACA,iBAAiB;AACf,WAAO;AAAA,EACT;A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AAM;AAAA,QACN,oBAAoB,KAAK,yBAAyB,MAAM;AAAA,MAC1D;AAAA,IACF,SAAS,OAAO;AACd,YAAM,eACJ,iBAAiB,QAAQ,MAAM,UAAU;AAC3C,YAAM;AAAA,QACJ,MAAM;AAAA,QACN,MAAM,EAAE,OAAO,aAAa;AAAA,QAC5B,oBAAoB,wBAAwB,YAAY;AAAA,MAC1D;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,129 @@
1
+ import { Box, Text } from "ink";
2
+ import * as React from "react";
3
+ import { z } from "zod";
4
+ import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
5
+ import { createToolErrorResult } from "../../utils/tooling/toolError.js";
6
+ import {
7
+ isAgentTeamsEnabled,
8
+ sanitizeTeamName,
9
+ createTeam,
10
+ addTeammate
11
+ } from "../../services/agentTeams/index.js";
12
+ import { DESCRIPTION, PROMPT } from "./prompt.js";
13
+ import { getTheme } from "../../utils/theme.js";
14
+ const inputSchema = z.strictObject({
15
+ team_name: z.string().describe("Name for the new team to create."),
16
+ description: z.string().optional().describe("Team description/purpose."),
17
+ agent_type: z.string().optional().describe(
18
+ 'Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'
19
+ )
20
+ });
21
+ const TeamCreateTool = {
22
+ name: "TeamCreate",
23
+ async description() {
24
+ return DESCRIPTION;
25
+ },
26
+ async prompt() {
27
+ return PROMPT;
28
+ },
29
+ inputSchema,
30
+ userFacingName() {
31
+ return "Create Team";
32
+ },
33
+ async isEnabled() {
34
+ return isAgentTeamsEnabled();
35
+ },
36
+ isReadOnly() {
37
+ return false;
38
+ },
39
+ isConcurrencySafe() {
40
+ return false;
41
+ },
42
+ needsPermissions() {
43
+ return false;
44
+ },
45
+ renderToolUseMessage(input) {
46
+ return `"${input.team_name || ""}"`;
47
+ },
48
+ renderToolUseRejectedMessage() {
49
+ return /* @__PURE__ */ React.createElement(FallbackToolUseRejectedMessage, null);
50
+ },
51
+ renderToolResultMessage(output) {
52
+ if (!output || !output.team_name) {
53
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React.createElement(Text, null, "Team created"));
54
+ }
55
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React.createElement(Text, { color: getTheme().success }, 'Team "', output.team_name, '" created'));
56
+ },
57
+ renderResultForAssistant(result) {
58
+ if (result.error) {
59
+ return `Error creating team: ${result.error}`;
60
+ }
61
+ return `Team "${result.team_name}" created successfully.
62
+ team_name: ${result.team_name}
63
+ team_file_path: ${result.team_file_path}
64
+ lead_agent_id: ${result.lead_agent_id}
65
+
66
+ ## Next Steps (REQUIRED):
67
+ 1. Create tasks with TaskCreate for each unit of work
68
+ 2. Spawn teammates with Task tool (team_name="${result.team_name}", name="<agent-name>") \u2014 launch in parallel
69
+ 3. Wait for agents to complete (they send idle notifications automatically)
70
+ 4. Collect results and summarize for the user
71
+ 5. Send shutdown_request to each agent via SendMessage
72
+ 6. Call TeamDelete to clean up
73
+
74
+ IMPORTANT: You MUST actually spawn teammates using the Task tool now. Do NOT just tell the user you spawned them \u2014 call the Task tool with team_name and name parameters.
75
+
76
+ CRITICAL: After presenting your final answer, you MUST send shutdown_request to ALL teammates, then call TeamDelete. Skipping cleanup leaves a broken team panel visible to the user.`;
77
+ },
78
+ async validateInput({ team_name }) {
79
+ if (!team_name?.trim()) {
80
+ return {
81
+ result: false,
82
+ message: "Team name cannot be empty"
83
+ };
84
+ }
85
+ const sanitized = sanitizeTeamName(team_name);
86
+ if (!sanitized || !/[a-z0-9]/.test(sanitized)) {
87
+ return {
88
+ result: false,
89
+ message: "Team name must contain at least one alphanumeric character"
90
+ };
91
+ }
92
+ return { result: true };
93
+ },
94
+ async *call(input) {
95
+ try {
96
+ const sanitizedName = sanitizeTeamName(input.team_name);
97
+ const team = createTeam({
98
+ name: sanitizedName,
99
+ displayMode: "auto",
100
+ maxTeammates: 10,
101
+ description: input.description
102
+ });
103
+ addTeammate(team.name, {
104
+ id: `team-lead@${team.name}`,
105
+ name: "team-lead",
106
+ agentType: input.agent_type || "leader",
107
+ status: "idle",
108
+ prompt: "",
109
+ color: "white"
110
+ });
111
+ const result = {
112
+ team_name: team.name,
113
+ team_file_path: `~/.minto/teams/${team.name}/config.json`,
114
+ lead_agent_id: `team-lead@${team.name}`
115
+ };
116
+ yield {
117
+ type: "result",
118
+ data: result,
119
+ resultForAssistant: this.renderResultForAssistant(result)
120
+ };
121
+ } catch (error) {
122
+ yield createToolErrorResult(error, "Error creating team");
123
+ }
124
+ }
125
+ };
126
+ export {
127
+ TeamCreateTool
128
+ };
129
+ //# sourceMappingURL=TeamCreateTool.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/tools/TeamCreateTool/TeamCreateTool.tsx"],
4
+ "sourcesContent": ["import { Box, Text } from 'ink'\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { FallbackToolUseRejectedMessage } from '@components/FallbackToolUseRejectedMessage'\nimport { Tool } from '@tool'\nimport { createToolErrorResult } from '@utils/tooling/toolError'\nimport {\n isAgentTeamsEnabled,\n sanitizeTeamName,\n createTeam,\n addTeammate,\n} from '@services/agentTeams'\nimport { DESCRIPTION, PROMPT } from './prompt'\nimport { getTheme } from '@utils/theme'\n\nconst inputSchema = z.strictObject({\n team_name: z.string().describe('Name for the new team to create.'),\n description: z.string().optional().describe('Team description/purpose.'),\n agent_type: z\n .string()\n .optional()\n .describe(\n 'Type/role of the team lead (e.g., \"researcher\", \"test-runner\"). Used for team file and inter-agent coordination.',\n ),\n})\n\nexport const TeamCreateTool = {\n name: 'TeamCreate',\n async description() {\n return DESCRIPTION\n },\n async prompt() {\n return PROMPT\n },\n inputSchema,\n userFacingName() {\n return 'Create Team'\n },\n async isEnabled() {\n return isAgentTeamsEnabled()\n },\n isReadOnly() {\n return false\n },\n isConcurrencySafe() {\n return false\n },\n needsPermissions() {\n return false\n },\n renderToolUseMessage(input: z.infer<typeof inputSchema>) {\n return `\"${input.team_name || ''}\"`\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n renderToolResultMessage(output: {\n team_name: string\n team_file_path: string\n }) {\n if (!output || !output.team_name) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text>Team created</Text>\n </Box>\n )\n }\n\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={getTheme().success}>\n Team &quot;{output.team_name}&quot; created\n </Text>\n </Box>\n )\n },\n renderResultForAssistant(result: {\n team_name?: string\n team_file_path?: string\n lead_agent_id?: string\n error?: string\n }) {\n if (result.error) {\n return `Error creating team: ${result.error}`\n }\n return `Team \"${result.team_name}\" created successfully.\nteam_name: ${result.team_name}\nteam_file_path: ${result.team_file_path}\nlead_agent_id: ${result.lead_agent_id}\n\n## Next Steps (REQUIRED):\n1. Create tasks with TaskCreate for each unit of work\n2. Spawn teammates with Task tool (team_name=\"${result.team_name}\", name=\"<agent-name>\") \u2014 launch in parallel\n3. Wait for agents to complete (they send idle notifications automatically)\n4. Collect results and summarize for the user\n5. Send shutdown_request to each agent via SendMessage\n6. Call TeamDelete to clean up\n\nIMPORTANT: You MUST actually spawn teammates using the Task tool now. Do NOT just tell the user you spawned them \u2014 call the Task tool with team_name and name parameters.\n\nCRITICAL: After presenting your final answer, you MUST send shutdown_request to ALL teammates, then call TeamDelete. Skipping cleanup leaves a broken team panel visible to the user.`\n },\n async validateInput({ team_name }: z.infer<typeof inputSchema>) {\n if (!team_name?.trim()) {\n return {\n result: false as const,\n message: 'Team name cannot be empty',\n }\n }\n const sanitized = sanitizeTeamName(team_name)\n if (!sanitized || !/[a-z0-9]/.test(sanitized)) {\n return {\n result: false as const,\n message: 'Team name must contain at least one alphanumeric character',\n }\n }\n return { result: true as const }\n },\n async *call(input: z.infer<typeof inputSchema>) {\n try {\n const sanitizedName = sanitizeTeamName(input.team_name)\n const team = createTeam({\n name: sanitizedName,\n displayMode: 'auto',\n maxTeammates: 10,\n description: input.description,\n })\n\n // Register team-lead as initial member so it appears in the panel\n addTeammate(team.name, {\n id: `team-lead@${team.name}`,\n name: 'team-lead',\n agentType: input.agent_type || 'leader',\n status: 'idle',\n prompt: '',\n color: 'white',\n })\n\n const result = {\n team_name: team.name,\n team_file_path: `~/.minto/teams/${team.name}/config.json`,\n lead_agent_id: `team-lead@${team.name}`,\n }\n\n yield {\n type: 'result' as const,\n data: result,\n resultForAssistant: this.renderResultForAssistant(result),\n }\n } catch (error) {\n yield createToolErrorResult(error, 'Error creating team')\n }\n },\n} satisfies Tool\n"],
5
+ "mappings": "AAAA,SAAS,KAAK,YAAY;AAC1B,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,sCAAsC;AAE/C,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,cAAc;AACpC,SAAS,gBAAgB;AAEzB,MAAM,cAAc,EAAE,aAAa;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS,kCAAkC;AAAA,EACjE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B;AAAA,EACvE,YAAY,EACT,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AACJ,CAAC;AAEM,MAAM,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM,cAAc;AAClB,WAAO;AAAA,EACT;AAAA,EACA,MAAM,SAAS;AACb,WAAO;AAAA,EACT;AAAA,EACA;AAAA,EACA,iBAAiB;AACf,WAAO;AAAA,EACT;AAAA,EACA,MAAM,YAAY;AAChB,WAAO,oBAAoB;AAAA,EAC7B;AAAA,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,KAAK,OAAoC;AAC9C,QAAI;AACF,YAAM,gBAAgB,iBAAiB,MAAM,SAAS;AACtD,YAAM,OAAO,WAAW;AAAA,QACtB,MAAM;AAAA,QACN,aAAa;AAAA,QACb,cAAc;AAAA,QACd,aAAa,MAAM;AAAA,MACrB,CAAC;AAGD,kBAAY,KAAK,MAAM;AAAA,QACrB,IAAI,aAAa,KAAK,IAAI;AAAA,QAC1B,MAAM;AAAA,QACN,WAAW,MAAM,cAAc;AAAA,QAC/B,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAO;AAAA,MACT,CAAC;AAED,YAAM,SAAS;AAAA,QACb,WAAW,KAAK;AAAA,QAChB,gBAAgB,kBAAkB,KAAK,IAAI;AAAA,QAC3C,eAAe,aAAa,KAAK,IAAI;AAAA,MACvC;AAEA,YAAM;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,oBAAoB,KAAK,yBAAyB,MAAM;AAAA,MAC1D;AAAA,IACF,SAAS,OAAO;AACd,YAAM,sBAAsB,OAAO,qBAAqB;AAAA,IAC1D;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
1
+ const PROMPT = `# TeamCreate
2
+
3
+ ## When to Use
4
+
5
+ Use this tool proactively whenever:
6
+ - The user explicitly asks to use a team, swarm, or group of agents
7
+ - A task benefits from parallel work by multiple agents (e.g., full-stack features, multi-step projects)
8
+
9
+ When spawning teammates via the Agent tool, choose the \`subagent_type\` based on what tools the agent needs:
10
+ - **Read-only agents** (Explore, Plan): research/planning only, cannot edit files
11
+ - **Full-capability agents** (general-purpose): all tools including editing and bash
12
+ - **Custom agents** (\`.claude/agents/\`): check their descriptions for tool restrictions
13
+
14
+ **Permission note**: Teammates run with 'acceptEdits' permission mode \u2014 they can edit files and run commands within the project directory without user confirmation.
15
+
16
+ Create a team to coordinate multiple agents working on a project. Teams have a 1:1 correspondence with task lists.
17
+
18
+ ## Team Workflow
19
+
20
+ 1. **Create a team** with TeamCreate
21
+ 2. **Create tasks** using TaskCreate \u2014 they automatically use the team's task list
22
+ 3. **Spawn teammates** using the Agent tool with \`team_name\` and \`name\` parameters
23
+ 4. **Assign tasks** using TaskUpdate with \`owner\`
24
+ 5. **Teammates work** on assigned tasks and mark them completed via TaskUpdate
25
+ 6. **Teammates go idle between turns** \u2014 this is normal. Be patient with idle teammates.
26
+ 7. **Shutdown your team** \u2014 send shutdown_request via SendMessage, then call TeamDelete to clean up
27
+
28
+ ## CRITICAL: Team Cleanup \u2014 NEVER SKIP
29
+
30
+ You MUST call TeamDelete after composing your final answer. Failing to do so leaves stale team state.
31
+
32
+ ## Automatic Message Delivery
33
+
34
+ Messages from teammates are delivered automatically as new conversation turns. You do NOT need to manually check inboxes. When reporting on teammate messages, you do NOT need to quote them \u2014 they're already rendered.
35
+
36
+ ## Teammate Idle State
37
+
38
+ Teammates go idle after every turn \u2014 this is completely normal. Idle means waiting for input, not done or unavailable. Sending a message to an idle teammate wakes them up. Do not treat idle as an error.
39
+
40
+ ## Task List Coordination
41
+
42
+ Teams share a task list at \`~/.minto/tasks/{team-name}/\`. Teammates should:
43
+ 1. Check TaskList after completing each task to find available work
44
+ 2. Claim unassigned tasks with TaskUpdate (prefer lowest ID first)
45
+ 3. Mark tasks completed, then check TaskList for next work
46
+
47
+ **Communication rules**:
48
+ - Always refer to teammates by NAME, never by UUID
49
+ - Your team cannot hear you without SendMessage
50
+ - Do NOT send structured JSON status messages \u2014 use plain text
51
+ - Do NOT reply to simple status/completion notifications \u2014 process silently
52
+ - Use TaskUpdate to mark tasks completed`;
53
+ const DESCRIPTION = `Create a new team to coordinate multiple agents working on a project`;
54
+ export {
55
+ DESCRIPTION,
56
+ PROMPT
57
+ };
58
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/tools/TeamCreateTool/prompt.ts"],
4
+ "sourcesContent": ["export const PROMPT = `# TeamCreate\n\n## When to Use\n\nUse this tool proactively whenever:\n- The user explicitly asks to use a team, swarm, or group of agents\n- A task benefits from parallel work by multiple agents (e.g., full-stack features, multi-step projects)\n\nWhen spawning teammates via the Agent tool, choose the \\`subagent_type\\` based on what tools the agent needs:\n- **Read-only agents** (Explore, Plan): research/planning only, cannot edit files\n- **Full-capability agents** (general-purpose): all tools including editing and bash\n- **Custom agents** (\\`.claude/agents/\\`): check their descriptions for tool restrictions\n\n**Permission note**: Teammates run with 'acceptEdits' permission mode \u2014 they can edit files and run commands within the project directory without user confirmation.\n\nCreate a team to coordinate multiple agents working on a project. Teams have a 1:1 correspondence with task lists.\n\n## Team Workflow\n\n1. **Create a team** with TeamCreate\n2. **Create tasks** using TaskCreate \u2014 they automatically use the team's task list\n3. **Spawn teammates** using the Agent tool with \\`team_name\\` and \\`name\\` parameters\n4. **Assign tasks** using TaskUpdate with \\`owner\\`\n5. **Teammates work** on assigned tasks and mark them completed via TaskUpdate\n6. **Teammates go idle between turns** \u2014 this is normal. Be patient with idle teammates.\n7. **Shutdown your team** \u2014 send shutdown_request via SendMessage, then call TeamDelete to clean up\n\n## CRITICAL: Team Cleanup \u2014 NEVER SKIP\n\nYou MUST call TeamDelete after composing your final answer. Failing to do so leaves stale team state.\n\n## Automatic Message Delivery\n\nMessages from teammates are delivered automatically as new conversation turns. You do NOT need to manually check inboxes. When reporting on teammate messages, you do NOT need to quote them \u2014 they're already rendered.\n\n## Teammate Idle State\n\nTeammates go idle after every turn \u2014 this is completely normal. Idle means waiting for input, not done or unavailable. Sending a message to an idle teammate wakes them up. Do not treat idle as an error.\n\n## Task List Coordination\n\nTeams share a task list at \\`~/.minto/tasks/{team-name}/\\`. Teammates should:\n1. Check TaskList after completing each task to find available work\n2. Claim unassigned tasks with TaskUpdate (prefer lowest ID first)\n3. Mark tasks completed, then check TaskList for next work\n\n**Communication rules**:\n- Always refer to teammates by NAME, never by UUID\n- Your team cannot hear you without SendMessage\n- Do NOT send structured JSON status messages \u2014 use plain text\n- Do NOT reply to simple status/completion notifications \u2014 process silently\n- Use TaskUpdate to mark tasks completed`\n\nexport const DESCRIPTION = `Create a new team to coordinate multiple agents working on a project`\n"],
5
+ "mappings": "AAAO,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqDf,MAAM,cAAc;",
6
+ "names": []
7
+ }