@within-7/minto 0.3.9 → 0.4.0

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 (383) hide show
  1. package/dist/Tool.js.map +2 -2
  2. package/dist/commands/agents/AgentsCommand.js +461 -657
  3. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  4. package/dist/commands/agents/types.js +1 -0
  5. package/dist/commands/agents/types.js.map +2 -2
  6. package/dist/commands/agents/utils/fileOperations.js +96 -36
  7. package/dist/commands/agents/utils/fileOperations.js.map +3 -3
  8. package/dist/commands/agents/utils/index.js +3 -1
  9. package/dist/commands/agents/utils/index.js.map +2 -2
  10. package/dist/commands/context.js +54 -23
  11. package/dist/commands/context.js.map +2 -2
  12. package/dist/commands/ctx_viz.js +1 -1
  13. package/dist/commands/effort.js +87 -0
  14. package/dist/commands/effort.js.map +7 -0
  15. package/dist/commands/export.js +684 -94
  16. package/dist/commands/export.js.map +2 -2
  17. package/dist/commands/ide.js +18 -0
  18. package/dist/commands/ide.js.map +7 -0
  19. package/dist/commands/language.js +19 -46
  20. package/dist/commands/language.js.map +2 -2
  21. package/dist/commands/mcp-interactive.js +425 -217
  22. package/dist/commands/mcp-interactive.js.map +2 -2
  23. package/dist/commands/memory.js +168 -0
  24. package/dist/commands/memory.js.map +7 -0
  25. package/dist/commands/model.js +457 -65
  26. package/dist/commands/model.js.map +2 -2
  27. package/dist/commands/outputStyle.js +64 -0
  28. package/dist/commands/outputStyle.js.map +7 -0
  29. package/dist/commands/permissions.js +75 -49
  30. package/dist/commands/permissions.js.map +2 -2
  31. package/dist/commands/plugin/utils.js +33 -1
  32. package/dist/commands/plugin/utils.js.map +2 -2
  33. package/dist/commands/plugin.js +891 -185
  34. package/dist/commands/plugin.js.map +3 -3
  35. package/dist/commands/refreshCommands.js +2 -0
  36. package/dist/commands/refreshCommands.js.map +2 -2
  37. package/dist/commands/resume.js +1 -1
  38. package/dist/commands/resume.js.map +1 -1
  39. package/dist/commands/review.js +51 -0
  40. package/dist/commands/review.js.map +7 -0
  41. package/dist/commands/sandbox.js +168 -70
  42. package/dist/commands/sandbox.js.map +2 -2
  43. package/dist/commands/setup.js +593 -107
  44. package/dist/commands/setup.js.map +2 -2
  45. package/dist/commands/stats.js +188 -131
  46. package/dist/commands/stats.js.map +2 -2
  47. package/dist/commands/status.js +75 -13
  48. package/dist/commands/status.js.map +2 -2
  49. package/dist/commands/terminalSetup.js +6 -0
  50. package/dist/commands/terminalSetup.js.map +2 -2
  51. package/dist/commands/undo.js +146 -174
  52. package/dist/commands/undo.js.map +2 -2
  53. package/dist/commands/vim.js +22 -0
  54. package/dist/commands/vim.js.map +7 -0
  55. package/dist/commands.js +12 -0
  56. package/dist/commands.js.map +2 -2
  57. package/dist/components/Help.js +165 -32
  58. package/dist/components/Help.js.map +2 -2
  59. package/dist/components/HighlightedCode.js +1 -0
  60. package/dist/components/HighlightedCode.js.map +2 -2
  61. package/dist/components/InfoPanel/InfoPanel.js +123 -0
  62. package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
  63. package/dist/components/InfoPanel/index.js +5 -0
  64. package/dist/components/InfoPanel/index.js.map +7 -0
  65. package/dist/components/InfoPanel/types.js +1 -0
  66. package/dist/components/InfoPanel/types.js.map +7 -0
  67. package/dist/components/ModelSelector/BrandTextInput.js +43 -0
  68. package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
  69. package/dist/components/ModelSelector/ModelSelector.js +590 -565
  70. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  71. package/dist/components/ModelSelector/WizardContainer.js +45 -0
  72. package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
  73. package/dist/components/ModelSelector/index.js +1 -3
  74. package/dist/components/ModelSelector/index.js.map +2 -2
  75. package/dist/components/PromptInput.js +26 -11
  76. package/dist/components/PromptInput.js.map +2 -2
  77. package/dist/components/PulseLabel.js +44 -0
  78. package/dist/components/PulseLabel.js.map +7 -0
  79. package/dist/components/RequestStatusIndicator.js +1 -1
  80. package/dist/components/RequestStatusIndicator.js.map +1 -1
  81. package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
  82. package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
  83. package/dist/components/SimpleSelector/index.js +5 -0
  84. package/dist/components/SimpleSelector/index.js.map +7 -0
  85. package/dist/components/SimpleSelector/types.js +1 -0
  86. package/dist/components/SimpleSelector/types.js.map +7 -0
  87. package/dist/components/Spinner.js +12 -42
  88. package/dist/components/Spinner.js.map +3 -3
  89. package/dist/components/StartupStatus.js +57 -0
  90. package/dist/components/StartupStatus.js.map +7 -0
  91. package/dist/components/StatusOverlayContent.js +21 -0
  92. package/dist/components/StatusOverlayContent.js.map +7 -0
  93. package/dist/components/SubagentBlock.js +43 -6
  94. package/dist/components/SubagentBlock.js.map +2 -2
  95. package/dist/components/TabbedListView/ScrollableList.js +31 -5
  96. package/dist/components/TabbedListView/ScrollableList.js.map +2 -2
  97. package/dist/components/TabbedListView/TabBar.js +13 -8
  98. package/dist/components/TabbedListView/TabBar.js.map +2 -2
  99. package/dist/components/TabbedListView/TabbedListView.js +123 -48
  100. package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
  101. package/dist/components/TodoPanel.js +1 -1
  102. package/dist/components/TodoPanel.js.map +1 -1
  103. package/dist/components/ToolUseLoader.js +5 -0
  104. package/dist/components/ToolUseLoader.js.map +2 -2
  105. package/dist/components/TrustDialog.js +0 -2
  106. package/dist/components/TrustDialog.js.map +2 -2
  107. package/dist/components/messages/TaskInModuleView.js +1 -1
  108. package/dist/components/messages/TaskInModuleView.js.map +2 -2
  109. package/dist/components/messages/TaskToolMessage.js +1 -1
  110. package/dist/components/messages/TaskToolMessage.js.map +2 -2
  111. package/dist/components/messages/UserPromptMessage.js +6 -1
  112. package/dist/components/messages/UserPromptMessage.js.map +2 -2
  113. package/dist/constants/modelCapabilities.js +103 -18
  114. package/dist/constants/modelCapabilities.js.map +2 -2
  115. package/dist/constants/product.js +2 -0
  116. package/dist/constants/product.js.map +2 -2
  117. package/dist/constants/prompts/agentPrompt.js +30 -0
  118. package/dist/constants/prompts/agentPrompt.js.map +7 -0
  119. package/dist/constants/prompts/codeConventions.js +27 -0
  120. package/dist/constants/prompts/codeConventions.js.map +7 -0
  121. package/dist/constants/prompts/doingTasks.js +15 -0
  122. package/dist/constants/prompts/doingTasks.js.map +7 -0
  123. package/dist/constants/prompts/envInfo.js +17 -0
  124. package/dist/constants/prompts/envInfo.js.map +7 -0
  125. package/dist/constants/prompts/executingWithCare.js +17 -0
  126. package/dist/constants/prompts/executingWithCare.js.map +7 -0
  127. package/dist/constants/prompts/identity.js +10 -0
  128. package/dist/constants/prompts/identity.js.map +7 -0
  129. package/dist/constants/prompts/index.js +78 -0
  130. package/dist/constants/prompts/index.js.map +7 -0
  131. package/dist/constants/prompts/taskManagement.js +60 -0
  132. package/dist/constants/prompts/taskManagement.js.map +7 -0
  133. package/dist/constants/prompts/toneAndStyle.js +62 -0
  134. package/dist/constants/prompts/toneAndStyle.js.map +7 -0
  135. package/dist/constants/prompts/toolUsagePolicy.js +38 -0
  136. package/dist/constants/prompts/toolUsagePolicy.js.map +7 -0
  137. package/dist/constants/prompts.js +5 -176
  138. package/dist/constants/prompts.js.map +2 -2
  139. package/dist/constants/providerRegistry.js +235 -0
  140. package/dist/constants/providerRegistry.js.map +7 -0
  141. package/dist/constants/providers.js +35 -0
  142. package/dist/constants/providers.js.map +7 -0
  143. package/dist/context/PermissionContext.js +0 -1
  144. package/dist/context/PermissionContext.js.map +2 -2
  145. package/dist/context.js +87 -31
  146. package/dist/context.js.map +2 -2
  147. package/dist/core/backupHook.js +29 -0
  148. package/dist/core/backupHook.js.map +7 -0
  149. package/dist/core/config/defaults.js +11 -2
  150. package/dist/core/config/defaults.js.map +2 -2
  151. package/dist/core/config/schema.js +21 -3
  152. package/dist/core/config/schema.js.map +2 -2
  153. package/dist/core/costTracker.js +18 -16
  154. package/dist/core/costTracker.js.map +2 -2
  155. package/dist/core/index.js +0 -1
  156. package/dist/core/index.js.map +2 -2
  157. package/dist/core/tokenStatsManager.js +22 -4
  158. package/dist/core/tokenStatsManager.js.map +2 -2
  159. package/dist/cost-tracker.js +0 -16
  160. package/dist/cost-tracker.js.map +2 -2
  161. package/dist/entrypoints/bootstrap.js +3 -1
  162. package/dist/entrypoints/bootstrap.js.map +2 -2
  163. package/dist/entrypoints/cli.js +81 -68
  164. package/dist/entrypoints/cli.js.map +2 -2
  165. package/dist/hooks/useAgentTokenStats.js +1 -1
  166. package/dist/hooks/useAgentTokenStats.js.map +2 -2
  167. package/dist/hooks/useAgentTranscripts.js +2 -1
  168. package/dist/hooks/useAgentTranscripts.js.map +2 -2
  169. package/dist/hooks/useBackgroundShells.js +29 -0
  170. package/dist/hooks/useBackgroundShells.js.map +7 -0
  171. package/dist/hooks/useCanUseTool.js +1 -1
  172. package/dist/hooks/useCanUseTool.js.map +2 -2
  173. package/dist/hooks/useDeferredLoading.js +64 -0
  174. package/dist/hooks/useDeferredLoading.js.map +7 -0
  175. package/dist/hooks/useHookStatus.js +1 -1
  176. package/dist/hooks/useHookStatus.js.map +2 -2
  177. package/dist/hooks/useSessionTracking.js +55 -0
  178. package/dist/hooks/useSessionTracking.js.map +7 -0
  179. package/dist/hooks/useTerminalSize.js +21 -0
  180. package/dist/hooks/useTerminalSize.js.map +2 -2
  181. package/dist/hooks/useTextInput.js +1 -0
  182. package/dist/hooks/useTextInput.js.map +2 -2
  183. package/dist/hooks/useUnifiedCompletion.js +3 -2
  184. package/dist/hooks/useUnifiedCompletion.js.map +2 -2
  185. package/dist/i18n/locales/en.js +299 -1
  186. package/dist/i18n/locales/en.js.map +2 -2
  187. package/dist/i18n/locales/zh-CN.js +300 -2
  188. package/dist/i18n/locales/zh-CN.js.map +2 -2
  189. package/dist/i18n/types.js.map +1 -1
  190. package/dist/messages.js +41 -17
  191. package/dist/messages.js.map +2 -2
  192. package/dist/permissions.js +94 -1
  193. package/dist/permissions.js.map +2 -2
  194. package/dist/query.js +27 -19
  195. package/dist/query.js.map +2 -2
  196. package/dist/screens/REPL.js +83 -74
  197. package/dist/screens/REPL.js.map +2 -2
  198. package/dist/services/adapters/responsesAPI.js +6 -0
  199. package/dist/services/adapters/responsesAPI.js.map +2 -2
  200. package/dist/services/agentTeams/index.js +35 -0
  201. package/dist/services/agentTeams/index.js.map +7 -0
  202. package/dist/services/agentTeams/mailbox.js +114 -0
  203. package/dist/services/agentTeams/mailbox.js.map +7 -0
  204. package/dist/services/agentTeams/teamManager.js +149 -0
  205. package/dist/services/agentTeams/teamManager.js.map +7 -0
  206. package/dist/services/agentTeams/teamTaskStore.js +114 -0
  207. package/dist/services/agentTeams/teamTaskStore.js.map +7 -0
  208. package/dist/services/agentTeams/teammateSpawner.js +80 -0
  209. package/dist/services/agentTeams/teammateSpawner.js.map +7 -0
  210. package/dist/services/checkpointManager.js +16 -3
  211. package/dist/services/checkpointManager.js.map +2 -2
  212. package/dist/services/claude.js +19 -1728
  213. package/dist/services/claude.js.map +3 -3
  214. package/dist/services/customCommands.js +30 -8
  215. package/dist/services/customCommands.js.map +2 -2
  216. package/dist/services/gpt5ConnectionTest.js +4 -2
  217. package/dist/services/gpt5ConnectionTest.js.map +2 -2
  218. package/dist/services/hookExecutor.js +411 -127
  219. package/dist/services/hookExecutor.js.map +2 -2
  220. package/dist/services/llm/anthropicProvider.js +807 -0
  221. package/dist/services/llm/anthropicProvider.js.map +7 -0
  222. package/dist/services/llm/dispatch.js +218 -0
  223. package/dist/services/llm/dispatch.js.map +7 -0
  224. package/dist/services/llm/index.js +44 -0
  225. package/dist/services/llm/index.js.map +7 -0
  226. package/dist/services/llm/mintoContext.js +69 -0
  227. package/dist/services/llm/mintoContext.js.map +7 -0
  228. package/dist/services/llm/openaiProvider.js +622 -0
  229. package/dist/services/llm/openaiProvider.js.map +7 -0
  230. package/dist/services/llm/types.js +157 -0
  231. package/dist/services/llm/types.js.map +7 -0
  232. package/dist/services/mcpClient.js +183 -33
  233. package/dist/services/mcpClient.js.map +2 -2
  234. package/dist/services/notifier.js +14 -0
  235. package/dist/services/notifier.js.map +2 -2
  236. package/dist/services/oauth.js +4 -2
  237. package/dist/services/oauth.js.map +2 -2
  238. package/dist/services/openai.js +66 -56
  239. package/dist/services/openai.js.map +3 -3
  240. package/dist/services/outputStyles.js +102 -21
  241. package/dist/services/outputStyles.js.map +2 -2
  242. package/dist/services/plugins/lspServers.js +1 -1
  243. package/dist/services/plugins/lspServers.js.map +2 -2
  244. package/dist/services/plugins/pluginRuntime.js +2 -1
  245. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  246. package/dist/services/plugins/pluginValidation.js +10 -3
  247. package/dist/services/plugins/pluginValidation.js.map +2 -2
  248. package/dist/services/plugins/skillMarketplace.js +20 -9
  249. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  250. package/dist/services/sentry.js +1 -1
  251. package/dist/services/sentry.js.map +2 -2
  252. package/dist/services/sessionMemory.js +16 -3
  253. package/dist/services/sessionMemory.js.map +2 -2
  254. package/dist/services/systemReminder.js +367 -9
  255. package/dist/services/systemReminder.js.map +2 -2
  256. package/dist/services/taskStore.js +19 -0
  257. package/dist/services/taskStore.js.map +2 -2
  258. package/dist/tools/ArchitectTool/ArchitectTool.js.map +1 -1
  259. package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +1 -1
  260. package/dist/tools/BashOutputTool/BashOutputTool.js.map +1 -1
  261. package/dist/tools/BashTool/BashTool.js +28 -0
  262. package/dist/tools/BashTool/BashTool.js.map +2 -2
  263. package/dist/tools/FileEditTool/FileEditTool.js +8 -1
  264. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  265. package/dist/tools/FileReadTool/FileReadTool.js +14 -0
  266. package/dist/tools/FileReadTool/FileReadTool.js.map +2 -2
  267. package/dist/tools/FileWriteTool/FileWriteTool.js +10 -1
  268. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  269. package/dist/tools/GlobTool/GlobTool.js.map +1 -1
  270. package/dist/tools/GrepTool/GrepTool.js.map +1 -1
  271. package/dist/tools/KillShellTool/KillShellTool.js.map +1 -1
  272. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +2 -2
  273. package/dist/tools/LspTool/LspTool.js +11 -2
  274. package/dist/tools/LspTool/LspTool.js.map +2 -2
  275. package/dist/tools/MCPTool/MCPTool.js.map +1 -1
  276. package/dist/tools/MemoryReadTool/MemoryReadTool.js +2 -1
  277. package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
  278. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +2 -1
  279. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
  280. package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
  281. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  282. package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
  283. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  284. package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +1 -1
  285. package/dist/tools/PlanModeTool/EnterPlanModeTool.js +8 -2
  286. package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
  287. package/dist/tools/PlanModeTool/ExitPlanModeTool.js +2 -0
  288. package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
  289. package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +1 -1
  290. package/dist/tools/SlashCommandTool/SlashCommandTool.js +174 -18
  291. package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +3 -3
  292. package/dist/tools/TaskCreateTool/TaskCreateTool.js.map +1 -1
  293. package/dist/tools/TaskGetTool/TaskGetTool.js.map +1 -1
  294. package/dist/tools/TaskListTool/TaskListTool.js.map +1 -1
  295. package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +1 -1
  296. package/dist/tools/TaskStopTool/TaskStopTool.js.map +1 -1
  297. package/dist/tools/TaskTool/TaskTool.js +84 -11
  298. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  299. package/dist/tools/TaskTool/prompt.js +12 -6
  300. package/dist/tools/TaskTool/prompt.js.map +2 -2
  301. package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
  302. package/dist/tools/ThinkTool/ThinkTool.js.map +1 -1
  303. package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +1 -1
  304. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +1 -1
  305. package/dist/tools/WebSearchTool/WebSearchTool.js.map +1 -1
  306. package/dist/tools/WebSearchTool/searchProviders.js +2 -1
  307. package/dist/tools/WebSearchTool/searchProviders.js.map +2 -2
  308. package/dist/tools/lsTool/lsTool.js.map +2 -2
  309. package/dist/tools/lsTool/prompt.js.map +1 -1
  310. package/dist/tools.js +14 -3
  311. package/dist/tools.js.map +2 -2
  312. package/dist/types/PermissionMode.js +21 -1
  313. package/dist/types/PermissionMode.js.map +2 -2
  314. package/dist/types/agentTeams.js +1 -0
  315. package/dist/types/agentTeams.js.map +7 -0
  316. package/dist/types/hooks.js +8 -2
  317. package/dist/types/hooks.js.map +2 -2
  318. package/dist/types/plugin.js +3 -5
  319. package/dist/types/plugin.js.map +2 -2
  320. package/dist/utils/agentHookExecutor.js +1 -4
  321. package/dist/utils/agentHookExecutor.js.map +2 -2
  322. package/dist/utils/agentLoader.js +91 -15
  323. package/dist/utils/agentLoader.js.map +2 -2
  324. package/dist/utils/agentMemory.js.map +2 -2
  325. package/dist/utils/animationManager.js +1 -1
  326. package/dist/utils/animationManager.js.map +2 -2
  327. package/dist/utils/ask.js +1 -1
  328. package/dist/utils/async.js +5 -1
  329. package/dist/utils/async.js.map +2 -2
  330. package/dist/utils/autoCompactCore.js +60 -0
  331. package/dist/utils/autoCompactCore.js.map +2 -2
  332. package/dist/utils/claudeCodeSync.js +439 -0
  333. package/dist/utils/claudeCodeSync.js.map +7 -0
  334. package/dist/utils/config.js +27 -151
  335. package/dist/utils/config.js.map +2 -2
  336. package/dist/utils/configSchema.js +227 -0
  337. package/dist/utils/configSchema.js.map +7 -0
  338. package/dist/utils/debugLogger.js.map +2 -2
  339. package/dist/utils/env.js +4 -3
  340. package/dist/utils/env.js.map +2 -2
  341. package/dist/utils/envConfig.js +34 -0
  342. package/dist/utils/envConfig.js.map +3 -3
  343. package/dist/utils/execFileNoThrow.js +2 -1
  344. package/dist/utils/execFileNoThrow.js.map +2 -2
  345. package/dist/utils/gpt5.js +146 -0
  346. package/dist/utils/gpt5.js.map +7 -0
  347. package/dist/utils/hookManager.js +374 -140
  348. package/dist/utils/hookManager.js.map +2 -2
  349. package/dist/utils/markdown.js +47 -0
  350. package/dist/utils/markdown.js.map +2 -2
  351. package/dist/utils/marketplaceManager.js +80 -43
  352. package/dist/utils/marketplaceManager.js.map +2 -2
  353. package/dist/utils/memoizeWithTTL.js +25 -0
  354. package/dist/utils/memoizeWithTTL.js.map +7 -0
  355. package/dist/utils/messages.js +2 -2
  356. package/dist/utils/messages.js.map +2 -2
  357. package/dist/utils/model.js +34 -9
  358. package/dist/utils/model.js.map +2 -2
  359. package/dist/utils/pluginInstaller.js +68 -29
  360. package/dist/utils/pluginInstaller.js.map +2 -2
  361. package/dist/utils/pluginLoader.js +249 -57
  362. package/dist/utils/pluginLoader.js.map +2 -2
  363. package/dist/utils/repoFetcher.js +110 -0
  364. package/dist/utils/repoFetcher.js.map +7 -0
  365. package/dist/utils/safeFetch.js +45 -0
  366. package/dist/utils/safeFetch.js.map +7 -0
  367. package/dist/utils/skillLoader.js +77 -12
  368. package/dist/utils/skillLoader.js.map +2 -2
  369. package/dist/utils/streamingState.js +52 -0
  370. package/dist/utils/streamingState.js.map +7 -0
  371. package/dist/utils/stringSubstitution.js +4 -5
  372. package/dist/utils/stringSubstitution.js.map +2 -2
  373. package/dist/utils/style.js +6 -3
  374. package/dist/utils/style.js.map +2 -2
  375. package/dist/utils/teamConfig.js +162 -16
  376. package/dist/utils/teamConfig.js.map +2 -2
  377. package/dist/utils/terminal.js +1 -1
  378. package/dist/utils/terminal.js.map +2 -2
  379. package/dist/utils/toolRiskClassification.js +0 -6
  380. package/dist/utils/toolRiskClassification.js.map +2 -2
  381. package/dist/version.js +2 -2
  382. package/dist/version.js.map +1 -1
  383. package/package.json +7 -6
@@ -17,11 +17,13 @@ import * as os from "os";
17
17
  import { exec } from "child_process";
18
18
  import { promisify } from "util";
19
19
  import { getTheme } from "../../utils/theme.js";
20
+ import { clearScreen } from "../../utils/terminal.js";
20
21
  import { SEMANTIC_COLORS } from "../../constants/colors.js";
21
22
  const execAsync = promisify(exec);
22
23
  import { getMCPTools } from "../../services/mcpClient.js";
23
24
  import { getModelManager } from "../../utils/model.js";
24
25
  import { randomUUID } from "crypto";
26
+ import { TabbedListView } from "../../components/TabbedListView/TabbedListView.js";
25
27
  import {
26
28
  UI_ICONS,
27
29
  TOOL_CATEGORIES
@@ -31,6 +33,7 @@ import {
31
33
  saveAgent,
32
34
  deleteAgent,
33
35
  openInEditor,
36
+ viewInPager,
34
37
  updateAgent
35
38
  } from "./utils/index.js";
36
39
  function getDisplayModelName(modelId) {
@@ -251,7 +254,7 @@ function MultilineTextInput({
251
254
  setInternalValue(value);
252
255
  }, [value]);
253
256
  useEffect(() => {
254
- if (!focus) return;
257
+ if (!focus) return void 0;
255
258
  const timer = setInterval(() => {
256
259
  setCursorBlink((prev) => !prev);
257
260
  }, 500);
@@ -327,7 +330,10 @@ function LoadingSpinner({ text }) {
327
330
  return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: theme.primary }, UI_ICONS.loading[frame]), text && /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, " ", text));
328
331
  }
329
332
  function AgentsUI({ onExit }) {
330
- const theme = getTheme();
333
+ const [phase, setPhase] = useState({ type: "main" });
334
+ const [activeTab, setActiveTab] = useState("all");
335
+ const [searchQuery, setSearchQuery] = useState("");
336
+ const [statusOverlay, setStatusOverlay] = useState(null);
331
337
  const [modeState, setModeState] = useState({
332
338
  mode: "list-agents",
333
339
  location: "all"
@@ -420,21 +426,12 @@ function AgentsUI({ onExit }) {
420
426
  setLoading(true);
421
427
  clearAgentCache();
422
428
  const abortController = new AbortController();
423
- const loadingId = Date.now();
424
429
  try {
425
430
  const result = await getActiveAgents();
426
431
  if (abortController.signal.aborted) {
427
- return;
432
+ return void 0;
428
433
  }
429
434
  setAgents(result);
430
- if (modeState.selectedAgent) {
431
- const freshSelectedAgent = result.find(
432
- (a) => a.agentType === modeState.selectedAgent.agentType
433
- );
434
- if (freshSelectedAgent) {
435
- setModeState((prev) => ({ ...prev, selectedAgent: freshSelectedAgent }));
436
- }
437
- }
438
435
  const availableTools = [];
439
436
  let coreTools = [
440
437
  { name: "Read", description: "Read files from filesystem" },
@@ -488,526 +485,492 @@ function AgentsUI({ onExit }) {
488
485
  }
489
486
  };
490
487
  }, [refreshKey, loadAgents]);
491
- useInput((input, key) => {
492
- if (!key.escape) return;
493
- const changesSummary = changes.length > 0 ? `Agent changes:
494
- ${changes.join("\n")}` : void 0;
495
- const current = modeState.mode;
496
- if (current === "list-agents") {
497
- onExit(changesSummary);
498
- return;
488
+ useEffect(() => {
489
+ if (phase.type === "main") {
490
+ setSearchQuery("");
499
491
  }
500
- switch (current) {
501
- case "create-location":
502
- setModeState({ mode: "list-agents", location: "all" });
503
- break;
504
- case "create-method":
505
- setModeState({ mode: "create-location", location: modeState.location });
506
- break;
507
- case "create-generate":
508
- setModeState({ mode: "create-location", location: modeState.location });
509
- break;
510
- case "create-type":
511
- setModeState({ mode: "create-generate", location: modeState.location });
512
- break;
513
- case "create-prompt":
514
- setModeState({ mode: "create-type", location: modeState.location });
515
- break;
516
- case "create-description":
517
- setModeState({ mode: "create-prompt", location: modeState.location });
518
- break;
519
- case "create-tools":
520
- setModeState({
521
- mode: "create-description",
522
- location: modeState.location
523
- });
524
- break;
525
- case "create-model":
526
- setModeState({ mode: "create-tools", location: modeState.location });
527
- break;
528
- case "create-color":
529
- setModeState({ mode: "create-model", location: modeState.location });
530
- break;
531
- case "create-confirm":
532
- setModeState({ mode: "create-color", location: modeState.location });
533
- break;
534
- case "agent-menu":
535
- setModeState({ mode: "list-agents", location: "all" });
536
- break;
537
- case "view-agent":
538
- setModeState({
539
- mode: "agent-menu",
540
- selectedAgent: modeState.selectedAgent
492
+ }, [phase]);
493
+ const activeMap = useMemo(() => {
494
+ const map = /* @__PURE__ */ new Map();
495
+ agents.forEach((a) => map.set(a.agentType, a));
496
+ return map;
497
+ }, [agents]);
498
+ const checkOverride = useCallback(
499
+ (agent) => {
500
+ const active = activeMap.get(agent.agentType);
501
+ const isOverridden = !!(active && active.location !== agent.location);
502
+ return {
503
+ isOverridden,
504
+ overriddenBy: isOverridden ? active.location : null
505
+ };
506
+ },
507
+ [activeMap]
508
+ );
509
+ const { tabs, items, title, footerHint, searchEnabled } = useMemo(() => {
510
+ switch (phase.type) {
511
+ case "main": {
512
+ const allAgents = agents;
513
+ const customAgents = allAgents.filter((a) => a.location !== "built-in");
514
+ const mainTabs = [
515
+ { id: "all", label: "All", badge: customAgents.length },
516
+ {
517
+ id: "plugin",
518
+ label: "Plugin",
519
+ badge: customAgents.filter((a) => a.location === "plugin").length
520
+ },
521
+ {
522
+ id: "user",
523
+ label: "Personal",
524
+ badge: customAgents.filter((a) => a.location === "user").length
525
+ },
526
+ {
527
+ id: "project",
528
+ label: "Project",
529
+ badge: customAgents.filter((a) => a.location === "project").length
530
+ }
531
+ ];
532
+ let mainItems = [];
533
+ mainItems.push({
534
+ id: "create-new",
535
+ label: "+ Create new agent",
536
+ description: "Create a new specialized agent"
541
537
  });
542
- break;
543
- case "edit-agent":
544
- setModeState({
545
- mode: "agent-menu",
546
- selectedAgent: modeState.selectedAgent
538
+ const displayAgents = activeTab === "all" ? customAgents : customAgents.filter((a) => a.location === activeTab);
539
+ for (const agent of displayAgents) {
540
+ const { isOverridden, overriddenBy } = checkOverride(agent);
541
+ const agentModel = agent.model || null;
542
+ const modelDisplay = getDisplayModelName(agentModel);
543
+ const locationLabel = agent.location === "plugin" ? "Plugin" : agent.location === "user" ? "Personal" : agent.location === "project" ? "Project" : agent.location;
544
+ mainItems.push({
545
+ id: `${agent.agentType}-${agent.location}`,
546
+ label: agent.agentType,
547
+ description: agent.whenToUse || agent.description || "",
548
+ category: locationLabel,
549
+ metadata: modelDisplay,
550
+ status: isOverridden ? "disabled" : "enabled",
551
+ data: agent
552
+ });
553
+ }
554
+ return {
555
+ tabs: mainTabs,
556
+ items: mainItems,
557
+ title: "Agents",
558
+ footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Tab/\u2190\u2192 Switch \xB7 / Search \xB7 Esc Close",
559
+ searchEnabled: true
560
+ };
561
+ }
562
+ case "agent-actions": {
563
+ const agent = phase.agent;
564
+ const isBuiltIn = agent.location === "built-in";
565
+ const actionItems = [
566
+ {
567
+ id: "view",
568
+ label: "View details",
569
+ description: "Show agent configuration"
570
+ }
571
+ ];
572
+ if (!isBuiltIn) {
573
+ actionItems.push({
574
+ id: "edit",
575
+ label: "Edit agent",
576
+ description: "Modify agent settings"
577
+ });
578
+ actionItems.push({
579
+ id: "delete",
580
+ label: "Delete agent",
581
+ description: "Remove this agent"
582
+ });
583
+ }
584
+ actionItems.push({
585
+ id: "back",
586
+ label: "Back",
587
+ description: "Return to agent list"
547
588
  });
589
+ return {
590
+ tabs: [{ id: "actions", label: "Actions" }],
591
+ items: actionItems,
592
+ title: agent.agentType,
593
+ footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Esc Back",
594
+ searchEnabled: false
595
+ };
596
+ }
597
+ case "edit-actions": {
598
+ const agent = phase.agent;
599
+ const editItems = [
600
+ {
601
+ id: "open-editor",
602
+ label: "Open in editor",
603
+ description: "Edit the agent file directly"
604
+ },
605
+ {
606
+ id: "edit-tools",
607
+ label: "Edit tools",
608
+ description: "Change available tools"
609
+ },
610
+ {
611
+ id: "edit-model",
612
+ label: "Edit model",
613
+ description: "Change the model"
614
+ },
615
+ {
616
+ id: "edit-color",
617
+ label: "Edit color",
618
+ description: "Change the color tag"
619
+ },
620
+ {
621
+ id: "back",
622
+ label: "Back",
623
+ description: "Return to agent actions"
624
+ }
625
+ ];
626
+ return {
627
+ tabs: [{ id: "edit", label: "Edit" }],
628
+ items: editItems,
629
+ title: `Edit: ${agent.agentType}`,
630
+ footerHint: "\u2191\u2193 Navigate \xB7 Enter Select \xB7 Esc Back",
631
+ searchEnabled: false
632
+ };
633
+ }
634
+ default:
635
+ return {
636
+ tabs: [{ id: "all", label: "All" }],
637
+ items: [],
638
+ title: "Agents",
639
+ footerHint: "",
640
+ searchEnabled: false
641
+ };
642
+ }
643
+ }, [phase, activeTab, agents, checkOverride]);
644
+ const handleTabChange = useCallback((tabId) => {
645
+ setActiveTab(tabId);
646
+ setSearchQuery("");
647
+ }, []);
648
+ const handleStatusDismiss = useCallback(() => {
649
+ setStatusOverlay(null);
650
+ setPhase({ type: "main" });
651
+ }, []);
652
+ const handleBack = useCallback(() => {
653
+ if (statusOverlay && statusOverlay.type !== "loading") {
654
+ handleStatusDismiss();
655
+ return;
656
+ }
657
+ switch (phase.type) {
658
+ case "main": {
659
+ const changesSummary = changes.length > 0 ? `Agent changes:
660
+ ${changes.join("\n")}` : void 0;
661
+ onExit(changesSummary);
548
662
  break;
549
- case "edit-tools":
550
- case "edit-model":
551
- case "edit-color":
552
- setModeState({
553
- mode: "edit-agent",
554
- selectedAgent: modeState.selectedAgent
555
- });
663
+ }
664
+ case "agent-actions":
665
+ setPhase({ type: "main" });
556
666
  break;
557
- case "delete-confirm":
558
- setModeState({
559
- mode: "agent-menu",
560
- selectedAgent: modeState.selectedAgent
561
- });
667
+ case "edit-actions":
668
+ setPhase({ type: "agent-actions", agent: phase.agent });
562
669
  break;
563
670
  default:
564
- setModeState({ mode: "list-agents", location: "all" });
671
+ setPhase({ type: "main" });
565
672
  break;
566
673
  }
567
- });
568
- const handleAgentSelect = useCallback(
569
- (agent) => {
570
- setModeState({
571
- mode: "agent-menu",
572
- location: modeState.location,
573
- selectedAgent: agent
574
- });
674
+ }, [phase, statusOverlay, changes, onExit, handleStatusDismiss]);
675
+ const handleClose = useCallback(() => {
676
+ if (statusOverlay && statusOverlay.type !== "loading") {
677
+ handleStatusDismiss();
678
+ return;
679
+ }
680
+ if (phase.type === "main") {
681
+ const changesSummary = changes.length > 0 ? `Agent changes:
682
+ ${changes.join("\n")}` : void 0;
683
+ onExit(changesSummary);
684
+ } else {
685
+ setPhase({ type: "main" });
686
+ setSearchQuery("");
687
+ }
688
+ }, [phase, statusOverlay, changes, onExit, handleStatusDismiss]);
689
+ const handleSelect = useCallback(
690
+ async (item) => {
691
+ switch (phase.type) {
692
+ case "main": {
693
+ if (item.id === "create-new") {
694
+ setCreateState({ type: "RESET" });
695
+ setModeState({ mode: "create-location" });
696
+ setPhase({ type: "create", step: { mode: "create-location" } });
697
+ return;
698
+ }
699
+ const agent = item.data;
700
+ if (agent) {
701
+ setPhase({ type: "agent-actions", agent });
702
+ }
703
+ break;
704
+ }
705
+ case "agent-actions": {
706
+ const agent = phase.agent;
707
+ if (item.id === "back") {
708
+ setPhase({ type: "main" });
709
+ return;
710
+ }
711
+ if (item.id === "view") {
712
+ try {
713
+ viewInPager(agent);
714
+ setRefreshKey((prev) => prev + 1);
715
+ } catch (err) {
716
+ setStatusOverlay({
717
+ type: "error",
718
+ message: `Failed to open pager: ${err instanceof Error ? err.message : String(err)}`
719
+ });
720
+ }
721
+ } else if (item.id === "edit") {
722
+ setPhase({ type: "edit-actions", agent });
723
+ } else if (item.id === "delete") {
724
+ setPhase({ type: "delete-confirm", agent });
725
+ }
726
+ break;
727
+ }
728
+ case "edit-actions": {
729
+ const agent = phase.agent;
730
+ if (item.id === "back") {
731
+ setPhase({ type: "agent-actions", agent });
732
+ return;
733
+ }
734
+ if (item.id === "open-editor") {
735
+ try {
736
+ const filePath = getAgentFilePath(agent);
737
+ openInEditor(filePath);
738
+ clearAgentCache();
739
+ const reloaded = await getActiveAgents();
740
+ setAgents(reloaded);
741
+ const updated = reloaded.find(
742
+ (a) => a.agentType === agent.agentType
743
+ );
744
+ if (updated) {
745
+ setPhase({ type: "edit-actions", agent: updated });
746
+ }
747
+ setStatusOverlay({
748
+ type: "success",
749
+ message: "Editor closed"
750
+ });
751
+ } catch (err) {
752
+ setStatusOverlay({
753
+ type: "error",
754
+ message: `Failed to open editor: ${err instanceof Error ? err.message : String(err)}`
755
+ });
756
+ }
757
+ } else if (item.id === "edit-tools") {
758
+ setPhase({ type: "edit-tools", agent });
759
+ } else if (item.id === "edit-model") {
760
+ setPhase({ type: "edit-model", agent });
761
+ } else if (item.id === "edit-color") {
762
+ setPhase({ type: "edit-color", agent });
763
+ }
764
+ break;
765
+ }
766
+ }
575
767
  },
576
- [modeState]
768
+ [phase]
577
769
  );
578
- const handleCreateNew = useCallback(() => {
579
- console.log("=== STARTING AGENT CREATION FLOW ===");
580
- console.log("Current mode state:", modeState);
581
- setCreateState({ type: "RESET" });
582
- console.log("Reset create state");
583
- setModeState({ mode: "create-location" });
584
- console.log("Set mode to create-location");
585
- console.log("=== CREATE NEW HANDLER COMPLETED ===");
586
- }, [modeState]);
587
770
  const handleAgentCreated = useCallback((message) => {
588
771
  setChanges((prev) => [...prev, message]);
589
772
  setRefreshKey((prev) => prev + 1);
590
- setModeState({ mode: "list-agents", location: "all" });
773
+ setPhase({ type: "main" });
591
774
  }, []);
592
775
  const handleAgentDeleted = useCallback((message) => {
593
776
  setChanges((prev) => [...prev, message]);
594
777
  setRefreshKey((prev) => prev + 1);
595
- setModeState({ mode: "list-agents", location: "all" });
778
+ setPhase({ type: "main" });
596
779
  }, []);
597
- if (loading) {
598
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "Agents" }, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Loading agents..." }))), /* @__PURE__ */ React.createElement(InstructionBar, null));
599
- }
600
- switch (modeState.mode) {
601
- case "list-agents":
602
- return /* @__PURE__ */ React.createElement(
603
- AgentListView,
604
- {
605
- location: modeState.location || "all",
606
- agents,
607
- allAgents: agents,
608
- onBack: () => onExit(),
609
- onSelect: handleAgentSelect,
610
- onCreateNew: handleCreateNew,
611
- changes
612
- }
613
- );
614
- case "create-location":
615
- return /* @__PURE__ */ React.createElement(
616
- LocationSelect,
617
- {
618
- createState,
619
- setCreateState,
620
- setModeState
621
- }
622
- );
623
- case "create-method":
624
- return /* @__PURE__ */ React.createElement(
625
- MethodSelect,
626
- {
627
- createState,
628
- setCreateState,
629
- setModeState
630
- }
631
- );
632
- case "create-generate":
633
- return /* @__PURE__ */ React.createElement(
634
- GenerateStep,
635
- {
636
- createState,
637
- setCreateState,
638
- setModeState,
639
- existingAgents: agents
640
- }
641
- );
642
- case "create-type":
643
- return /* @__PURE__ */ React.createElement(
644
- TypeStep,
645
- {
646
- createState,
647
- setCreateState,
648
- setModeState,
649
- existingAgents: agents
650
- }
651
- );
652
- case "create-description":
653
- return /* @__PURE__ */ React.createElement(
654
- DescriptionStep,
655
- {
656
- createState,
657
- setCreateState,
658
- setModeState
659
- }
660
- );
661
- case "create-tools":
662
- return /* @__PURE__ */ React.createElement(
663
- ToolsStep,
664
- {
665
- createState,
666
- setCreateState,
667
- setModeState,
668
- tools
669
- }
670
- );
671
- case "create-model":
672
- return /* @__PURE__ */ React.createElement(
673
- ModelStep,
674
- {
675
- createState,
676
- setCreateState,
677
- setModeState
678
- }
679
- );
680
- case "create-color":
681
- return /* @__PURE__ */ React.createElement(
682
- ColorStep,
683
- {
684
- createState,
685
- setCreateState,
686
- setModeState
687
- }
688
- );
689
- case "create-prompt":
690
- return /* @__PURE__ */ React.createElement(
691
- PromptStep,
692
- {
693
- createState,
694
- setCreateState,
695
- setModeState
696
- }
697
- );
698
- case "create-confirm":
699
- return /* @__PURE__ */ React.createElement(
700
- ConfirmStep,
701
- {
702
- createState,
703
- setCreateState,
704
- setModeState,
705
- tools,
706
- onAgentCreated: handleAgentCreated
707
- }
708
- );
709
- case "agent-menu":
710
- return /* @__PURE__ */ React.createElement(
711
- AgentMenu,
712
- {
713
- agent: modeState.selectedAgent,
714
- setModeState
715
- }
716
- );
717
- case "view-agent":
718
- return /* @__PURE__ */ React.createElement(
719
- ViewAgent,
720
- {
721
- agent: modeState.selectedAgent,
722
- tools,
723
- setModeState
724
- }
725
- );
726
- case "edit-agent":
727
- return /* @__PURE__ */ React.createElement(
728
- EditMenu,
729
- {
730
- agent: modeState.selectedAgent,
731
- setModeState
732
- }
733
- );
734
- case "edit-tools":
735
- return /* @__PURE__ */ React.createElement(
736
- EditToolsStep,
737
- {
738
- agent: modeState.selectedAgent,
739
- tools,
740
- setModeState,
741
- onAgentUpdated: (message, updated) => {
742
- setChanges((prev) => [...prev, message]);
743
- setRefreshKey((prev) => prev + 1);
744
- setModeState({ mode: "agent-menu", selectedAgent: updated });
780
+ const handleAgentUpdated = useCallback(
781
+ (message, updated) => {
782
+ setChanges((prev) => [...prev, message]);
783
+ setRefreshKey((prev) => prev + 1);
784
+ setPhase({ type: "agent-actions", agent: updated });
785
+ },
786
+ []
787
+ );
788
+ const wizardSetModeState = useCallback((state) => {
789
+ if (state.mode === "list-agents") {
790
+ setPhase({ type: "main" });
791
+ return;
792
+ }
793
+ setModeState(state);
794
+ }, []);
795
+ if (phase.type === "create") {
796
+ switch (modeState.mode) {
797
+ case "create-location":
798
+ return /* @__PURE__ */ React.createElement(
799
+ LocationSelect,
800
+ {
801
+ createState,
802
+ setCreateState,
803
+ setModeState: wizardSetModeState
745
804
  }
746
- }
747
- );
748
- case "edit-model":
749
- return /* @__PURE__ */ React.createElement(
750
- EditModelStep,
751
- {
752
- agent: modeState.selectedAgent,
753
- setModeState,
754
- onAgentUpdated: (message, updated) => {
755
- setChanges((prev) => [...prev, message]);
756
- setRefreshKey((prev) => prev + 1);
757
- setModeState({ mode: "agent-menu", selectedAgent: updated });
805
+ );
806
+ case "create-method":
807
+ return /* @__PURE__ */ React.createElement(
808
+ MethodSelect,
809
+ {
810
+ createState,
811
+ setCreateState,
812
+ setModeState: wizardSetModeState
758
813
  }
759
- }
760
- );
761
- case "edit-color":
762
- return /* @__PURE__ */ React.createElement(
763
- EditColorStep,
764
- {
765
- agent: modeState.selectedAgent,
766
- setModeState,
767
- onAgentUpdated: (message, updated) => {
768
- setChanges((prev) => [...prev, message]);
769
- setRefreshKey((prev) => prev + 1);
770
- setModeState({ mode: "agent-menu", selectedAgent: updated });
814
+ );
815
+ case "create-generate":
816
+ return /* @__PURE__ */ React.createElement(
817
+ GenerateStep,
818
+ {
819
+ createState,
820
+ setCreateState,
821
+ setModeState: wizardSetModeState,
822
+ existingAgents: agents
771
823
  }
772
- }
773
- );
774
- case "delete-confirm":
775
- return /* @__PURE__ */ React.createElement(
776
- DeleteConfirm,
777
- {
778
- agent: modeState.selectedAgent,
779
- setModeState,
780
- onAgentDeleted: handleAgentDeleted
781
- }
782
- );
783
- default:
784
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "Agents" }, /* @__PURE__ */ React.createElement(Text, null, "Mode: ", modeState.mode, " (Not implemented yet)"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, "Press Esc to go back"))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "Esc to go back" }));
785
- }
786
- }
787
- function AgentListView({
788
- location,
789
- agents,
790
- allAgents,
791
- onBack,
792
- onSelect,
793
- onCreateNew,
794
- changes
795
- }) {
796
- const theme = getTheme();
797
- const allAgentsList = allAgents || agents;
798
- const customAgents = allAgentsList.filter((a) => a.location !== "built-in");
799
- const builtInAgents = allAgentsList.filter((a) => a.location === "built-in");
800
- const [selectedAgent, setSelectedAgent] = useState(null);
801
- const [onCreateOption, setOnCreateOption] = useState(true);
802
- const [currentLocation, setCurrentLocation] = useState(location);
803
- const [inLocationTabs, setInLocationTabs] = useState(false);
804
- const [selectedLocationTab, setSelectedLocationTab] = useState(0);
805
- const locationTabs = [
806
- { label: "All", value: "all" },
807
- { label: "Personal", value: "user" },
808
- { label: "Project", value: "project" }
809
- ];
810
- const activeMap = useMemo(() => {
811
- const map = /* @__PURE__ */ new Map();
812
- agents.forEach((a) => map.set(a.agentType, a));
813
- return map;
814
- }, [agents]);
815
- const checkOverride = (agent) => {
816
- const active = activeMap.get(agent.agentType);
817
- const isOverridden = !!(active && active.location !== agent.location);
818
- return {
819
- isOverridden,
820
- overriddenBy: isOverridden ? active.location : null
821
- };
822
- };
823
- const renderCreateOption = () => /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React.createElement(Text, { color: onCreateOption ? theme.primary : void 0 }, onCreateOption ? `${UI_ICONS.pointer} ` : " "), /* @__PURE__ */ React.createElement(Text, { bold: true, color: onCreateOption ? theme.primary : void 0 }, "\u2728 Create new agent"));
824
- const renderAgent = (agent, isBuiltIn = false) => {
825
- const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.location === agent.location;
826
- const { isOverridden, overriddenBy } = checkOverride(agent);
827
- const dimmed = isBuiltIn || isOverridden;
828
- const color = !isBuiltIn && isSelected ? theme.primary : void 0;
829
- const agentModel = agent.model || null;
830
- const modelDisplay = getDisplayModelName(agentModel);
831
- return /* @__PURE__ */ React.createElement(
832
- Box,
833
- {
834
- key: `${agent.agentType}-${agent.location}`,
835
- flexDirection: "row",
836
- alignItems: "center"
837
- },
838
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", alignItems: "center", minWidth: 3 }, /* @__PURE__ */ React.createElement(Text, { color: dimmed && !isSelected ? SEMANTIC_COLORS.dim : color }, isBuiltIn ? "" : isSelected ? `${UI_ICONS.pointer} ` : " ")),
839
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", alignItems: "center", flexGrow: 1 }, /* @__PURE__ */ React.createElement(Text, { color: dimmed && !isSelected ? SEMANTIC_COLORS.dim : color }, agent.agentType), /* @__PURE__ */ React.createElement(Text, { color: dimmed ? SEMANTIC_COLORS.dim : "gray" }, " \xB7 ", modelDisplay)),
840
- overriddenBy && /* @__PURE__ */ React.createElement(Box, { marginLeft: 1 }, /* @__PURE__ */ React.createElement(Text, { color: isSelected ? "yellow" : SEMANTIC_COLORS.dim }, UI_ICONS.warning, " overridden by ", overriddenBy))
841
- );
842
- };
843
- const displayAgents = useMemo(() => {
844
- if (currentLocation === "all") {
845
- return [
846
- ...customAgents.filter((a) => a.location === "user"),
847
- ...customAgents.filter((a) => a.location === "project")
848
- ];
849
- } else if (currentLocation === "user" || currentLocation === "project") {
850
- return customAgents.filter((a) => a.location === currentLocation);
851
- }
852
- return customAgents;
853
- }, [customAgents, currentLocation]);
854
- useEffect(() => {
855
- const tabIndex = locationTabs.findIndex(
856
- (tab) => tab.value === currentLocation
857
- );
858
- if (tabIndex !== -1) {
859
- setSelectedLocationTab(tabIndex);
860
- }
861
- }, [currentLocation, locationTabs]);
862
- useEffect(() => {
863
- if (displayAgents.length > 0 && !selectedAgent && !onCreateOption) {
864
- setOnCreateOption(true);
865
- }
866
- }, [displayAgents.length, selectedAgent, onCreateOption]);
867
- useInput((input, key) => {
868
- if (key.escape) {
869
- if (inLocationTabs) {
870
- setInLocationTabs(false);
871
- return;
872
- }
873
- onBack();
874
- return;
875
- }
876
- if (key.return) {
877
- if (inLocationTabs) {
878
- setCurrentLocation(locationTabs[selectedLocationTab].value);
879
- setInLocationTabs(false);
880
- return;
881
- }
882
- if (onCreateOption && onCreateNew) {
883
- onCreateNew();
884
- } else if (selectedAgent) {
885
- onSelect(selectedAgent);
886
- }
887
- return;
888
- }
889
- if (key.tab) {
890
- setInLocationTabs(!inLocationTabs);
891
- return;
892
- }
893
- if (inLocationTabs) {
894
- if (key.leftArrow) {
895
- setSelectedLocationTab(
896
- (prev) => prev > 0 ? prev - 1 : locationTabs.length - 1
897
824
  );
898
- } else if (key.rightArrow) {
899
- setSelectedLocationTab(
900
- (prev) => prev < locationTabs.length - 1 ? prev + 1 : 0
825
+ case "create-type":
826
+ return /* @__PURE__ */ React.createElement(
827
+ TypeStep,
828
+ {
829
+ createState,
830
+ setCreateState,
831
+ setModeState: wizardSetModeState,
832
+ existingAgents: agents
833
+ }
901
834
  );
902
- }
903
- return;
904
- }
905
- if (key.upArrow || key.downArrow) {
906
- const allNavigableItems = [];
907
- if (onCreateNew) {
908
- allNavigableItems.push({ type: "create", agent: null });
909
- }
910
- displayAgents.forEach((agent) => {
911
- const { isOverridden } = checkOverride(agent);
912
- if (!isOverridden) {
913
- allNavigableItems.push({ type: "agent", agent });
914
- }
915
- });
916
- if (allNavigableItems.length === 0) return;
917
- if (key.upArrow) {
918
- if (onCreateOption) {
919
- const lastAgent = allNavigableItems[allNavigableItems.length - 1];
920
- if (lastAgent.type === "agent") {
921
- setSelectedAgent(lastAgent.agent);
922
- setOnCreateOption(false);
835
+ case "create-description":
836
+ return /* @__PURE__ */ React.createElement(
837
+ DescriptionStep,
838
+ {
839
+ createState,
840
+ setCreateState,
841
+ setModeState: wizardSetModeState
923
842
  }
924
- } else if (selectedAgent) {
925
- const currentIndex = allNavigableItems.findIndex(
926
- (item) => item.type === "agent" && item.agent?.agentType === selectedAgent.agentType && item.agent?.location === selectedAgent.location
927
- );
928
- if (currentIndex > 0) {
929
- const prevItem = allNavigableItems[currentIndex - 1];
930
- if (prevItem.type === "create") {
931
- setOnCreateOption(true);
932
- setSelectedAgent(null);
933
- } else {
934
- setSelectedAgent(prevItem.agent);
935
- }
936
- } else {
937
- if (onCreateNew) {
938
- setOnCreateOption(true);
939
- setSelectedAgent(null);
940
- }
843
+ );
844
+ case "create-tools":
845
+ return /* @__PURE__ */ React.createElement(
846
+ ToolsStep,
847
+ {
848
+ createState,
849
+ setCreateState,
850
+ setModeState: wizardSetModeState,
851
+ tools
941
852
  }
942
- }
943
- } else if (key.downArrow) {
944
- if (onCreateOption) {
945
- const firstAgent = allNavigableItems.find(
946
- (item) => item.type === "agent"
947
- );
948
- if (firstAgent) {
949
- setSelectedAgent(firstAgent.agent);
950
- setOnCreateOption(false);
853
+ );
854
+ case "create-model":
855
+ return /* @__PURE__ */ React.createElement(
856
+ ModelStep,
857
+ {
858
+ createState,
859
+ setCreateState,
860
+ setModeState: wizardSetModeState
951
861
  }
952
- } else if (selectedAgent) {
953
- const currentIndex = allNavigableItems.findIndex(
954
- (item) => item.type === "agent" && item.agent?.agentType === selectedAgent.agentType && item.agent?.location === selectedAgent.location
955
- );
956
- if (currentIndex < allNavigableItems.length - 1) {
957
- const nextItem = allNavigableItems[currentIndex + 1];
958
- if (nextItem.type === "agent") {
959
- setSelectedAgent(nextItem.agent);
960
- }
961
- } else {
962
- if (onCreateNew) {
963
- setOnCreateOption(true);
964
- setSelectedAgent(null);
965
- }
862
+ );
863
+ case "create-color":
864
+ return /* @__PURE__ */ React.createElement(
865
+ ColorStep,
866
+ {
867
+ createState,
868
+ setCreateState,
869
+ setModeState: wizardSetModeState
966
870
  }
967
- }
968
- }
871
+ );
872
+ case "create-prompt":
873
+ return /* @__PURE__ */ React.createElement(
874
+ PromptStep,
875
+ {
876
+ createState,
877
+ setCreateState,
878
+ setModeState: wizardSetModeState
879
+ }
880
+ );
881
+ case "create-confirm":
882
+ return /* @__PURE__ */ React.createElement(
883
+ ConfirmStep,
884
+ {
885
+ createState,
886
+ setCreateState,
887
+ setModeState: wizardSetModeState,
888
+ tools,
889
+ onAgentCreated: handleAgentCreated
890
+ }
891
+ );
892
+ default:
893
+ setPhase({ type: "main" });
894
+ return null;
969
895
  }
970
- });
971
- const EmptyStateInput = () => {
972
- useInput((input, key) => {
973
- if (key.escape) {
974
- onBack();
975
- return;
896
+ }
897
+ if (phase.type === "edit-tools") {
898
+ return /* @__PURE__ */ React.createElement(
899
+ EditToolsStep,
900
+ {
901
+ agent: phase.agent,
902
+ tools,
903
+ setModeState: (state) => {
904
+ clearScreen();
905
+ setPhase({ type: "edit-actions", agent: phase.agent });
906
+ },
907
+ onAgentUpdated: handleAgentUpdated
976
908
  }
977
- if (key.return && onCreateNew) {
978
- onCreateNew();
979
- return;
909
+ );
910
+ }
911
+ if (phase.type === "edit-model") {
912
+ return /* @__PURE__ */ React.createElement(
913
+ EditModelStep,
914
+ {
915
+ agent: phase.agent,
916
+ setModeState: (state) => {
917
+ clearScreen();
918
+ setPhase({ type: "edit-actions", agent: phase.agent });
919
+ },
920
+ onAgentUpdated: handleAgentUpdated
980
921
  }
981
- });
982
- return null;
983
- };
984
- if (!agents.length || currentLocation !== "built-in" && !customAgents.length) {
985
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(EmptyStateInput, null), /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Agents", subtitle: "" }, onCreateNew && /* @__PURE__ */ React.createElement(Box, { marginY: 1 }, renderCreateOption()), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4AD} What are agents?")), /* @__PURE__ */ React.createElement(Text, null, "Specialized AI assistants that Minto can delegate to for specific tasks."), /* @__PURE__ */ React.createElement(Text, null, "Each agent has its own context, prompt, and tools."), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.primary }, "\u{1F4A1} Popular agent ideas:")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F50D} Code Reviewer - Reviews PRs for best practices"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F512} Security Auditor - Finds vulnerabilities"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u26A1 Performance Optimizer - Improves code speed"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F9D1}\u200D\u{1F4BC} Tech Lead - Makes architecture decisions"), /* @__PURE__ */ React.createElement(Text, null, "\u2022 \u{1F3A8} UX Expert - Improves user experience"))), currentLocation !== "built-in" && builtInAgents.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, UI_ICONS.separator.repeat(40))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Built-in (always available):"), builtInAgents.map((a) => renderAgent(a, true))))), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "Press Enter to create new agent \xB7 Esc to go back" }));
922
+ );
986
923
  }
987
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: "\u{1F916} Agents", subtitle: "" }, changes.length > 0 && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, changes[changes.length - 1])), /* @__PURE__ */ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", gap: 2 }, locationTabs.map((tab, idx) => {
988
- const isActive = currentLocation === tab.value;
989
- const isSelected = inLocationTabs && idx === selectedLocationTab;
990
- return /* @__PURE__ */ React.createElement(Box, { key: tab.value, flexDirection: "row" }, /* @__PURE__ */ React.createElement(
991
- Text,
924
+ if (phase.type === "edit-color") {
925
+ return /* @__PURE__ */ React.createElement(
926
+ EditColorStep,
992
927
  {
993
- color: isSelected || isActive ? theme.primary : !isActive && !isSelected ? SEMANTIC_COLORS.dim : void 0,
994
- bold: isActive
995
- },
996
- isSelected ? "\u25B6 " : isActive ? "\u25C9 " : "\u25CB ",
997
- tab.label
998
- ), idx < locationTabs.length - 1 && /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, " | "));
999
- })), /* @__PURE__ */ React.createElement(Box, { marginTop: 0 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, currentLocation === "all" ? "Showing all agents" : currentLocation === "user" ? "Personal agents (~/.minto/agents)" : "Project agents (.minto/agents)"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, onCreateNew && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, renderCreateOption()), currentLocation === "all" ? /* @__PURE__ */ React.createElement(React.Fragment, null, customAgents.filter((a) => a.location === "user").length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Personal:"), customAgents.filter((a) => a.location === "user").map((a) => renderAgent(a))), customAgents.filter((a) => a.location === "project").length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1000
- Box,
1001
- {
1002
- marginTop: customAgents.filter((a) => a.location === "user").length > 0 ? 1 : 0
1003
- },
1004
- /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Project:")
1005
- ), customAgents.filter((a) => a.location === "project").map((a) => renderAgent(a))), builtInAgents.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: customAgents.length > 0 ? 1 : 0 }, /* @__PURE__ */ React.createElement(Text, null, UI_ICONS.separator.repeat(40))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Built-in:"), builtInAgents.map((a) => renderAgent(a, true))))) : /* @__PURE__ */ React.createElement(React.Fragment, null, displayAgents.map((a) => renderAgent(a)), currentLocation !== "built-in" && builtInAgents.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, UI_ICONS.separator.repeat(40))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.secondary }, "Built-in:"), builtInAgents.map((a) => renderAgent(a, true))))))), /* @__PURE__ */ React.createElement(
1006
- InstructionBar,
928
+ agent: phase.agent,
929
+ setModeState: (state) => {
930
+ clearScreen();
931
+ setPhase({ type: "edit-actions", agent: phase.agent });
932
+ },
933
+ onAgentUpdated: handleAgentUpdated
934
+ }
935
+ );
936
+ }
937
+ if (phase.type === "delete-confirm") {
938
+ return /* @__PURE__ */ React.createElement(
939
+ DeleteConfirm,
940
+ {
941
+ agent: phase.agent,
942
+ setModeState: (state) => {
943
+ clearScreen();
944
+ setPhase({ type: "agent-actions", agent: phase.agent });
945
+ },
946
+ onAgentDeleted: handleAgentDeleted
947
+ }
948
+ );
949
+ }
950
+ const currentTab = phase.type === "main" ? activeTab : phase.type === "agent-actions" ? "actions" : "edit";
951
+ return /* @__PURE__ */ React.createElement(
952
+ TabbedListView,
1007
953
  {
1008
- instructions: inLocationTabs ? "\u2190\u2192 Switch tabs \u2022 Enter Select \u2022 Tab Exit tabs" : "\u2191\u2193 Navigate \u2022 Tab Location \u2022 Enter Select"
954
+ title,
955
+ tabs,
956
+ activeTab: currentTab,
957
+ onTabChange: handleTabChange,
958
+ items,
959
+ searchEnabled,
960
+ searchQuery,
961
+ onSearchChange: setSearchQuery,
962
+ onSelect: handleSelect,
963
+ onClose: handleClose,
964
+ onBack: handleBack,
965
+ statusOverlay,
966
+ footerHint,
967
+ groupByCategory: phase.type === "main" && activeTab === "all",
968
+ isLoading: loading,
969
+ loadingText: "Loading agents...",
970
+ emptyText: phase.type === "main" ? 'No agents found. Select "+ Create new agent" to get started.' : "No items",
971
+ statusDismissHint: "Enter Continue \xB7 Esc Back"
1009
972
  }
1010
- ));
973
+ );
1011
974
  }
1012
975
  function GenerateStep({
1013
976
  createState,
@@ -1618,146 +1581,6 @@ function MethodSelect({
1618
1581
  ))
1619
1582
  ), /* @__PURE__ */ React.createElement(InstructionBar, null));
1620
1583
  }
1621
- function AgentMenu({ agent, setModeState }) {
1622
- const [selectedIndex, setSelectedIndex] = useState(0);
1623
- const options = [
1624
- { label: "View details", value: "view" },
1625
- {
1626
- label: "Edit agent",
1627
- value: "edit",
1628
- disabled: agent.location === "built-in"
1629
- },
1630
- {
1631
- label: "Delete agent",
1632
- value: "delete",
1633
- disabled: agent.location === "built-in"
1634
- }
1635
- ];
1636
- const availableOptions = options.filter((opt) => !opt.disabled);
1637
- const handleSelect = (value) => {
1638
- switch (value) {
1639
- case "view":
1640
- setModeState({ mode: "view-agent", selectedAgent: agent });
1641
- break;
1642
- case "edit":
1643
- setModeState({ mode: "edit-agent", selectedAgent: agent });
1644
- break;
1645
- case "delete":
1646
- setModeState({ mode: "delete-confirm", selectedAgent: agent });
1647
- break;
1648
- }
1649
- };
1650
- useInput((input, key) => {
1651
- if (key.return) {
1652
- handleSelect(availableOptions[selectedIndex].value);
1653
- } else if (key.upArrow) {
1654
- setSelectedIndex(
1655
- (prev) => prev > 0 ? prev - 1 : availableOptions.length - 1
1656
- );
1657
- } else if (key.downArrow) {
1658
- setSelectedIndex(
1659
- (prev) => prev < availableOptions.length - 1 ? prev + 1 : 0
1660
- );
1661
- }
1662
- });
1663
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
1664
- Header,
1665
- {
1666
- title: `Agent: ${agent.agentType}`,
1667
- subtitle: `${agent.location}`
1668
- },
1669
- /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
1670
- SelectList,
1671
- {
1672
- options: availableOptions,
1673
- selectedIndex,
1674
- onChange: handleSelect,
1675
- numbered: false
1676
- }
1677
- ))
1678
- ), /* @__PURE__ */ React.createElement(InstructionBar, null));
1679
- }
1680
- function EditMenu({ agent, setModeState }) {
1681
- const [selectedIndex, setSelectedIndex] = useState(0);
1682
- const [isOpening, setIsOpening] = useState(false);
1683
- const [error, setError] = useState(null);
1684
- const theme = getTheme();
1685
- const options = [
1686
- { label: "Open in editor", value: "open-editor" },
1687
- { label: "Edit tools", value: "edit-tools" },
1688
- { label: "Edit model", value: "edit-model" },
1689
- { label: "Edit color", value: "edit-color" }
1690
- ];
1691
- const handleSelect = async (value) => {
1692
- switch (value) {
1693
- case "open-editor":
1694
- setIsOpening(true);
1695
- try {
1696
- const filePath = getAgentFilePath(agent);
1697
- await openInEditor(filePath);
1698
- setModeState({ mode: "agent-menu", selectedAgent: agent });
1699
- } catch (err) {
1700
- console.error("Failed to open editor:", err);
1701
- setError(
1702
- `Failed to open editor: ${err instanceof Error ? err.message : String(err)}`
1703
- );
1704
- } finally {
1705
- setIsOpening(false);
1706
- }
1707
- break;
1708
- case "edit-tools":
1709
- setModeState({ mode: "edit-tools", selectedAgent: agent });
1710
- break;
1711
- case "edit-model":
1712
- setModeState({ mode: "edit-model", selectedAgent: agent });
1713
- break;
1714
- case "edit-color":
1715
- setModeState({ mode: "edit-color", selectedAgent: agent });
1716
- break;
1717
- }
1718
- };
1719
- const handleBack = () => {
1720
- setModeState({ mode: "agent-menu", selectedAgent: agent });
1721
- };
1722
- useInput((input, key) => {
1723
- if (key.escape) {
1724
- handleBack();
1725
- } else if (key.return && !isOpening) {
1726
- handleSelect(options[selectedIndex].value);
1727
- } else if (key.upArrow) {
1728
- setSelectedIndex((prev) => prev > 0 ? prev - 1 : options.length - 1);
1729
- } else if (key.downArrow) {
1730
- setSelectedIndex((prev) => prev < options.length - 1 ? prev + 1 : 0);
1731
- }
1732
- });
1733
- if (isOpening) {
1734
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
1735
- Header,
1736
- {
1737
- title: `Edit agent: ${agent.agentType}`,
1738
- subtitle: "Opening in editor..."
1739
- },
1740
- /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(LoadingSpinner, { text: "Opening file in editor..." }))
1741
- ), /* @__PURE__ */ React.createElement(InstructionBar, null));
1742
- }
1743
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(
1744
- Header,
1745
- {
1746
- title: `Edit agent: ${agent.agentType}`,
1747
- subtitle: `Location: ${agent.location}`
1748
- },
1749
- error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2717 ", error)),
1750
- /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(
1751
- SelectList,
1752
- {
1753
- options,
1754
- selectedIndex,
1755
- onChange: handleSelect,
1756
- numbered: false
1757
- }
1758
- ))
1759
- ), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back" }));
1760
- }
1761
1584
  function EditToolsStep({
1762
1585
  agent,
1763
1586
  tools,
@@ -2166,26 +1989,6 @@ function EditColorStep({
2166
1989
  }), /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, /* @__PURE__ */ React.createElement(Text, null, "Preview: "), /* @__PURE__ */ React.createElement(Text, { color: previewColor }, agent.agentType)))
2167
1990
  ), /* @__PURE__ */ React.createElement(InstructionBar, { instructions: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back" }));
2168
1991
  }
2169
- function ViewAgent({ agent, tools, setModeState }) {
2170
- const theme = getTheme();
2171
- const agentTools = Array.isArray(agent.tools) ? agent.tools : [];
2172
- const hasAllTools = agent.tools === "*" || agentTools.includes("*");
2173
- const locationPath = agent.location === "user" ? `~/.minto/agents/${agent.agentType}.md` : agent.location === "project" ? `.minto/agents/${agent.agentType}.md` : "(built-in)";
2174
- const displayModel = getDisplayModelName(agent.model || null);
2175
- const allowedTools = useMemo(() => {
2176
- if (hasAllTools) return tools;
2177
- return tools.filter(
2178
- (tool) => agentTools.some((allowedTool) => {
2179
- if (allowedTool.includes("*")) {
2180
- const prefix = allowedTool.replace("*", "");
2181
- return tool.name.startsWith(prefix);
2182
- }
2183
- return tool.name === allowedTool;
2184
- })
2185
- );
2186
- }, [tools, agentTools, hasAllTools]);
2187
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Header, { title: `Agent: ${agent.agentType}`, subtitle: "Details" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Type:"), " ", agent.agentType), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Location:"), " ", agent.location, " ", locationPath !== "(built-in)" ? `\xB7 ${locationPath}` : ""), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Description:"), " ", agent.whenToUse), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Model:"), " ", displayModel), /* @__PURE__ */ React.createElement(Text, null, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Color:"), " ", agent.color || "auto"), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Tools:")), hasAllTools ? /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, "All tools (", tools.length, " available)") : /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", paddingLeft: 2 }, allowedTools.map((tool) => /* @__PURE__ */ React.createElement(Fragment, { key: tool.name }, /* @__PURE__ */ React.createElement(Text, { color: theme.secondary }, "\u2022 ", tool.name)))), /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "System Prompt:")), /* @__PURE__ */ React.createElement(Box, { paddingLeft: 2 }, /* @__PURE__ */ React.createElement(Text, null, agent.systemPrompt)))), /* @__PURE__ */ React.createElement(InstructionBar, null));
2188
- }
2189
1992
  function EditAgent({
2190
1993
  agent,
2191
1994
  tools,
@@ -2353,6 +2156,7 @@ var AgentsCommand_default = {
2353
2156
  type: "local-jsx",
2354
2157
  isEnabled: true,
2355
2158
  isHidden: false,
2159
+ hidePromptInput: true,
2356
2160
  async call(onExit) {
2357
2161
  return /* @__PURE__ */ React.createElement(AgentsUI, { onExit });
2358
2162
  },