@within-7/minto 0.1.7 → 0.3.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 (601) hide show
  1. package/cli.js +155 -37
  2. package/dist/Tool.js +38 -0
  3. package/dist/Tool.js.map +3 -3
  4. package/dist/commands/agents/AgentsCommand.js +73 -49
  5. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  6. package/dist/commands/agents/constants.js +1 -1
  7. package/dist/commands/agents/constants.js.map +1 -1
  8. package/dist/commands/agents/index.js +1 -1
  9. package/dist/commands/bug.js +74 -7
  10. package/dist/commands/bug.js.map +3 -3
  11. package/dist/commands/clear.js +3 -0
  12. package/dist/commands/clear.js.map +2 -2
  13. package/dist/commands/compact.js +37 -0
  14. package/dist/commands/compact.js.map +2 -2
  15. package/dist/commands/context.js +85 -0
  16. package/dist/commands/context.js.map +7 -0
  17. package/dist/commands/ctx_viz.js +18 -10
  18. package/dist/commands/ctx_viz.js.map +2 -2
  19. package/dist/commands/doctor.js +158 -12
  20. package/dist/commands/doctor.js.map +2 -2
  21. package/dist/commands/export.js +157 -0
  22. package/dist/commands/export.js.map +7 -0
  23. package/dist/commands/mcp-interactive.js +28 -18
  24. package/dist/commands/mcp-interactive.js.map +2 -2
  25. package/dist/commands/model.js +9 -7
  26. package/dist/commands/model.js.map +2 -2
  27. package/dist/commands/permissions.js +87 -0
  28. package/dist/commands/permissions.js.map +7 -0
  29. package/dist/commands/plugin/AddMarketplaceForm.js +3 -2
  30. package/dist/commands/plugin/AddMarketplaceForm.js.map +2 -2
  31. package/dist/commands/plugin/ConfirmDialog.js +2 -1
  32. package/dist/commands/plugin/ConfirmDialog.js.map +2 -2
  33. package/dist/commands/plugin/ErrorView.js +2 -1
  34. package/dist/commands/plugin/ErrorView.js.map +2 -2
  35. package/dist/commands/plugin/InstalledPluginsByMarketplace.js +5 -4
  36. package/dist/commands/plugin/InstalledPluginsByMarketplace.js.map +2 -2
  37. package/dist/commands/plugin/InstalledPluginsManager.js +5 -4
  38. package/dist/commands/plugin/InstalledPluginsManager.js.map +2 -2
  39. package/dist/commands/plugin/MainMenu.js +2 -1
  40. package/dist/commands/plugin/MainMenu.js.map +2 -2
  41. package/dist/commands/plugin/MarketplaceManager.js +5 -4
  42. package/dist/commands/plugin/MarketplaceManager.js.map +2 -2
  43. package/dist/commands/plugin/MarketplaceSelector.js +4 -3
  44. package/dist/commands/plugin/MarketplaceSelector.js.map +2 -2
  45. package/dist/commands/plugin/PlaceholderScreen.js +3 -2
  46. package/dist/commands/plugin/PlaceholderScreen.js.map +2 -2
  47. package/dist/commands/plugin/PluginBrowser.js +6 -5
  48. package/dist/commands/plugin/PluginBrowser.js.map +2 -2
  49. package/dist/commands/plugin/PluginDetailsInstall.js +5 -4
  50. package/dist/commands/plugin/PluginDetailsInstall.js.map +2 -2
  51. package/dist/commands/plugin/PluginDetailsManage.js +4 -3
  52. package/dist/commands/plugin/PluginDetailsManage.js.map +2 -2
  53. package/dist/commands/plugin.js +16 -15
  54. package/dist/commands/plugin.js.map +2 -2
  55. package/dist/commands/quit.js +3 -1
  56. package/dist/commands/quit.js.map +2 -2
  57. package/dist/commands/sandbox.js +105 -0
  58. package/dist/commands/sandbox.js.map +7 -0
  59. package/dist/commands/setup.js +2 -1
  60. package/dist/commands/setup.js.map +2 -2
  61. package/dist/commands/status.js +59 -0
  62. package/dist/commands/status.js.map +7 -0
  63. package/dist/commands/tasks.js +108 -0
  64. package/dist/commands/tasks.js.map +7 -0
  65. package/dist/commands/todos.js +123 -0
  66. package/dist/commands/todos.js.map +7 -0
  67. package/dist/commands/undo.js +245 -0
  68. package/dist/commands/undo.js.map +7 -0
  69. package/dist/commands.js +22 -2
  70. package/dist/commands.js.map +2 -2
  71. package/dist/components/AgentThinkingBlock.js +10 -18
  72. package/dist/components/AgentThinkingBlock.js.map +2 -2
  73. package/dist/components/AsciiLogo.js +7 -8
  74. package/dist/components/AsciiLogo.js.map +2 -2
  75. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js +3 -2
  76. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js.map +2 -2
  77. package/dist/components/AskUserQuestionDialog/QuestionView.js +2 -1
  78. package/dist/components/AskUserQuestionDialog/QuestionView.js.map +2 -2
  79. package/dist/components/BackgroundTasksPanel.js +78 -29
  80. package/dist/components/BackgroundTasksPanel.js.map +2 -2
  81. package/dist/components/BashStreamingProgress.js +24 -0
  82. package/dist/components/BashStreamingProgress.js.map +7 -0
  83. package/dist/components/CollapsibleHint.js +15 -0
  84. package/dist/components/CollapsibleHint.js.map +7 -0
  85. package/dist/components/Config.js +3 -2
  86. package/dist/components/Config.js.map +2 -2
  87. package/dist/components/ConsoleOAuthFlow.js +2 -1
  88. package/dist/components/ConsoleOAuthFlow.js.map +2 -2
  89. package/dist/components/Cost.js +2 -1
  90. package/dist/components/Cost.js.map +2 -2
  91. package/dist/components/FileEditToolUpdatedMessage.js +1 -1
  92. package/dist/components/FileEditToolUpdatedMessage.js.map +2 -2
  93. package/dist/components/HeaderBar.js +13 -8
  94. package/dist/components/HeaderBar.js.map +2 -2
  95. package/dist/components/HistorySearchOverlay.js +4 -3
  96. package/dist/components/HistorySearchOverlay.js.map +2 -2
  97. package/dist/components/HotkeyHelpPanel.js +134 -0
  98. package/dist/components/HotkeyHelpPanel.js.map +7 -0
  99. package/dist/components/InvalidConfigDialog.js +2 -1
  100. package/dist/components/InvalidConfigDialog.js.map +2 -2
  101. package/dist/components/Logo.js +24 -68
  102. package/dist/components/Logo.js.map +2 -2
  103. package/dist/components/MCPServerApprovalDialog.js +2 -1
  104. package/dist/components/MCPServerApprovalDialog.js.map +2 -2
  105. package/dist/components/MCPServerDialogCopy.js +2 -1
  106. package/dist/components/MCPServerDialogCopy.js.map +2 -2
  107. package/dist/components/MCPServerMultiselectDialog.js +2 -1
  108. package/dist/components/MCPServerMultiselectDialog.js.map +2 -2
  109. package/dist/components/Message.js +23 -7
  110. package/dist/components/Message.js.map +3 -3
  111. package/dist/components/MessageSelector.js +4 -3
  112. package/dist/components/MessageSelector.js.map +2 -2
  113. package/dist/components/ModeIndicator.js +2 -1
  114. package/dist/components/ModeIndicator.js.map +2 -2
  115. package/dist/components/ModelConfig.js +20 -6
  116. package/dist/components/ModelConfig.js.map +2 -2
  117. package/dist/components/ModelListManager.js +7 -6
  118. package/dist/components/ModelListManager.js.map +2 -2
  119. package/dist/components/ModelSelector/ModelSelector.js +27 -14
  120. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  121. package/dist/components/Onboarding.js +22 -16
  122. package/dist/components/Onboarding.js.map +2 -2
  123. package/dist/components/OperationSummary.js +130 -0
  124. package/dist/components/OperationSummary.js.map +7 -0
  125. package/dist/components/ProgressBar.js +74 -0
  126. package/dist/components/ProgressBar.js.map +7 -0
  127. package/dist/components/PromptInput.js +210 -87
  128. package/dist/components/PromptInput.js.map +2 -2
  129. package/dist/components/RequestStatusIndicator.js +194 -0
  130. package/dist/components/RequestStatusIndicator.js.map +7 -0
  131. package/dist/components/SensitiveFileWarning.js +31 -0
  132. package/dist/components/SensitiveFileWarning.js.map +7 -0
  133. package/dist/components/Spinner.js +141 -27
  134. package/dist/components/Spinner.js.map +2 -2
  135. package/dist/components/SpinnerSymbol.js +21 -27
  136. package/dist/components/SpinnerSymbol.js.map +2 -2
  137. package/dist/components/StreamingBashOutput.js +9 -8
  138. package/dist/components/StreamingBashOutput.js.map +2 -2
  139. package/dist/components/StructuredDiff.js +6 -8
  140. package/dist/components/StructuredDiff.js.map +2 -2
  141. package/dist/components/SubagentBlock.js +5 -3
  142. package/dist/components/SubagentBlock.js.map +2 -2
  143. package/dist/components/SubagentProgress.js +17 -15
  144. package/dist/components/SubagentProgress.js.map +2 -2
  145. package/dist/components/TaskCard.js +30 -24
  146. package/dist/components/TaskCard.js.map +2 -2
  147. package/dist/components/TextInput.js +9 -1
  148. package/dist/components/TextInput.js.map +2 -2
  149. package/dist/components/TodoChangeBlock.js +1 -1
  150. package/dist/components/TodoChangeBlock.js.map +2 -2
  151. package/dist/components/TodoPanel.js +140 -31
  152. package/dist/components/TodoPanel.js.map +3 -3
  153. package/dist/components/TokenCounter.js +74 -0
  154. package/dist/components/TokenCounter.js.map +7 -0
  155. package/dist/components/TokenWarning.js +2 -1
  156. package/dist/components/TokenWarning.js.map +2 -2
  157. package/dist/components/ToolUseLoader.js +2 -2
  158. package/dist/components/ToolUseLoader.js.map +2 -2
  159. package/dist/components/TreeConnector.js +26 -0
  160. package/dist/components/TreeConnector.js.map +7 -0
  161. package/dist/components/TrustDialog.js +2 -1
  162. package/dist/components/TrustDialog.js.map +2 -2
  163. package/dist/components/TurnCompletionIndicator.js +18 -0
  164. package/dist/components/TurnCompletionIndicator.js.map +7 -0
  165. package/dist/components/binary-feedback/BinaryFeedbackView.js +2 -1
  166. package/dist/components/binary-feedback/BinaryFeedbackView.js.map +2 -2
  167. package/dist/components/messages/AssistantTextMessage.js +20 -9
  168. package/dist/components/messages/AssistantTextMessage.js.map +2 -2
  169. package/dist/components/messages/AssistantThinkingMessage.js +18 -3
  170. package/dist/components/messages/AssistantThinkingMessage.js.map +2 -2
  171. package/dist/components/messages/AssistantToolUseMessage.js +17 -10
  172. package/dist/components/messages/AssistantToolUseMessage.js.map +2 -2
  173. package/dist/components/messages/GroupRenderer.js +54 -0
  174. package/dist/components/messages/GroupRenderer.js.map +7 -0
  175. package/dist/components/messages/NestedTasksPreview.js +24 -0
  176. package/dist/components/messages/NestedTasksPreview.js.map +7 -0
  177. package/dist/components/messages/ParallelTasksGroupView.js +93 -0
  178. package/dist/components/messages/ParallelTasksGroupView.js.map +7 -0
  179. package/dist/components/messages/TaskInModuleView.js +218 -0
  180. package/dist/components/messages/TaskInModuleView.js.map +7 -0
  181. package/dist/components/messages/TaskOutputContent.js +56 -0
  182. package/dist/components/messages/TaskOutputContent.js.map +7 -0
  183. package/dist/components/messages/UserPromptMessage.js +2 -2
  184. package/dist/components/messages/UserPromptMessage.js.map +2 -2
  185. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +2 -3
  186. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +2 -2
  187. package/dist/components/permissions/FallbackPermissionRequest.js +4 -4
  188. package/dist/components/permissions/FallbackPermissionRequest.js.map +2 -2
  189. package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +4 -4
  190. package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +2 -2
  191. package/dist/constants/colors.js +120 -54
  192. package/dist/constants/colors.js.map +2 -2
  193. package/dist/constants/formatRules.js +102 -0
  194. package/dist/constants/formatRules.js.map +7 -0
  195. package/dist/constants/prompts.js +12 -34
  196. package/dist/constants/prompts.js.map +2 -2
  197. package/dist/constants/symbols.js +64 -6
  198. package/dist/constants/symbols.js.map +2 -2
  199. package/dist/constants/timing.js +5 -0
  200. package/dist/constants/timing.js.map +2 -2
  201. package/dist/constants/toolInputExamples.js +84 -0
  202. package/dist/constants/toolInputExamples.js.map +7 -0
  203. package/dist/core/backupManager.js +321 -0
  204. package/dist/core/backupManager.js.map +7 -0
  205. package/dist/core/config/defaults.js +84 -0
  206. package/dist/core/config/defaults.js.map +7 -0
  207. package/dist/core/config/index.js +111 -0
  208. package/dist/core/config/index.js.map +7 -0
  209. package/dist/core/config/loader.js +221 -0
  210. package/dist/core/config/loader.js.map +7 -0
  211. package/dist/core/config/migrations.js +128 -0
  212. package/dist/core/config/migrations.js.map +7 -0
  213. package/dist/core/config/schema.js +178 -0
  214. package/dist/core/config/schema.js.map +7 -0
  215. package/dist/core/costTracker.js +129 -0
  216. package/dist/core/costTracker.js.map +7 -0
  217. package/dist/core/gitAutoCommit.js +287 -0
  218. package/dist/core/gitAutoCommit.js.map +7 -0
  219. package/dist/core/index.js +8 -0
  220. package/dist/core/index.js.map +7 -0
  221. package/dist/core/operationTracker.js +212 -0
  222. package/dist/core/operationTracker.js.map +7 -0
  223. package/dist/core/permissions/auditLog.js +204 -0
  224. package/dist/core/permissions/auditLog.js.map +7 -0
  225. package/dist/core/permissions/engine/index.js +3 -0
  226. package/dist/core/permissions/engine/index.js.map +7 -0
  227. package/dist/core/permissions/engine/permissionEngine.js +106 -0
  228. package/dist/core/permissions/engine/permissionEngine.js.map +7 -0
  229. package/dist/core/permissions/engine/types.js +1 -0
  230. package/dist/core/permissions/engine/types.js.map +7 -0
  231. package/dist/core/permissions/index.js +84 -0
  232. package/dist/core/permissions/index.js.map +7 -0
  233. package/dist/core/permissions/ruleEngine.js +259 -0
  234. package/dist/core/permissions/ruleEngine.js.map +7 -0
  235. package/dist/core/permissions/rules/allowedToolsRule.js +62 -0
  236. package/dist/core/permissions/rules/allowedToolsRule.js.map +7 -0
  237. package/dist/core/permissions/rules/autoEscalationRule.js +296 -0
  238. package/dist/core/permissions/rules/autoEscalationRule.js.map +7 -0
  239. package/dist/core/permissions/rules/index.js +46 -0
  240. package/dist/core/permissions/rules/index.js.map +7 -0
  241. package/dist/core/permissions/rules/planModeRule.js +55 -0
  242. package/dist/core/permissions/rules/planModeRule.js.map +7 -0
  243. package/dist/core/permissions/rules/projectBoundaryRule.js +173 -0
  244. package/dist/core/permissions/rules/projectBoundaryRule.js.map +7 -0
  245. package/dist/core/permissions/rules/safeModeRule.js +65 -0
  246. package/dist/core/permissions/rules/safeModeRule.js.map +7 -0
  247. package/dist/core/permissions/rules/sensitivePathsRule.js +345 -0
  248. package/dist/core/permissions/rules/sensitivePathsRule.js.map +7 -0
  249. package/dist/core/permissions/types.js +127 -0
  250. package/dist/core/permissions/types.js.map +7 -0
  251. package/dist/core/tokenStats.js +9 -0
  252. package/dist/core/tokenStats.js.map +7 -0
  253. package/dist/core/tokenStatsManager.js +331 -0
  254. package/dist/core/tokenStatsManager.js.map +7 -0
  255. package/dist/core/tools/executor.js +143 -0
  256. package/dist/core/tools/executor.js.map +7 -0
  257. package/dist/core/tools/index.js +15 -0
  258. package/dist/core/tools/index.js.map +7 -0
  259. package/dist/core/tools/registry.js +183 -0
  260. package/dist/core/tools/registry.js.map +7 -0
  261. package/dist/core/tools/types.js +1 -0
  262. package/dist/core/tools/types.js.map +7 -0
  263. package/dist/cost-tracker.js +23 -15
  264. package/dist/cost-tracker.js.map +2 -2
  265. package/dist/entrypoints/cli.js +158 -130
  266. package/dist/entrypoints/cli.js.map +2 -2
  267. package/dist/entrypoints/mcp.js +12 -4
  268. package/dist/entrypoints/mcp.js.map +2 -2
  269. package/dist/history.js +14 -3
  270. package/dist/history.js.map +2 -2
  271. package/dist/hooks/useAgentTokenStats.js +72 -0
  272. package/dist/hooks/useAgentTokenStats.js.map +7 -0
  273. package/dist/hooks/useAgentTranscripts.js +140 -0
  274. package/dist/hooks/useAgentTranscripts.js.map +7 -0
  275. package/dist/hooks/useAnimationSync.js +53 -0
  276. package/dist/hooks/useAnimationSync.js.map +7 -0
  277. package/dist/hooks/useArrowKeyHistory.js +4 -2
  278. package/dist/hooks/useArrowKeyHistory.js.map +2 -2
  279. package/dist/hooks/useCanUseTool.js +3 -1
  280. package/dist/hooks/useCanUseTool.js.map +2 -2
  281. package/dist/hooks/useExitOnCtrlCD.js +9 -5
  282. package/dist/hooks/useExitOnCtrlCD.js.map +2 -2
  283. package/dist/hooks/useHookStatus.js +40 -0
  284. package/dist/hooks/useHookStatus.js.map +7 -0
  285. package/dist/hooks/useLogMessages.js +29 -2
  286. package/dist/hooks/useLogMessages.js.map +2 -2
  287. package/dist/hooks/useMessageGroups.js +43 -0
  288. package/dist/hooks/useMessageGroups.js.map +7 -0
  289. package/dist/hooks/useTerminalSize.js +62 -6
  290. package/dist/hooks/useTerminalSize.js.map +2 -2
  291. package/dist/hooks/useUnifiedCompletion.js +69 -0
  292. package/dist/hooks/useUnifiedCompletion.js.map +2 -2
  293. package/dist/i18n/index.js +109 -0
  294. package/dist/i18n/index.js.map +7 -0
  295. package/dist/i18n/locales/en.js +348 -0
  296. package/dist/i18n/locales/en.js.map +7 -0
  297. package/dist/i18n/locales/index.js +7 -0
  298. package/dist/i18n/locales/index.js.map +7 -0
  299. package/dist/i18n/locales/zh-CN.js +348 -0
  300. package/dist/i18n/locales/zh-CN.js.map +7 -0
  301. package/dist/i18n/types.js +8 -0
  302. package/dist/i18n/types.js.map +7 -0
  303. package/dist/permissions.js +28 -1
  304. package/dist/permissions.js.map +2 -2
  305. package/dist/query.js +253 -21
  306. package/dist/query.js.map +3 -3
  307. package/dist/screens/REPL.js +523 -194
  308. package/dist/screens/REPL.js.map +3 -3
  309. package/dist/services/adapters/chatCompletions.js +3 -1
  310. package/dist/services/adapters/chatCompletions.js.map +2 -2
  311. package/dist/services/adapters/messageNormalizer.js +354 -0
  312. package/dist/services/adapters/messageNormalizer.js.map +7 -0
  313. package/dist/services/adapters/responsesAPI.js +6 -3
  314. package/dist/services/adapters/responsesAPI.js.map +2 -2
  315. package/dist/services/checkpointManager.js +386 -0
  316. package/dist/services/checkpointManager.js.map +7 -0
  317. package/dist/services/claude.js +192 -14
  318. package/dist/services/claude.js.map +3 -3
  319. package/dist/services/compressionService.js +50 -1
  320. package/dist/services/compressionService.js.map +2 -2
  321. package/dist/services/contextMonitor.js +162 -0
  322. package/dist/services/contextMonitor.js.map +7 -0
  323. package/dist/services/customCommands.js +60 -41
  324. package/dist/services/customCommands.js.map +2 -2
  325. package/dist/services/hookExecutor.js +173 -1
  326. package/dist/services/hookExecutor.js.map +2 -2
  327. package/dist/services/intelligentCompactor.js +281 -0
  328. package/dist/services/intelligentCompactor.js.map +7 -0
  329. package/dist/services/lspConfig.js +109 -0
  330. package/dist/services/lspConfig.js.map +7 -0
  331. package/dist/services/mcpClient.js +338 -43
  332. package/dist/services/mcpClient.js.map +2 -2
  333. package/dist/services/modelOrchestrator.js +310 -0
  334. package/dist/services/modelOrchestrator.js.map +7 -0
  335. package/dist/services/openai.js +8 -1
  336. package/dist/services/openai.js.map +2 -2
  337. package/dist/services/outputStyles.js +138 -0
  338. package/dist/services/outputStyles.js.map +7 -0
  339. package/dist/services/plugins/index.js +5 -0
  340. package/dist/services/plugins/index.js.map +7 -0
  341. package/dist/services/plugins/lspServers.js +188 -0
  342. package/dist/services/plugins/lspServers.js.map +7 -0
  343. package/dist/services/plugins/pluginRuntime.js +229 -0
  344. package/dist/services/plugins/pluginRuntime.js.map +7 -0
  345. package/dist/services/plugins/pluginValidation.js +219 -0
  346. package/dist/services/plugins/pluginValidation.js.map +7 -0
  347. package/dist/services/plugins/skillMarketplace.js +556 -0
  348. package/dist/services/plugins/skillMarketplace.js.map +7 -0
  349. package/dist/services/responseStateManager.js +37 -3
  350. package/dist/services/responseStateManager.js.map +2 -2
  351. package/dist/services/sandbox/filesystemBoundary.js +341 -0
  352. package/dist/services/sandbox/filesystemBoundary.js.map +7 -0
  353. package/dist/services/sandbox/index.js +14 -0
  354. package/dist/services/sandbox/index.js.map +7 -0
  355. package/dist/services/sandbox/networkProxy.js +293 -0
  356. package/dist/services/sandbox/networkProxy.js.map +7 -0
  357. package/dist/services/sandbox/sandboxController.js +574 -0
  358. package/dist/services/sandbox/sandboxController.js.map +7 -0
  359. package/dist/services/sandbox/types.js +50 -0
  360. package/dist/services/sandbox/types.js.map +7 -0
  361. package/dist/services/sessionMemory.js +266 -0
  362. package/dist/services/sessionMemory.js.map +7 -0
  363. package/dist/services/taskRouter.js +324 -0
  364. package/dist/services/taskRouter.js.map +7 -0
  365. package/dist/tools/ArchitectTool/ArchitectTool.js +7 -1
  366. package/dist/tools/ArchitectTool/ArchitectTool.js.map +2 -2
  367. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +6 -2
  368. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +2 -2
  369. package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js +2 -1
  370. package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +2 -2
  371. package/dist/tools/BaseTool.js +72 -0
  372. package/dist/tools/BaseTool.js.map +7 -0
  373. package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js +3 -0
  374. package/dist/tools/BashOutputTool/BashOutputToolResultMessage.js.map +2 -2
  375. package/dist/tools/BashTool/BashTool.js +79 -3
  376. package/dist/tools/BashTool/BashTool.js.map +2 -2
  377. package/dist/tools/BashTool/BashToolResultMessage.js +3 -0
  378. package/dist/tools/BashTool/BashToolResultMessage.js.map +2 -2
  379. package/dist/tools/BashTool/OutputLine.js +54 -0
  380. package/dist/tools/BashTool/OutputLine.js.map +2 -2
  381. package/dist/tools/BashTool/prompt.js +336 -3
  382. package/dist/tools/BashTool/prompt.js.map +2 -2
  383. package/dist/tools/FileEditTool/FileEditTool.js +29 -4
  384. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  385. package/dist/tools/FileEditTool/prompt.js +6 -3
  386. package/dist/tools/FileEditTool/prompt.js.map +2 -2
  387. package/dist/tools/FileWriteTool/FileWriteTool.js +5 -5
  388. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  389. package/dist/tools/FileWriteTool/prompt.js +4 -2
  390. package/dist/tools/FileWriteTool/prompt.js.map +2 -2
  391. package/dist/tools/GlobTool/GlobTool.js +4 -2
  392. package/dist/tools/GlobTool/GlobTool.js.map +2 -2
  393. package/dist/tools/GrepTool/GrepTool.js +36 -7
  394. package/dist/tools/GrepTool/GrepTool.js.map +2 -2
  395. package/dist/tools/KillShellTool/KillShellToolResultMessage.js +3 -0
  396. package/dist/tools/KillShellTool/KillShellToolResultMessage.js.map +2 -2
  397. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +109 -0
  398. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +7 -0
  399. package/dist/tools/ListMcpResourcesTool/prompt.js +19 -0
  400. package/dist/tools/ListMcpResourcesTool/prompt.js.map +7 -0
  401. package/dist/tools/LspTool/LspTool.js +664 -0
  402. package/dist/tools/LspTool/LspTool.js.map +7 -0
  403. package/dist/tools/LspTool/prompt.js +27 -0
  404. package/dist/tools/LspTool/prompt.js.map +7 -0
  405. package/dist/tools/MCPTool/MCPTool.js +9 -1
  406. package/dist/tools/MCPTool/MCPTool.js.map +2 -2
  407. package/dist/tools/MemoryReadTool/MemoryReadTool.js +19 -6
  408. package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
  409. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +6 -6
  410. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
  411. package/dist/tools/MultiEditTool/MultiEditTool.js +19 -2
  412. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  413. package/dist/tools/MultiEditTool/prompt.js +5 -3
  414. package/dist/tools/MultiEditTool/prompt.js.map +2 -2
  415. package/dist/tools/NotebookEditTool/NotebookEditTool.js +7 -2
  416. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  417. package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +2 -2
  418. package/dist/tools/PlanModeTool/EnterPlanModeTool.js +75 -0
  419. package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +7 -0
  420. package/dist/tools/PlanModeTool/ExitPlanModeTool.js +109 -0
  421. package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +7 -0
  422. package/dist/tools/PlanModeTool/prompt.js +94 -0
  423. package/dist/tools/PlanModeTool/prompt.js.map +7 -0
  424. package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +130 -0
  425. package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +7 -0
  426. package/dist/tools/ReadMcpResourceTool/prompt.js +17 -0
  427. package/dist/tools/ReadMcpResourceTool/prompt.js.map +7 -0
  428. package/dist/tools/SkillTool/SkillTool.js +10 -4
  429. package/dist/tools/SkillTool/SkillTool.js.map +2 -2
  430. package/dist/tools/SkillTool/prompt.js +1 -1
  431. package/dist/tools/SkillTool/prompt.js.map +1 -1
  432. package/dist/tools/SlashCommandTool/SlashCommandTool.js +260 -0
  433. package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +7 -0
  434. package/dist/tools/SlashCommandTool/prompt.js +35 -0
  435. package/dist/tools/SlashCommandTool/prompt.js.map +7 -0
  436. package/dist/tools/TaskOutputTool/TaskOutputTool.js +190 -0
  437. package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +7 -0
  438. package/dist/tools/TaskOutputTool/prompt.js +15 -0
  439. package/dist/tools/TaskOutputTool/prompt.js.map +7 -0
  440. package/dist/tools/TaskTool/TaskTool.js +310 -104
  441. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  442. package/dist/tools/TaskTool/prompt.js.map +2 -2
  443. package/dist/tools/TodoWriteTool/TodoWriteTool.js +42 -77
  444. package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +2 -2
  445. package/dist/tools/URLFetcherTool/URLFetcherTool.js +4 -1
  446. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +2 -2
  447. package/dist/tools/URLFetcherTool/cache.js +55 -8
  448. package/dist/tools/URLFetcherTool/cache.js.map +2 -2
  449. package/dist/tools.js +31 -2
  450. package/dist/tools.js.map +2 -2
  451. package/dist/types/hooks.js +4 -0
  452. package/dist/types/hooks.js.map +2 -2
  453. package/dist/types/marketplace.js.map +2 -2
  454. package/dist/types/messageGroup.js +36 -0
  455. package/dist/types/messageGroup.js.map +7 -0
  456. package/dist/types/plugin.js.map +2 -2
  457. package/dist/types/thinking.js +1 -0
  458. package/dist/types/thinking.js.map +7 -0
  459. package/dist/utils/BackgroundShellManager.js +136 -39
  460. package/dist/utils/BackgroundShellManager.js.map +2 -2
  461. package/dist/utils/CircuitBreaker.js +242 -0
  462. package/dist/utils/CircuitBreaker.js.map +7 -0
  463. package/dist/utils/MessageBatchBuffer.js +102 -0
  464. package/dist/utils/MessageBatchBuffer.js.map +7 -0
  465. package/dist/utils/PersistentShell.js +151 -1
  466. package/dist/utils/PersistentShell.js.map +2 -2
  467. package/dist/utils/agentLoader.js +1 -23
  468. package/dist/utils/agentLoader.js.map +2 -2
  469. package/dist/utils/agentTranscripts.js +641 -0
  470. package/dist/utils/agentTranscripts.js.map +7 -0
  471. package/dist/utils/animationManager.js +213 -0
  472. package/dist/utils/animationManager.js.map +7 -0
  473. package/dist/utils/animationSync.js +110 -0
  474. package/dist/utils/animationSync.js.map +7 -0
  475. package/dist/utils/ask.js +2 -0
  476. package/dist/utils/ask.js.map +2 -2
  477. package/dist/utils/asyncFile.js +215 -0
  478. package/dist/utils/asyncFile.js.map +7 -0
  479. package/dist/utils/backgroundAgentManager.js +231 -0
  480. package/dist/utils/backgroundAgentManager.js.map +7 -0
  481. package/dist/utils/config.js +108 -10
  482. package/dist/utils/config.js.map +2 -2
  483. package/dist/utils/conversationRecovery.js +19 -0
  484. package/dist/utils/conversationRecovery.js.map +2 -2
  485. package/dist/utils/credentials/CredentialStore.js +1 -0
  486. package/dist/utils/credentials/CredentialStore.js.map +7 -0
  487. package/dist/utils/credentials/EncryptedFileStore.js +157 -0
  488. package/dist/utils/credentials/EncryptedFileStore.js.map +7 -0
  489. package/dist/utils/credentials/index.js +37 -0
  490. package/dist/utils/credentials/index.js.map +7 -0
  491. package/dist/utils/credentials/migration.js +82 -0
  492. package/dist/utils/credentials/migration.js.map +7 -0
  493. package/dist/utils/exit.js +73 -0
  494. package/dist/utils/exit.js.map +7 -0
  495. package/dist/utils/format.js +73 -5
  496. package/dist/utils/format.js.map +2 -2
  497. package/dist/utils/generators.js +76 -6
  498. package/dist/utils/generators.js.map +2 -2
  499. package/dist/utils/globalErrorHandler.js +149 -0
  500. package/dist/utils/globalErrorHandler.js.map +7 -0
  501. package/dist/utils/groupHandlers/index.js +8 -0
  502. package/dist/utils/groupHandlers/index.js.map +7 -0
  503. package/dist/utils/groupHandlers/parallelTasksHandler.js +140 -0
  504. package/dist/utils/groupHandlers/parallelTasksHandler.js.map +7 -0
  505. package/dist/utils/groupHandlers/taskHandler.js +104 -0
  506. package/dist/utils/groupHandlers/taskHandler.js.map +7 -0
  507. package/dist/utils/groupHandlers/types.js +1 -0
  508. package/dist/utils/groupHandlers/types.js.map +7 -0
  509. package/dist/utils/logRotation.js +224 -0
  510. package/dist/utils/logRotation.js.map +7 -0
  511. package/dist/utils/markdown.js +13 -1
  512. package/dist/utils/markdown.js.map +2 -2
  513. package/dist/utils/marketplaceManager.js +3 -5
  514. package/dist/utils/marketplaceManager.js.map +2 -2
  515. package/dist/utils/memSafety.js +264 -0
  516. package/dist/utils/memSafety.js.map +7 -0
  517. package/dist/utils/messageGroupManager.js +274 -0
  518. package/dist/utils/messageGroupManager.js.map +7 -0
  519. package/dist/utils/messages.js +13 -4
  520. package/dist/utils/messages.js.map +2 -2
  521. package/dist/utils/model.js +119 -15
  522. package/dist/utils/model.js.map +3 -3
  523. package/dist/utils/permissions/filesystem.js +162 -6
  524. package/dist/utils/permissions/filesystem.js.map +2 -2
  525. package/dist/utils/plan/planMode.js +143 -0
  526. package/dist/utils/plan/planMode.js.map +7 -0
  527. package/dist/utils/pluginLoader.js +17 -21
  528. package/dist/utils/pluginLoader.js.map +2 -2
  529. package/dist/utils/ripgrep.js +55 -2
  530. package/dist/utils/ripgrep.js.map +2 -2
  531. package/dist/utils/safePath.js +132 -0
  532. package/dist/utils/safePath.js.map +7 -0
  533. package/dist/utils/sanitizeInput.js +32 -0
  534. package/dist/utils/sanitizeInput.js.map +7 -0
  535. package/dist/utils/secureKeyStorage.js +312 -0
  536. package/dist/utils/secureKeyStorage.js.map +7 -0
  537. package/dist/utils/sensitiveFiles.js +125 -0
  538. package/dist/utils/sensitiveFiles.js.map +7 -0
  539. package/dist/utils/session/sessionPlugins.js +67 -0
  540. package/dist/utils/session/sessionPlugins.js.map +7 -0
  541. package/dist/utils/taskDisplayUtils.js +257 -0
  542. package/dist/utils/taskDisplayUtils.js.map +7 -0
  543. package/dist/utils/teamConfig.js +2 -1
  544. package/dist/utils/teamConfig.js.map +2 -2
  545. package/dist/utils/theme.js +6 -6
  546. package/dist/utils/theme.js.map +1 -1
  547. package/dist/utils/todoStorage.js +92 -2
  548. package/dist/utils/todoStorage.js.map +2 -2
  549. package/dist/utils/toolRiskClassification.js +207 -0
  550. package/dist/utils/toolRiskClassification.js.map +7 -0
  551. package/dist/utils/toolTimeout.js +136 -0
  552. package/dist/utils/toolTimeout.js.map +7 -0
  553. package/dist/utils/tooling/safeRender.js +116 -0
  554. package/dist/utils/tooling/safeRender.js.map +7 -0
  555. package/dist/utils/userFriendlyError.js +346 -0
  556. package/dist/utils/userFriendlyError.js.map +7 -0
  557. package/dist/utils/vendor/ripgrep/arm64-darwin/rg +0 -0
  558. package/dist/version.js +2 -2
  559. package/dist/version.js.map +1 -1
  560. package/package.json +17 -5
  561. package/scripts/postinstall.js +128 -38
  562. package/dist/commands/agents.js +0 -2086
  563. package/dist/commands/agents.js.map +0 -7
  564. package/dist/commands/build.js +0 -74
  565. package/dist/commands/build.js.map +0 -7
  566. package/dist/commands/compression.js +0 -57
  567. package/dist/commands/compression.js.map +0 -7
  568. package/dist/commands/listen.js +0 -37
  569. package/dist/commands/listen.js.map +0 -7
  570. package/dist/commands/login.js +0 -37
  571. package/dist/commands/login.js.map +0 -7
  572. package/dist/commands/logout.js +0 -33
  573. package/dist/commands/logout.js.map +0 -7
  574. package/dist/commands/mcp.js +0 -40
  575. package/dist/commands/mcp.js.map +0 -7
  576. package/dist/commands/mcp_refresh.js +0 -40
  577. package/dist/commands/mcp_refresh.js.map +0 -7
  578. package/dist/commands/modelstatus.js +0 -21
  579. package/dist/commands/modelstatus.js.map +0 -7
  580. package/dist/commands/onboarding.js +0 -36
  581. package/dist/commands/onboarding.js.map +0 -7
  582. package/dist/commands/plugin-interactive.js +0 -446
  583. package/dist/commands/plugin-interactive.js.map +0 -7
  584. package/dist/commands/pr_comments.js +0 -61
  585. package/dist/commands/pr_comments.js.map +0 -7
  586. package/dist/commands/release-notes.js +0 -30
  587. package/dist/commands/release-notes.js.map +0 -7
  588. package/dist/commands/review.js +0 -51
  589. package/dist/commands/review.js.map +0 -7
  590. package/dist/components/Bug.js +0 -147
  591. package/dist/components/Bug.js.map +0 -7
  592. package/dist/components/ModelSelector.js +0 -2062
  593. package/dist/components/ModelSelector.js.map +0 -7
  594. package/dist/components/ModelStatusDisplay.js +0 -87
  595. package/dist/components/ModelStatusDisplay.js.map +0 -7
  596. package/dist/entrypoints/cli-wrapper.js +0 -61
  597. package/dist/entrypoints/cli-wrapper.js.map +0 -7
  598. package/dist/hooks/useCancelRequest.js +0 -28
  599. package/dist/hooks/useCancelRequest.js.map +0 -7
  600. package/dist/screens/Doctor.js +0 -22
  601. package/dist/screens/Doctor.js.map +0 -7
@@ -1,44 +1,117 @@
1
+ const BRAND_GRADIENT = {
2
+ /** 起始色 - 紫蓝 (智慧、专业) */
3
+ START: "#667EEA",
4
+ /** 中间色 - 粉紫 (创意、活力) */
5
+ MIDDLE: "#B668C8",
6
+ /** 结束色 - 珊瑚红 (热情、能量) */
7
+ END: "#F5576C"
8
+ };
1
9
  const TEXT_COLORS = {
2
- /** 主要文本 - 用户输入、AI 最终回答 (#FFFFFF) */
10
+ /** 主要文本 - 重要内容、标题、用户输入 */
3
11
  PRIMARY: "#FFFFFF",
4
- /** 次要文本 - 页眉信息、普通提示 (#CCCCCC) */
12
+ /** 次要文本 - 说明信息、普通提示 */
5
13
  SECONDARY: "#CCCCCC",
6
- /** 暗淡文本 - 思考过程、加载状态、快捷键提示 (#888888) */
14
+ /** 辅助文本 - 补充信息、快捷键提示 */
7
15
  DIMMED: "#888888",
8
- /** 极暗文本 - 时间戳、极次要元数据 (#555555) */
16
+ /** 最淡文本 - 时间戳、元数据 */
9
17
  MUTED: "#555555"
10
18
  };
11
19
  const FUNCTIONAL_COLORS = {
12
- /** 品牌强调色 - Claude 标记、特殊提示符 (#D4BBFF 薰衣草紫) */
13
- BRAND: "#D4BBFF",
14
- /** 成功/新增 - Diff 新增行、成功消息 (#3DDC84 鲜绿) */
15
- SUCCESS: "#3DDC84",
16
- /** 错误/删除 - Diff 删除行、错误消息 (#FF5555 鲜红) */
17
- ERROR: "#FF5555",
18
- /** 警告/确认 - 确认提示、警告信息 (#FFB86C 橙黄) */
20
+ /** 品牌色 - 紫蓝,用于品牌标识 */
21
+ BRAND: "#667EEA",
22
+ /** 强调色 - 珊瑚红,用于高亮重要元素 */
23
+ ACCENT: "#F5576C",
24
+ /** 成功 - 完成、新增、通过 */
25
+ SUCCESS: "#4EBA65",
26
+ /** 错误 - 失败、删除、警告 */
27
+ ERROR: "#FF6B80",
28
+ /** 警告 - 需要注意、确认 */
19
29
  WARNING: "#FFB86C",
20
- /** 链接/信息 - URL、信息提示 (#58A6FF 天蓝) */
21
- INFO: "#58A6FF"
30
+ /** 信息 - 提示、链接、说明 */
31
+ INFO: "#5DADE2",
32
+ /** 进行中 - 正在处理、等待 */
33
+ RUNNING: "#B668C8"
22
34
  };
23
35
  const BACKGROUND_COLORS = {
24
- /** 页眉背景 - 顶部固定状态栏 (#2E2E3E 深蓝紫石板灰) */
36
+ /** 头部背景 */
25
37
  HEADER: "#2E2E3E",
26
- /** 代码块背景 - Markdown 代码片段 (#1E1E1E 比纯黑稍亮) */
38
+ /** 代码块背景 */
27
39
  CODE_BLOCK: "#1E1E1E",
28
- /** 选中态 - 列表项高亮 (#3C3C3C) */
40
+ /** 选中高亮 */
29
41
  SELECTION: "#3C3C3C",
30
- /** 终端默认背景 - 透明,依赖用户终端设置 */
42
+ /** 透明背景 */
31
43
  TRANSPARENT: "transparent"
32
44
  };
33
45
  const MINTO_COLORS = {
34
- /** Bash 模式边框 */
46
+ /** 命令模式边框 */
35
47
  BASH_BORDER: "#FFB86C",
36
- /** Koding 模式边框 (笔记模式) */
37
- KODING_BORDER: "#58A6FF",
38
- /** Subagent 进度条 */
39
- SUBAGENT_PROGRESS: "#3DDC84",
40
- /** TODO 面板主色 */
41
- TODO_MAIN: "#D4BBFF"
48
+ /** 笔记模式边框 */
49
+ KODING_BORDER: "#5DADE2",
50
+ /** 任务进度条 */
51
+ SUBAGENT_PROGRESS: "#B668C8",
52
+ /** 待办面板主色 */
53
+ TODO_MAIN: "#667EEA"
54
+ };
55
+ const SEMANTIC_COLORS = {
56
+ /** 品牌色 - 紫蓝 */
57
+ brand: "#667EEA",
58
+ /** 强调色 - 珊瑚红 */
59
+ accent: "#F5576C",
60
+ /** 主要文本 */
61
+ primary: "#FFFFFF",
62
+ /** 次要文本 */
63
+ secondary: "#CCCCCC",
64
+ /** 辅助文本 */
65
+ dim: "#888888",
66
+ /** 最淡文本 */
67
+ muted: "#555555",
68
+ /** 进行中 - 粉紫 */
69
+ running: "#B668C8",
70
+ /** 成功 */
71
+ success: "#4EBA65",
72
+ /** 错误 */
73
+ error: "#FF6B80",
74
+ /** 信息 */
75
+ info: "#5DADE2"
76
+ };
77
+ function getSemanticColor(color) {
78
+ return SEMANTIC_COLORS[color];
79
+ }
80
+ const SYMBOL_COLORS = {
81
+ /** 完成状态 (✓) - 使用品牌起始色紫蓝 */
82
+ success: BRAND_GRADIENT.START,
83
+ /** 进行中状态 (◐) - 使用品牌中间色粉紫 */
84
+ running: BRAND_GRADIENT.MIDDLE,
85
+ /** 错误状态 (✗) - 使用品牌结束色珊瑚红 */
86
+ error: BRAND_GRADIENT.END,
87
+ /** 待处理状态 - 使用 dim */
88
+ pending: SEMANTIC_COLORS.dim,
89
+ /** 子输出连接符 (⎿) - 使用 dim 保持层级感 */
90
+ child: SEMANTIC_COLORS.dim,
91
+ /** Todo 更新 (⏺) - 使用品牌起始色 */
92
+ todo: BRAND_GRADIENT.START,
93
+ /** 并行任务组 (◈) - 使用品牌中间色 */
94
+ parallel: BRAND_GRADIENT.MIDDLE
95
+ };
96
+ const STATUS_COLORS = {
97
+ running: SEMANTIC_COLORS.running,
98
+ pending: SEMANTIC_COLORS.dim,
99
+ success: SEMANTIC_COLORS.success,
100
+ completed: SEMANTIC_COLORS.success,
101
+ error: SEMANTIC_COLORS.error,
102
+ failed: SEMANTIC_COLORS.error,
103
+ done: SEMANTIC_COLORS.success
104
+ };
105
+ function getStatusColorHex(status) {
106
+ return STATUS_COLORS[status] || SEMANTIC_COLORS.dim;
107
+ }
108
+ const VALUE_TIER_COLORS = {
109
+ /** 核心信息 */
110
+ core: SEMANTIC_COLORS.secondary,
111
+ /** 辅助信息 */
112
+ auxiliary: SEMANTIC_COLORS.dim,
113
+ /** 元信息 */
114
+ meta: SEMANTIC_COLORS.muted
42
115
  };
43
116
  const CLAUDE_COLORS = {
44
117
  ...TEXT_COLORS,
@@ -47,39 +120,25 @@ const CLAUDE_COLORS = {
47
120
  ...MINTO_COLORS
48
121
  };
49
122
  const AGENT_COLORS = {
50
- red: "#FF5555",
51
- // 亮红色
52
- blue: "#5555FF",
53
- // 深蓝色
54
- green: "#55FF55",
55
- // 墨绿色
56
- yellow: "#FFFF55",
57
- // 亮黄色
58
- purple: "#FF55FF",
59
- // 紫色
60
- orange: "#FFA500",
61
- // 橙色
62
- pink: "#FFB6C1",
63
- // 粉色
64
- cyan: "#00FFFF",
65
- // 青色
123
+ red: "#FF6B80",
124
+ blue: "#667EEA",
125
+ green: "#4EBA65",
126
+ yellow: "#FFB86C",
127
+ purple: "#B668C8",
128
+ orange: "#F5576C",
129
+ pink: "#DC75A8",
130
+ cyan: "#5DADE2",
66
131
  auto: "#FFFFFF"
67
- // 默认白色
68
132
  };
69
133
  const AGENT_COLOR_RECOMMENDATIONS = {
70
- red: ["\u4EE3\u7801\u5BA1\u67E5", "\u5B89\u5168\u5BA1\u8BA1", "code-reviewer", "security-auditor"],
71
- blue: [
72
- "\u901A\u7528\u5F00\u53D1",
73
- "general-purpose",
74
- "backend-developer",
75
- "frontend-developer"
76
- ],
77
- green: ["\u6D4B\u8BD5", "CI", "test-automator", "unit-test-builder"],
78
- yellow: ["\u6570\u636E\u79D1\u5B66", "data-scientist", "data-engineer", "ml-engineer"],
79
- purple: ["\u63A2\u7D22", "\u8C03\u7814", "research-expert", "explorer"],
80
- orange: ["\u6784\u5EFA", "\u90E8\u7F72", "deployment-engineer", "devops-automator"],
81
- pink: ["\u6587\u6863", "\u6587\u6848", "content-writer", "docs-architect"],
82
- cyan: ["\u8C03\u8BD5", "\u8BCA\u65AD", "debugger", "performance-engineer"],
134
+ red: ["\u5BA1\u6838", "\u98CE\u9669\u8BC4\u4F30", "code-reviewer", "security-auditor"],
135
+ blue: ["\u5206\u6790", "\u7814\u7A76", "general-purpose", "research"],
136
+ green: ["\u9A8C\u8BC1", "\u6D4B\u8BD5", "test-automator", "validator"],
137
+ yellow: ["\u6570\u636E\u5206\u6790", "\u62A5\u544A", "data-scientist", "analyst"],
138
+ purple: ["\u63A2\u7D22", "\u521B\u610F", "explorer", "creative"],
139
+ orange: ["\u6267\u884C", "\u90E8\u7F72", "deployment", "action"],
140
+ pink: ["\u5199\u4F5C", "\u6587\u6863", "content-writer", "docs"],
141
+ cyan: ["\u8BCA\u65AD", "\u4F18\u5316", "debugger", "optimizer"],
83
142
  auto: ["\u9ED8\u8BA4"]
84
143
  };
85
144
  function getAgentColor(color, theme) {
@@ -115,12 +174,19 @@ export {
115
174
  AGENT_COLORS,
116
175
  AGENT_COLOR_RECOMMENDATIONS,
117
176
  BACKGROUND_COLORS,
177
+ BRAND_GRADIENT,
118
178
  CLAUDE_COLORS,
119
179
  FUNCTIONAL_COLORS,
120
180
  MINTO_COLORS,
181
+ SEMANTIC_COLORS,
182
+ STATUS_COLORS,
183
+ SYMBOL_COLORS,
121
184
  TEXT_COLORS,
185
+ VALUE_TIER_COLORS,
122
186
  getAgentColor,
123
187
  getContrastTextColor,
188
+ getSemanticColor,
189
+ getStatusColorHex,
124
190
  recommendColorForAgent
125
191
  };
126
192
  //# sourceMappingURL=colors.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/colors.ts"],
4
- "sourcesContent": ["/**\n * Minto \u914D\u8272\u7CFB\u7EDF - Claude Code CLI \u98CE\u683C\n *\n * \u57FA\u4E8E 24-bit True Color\uFF0C\u63D0\u4F9B\u6E05\u6670\u7684\u4FE1\u606F\u5C42\u7EA7\u548C\u529F\u80FD\u72B6\u6001\u7684\u89C6\u89C9\u533A\u5206\n *\n * \u5305\u542B\uFF1A\n * 1. \u6587\u672C\u524D\u666F\u8272 - 4\u7EA7\u7070\u5EA6\u5C42\u7EA7\n * 2. \u529F\u80FD\u5F3A\u8C03\u8272 - \u72B6\u6001\u548C\u64CD\u4F5C\n * 3. \u80CC\u666F\u8272 - \u89C6\u89C9\u5206\u5272\n * 4. Agent \u989C\u8272\u7CFB\u7EDF - \u591A Agent \u53EF\u89C6\u5316\n */\n\nimport type { getTheme } from '@utils/theme'\n\n// ============================================================================\n// Claude Code CLI \u98CE\u683C\u914D\u8272\u7CFB\u7EDF\n// ============================================================================\n\n/**\n * \u6587\u672C\u524D\u666F\u8272 - \u901A\u8FC7\u4EAE\u5EA6\u5DEE\u5F02\u533A\u5206\u4FE1\u606F\u4E3B\u6B21\u5C42\u7EA7\n */\nexport const TEXT_COLORS = {\n /** \u4E3B\u8981\u6587\u672C - \u7528\u6237\u8F93\u5165\u3001AI \u6700\u7EC8\u56DE\u7B54 (#FFFFFF) */\n PRIMARY: '#FFFFFF',\n\n /** \u6B21\u8981\u6587\u672C - \u9875\u7709\u4FE1\u606F\u3001\u666E\u901A\u63D0\u793A (#CCCCCC) */\n SECONDARY: '#CCCCCC',\n\n /** \u6697\u6DE1\u6587\u672C - \u601D\u8003\u8FC7\u7A0B\u3001\u52A0\u8F7D\u72B6\u6001\u3001\u5FEB\u6377\u952E\u63D0\u793A (#888888) */\n DIMMED: '#888888',\n\n /** \u6781\u6697\u6587\u672C - \u65F6\u95F4\u6233\u3001\u6781\u6B21\u8981\u5143\u6570\u636E (#555555) */\n MUTED: '#555555',\n} as const\n\n/**\n * \u529F\u80FD\u5F3A\u8C03\u8272 - \u4F20\u8FBE\u72B6\u6001\u3001\u8EAB\u4EFD\u548C\u5173\u952E\u64CD\u4F5C\n */\nexport const FUNCTIONAL_COLORS = {\n /** \u54C1\u724C\u5F3A\u8C03\u8272 - Claude \u6807\u8BB0\u3001\u7279\u6B8A\u63D0\u793A\u7B26 (#D4BBFF \u85B0\u8863\u8349\u7D2B) */\n BRAND: '#D4BBFF',\n\n /** \u6210\u529F/\u65B0\u589E - Diff \u65B0\u589E\u884C\u3001\u6210\u529F\u6D88\u606F (#3DDC84 \u9C9C\u7EFF) */\n SUCCESS: '#3DDC84',\n\n /** \u9519\u8BEF/\u5220\u9664 - Diff \u5220\u9664\u884C\u3001\u9519\u8BEF\u6D88\u606F (#FF5555 \u9C9C\u7EA2) */\n ERROR: '#FF5555',\n\n /** \u8B66\u544A/\u786E\u8BA4 - \u786E\u8BA4\u63D0\u793A\u3001\u8B66\u544A\u4FE1\u606F (#FFB86C \u6A59\u9EC4) */\n WARNING: '#FFB86C',\n\n /** \u94FE\u63A5/\u4FE1\u606F - URL\u3001\u4FE1\u606F\u63D0\u793A (#58A6FF \u5929\u84DD) */\n INFO: '#58A6FF',\n} as const\n\n/**\n * \u80CC\u666F\u8272 - \u7528\u4E8E\u89C6\u89C9\u5206\u5272\u548C\u5185\u5BB9\u51F8\u663E\n */\nexport const BACKGROUND_COLORS = {\n /** \u9875\u7709\u80CC\u666F - \u9876\u90E8\u56FA\u5B9A\u72B6\u6001\u680F (#2E2E3E \u6DF1\u84DD\u7D2B\u77F3\u677F\u7070) */\n HEADER: '#2E2E3E',\n\n /** \u4EE3\u7801\u5757\u80CC\u666F - Markdown \u4EE3\u7801\u7247\u6BB5 (#1E1E1E \u6BD4\u7EAF\u9ED1\u7A0D\u4EAE) */\n CODE_BLOCK: '#1E1E1E',\n\n /** \u9009\u4E2D\u6001 - \u5217\u8868\u9879\u9AD8\u4EAE (#3C3C3C) */\n SELECTION: '#3C3C3C',\n\n /** \u7EC8\u7AEF\u9ED8\u8BA4\u80CC\u666F - \u900F\u660E\uFF0C\u4F9D\u8D56\u7528\u6237\u7EC8\u7AEF\u8BBE\u7F6E */\n TRANSPARENT: 'transparent',\n} as const\n\n/**\n * Minto \u7279\u8272\u529F\u80FD\u7684\u989D\u5916\u914D\u8272\n */\nexport const MINTO_COLORS = {\n /** Bash \u6A21\u5F0F\u8FB9\u6846 */\n BASH_BORDER: '#FFB86C',\n\n /** Koding \u6A21\u5F0F\u8FB9\u6846 (\u7B14\u8BB0\u6A21\u5F0F) */\n KODING_BORDER: '#58A6FF',\n\n /** Subagent \u8FDB\u5EA6\u6761 */\n SUBAGENT_PROGRESS: '#3DDC84',\n\n /** TODO \u9762\u677F\u4E3B\u8272 */\n TODO_MAIN: '#D4BBFF',\n} as const\n\n/**\n * \u7EDF\u4E00\u7684\u914D\u8272\u5BFC\u51FA\n */\nexport const CLAUDE_COLORS = {\n ...TEXT_COLORS,\n ...FUNCTIONAL_COLORS,\n ...BACKGROUND_COLORS,\n ...MINTO_COLORS,\n} as const\n\n// ============================================================================\n// Agent \u989C\u8272\u7CFB\u7EDF\n// ============================================================================\n\n/**\n * \u652F\u6301\u7684\u989C\u8272\u5173\u952E\u5B57\u4E0E\u7EC8\u7AEF\u663E\u793A\u6548\u679C\uFF1A\n * - red: \u4EAE\u7EA2\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u4EE3\u7801\u5BA1\u67E5/\u5B89\u5168\u5BA1\u8BA1\n * - blue: \u6DF1\u84DD\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u901A\u7528\u5F00\u53D1\n * - green: \u58A8\u7EFF\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u6D4B\u8BD5/CI\n * - yellow: \u4EAE\u9EC4\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u6570\u636E\u79D1\u5B66\n * - purple: \u7D2B\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u63A2\u7D22/\u8C03\u7814\n * - orange: \u6A59\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u6784\u5EFA/\u90E8\u7F72\n * - pink: \u7C89\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u6587\u6863/\u6587\u6848\n * - cyan: \u9752\u8272\uFF0C\u63A8\u8350\u7528\u4E8E\u8C03\u8BD5/\u8BCA\u65AD\n * - auto: \u7CFB\u7EDF\u9ED8\u8BA4\uFF0C\u4F7F\u7528\u4E3B\u9898\u8272\n */\n\n/**\n * Agent \u989C\u8272\u7C7B\u578B\u5B9A\u4E49\n */\nexport type AgentColor =\n | 'red'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'purple'\n | 'orange'\n | 'pink'\n | 'cyan'\n | 'auto'\n\n/**\n * Agent \u989C\u8272\u6620\u5C04\u8868\uFF08Hex \u683C\u5F0F\uFF09\n */\nexport const AGENT_COLORS: Record<AgentColor, string> = {\n red: '#FF5555', // \u4EAE\u7EA2\u8272\n blue: '#5555FF', // \u6DF1\u84DD\u8272\n green: '#55FF55', // \u58A8\u7EFF\u8272\n yellow: '#FFFF55', // \u4EAE\u9EC4\u8272\n purple: '#FF55FF', // \u7D2B\u8272\n orange: '#FFA500', // \u6A59\u8272\n pink: '#FFB6C1', // \u7C89\u8272\n cyan: '#00FFFF', // \u9752\u8272\n auto: '#FFFFFF', // \u9ED8\u8BA4\u767D\u8272\n} as const\n\n/**\n * Agent \u989C\u8272\u63A8\u8350\u573A\u666F\n */\nexport const AGENT_COLOR_RECOMMENDATIONS: Record<AgentColor, string[]> = {\n red: ['\u4EE3\u7801\u5BA1\u67E5', '\u5B89\u5168\u5BA1\u8BA1', 'code-reviewer', 'security-auditor'],\n blue: [\n '\u901A\u7528\u5F00\u53D1',\n 'general-purpose',\n 'backend-developer',\n 'frontend-developer',\n ],\n green: ['\u6D4B\u8BD5', 'CI', 'test-automator', 'unit-test-builder'],\n yellow: ['\u6570\u636E\u79D1\u5B66', 'data-scientist', 'data-engineer', 'ml-engineer'],\n purple: ['\u63A2\u7D22', '\u8C03\u7814', 'research-expert', 'explorer'],\n orange: ['\u6784\u5EFA', '\u90E8\u7F72', 'deployment-engineer', 'devops-automator'],\n pink: ['\u6587\u6863', '\u6587\u6848', 'content-writer', 'docs-architect'],\n cyan: ['\u8C03\u8BD5', '\u8BCA\u65AD', 'debugger', 'performance-engineer'],\n auto: ['\u9ED8\u8BA4'],\n}\n\n/**\n * \u83B7\u53D6 Agent \u989C\u8272\n *\n * @param color - Agent \u914D\u7F6E\u4E2D\u7684\u989C\u8272\u5B57\u6BB5\n * @param theme - \u5F53\u524D\u4E3B\u9898\n * @returns \u6700\u7EC8\u4F7F\u7528\u7684\u989C\u8272 Hex \u503C\n */\nexport function getAgentColor(\n color: string | undefined,\n theme: ReturnType<typeof getTheme>,\n): string {\n // \u5982\u679C\u6CA1\u6709\u914D\u7F6E\u989C\u8272\u6216\u914D\u7F6E\u4E3A auto\uFF0C\u4F7F\u7528\u4E3B\u9898\u9ED8\u8BA4\u8272\n if (!color || color === 'auto') {\n return theme.minto\n }\n\n // \u68C0\u67E5\u662F\u5426\u4E3A\u6709\u6548\u7684\u989C\u8272\u5173\u952E\u5B57\n const normalizedColor = color.toLowerCase() as AgentColor\n if (normalizedColor in AGENT_COLORS) {\n return AGENT_COLORS[normalizedColor]\n }\n\n // \u5982\u679C\u989C\u8272\u5173\u952E\u5B57\u65E0\u6548\uFF0C\u56DE\u9000\u5230\u4E3B\u9898\u8272\n return theme.minto\n}\n\n/**\n * \u6839\u636E Agent \u7C7B\u578B\u63A8\u8350\u989C\u8272\n *\n * @param agentType - Agent \u7C7B\u578B\u540D\u79F0\n * @returns \u63A8\u8350\u7684\u989C\u8272\u5173\u952E\u5B57\n */\nexport function recommendColorForAgent(agentType: string): AgentColor {\n const lowerType = agentType.toLowerCase()\n\n for (const [color, keywords] of Object.entries(AGENT_COLOR_RECOMMENDATIONS)) {\n for (const keyword of keywords) {\n if (lowerType.includes(keyword.toLowerCase())) {\n return color as AgentColor\n }\n }\n }\n\n return 'auto'\n}\n\n/**\n * \u83B7\u53D6\u989C\u8272\u7684\u5BF9\u6BD4\u6587\u672C\u989C\u8272\uFF08\u786E\u4FDD\u53EF\u8BFB\u6027\uFF09\n *\n * @param backgroundColor - \u80CC\u666F\u989C\u8272 Hex \u503C\n * @returns 'black' \u6216 'white'\n */\nexport function getContrastTextColor(\n backgroundColor: string,\n): 'black' | 'white' {\n // \u79FB\u9664 # \u524D\u7F00\n const hex = backgroundColor.replace('#', '')\n\n // \u8F6C\u6362\u4E3A RGB\n const r = parseInt(hex.substring(0, 2), 16)\n const g = parseInt(hex.substring(2, 4), 16)\n const b = parseInt(hex.substring(4, 6), 16)\n\n // \u8BA1\u7B97\u4EAE\u5EA6\uFF08YIQ \u516C\u5F0F\uFF09\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n\n // \u4EAE\u5EA6\u5927\u4E8E 128 \u65F6\u4F7F\u7528\u9ED1\u8272\u6587\u5B57\uFF0C\u5426\u5219\u4F7F\u7528\u767D\u8272\n return yiq >= 128 ? 'black' : 'white'\n}\n"],
5
- "mappings": "AAqBO,MAAM,cAAc;AAAA;AAAA,EAEzB,SAAS;AAAA;AAAA,EAGT,WAAW;AAAA;AAAA,EAGX,QAAQ;AAAA;AAAA,EAGR,OAAO;AACT;AAKO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,OAAO;AAAA;AAAA,EAGP,SAAS;AAAA;AAAA,EAGT,OAAO;AAAA;AAAA,EAGP,SAAS;AAAA;AAAA,EAGT,MAAM;AACR;AAKO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,QAAQ;AAAA;AAAA,EAGR,YAAY;AAAA;AAAA,EAGZ,WAAW;AAAA;AAAA,EAGX,aAAa;AACf;AAKO,MAAM,eAAe;AAAA;AAAA,EAE1B,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA;AAAA,EAGf,mBAAmB;AAAA;AAAA,EAGnB,WAAW;AACb;AAKO,MAAM,gBAAgB;AAAA,EAC3B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAoCO,MAAM,eAA2C;AAAA,EACtD,KAAK;AAAA;AAAA,EACL,MAAM;AAAA;AAAA,EACN,OAAO;AAAA;AAAA,EACP,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA;AAAA,EACR,MAAM;AAAA;AAAA,EACN,MAAM;AAAA;AAAA,EACN,MAAM;AAAA;AACR;AAKO,MAAM,8BAA4D;AAAA,EACvE,KAAK,CAAC,4BAAQ,4BAAQ,iBAAiB,kBAAkB;AAAA,EACzD,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO,CAAC,gBAAM,MAAM,kBAAkB,mBAAmB;AAAA,EACzD,QAAQ,CAAC,4BAAQ,kBAAkB,iBAAiB,aAAa;AAAA,EACjE,QAAQ,CAAC,gBAAM,gBAAM,mBAAmB,UAAU;AAAA,EAClD,QAAQ,CAAC,gBAAM,gBAAM,uBAAuB,kBAAkB;AAAA,EAC9D,MAAM,CAAC,gBAAM,gBAAM,kBAAkB,gBAAgB;AAAA,EACrD,MAAM,CAAC,gBAAM,gBAAM,YAAY,sBAAsB;AAAA,EACrD,MAAM,CAAC,cAAI;AACb;AASO,SAAS,cACd,OACA,OACQ;AAER,MAAI,CAAC,SAAS,UAAU,QAAQ;AAC9B,WAAO,MAAM;AAAA,EACf;AAGA,QAAM,kBAAkB,MAAM,YAAY;AAC1C,MAAI,mBAAmB,cAAc;AACnC,WAAO,aAAa,eAAe;AAAA,EACrC;AAGA,SAAO,MAAM;AACf;AAQO,SAAS,uBAAuB,WAA+B;AACpE,QAAM,YAAY,UAAU,YAAY;AAExC,aAAW,CAAC,OAAO,QAAQ,KAAK,OAAO,QAAQ,2BAA2B,GAAG;AAC3E,eAAW,WAAW,UAAU;AAC9B,UAAI,UAAU,SAAS,QAAQ,YAAY,CAAC,GAAG;AAC7C,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAQO,SAAS,qBACd,iBACmB;AAEnB,QAAM,MAAM,gBAAgB,QAAQ,KAAK,EAAE;AAG3C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAC1C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAC1C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAG1C,QAAM,OAAO,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO;AAG5C,SAAO,OAAO,MAAM,UAAU;AAChC;",
4
+ "sourcesContent": ["/**\n * Minto \u914D\u8272\u7CFB\u7EDF - \u9762\u5411\u5546\u4E1A\u7528\u6237\u7684\u6218\u7565 AI \u52A9\u624B\n *\n * \u8BBE\u8BA1\u7406\u5FF5\uFF1A\n * - \u7D2B\u84DD\u2192\u73CA\u745A\u6E10\u53D8\uFF1A\u70ED\u60C5\u3001\u4E13\u4E1A\u3001\u73B0\u4EE3\n * - \u6E05\u6670\u7684\u4FE1\u606F\u5C42\u7EA7\uFF1A\u91CD\u8981\u4FE1\u606F\u7A81\u51FA\uFF0C\u6B21\u8981\u4FE1\u606F\u6DE1\u5316\n * - \u5BF9\u975E\u6280\u672F\u7528\u6237\u53CB\u597D\uFF1A\u6E29\u6696\u3001\u4E13\u4E1A\u3001\u6613\u8BFB\n */\n\nimport type { getTheme } from '@utils/theme'\n\n// ============================================================================\n// \u54C1\u724C\u6E10\u53D8\u8272\u7CFB\u7EDF (Brand Gradient System)\n// ============================================================================\n\n/**\n * Minto \u54C1\u724C\u6E10\u53D8\u8272\n * \u7D2B\u84DD\u2192\u7C89\u7D2B\u2192\u73CA\u745A\u7EA2\uFF0C\u4F20\u9012\u70ED\u60C5\u4E0E\u4E13\u4E1A\n */\nexport const BRAND_GRADIENT = {\n /** \u8D77\u59CB\u8272 - \u7D2B\u84DD (\u667A\u6167\u3001\u4E13\u4E1A) */\n START: '#667EEA',\n\n /** \u4E2D\u95F4\u8272 - \u7C89\u7D2B (\u521B\u610F\u3001\u6D3B\u529B) */\n MIDDLE: '#B668C8',\n\n /** \u7ED3\u675F\u8272 - \u73CA\u745A\u7EA2 (\u70ED\u60C5\u3001\u80FD\u91CF) */\n END: '#F5576C',\n} as const\n\n// ============================================================================\n// \u6587\u672C\u989C\u8272\u7CFB\u7EDF (Text Color System)\n// ============================================================================\n\n/**\n * \u6587\u672C\u989C\u8272 - \u901A\u8FC7\u4EAE\u5EA6\u5DEE\u5F02\u533A\u5206\u4FE1\u606F\u5C42\u7EA7\n */\nexport const TEXT_COLORS = {\n /** \u4E3B\u8981\u6587\u672C - \u91CD\u8981\u5185\u5BB9\u3001\u6807\u9898\u3001\u7528\u6237\u8F93\u5165 */\n PRIMARY: '#FFFFFF',\n\n /** \u6B21\u8981\u6587\u672C - \u8BF4\u660E\u4FE1\u606F\u3001\u666E\u901A\u63D0\u793A */\n SECONDARY: '#CCCCCC',\n\n /** \u8F85\u52A9\u6587\u672C - \u8865\u5145\u4FE1\u606F\u3001\u5FEB\u6377\u952E\u63D0\u793A */\n DIMMED: '#888888',\n\n /** \u6700\u6DE1\u6587\u672C - \u65F6\u95F4\u6233\u3001\u5143\u6570\u636E */\n MUTED: '#555555',\n} as const\n\n// ============================================================================\n// \u529F\u80FD\u989C\u8272\u7CFB\u7EDF (Functional Color System)\n// ============================================================================\n\n/**\n * \u529F\u80FD\u989C\u8272 - \u4F20\u8FBE\u72B6\u6001\u548C\u5173\u952E\u64CD\u4F5C\n */\nexport const FUNCTIONAL_COLORS = {\n /** \u54C1\u724C\u8272 - \u7D2B\u84DD\uFF0C\u7528\u4E8E\u54C1\u724C\u6807\u8BC6 */\n BRAND: '#667EEA',\n\n /** \u5F3A\u8C03\u8272 - \u73CA\u745A\u7EA2\uFF0C\u7528\u4E8E\u9AD8\u4EAE\u91CD\u8981\u5143\u7D20 */\n ACCENT: '#F5576C',\n\n /** \u6210\u529F - \u5B8C\u6210\u3001\u65B0\u589E\u3001\u901A\u8FC7 */\n SUCCESS: '#4EBA65',\n\n /** \u9519\u8BEF - \u5931\u8D25\u3001\u5220\u9664\u3001\u8B66\u544A */\n ERROR: '#FF6B80',\n\n /** \u8B66\u544A - \u9700\u8981\u6CE8\u610F\u3001\u786E\u8BA4 */\n WARNING: '#FFB86C',\n\n /** \u4FE1\u606F - \u63D0\u793A\u3001\u94FE\u63A5\u3001\u8BF4\u660E */\n INFO: '#5DADE2',\n\n /** \u8FDB\u884C\u4E2D - \u6B63\u5728\u5904\u7406\u3001\u7B49\u5F85 */\n RUNNING: '#B668C8',\n} as const\n\n// ============================================================================\n// \u80CC\u666F\u989C\u8272\u7CFB\u7EDF (Background Color System)\n// ============================================================================\n\n/**\n * \u80CC\u666F\u989C\u8272 - \u7528\u4E8E\u89C6\u89C9\u5206\u5272\n */\nexport const BACKGROUND_COLORS = {\n /** \u5934\u90E8\u80CC\u666F */\n HEADER: '#2E2E3E',\n\n /** \u4EE3\u7801\u5757\u80CC\u666F */\n CODE_BLOCK: '#1E1E1E',\n\n /** \u9009\u4E2D\u9AD8\u4EAE */\n SELECTION: '#3C3C3C',\n\n /** \u900F\u660E\u80CC\u666F */\n TRANSPARENT: 'transparent',\n} as const\n\n// ============================================================================\n// Minto \u7279\u8272\u989C\u8272 (Minto Feature Colors)\n// ============================================================================\n\n/**\n * Minto \u7279\u8272\u529F\u80FD\u914D\u8272\n */\nexport const MINTO_COLORS = {\n /** \u547D\u4EE4\u6A21\u5F0F\u8FB9\u6846 */\n BASH_BORDER: '#FFB86C',\n\n /** \u7B14\u8BB0\u6A21\u5F0F\u8FB9\u6846 */\n KODING_BORDER: '#5DADE2',\n\n /** \u4EFB\u52A1\u8FDB\u5EA6\u6761 */\n SUBAGENT_PROGRESS: '#B668C8',\n\n /** \u5F85\u529E\u9762\u677F\u4E3B\u8272 */\n TODO_MAIN: '#667EEA',\n} as const\n\n// ============================================================================\n// \u8BED\u4E49\u989C\u8272\u7CFB\u7EDF (Semantic Color System)\n// ============================================================================\n\n/**\n * \u8BED\u4E49\u989C\u8272 - \u6309\u4FE1\u606F\u7C7B\u578B\u5B9A\u4E49\u7684\u989C\u8272\n *\n * \u4F7F\u7528\u573A\u666F\uFF1A\n * - brand: \u54C1\u724C\u6807\u8BC6\u3001\u6B22\u8FCE\u4FE1\u606F\n * - accent: \u91CD\u8981\u9AD8\u4EAE\u3001\u884C\u52A8\u53EC\u5524\n * - primary: \u4E3B\u8981\u5185\u5BB9\u3001\u7528\u6237\u8F93\u5165\n * - secondary: \u8BF4\u660E\u4FE1\u606F\u3001\u64CD\u4F5C\u540D\u79F0\n * - dim: \u8865\u5145\u4FE1\u606F\u3001\u53C2\u6570\n * - muted: \u5143\u6570\u636E\u3001\u65F6\u95F4\u6233\n * - running: \u6B63\u5728\u5904\u7406\n * - success: \u5B8C\u6210\u3001\u6210\u529F\n * - error: \u5931\u8D25\u3001\u9519\u8BEF\n * - info: \u63D0\u793A\u3001\u94FE\u63A5\n */\nexport const SEMANTIC_COLORS = {\n /** \u54C1\u724C\u8272 - \u7D2B\u84DD */\n brand: '#667EEA',\n\n /** \u5F3A\u8C03\u8272 - \u73CA\u745A\u7EA2 */\n accent: '#F5576C',\n\n /** \u4E3B\u8981\u6587\u672C */\n primary: '#FFFFFF',\n\n /** \u6B21\u8981\u6587\u672C */\n secondary: '#CCCCCC',\n\n /** \u8F85\u52A9\u6587\u672C */\n dim: '#888888',\n\n /** \u6700\u6DE1\u6587\u672C */\n muted: '#555555',\n\n /** \u8FDB\u884C\u4E2D - \u7C89\u7D2B */\n running: '#B668C8',\n\n /** \u6210\u529F */\n success: '#4EBA65',\n\n /** \u9519\u8BEF */\n error: '#FF6B80',\n\n /** \u4FE1\u606F */\n info: '#5DADE2',\n} as const\n\n/**\n * \u8BED\u4E49\u989C\u8272\u7C7B\u578B\n */\nexport type SemanticColor = keyof typeof SEMANTIC_COLORS\n\n/**\n * \u83B7\u53D6\u8BED\u4E49\u989C\u8272\u503C\n */\nexport function getSemanticColor(color: SemanticColor): string {\n return SEMANTIC_COLORS[color]\n}\n\n// ============================================================================\n// \u72B6\u6001\u7B26\u53F7\u989C\u8272\u7CFB\u7EDF (Status Symbol Color System)\n// \u4E0E Logo \u914D\u8272\u4FDD\u6301\u4E00\u81F4\uFF0C\u4F7F\u7528 BRAND_GRADIENT\n// ============================================================================\n\n/**\n * \u72B6\u6001\u7B26\u53F7\u989C\u8272 - \u4E0E Logo \u4FDD\u6301\u4E00\u81F4\u7684\u54C1\u724C\u914D\u8272\n *\n * \u7528\u4E8E REPL \u4EA4\u4E92\u4E2D\u7684\u72B6\u6001\u6807\u8BB0\u7B26\u53F7\uFF08\u2713\u3001\u25D0\u3001\u23FA\u3001\u23BF \u7B49\uFF09\n * \u786E\u4FDD\u89C6\u89C9\u4E00\u81F4\u6027\u548C\u54C1\u724C\u8BC6\u522B\u5EA6\n */\nexport const SYMBOL_COLORS = {\n /** \u5B8C\u6210\u72B6\u6001 (\u2713) - \u4F7F\u7528\u54C1\u724C\u8D77\u59CB\u8272\u7D2B\u84DD */\n success: BRAND_GRADIENT.START,\n\n /** \u8FDB\u884C\u4E2D\u72B6\u6001 (\u25D0) - \u4F7F\u7528\u54C1\u724C\u4E2D\u95F4\u8272\u7C89\u7D2B */\n running: BRAND_GRADIENT.MIDDLE,\n\n /** \u9519\u8BEF\u72B6\u6001 (\u2717) - \u4F7F\u7528\u54C1\u724C\u7ED3\u675F\u8272\u73CA\u745A\u7EA2 */\n error: BRAND_GRADIENT.END,\n\n /** \u5F85\u5904\u7406\u72B6\u6001 - \u4F7F\u7528 dim */\n pending: SEMANTIC_COLORS.dim,\n\n /** \u5B50\u8F93\u51FA\u8FDE\u63A5\u7B26 (\u23BF) - \u4F7F\u7528 dim \u4FDD\u6301\u5C42\u7EA7\u611F */\n child: SEMANTIC_COLORS.dim,\n\n /** Todo \u66F4\u65B0 (\u23FA) - \u4F7F\u7528\u54C1\u724C\u8D77\u59CB\u8272 */\n todo: BRAND_GRADIENT.START,\n\n /** \u5E76\u884C\u4EFB\u52A1\u7EC4 (\u25C8) - \u4F7F\u7528\u54C1\u724C\u4E2D\u95F4\u8272 */\n parallel: BRAND_GRADIENT.MIDDLE,\n} as const\n\n// ============================================================================\n// \u72B6\u6001\u989C\u8272\u6620\u5C04 (Status Color Mapping)\n// ============================================================================\n\n/**\n * \u72B6\u6001\u989C\u8272\u6620\u5C04\n */\nexport const STATUS_COLORS = {\n running: SEMANTIC_COLORS.running,\n pending: SEMANTIC_COLORS.dim,\n success: SEMANTIC_COLORS.success,\n completed: SEMANTIC_COLORS.success,\n error: SEMANTIC_COLORS.error,\n failed: SEMANTIC_COLORS.error,\n done: SEMANTIC_COLORS.success,\n} as const\n\n/**\n * \u83B7\u53D6\u72B6\u6001\u989C\u8272\n */\nexport function getStatusColorHex(\n status: keyof typeof STATUS_COLORS | string,\n): string {\n return (\n STATUS_COLORS[status as keyof typeof STATUS_COLORS] || SEMANTIC_COLORS.dim\n )\n}\n\n/**\n * \u4FE1\u606F\u5C42\u7EA7\u989C\u8272\n */\nexport const VALUE_TIER_COLORS = {\n /** \u6838\u5FC3\u4FE1\u606F */\n core: SEMANTIC_COLORS.secondary,\n\n /** \u8F85\u52A9\u4FE1\u606F */\n auxiliary: SEMANTIC_COLORS.dim,\n\n /** \u5143\u4FE1\u606F */\n meta: SEMANTIC_COLORS.muted,\n} as const\n\n// ============================================================================\n// \u7EDF\u4E00\u5BFC\u51FA (Unified Export)\n// ============================================================================\n\nexport const CLAUDE_COLORS = {\n ...TEXT_COLORS,\n ...FUNCTIONAL_COLORS,\n ...BACKGROUND_COLORS,\n ...MINTO_COLORS,\n} as const\n\n// ============================================================================\n// Agent \u989C\u8272\u7CFB\u7EDF (Agent Color System)\n// ============================================================================\n\n/**\n * Agent \u989C\u8272\u7C7B\u578B\n */\nexport type AgentColor =\n | 'red'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'purple'\n | 'orange'\n | 'pink'\n | 'cyan'\n | 'auto'\n\n/**\n * Agent \u989C\u8272\u6620\u5C04\u8868\n */\nexport const AGENT_COLORS: Record<AgentColor, string> = {\n red: '#FF6B80',\n blue: '#667EEA',\n green: '#4EBA65',\n yellow: '#FFB86C',\n purple: '#B668C8',\n orange: '#F5576C',\n pink: '#DC75A8',\n cyan: '#5DADE2',\n auto: '#FFFFFF',\n} as const\n\n/**\n * Agent \u989C\u8272\u63A8\u8350\u573A\u666F\uFF08\u9762\u5411\u5546\u4E1A\u7528\u6237\uFF09\n */\nexport const AGENT_COLOR_RECOMMENDATIONS: Record<AgentColor, string[]> = {\n red: ['\u5BA1\u6838', '\u98CE\u9669\u8BC4\u4F30', 'code-reviewer', 'security-auditor'],\n blue: ['\u5206\u6790', '\u7814\u7A76', 'general-purpose', 'research'],\n green: ['\u9A8C\u8BC1', '\u6D4B\u8BD5', 'test-automator', 'validator'],\n yellow: ['\u6570\u636E\u5206\u6790', '\u62A5\u544A', 'data-scientist', 'analyst'],\n purple: ['\u63A2\u7D22', '\u521B\u610F', 'explorer', 'creative'],\n orange: ['\u6267\u884C', '\u90E8\u7F72', 'deployment', 'action'],\n pink: ['\u5199\u4F5C', '\u6587\u6863', 'content-writer', 'docs'],\n cyan: ['\u8BCA\u65AD', '\u4F18\u5316', 'debugger', 'optimizer'],\n auto: ['\u9ED8\u8BA4'],\n}\n\n/**\n * \u83B7\u53D6 Agent \u989C\u8272\n */\nexport function getAgentColor(\n color: string | undefined,\n theme: ReturnType<typeof getTheme>,\n): string {\n if (!color || color === 'auto') {\n return theme.minto\n }\n\n const normalizedColor = color.toLowerCase() as AgentColor\n if (normalizedColor in AGENT_COLORS) {\n return AGENT_COLORS[normalizedColor]\n }\n\n return theme.minto\n}\n\n/**\n * \u6839\u636E Agent \u7C7B\u578B\u63A8\u8350\u989C\u8272\n */\nexport function recommendColorForAgent(agentType: string): AgentColor {\n const lowerType = agentType.toLowerCase()\n\n for (const [color, keywords] of Object.entries(AGENT_COLOR_RECOMMENDATIONS)) {\n for (const keyword of keywords) {\n if (lowerType.includes(keyword.toLowerCase())) {\n return color as AgentColor\n }\n }\n }\n\n return 'auto'\n}\n\n/**\n * \u83B7\u53D6\u5BF9\u6BD4\u6587\u672C\u989C\u8272\n */\nexport function getContrastTextColor(\n backgroundColor: string,\n): 'black' | 'white' {\n const hex = backgroundColor.replace('#', '')\n const r = parseInt(hex.substring(0, 2), 16)\n const g = parseInt(hex.substring(2, 4), 16)\n const b = parseInt(hex.substring(4, 6), 16)\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n return yiq >= 128 ? 'black' : 'white'\n}\n"],
5
+ "mappings": "AAmBO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,OAAO;AAAA;AAAA,EAGP,QAAQ;AAAA;AAAA,EAGR,KAAK;AACP;AASO,MAAM,cAAc;AAAA;AAAA,EAEzB,SAAS;AAAA;AAAA,EAGT,WAAW;AAAA;AAAA,EAGX,QAAQ;AAAA;AAAA,EAGR,OAAO;AACT;AASO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,OAAO;AAAA;AAAA,EAGP,QAAQ;AAAA;AAAA,EAGR,SAAS;AAAA;AAAA,EAGT,OAAO;AAAA;AAAA,EAGP,SAAS;AAAA;AAAA,EAGT,MAAM;AAAA;AAAA,EAGN,SAAS;AACX;AASO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,QAAQ;AAAA;AAAA,EAGR,YAAY;AAAA;AAAA,EAGZ,WAAW;AAAA;AAAA,EAGX,aAAa;AACf;AASO,MAAM,eAAe;AAAA;AAAA,EAE1B,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA;AAAA,EAGf,mBAAmB;AAAA;AAAA,EAGnB,WAAW;AACb;AAqBO,MAAM,kBAAkB;AAAA;AAAA,EAE7B,OAAO;AAAA;AAAA,EAGP,QAAQ;AAAA;AAAA,EAGR,SAAS;AAAA;AAAA,EAGT,WAAW;AAAA;AAAA,EAGX,KAAK;AAAA;AAAA,EAGL,OAAO;AAAA;AAAA,EAGP,SAAS;AAAA;AAAA,EAGT,SAAS;AAAA;AAAA,EAGT,OAAO;AAAA;AAAA,EAGP,MAAM;AACR;AAUO,SAAS,iBAAiB,OAA8B;AAC7D,SAAO,gBAAgB,KAAK;AAC9B;AAaO,MAAM,gBAAgB;AAAA;AAAA,EAE3B,SAAS,eAAe;AAAA;AAAA,EAGxB,SAAS,eAAe;AAAA;AAAA,EAGxB,OAAO,eAAe;AAAA;AAAA,EAGtB,SAAS,gBAAgB;AAAA;AAAA,EAGzB,OAAO,gBAAgB;AAAA;AAAA,EAGvB,MAAM,eAAe;AAAA;AAAA,EAGrB,UAAU,eAAe;AAC3B;AASO,MAAM,gBAAgB;AAAA,EAC3B,SAAS,gBAAgB;AAAA,EACzB,SAAS,gBAAgB;AAAA,EACzB,SAAS,gBAAgB;AAAA,EACzB,WAAW,gBAAgB;AAAA,EAC3B,OAAO,gBAAgB;AAAA,EACvB,QAAQ,gBAAgB;AAAA,EACxB,MAAM,gBAAgB;AACxB;AAKO,SAAS,kBACd,QACQ;AACR,SACE,cAAc,MAAoC,KAAK,gBAAgB;AAE3E;AAKO,MAAM,oBAAoB;AAAA;AAAA,EAE/B,MAAM,gBAAgB;AAAA;AAAA,EAGtB,WAAW,gBAAgB;AAAA;AAAA,EAG3B,MAAM,gBAAgB;AACxB;AAMO,MAAM,gBAAgB;AAAA,EAC3B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAuBO,MAAM,eAA2C;AAAA,EACtD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAKO,MAAM,8BAA4D;AAAA,EACvE,KAAK,CAAC,gBAAM,4BAAQ,iBAAiB,kBAAkB;AAAA,EACvD,MAAM,CAAC,gBAAM,gBAAM,mBAAmB,UAAU;AAAA,EAChD,OAAO,CAAC,gBAAM,gBAAM,kBAAkB,WAAW;AAAA,EACjD,QAAQ,CAAC,4BAAQ,gBAAM,kBAAkB,SAAS;AAAA,EAClD,QAAQ,CAAC,gBAAM,gBAAM,YAAY,UAAU;AAAA,EAC3C,QAAQ,CAAC,gBAAM,gBAAM,cAAc,QAAQ;AAAA,EAC3C,MAAM,CAAC,gBAAM,gBAAM,kBAAkB,MAAM;AAAA,EAC3C,MAAM,CAAC,gBAAM,gBAAM,YAAY,WAAW;AAAA,EAC1C,MAAM,CAAC,cAAI;AACb;AAKO,SAAS,cACd,OACA,OACQ;AACR,MAAI,CAAC,SAAS,UAAU,QAAQ;AAC9B,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,kBAAkB,MAAM,YAAY;AAC1C,MAAI,mBAAmB,cAAc;AACnC,WAAO,aAAa,eAAe;AAAA,EACrC;AAEA,SAAO,MAAM;AACf;AAKO,SAAS,uBAAuB,WAA+B;AACpE,QAAM,YAAY,UAAU,YAAY;AAExC,aAAW,CAAC,OAAO,QAAQ,KAAK,OAAO,QAAQ,2BAA2B,GAAG;AAC3E,eAAW,WAAW,UAAU;AAC9B,UAAI,UAAU,SAAS,QAAQ,YAAY,CAAC,GAAG;AAC7C,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAKO,SAAS,qBACd,iBACmB;AACnB,QAAM,MAAM,gBAAgB,QAAQ,KAAK,EAAE;AAC3C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAC1C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAC1C,QAAM,IAAI,SAAS,IAAI,UAAU,GAAG,CAAC,GAAG,EAAE;AAC1C,QAAM,OAAO,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO;AAC5C,SAAO,OAAO,MAAM,UAAU;AAChC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,102 @@
1
+ const STATS_SEPARATOR = " \xB7 ";
2
+ const PREVIEW_SEPARATOR = " \xB7 ";
3
+ const SPACE_BEFORE_STATS_PAREN = true;
4
+ const SPACE_IN_TOOL_PAREN = false;
5
+ const INDENT_UNIT = 2;
6
+ const INDENT_LEVELS = {
7
+ L0: 0,
8
+ L1: INDENT_UNIT,
9
+ L2: INDENT_UNIT * 2,
10
+ L3: INDENT_UNIT * 3
11
+ };
12
+ function getIndent(level) {
13
+ const spaces = typeof level === "number" ? level : INDENT_LEVELS[level];
14
+ return " ".repeat(spaces);
15
+ }
16
+ const INDENT_LEVEL_1 = " ";
17
+ const INDENT_CHILD_FIRST = " \u23BF ";
18
+ const INDENT_CHILD_ALIGN = " ";
19
+ const VERTICAL_GAP = {
20
+ /** 同类连续操作之间 */
21
+ SAME_TYPE: 0,
22
+ /** 不同类型切换 */
23
+ TYPE_SWITCH: 1,
24
+ /** 用户输入后 */
25
+ AFTER_USER_INPUT: 1,
26
+ /** AI 输出前 */
27
+ BEFORE_AI_OUTPUT: 1
28
+ };
29
+ const MARGIN_BEFORE_USER_MESSAGE = 1;
30
+ const MARGIN_BEFORE_MODULE = 1;
31
+ const MARGIN_AFTER_MODULE = 0;
32
+ const MARGIN_BEFORE_ASSISTANT = 1;
33
+ const STATUS_SYMBOLS = {
34
+ /** Task is currently running */
35
+ RUNNING: "\u25CB",
36
+ /** Task completed successfully */
37
+ COMPLETED: "\u25CF",
38
+ /** Task is pending/queued */
39
+ PENDING: "\u25CB",
40
+ /** Task failed */
41
+ FAILED: "\u2717"
42
+ };
43
+ const TODO_SYMBOLS = {
44
+ /** Todo item completed */
45
+ COMPLETED: "\u2612",
46
+ /** Todo item pending */
47
+ PENDING: "\u2610",
48
+ /** Todo item in progress */
49
+ IN_PROGRESS: "\u2610"
50
+ };
51
+ const TREE_SYMBOLS = {
52
+ /** Connector for non-last items */
53
+ BRANCH: "\u251C\u2500",
54
+ /** Connector for last item */
55
+ LAST_BRANCH: "\u2514\u2500",
56
+ /** Vertical continuation line */
57
+ VERTICAL: "\u2502 ",
58
+ /** Empty space for alignment after last item */
59
+ EMPTY: " "
60
+ };
61
+ const ABBREVIATIONS = {
62
+ /** "characters" -> "chars" */
63
+ CHARACTERS: "chars",
64
+ /** "completed" - keep full for clarity */
65
+ COMPLETED: "completed",
66
+ /** "tokens" - keep full */
67
+ TOKENS: "tokens"
68
+ };
69
+ function formatStats(items) {
70
+ return items.filter(Boolean).join(STATS_SEPARATOR);
71
+ }
72
+ function formatCount(count, singular, plural = singular + "s") {
73
+ return `${count} ${count === 1 ? singular : plural}`;
74
+ }
75
+ function spaceBeforeParen() {
76
+ return SPACE_BEFORE_STATS_PAREN ? " " : "";
77
+ }
78
+ export {
79
+ ABBREVIATIONS,
80
+ INDENT_CHILD_ALIGN,
81
+ INDENT_CHILD_FIRST,
82
+ INDENT_LEVELS,
83
+ INDENT_LEVEL_1,
84
+ INDENT_UNIT,
85
+ MARGIN_AFTER_MODULE,
86
+ MARGIN_BEFORE_ASSISTANT,
87
+ MARGIN_BEFORE_MODULE,
88
+ MARGIN_BEFORE_USER_MESSAGE,
89
+ PREVIEW_SEPARATOR,
90
+ SPACE_BEFORE_STATS_PAREN,
91
+ SPACE_IN_TOOL_PAREN,
92
+ STATS_SEPARATOR,
93
+ STATUS_SYMBOLS,
94
+ TODO_SYMBOLS,
95
+ TREE_SYMBOLS,
96
+ VERTICAL_GAP,
97
+ formatCount,
98
+ formatStats,
99
+ getIndent,
100
+ spaceBeforeParen
101
+ };
102
+ //# sourceMappingURL=formatRules.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants/formatRules.ts"],
4
+ "sourcesContent": ["/**\n * REPL Output Format Rules\n *\n * Unified formatting constants for consistent CLI output.\n * All components should reference these constants for formatting decisions.\n */\n\n// ============================================================================\n// SEPARATORS\n// ============================================================================\n\n/**\n * Standard separator for statistics items\n * Example: \"1 tool \u00B7 32.8k tokens \u00B7 27s\"\n */\nexport const STATS_SEPARATOR = ' \u00B7 '\n\n/**\n * Separator for preview content\n * Example: \"(2335 chars) \u00B7 # preview text\"\n */\nexport const PREVIEW_SEPARATOR = ' \u00B7 '\n\n// ============================================================================\n// SPACING\n// ============================================================================\n\n/**\n * Whether to add space before statistics parentheses\n * true: \"Parallel Tasks (3/3 completed)\"\n * false: \"Parallel Tasks(3/3 completed)\"\n */\nexport const SPACE_BEFORE_STATS_PAREN = true\n\n/**\n * Whether to add space inside tool parameter parentheses\n * false: \"Bash(command)\"\n * true: \"Bash( command )\"\n */\nexport const SPACE_IN_TOOL_PAREN = false\n\n// ============================================================================\n// INDENTATION (\u57FA\u4E8E REPL \u663E\u793A\u89C4\u8303)\n// ============================================================================\n\n/**\n * \u57FA\u7840\u7F29\u8FDB\u5355\u4F4D (2 \u5B57\u7B26)\n * \u6240\u6709\u7F29\u8FDB\u90FD\u662F\u6B64\u5355\u4F4D\u7684\u500D\u6570\n */\nexport const INDENT_UNIT = 2\n\n/**\n * \u7F29\u8FDB\u5C42\u7EA7\u5B9A\u4E49\n * - L0: 0 \u5B57\u7B26 - \u7528\u6237\u8F93\u5165\u3001AI \u8F93\u51FA\u6807\u9898\n * - L1: 2 \u5B57\u7B26 - \u5DE5\u5177\u8C03\u7528\u3001Todo \u66F4\u65B0\u3001\u5E76\u884C\u4EFB\u52A1\u7EC4\n * - L2: 4 \u5B57\u7B26 - \u5DE5\u5177\u8F93\u51FA\u3001\u5E76\u884C\u5B50\u4EFB\u52A1\n * - L3: 6 \u5B57\u7B26 - \u5B50\u4EFB\u52A1\u7684\u8F93\u51FA\u8BE6\u60C5\n */\nexport const INDENT_LEVELS = {\n L0: 0,\n L1: INDENT_UNIT,\n L2: INDENT_UNIT * 2,\n L3: INDENT_UNIT * 3,\n} as const\n\n/**\n * \u751F\u6210\u6307\u5B9A\u5C42\u7EA7\u7684\u7F29\u8FDB\u5B57\u7B26\u4E32\n */\nexport function getIndent(level: keyof typeof INDENT_LEVELS | number): string {\n const spaces = typeof level === 'number' ? level : INDENT_LEVELS[level]\n return ' '.repeat(spaces)\n}\n\n/**\n * First-level indentation (2 spaces)\n * @deprecated \u4F7F\u7528 getIndent('L1') \u66FF\u4EE3\n */\nexport const INDENT_LEVEL_1 = ' '\n\n/**\n * Child item prefix with continuation symbol\n * Used for first child in a list\n */\nexport const INDENT_CHILD_FIRST = ' \u23BF '\n\n/**\n * Alignment spaces for subsequent children (5 spaces to align with first child)\n */\nexport const INDENT_CHILD_ALIGN = ' '\n\n// ============================================================================\n// MARGINS (vertical spacing in terminal lines)\n// \u57FA\u4E8E REPL \u663E\u793A\u89C4\u8303\uFF1A\n// - \u540C\u7C7B\u8FDE\u7EED\u64CD\u4F5C: 0 \u884C\n// - \u4E0D\u540C\u7C7B\u578B\u5207\u6362: 1 \u884C\n// - \u7528\u6237\u8F93\u5165\u540E: 1 \u884C\n// - AI \u8F93\u51FA\u524D: 1 \u884C\n// ============================================================================\n\n/**\n * \u5782\u76F4\u95F4\u8DDD\u5B9A\u4E49\n */\nexport const VERTICAL_GAP = {\n /** \u540C\u7C7B\u8FDE\u7EED\u64CD\u4F5C\u4E4B\u95F4 */\n SAME_TYPE: 0,\n /** \u4E0D\u540C\u7C7B\u578B\u5207\u6362 */\n TYPE_SWITCH: 1,\n /** \u7528\u6237\u8F93\u5165\u540E */\n AFTER_USER_INPUT: 1,\n /** AI \u8F93\u51FA\u524D */\n BEFORE_AI_OUTPUT: 1,\n} as const\n\n/**\n * Margin before user message blocks\n */\nexport const MARGIN_BEFORE_USER_MESSAGE = 1\n\n/**\n * Margin before module-level components (Parallel Tasks, Update Todos)\n */\nexport const MARGIN_BEFORE_MODULE = 1\n\n/**\n * Margin after module-level components\n */\nexport const MARGIN_AFTER_MODULE = 0\n\n/**\n * Margin before assistant response blocks\n */\nexport const MARGIN_BEFORE_ASSISTANT = 1\n\n// ============================================================================\n// STATUS SYMBOLS\n// ============================================================================\n\n/**\n * Status symbols for task states\n */\nexport const STATUS_SYMBOLS = {\n /** Task is currently running */\n RUNNING: '\u25CB',\n /** Task completed successfully */\n COMPLETED: '\u25CF',\n /** Task is pending/queued */\n PENDING: '\u25CB',\n /** Task failed */\n FAILED: '\u2717',\n} as const\n\n/**\n * Todo item status symbols\n */\nexport const TODO_SYMBOLS = {\n /** Todo item completed */\n COMPLETED: '\u2612',\n /** Todo item pending */\n PENDING: '\u2610',\n /** Todo item in progress */\n IN_PROGRESS: '\u2610',\n} as const\n\n// ============================================================================\n// TREE CONNECTORS\n// ============================================================================\n\n/**\n * Tree connector symbols for hierarchical display\n */\nexport const TREE_SYMBOLS = {\n /** Connector for non-last items */\n BRANCH: '\u251C\u2500',\n /** Connector for last item */\n LAST_BRANCH: '\u2514\u2500',\n /** Vertical continuation line */\n VERTICAL: '\u2502 ',\n /** Empty space for alignment after last item */\n EMPTY: ' ',\n} as const\n\n// ============================================================================\n// TEXT ABBREVIATIONS\n// ============================================================================\n\n/**\n * Abbreviated text for compact display\n */\nexport const ABBREVIATIONS = {\n /** \"characters\" -> \"chars\" */\n CHARACTERS: 'chars',\n /** \"completed\" - keep full for clarity */\n COMPLETED: 'completed',\n /** \"tokens\" - keep full */\n TOKENS: 'tokens',\n} as const\n\n// ============================================================================\n// HELPER FUNCTIONS\n// ============================================================================\n\n/**\n * Format statistics string with consistent separator\n * @example formatStats(['1 tool', '32.8k tokens', '27s']) => \"1 tool \u00B7 32.8k tokens \u00B7 27s\"\n */\nexport function formatStats(items: (string | null | undefined)[]): string {\n return items.filter(Boolean).join(STATS_SEPARATOR)\n}\n\n/**\n * Format a count with optional singular/plural label\n * @example formatCount(1, 'tool', 'tools') => \"1 tool\"\n * @example formatCount(3, 'tool', 'tools') => \"3 tools\"\n */\nexport function formatCount(\n count: number,\n singular: string,\n plural: string = singular + 's',\n): string {\n return `${count} ${count === 1 ? singular : plural}`\n}\n\n/**\n * Add space before parenthesis if SPACE_BEFORE_STATS_PAREN is true\n * @example spaceBeforeParen() => \" \" or \"\"\n */\nexport function spaceBeforeParen(): string {\n return SPACE_BEFORE_STATS_PAREN ? ' ' : ''\n}\n"],
5
+ "mappings": "AAeO,MAAM,kBAAkB;AAMxB,MAAM,oBAAoB;AAW1B,MAAM,2BAA2B;AAOjC,MAAM,sBAAsB;AAU5B,MAAM,cAAc;AASpB,MAAM,gBAAgB;AAAA,EAC3B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI,cAAc;AAAA,EAClB,IAAI,cAAc;AACpB;AAKO,SAAS,UAAU,OAAoD;AAC5E,QAAM,SAAS,OAAO,UAAU,WAAW,QAAQ,cAAc,KAAK;AACtE,SAAO,IAAI,OAAO,MAAM;AAC1B;AAMO,MAAM,iBAAiB;AAMvB,MAAM,qBAAqB;AAK3B,MAAM,qBAAqB;AAc3B,MAAM,eAAe;AAAA;AAAA,EAE1B,WAAW;AAAA;AAAA,EAEX,aAAa;AAAA;AAAA,EAEb,kBAAkB;AAAA;AAAA,EAElB,kBAAkB;AACpB;AAKO,MAAM,6BAA6B;AAKnC,MAAM,uBAAuB;AAK7B,MAAM,sBAAsB;AAK5B,MAAM,0BAA0B;AAShC,MAAM,iBAAiB;AAAA;AAAA,EAE5B,SAAS;AAAA;AAAA,EAET,WAAW;AAAA;AAAA,EAEX,SAAS;AAAA;AAAA,EAET,QAAQ;AACV;AAKO,MAAM,eAAe;AAAA;AAAA,EAE1B,WAAW;AAAA;AAAA,EAEX,SAAS;AAAA;AAAA,EAET,aAAa;AACf;AASO,MAAM,eAAe;AAAA;AAAA,EAE1B,QAAQ;AAAA;AAAA,EAER,aAAa;AAAA;AAAA,EAEb,UAAU;AAAA;AAAA,EAEV,OAAO;AACT;AASO,MAAM,gBAAgB;AAAA;AAAA,EAE3B,YAAY;AAAA;AAAA,EAEZ,WAAW;AAAA;AAAA,EAEX,QAAQ;AACV;AAUO,SAAS,YAAY,OAA8C;AACxE,SAAO,MAAM,OAAO,OAAO,EAAE,KAAK,eAAe;AACnD;AAOO,SAAS,YACd,OACA,UACA,SAAiB,WAAW,KACpB;AACR,SAAO,GAAG,KAAK,IAAI,UAAU,IAAI,WAAW,MAAM;AACpD;AAMO,SAAS,mBAA2B;AACzC,SAAO,2BAA2B,MAAM;AAC1C;",
6
+ "names": []
7
+ }
@@ -46,48 +46,22 @@ Output text to communicate with the user; all text you output outside of tool us
46
46
  If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
47
47
  IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
48
48
  IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
49
- IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...". Here are some examples to demonstrate appropriate verbosity:
49
+ IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...". Examples of appropriate verbosity:
50
50
  <example>
51
51
  user: 2 + 2
52
52
  assistant: 4
53
53
  </example>
54
-
55
- <example>
56
- user: what is 2+2?
57
- assistant: 4
58
- </example>
59
-
60
54
  <example>
61
- user: is 11 a prime number?
62
- assistant: Yes
63
- </example>
64
-
65
- <example>
66
- user: what command should I run to list files in the current directory?
55
+ user: what command should I run to list files?
67
56
  assistant: ls
68
57
  </example>
69
-
70
58
  <example>
71
- user: what command should I run to watch files in the current directory?
72
- assistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
73
- npm run dev
59
+ user: what files are in src/?
60
+ assistant: [runs ls] foo.c, bar.c, baz.c
74
61
  </example>
75
-
76
- <example>
77
- user: How many golf balls fit inside a jetta?
78
- assistant: 150000
79
- </example>
80
-
81
- <example>
82
- user: what files are in the directory src/?
83
- assistant: [runs ls and sees foo.c, bar.c, baz.c]
84
- user: which file contains the implementation of foo?
85
- assistant: src/foo.c
86
- </example>
87
-
88
62
  <example>
89
63
  user: write tests for new feature
90
- assistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]
64
+ assistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]
91
65
  </example>
92
66
 
93
67
  # Proactiveness
@@ -129,12 +103,16 @@ NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTAN
129
103
  - It is always better to speculatively perform multiple searches as a batch that are potentially useful.
130
104
  - For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.
131
105
 
106
+ # MCP Resources
107
+ If MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:
108
+ - ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.
109
+ - ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.
110
+ When the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.
111
+
132
112
  You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
133
113
  `,
134
114
  `
135
- ${await getEnvInfo()}`,
136
- `IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
137
- IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).`
115
+ ${await getEnvInfo()}`
138
116
  ];
139
117
  }
140
118
  async function getEnvInfo() {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/prompts.ts"],
4
- "sourcesContent": ["import { env } from '@utils/env'\nimport { getIsGit } from '@utils/git'\nimport {\n INTERRUPT_MESSAGE,\n INTERRUPT_MESSAGE_FOR_TOOL_USE,\n} from '@utils/messages'\nimport { getCwd } from '@utils/state'\nimport { PRODUCT_NAME, PROJECT_FILE, PRODUCT_COMMAND } from './product'\nimport { BashTool } from '@tools/BashTool/BashTool'\nimport { MACRO } from './macros'\n\n// // Security policy constant matching reference implementation\n// export const SECURITY_POLICY =\n// 'IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.'\n\nexport function getCLISyspromptPrefix(): string {\n return `You are ${PRODUCT_NAME}, ShareAI-lab's Agent AI CLI for terminal & coding.`\n}\n\nexport async function getSystemPrompt(): Promise<string[]> {\n return [\n `\nYou are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\nIMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).\n\nHere are useful slash commands users can run to interact with you:\n- /help: Get help with using ${PRODUCT_NAME}\n- /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit\nThere are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \\`${PRODUCT_COMMAND} -h\\` with ${BashTool.name} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.\nTo give feedback, users should ${MACRO.ISSUES_EXPLAINER}.\n\n# Task Management\nYou have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\nThese tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n\nIt is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n\n# Memory\nIf the current working directory contains a file called ${PROJECT_FILE}, it will be automatically added to your context. This file serves multiple purposes:\n1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\n2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\n3. Maintaining useful information about the codebase structure and organization\n\nWhen you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to ${PROJECT_FILE}. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to ${PROJECT_FILE} so you can remember it for next time.\n\n# Tone and style\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).\nRemember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BashTool.name} or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nIMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\". Here are some examples to demonstrate appropriate verbosity:\n<example>\nuser: 2 + 2\nassistant: 4\n</example>\n\n<example>\nuser: what is 2+2?\nassistant: 4\n</example>\n\n<example>\nuser: is 11 a prime number?\nassistant: Yes\n</example>\n\n<example>\nuser: what command should I run to list files in the current directory?\nassistant: ls\n</example>\n\n<example>\nuser: what command should I run to watch files in the current directory?\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\nnpm run dev\n</example>\n\n<example>\nuser: How many golf balls fit inside a jetta?\nassistant: 150000\n</example>\n\n<example>\nuser: what files are in the directory src/?\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\nuser: which file contains the implementation of foo?\nassistant: src/foo.c\n</example>\n\n<example>\nuser: write tests for new feature\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\n</example>\n\n# Proactiveness\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\n1. Doing the right thing when asked, including taking actions and follow-up actions\n2. Not surprising the user with actions you take without asking\nFor example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\n3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\n\n# Synthetic messages\nSometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself. \n\n# Following conventions\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\n\n# Code style\n- Do not add comments to the code you write, unless the user asks you to, or the code is complex and requires additional context.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- Use the TodoWrite tool to plan the task if required\n- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.\n- Implement the solution using all tools available to you\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\n- VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to ${PROJECT_FILE} so that you will know to run it next time.\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.\n\n# Tool usage policy\n- When doing file search, prefer to use the Task tool in order to reduce context usage.\n- You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.\n- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run \"git status\" and \"git diff\", send a single message with two tool calls to run the calls in parallel.\n- It is always better to speculatively read multiple files as a batch that are potentially useful.\n- It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n- For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.\n\nYou MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.\n`,\n `\\n${await getEnvInfo()}`,\n `IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).`,\n ]\n}\n\nexport async function getEnvInfo(): Promise<string> {\n const isGit = await getIsGit()\n return `Here is useful information about the environment you are running in:\n<env>\nWorking directory: ${getCwd()}\nIs directory a git repo: ${isGit ? 'Yes' : 'No'}\nPlatform: ${env.platform}\nToday's date: ${new Date().toLocaleDateString()}\n</env>`\n}\n\nexport async function getAgentPrompt(): Promise<string[]> {\n return [\n `\nYou are an agent for ${PRODUCT_NAME}. Given the user's prompt, you should use the tools available to you to answer the user's question.\n\nNotes:\n1. IMPORTANT: You should be concise, direct, and to the point, since your responses will be displayed on a command line interface. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\".\n2. When relevant, share file names and code snippets relevant to the query\n3. Any file paths you return in your final response MUST be absolute. DO NOT use relative paths.`,\n `${await getEnvInfo()}`,\n ]\n}\n"],
5
- "mappings": "AAAA,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,cAAc,cAAc,uBAAuB;AAC5D,SAAS,gBAAgB;AACzB,SAAS,aAAa;AAMf,SAAS,wBAAgC;AAC9C,SAAO,WAAW,YAAY;AAChC;AAEA,eAAsB,kBAAqC;AACzD,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAO2B,YAAY;AAAA;AAAA,8FAEmD,YAAY,gCAAgC,eAAe,cAAc,SAAS,IAAI;AAAA,iCACnJ,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0DASG,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,+IAKyE,YAAY,8HAA8H,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,qKAKhI,SAAS,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yDAwDzH,iBAAiB,OAAO,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4VAkB6O,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAepW;AAAA,EAAK,MAAM,WAAW,CAAC;AAAA,IACvB;AAAA;AAAA,EAEF;AACF;AAEA,eAAsB,aAA8B;AAClD,QAAM,QAAQ,MAAM,SAAS;AAC7B,SAAO;AAAA;AAAA,qBAEY,OAAO,CAAC;AAAA,2BACF,QAAQ,QAAQ,IAAI;AAAA,YACnC,IAAI,QAAQ;AAAA,iBACR,oBAAI,KAAK,GAAE,mBAAmB,CAAC;AAAA;AAE/C;AAEA,eAAsB,iBAAoC;AACxD,SAAO;AAAA,IACL;AAAA,uBACmB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,GAAG,MAAM,WAAW,CAAC;AAAA,EACvB;AACF;",
4
+ "sourcesContent": ["import { env } from '@utils/env'\nimport { getIsGit } from '@utils/git'\nimport {\n INTERRUPT_MESSAGE,\n INTERRUPT_MESSAGE_FOR_TOOL_USE,\n} from '@utils/messages'\nimport { getCwd } from '@utils/state'\nimport { PRODUCT_NAME, PROJECT_FILE, PRODUCT_COMMAND } from './product'\nimport { BashTool } from '@tools/BashTool/BashTool'\nimport { MACRO } from './macros'\n\n// // Security policy constant matching reference implementation\n// export const SECURITY_POLICY =\n// 'IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.'\n\nexport function getCLISyspromptPrefix(): string {\n return `You are ${PRODUCT_NAME}, ShareAI-lab's Agent AI CLI for terminal & coding.`\n}\n\nexport async function getSystemPrompt(): Promise<string[]> {\n return [\n `\nYou are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\nIMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).\n\nHere are useful slash commands users can run to interact with you:\n- /help: Get help with using ${PRODUCT_NAME}\n- /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit\nThere are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \\`${PRODUCT_COMMAND} -h\\` with ${BashTool.name} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.\nTo give feedback, users should ${MACRO.ISSUES_EXPLAINER}.\n\n# Task Management\nYou have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\nThese tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n\nIt is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n\n# Memory\nIf the current working directory contains a file called ${PROJECT_FILE}, it will be automatically added to your context. This file serves multiple purposes:\n1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\n2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\n3. Maintaining useful information about the codebase structure and organization\n\nWhen you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to ${PROJECT_FILE}. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to ${PROJECT_FILE} so you can remember it for next time.\n\n# Tone and style\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).\nRemember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BashTool.name} or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nIMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\". Examples of appropriate verbosity:\n<example>\nuser: 2 + 2\nassistant: 4\n</example>\n<example>\nuser: what command should I run to list files?\nassistant: ls\n</example>\n<example>\nuser: what files are in src/?\nassistant: [runs ls] foo.c, bar.c, baz.c\n</example>\n<example>\nuser: write tests for new feature\nassistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]\n</example>\n\n# Proactiveness\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\n1. Doing the right thing when asked, including taking actions and follow-up actions\n2. Not surprising the user with actions you take without asking\nFor example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\n3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\n\n# Synthetic messages\nSometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself. \n\n# Following conventions\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\n\n# Code style\n- Do not add comments to the code you write, unless the user asks you to, or the code is complex and requires additional context.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- Use the TodoWrite tool to plan the task if required\n- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.\n- Implement the solution using all tools available to you\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\n- VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to ${PROJECT_FILE} so that you will know to run it next time.\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.\n\n# Tool usage policy\n- When doing file search, prefer to use the Task tool in order to reduce context usage.\n- You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.\n- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run \"git status\" and \"git diff\", send a single message with two tool calls to run the calls in parallel.\n- It is always better to speculatively read multiple files as a batch that are potentially useful.\n- It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n- For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.\n\n# MCP Resources\nIf MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:\n- ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.\n- ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.\nWhen the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.\n\nYou MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.\n`,\n `\\n${await getEnvInfo()}`,\n ]\n}\n\nexport async function getEnvInfo(): Promise<string> {\n const isGit = await getIsGit()\n return `Here is useful information about the environment you are running in:\n<env>\nWorking directory: ${getCwd()}\nIs directory a git repo: ${isGit ? 'Yes' : 'No'}\nPlatform: ${env.platform}\nToday's date: ${new Date().toLocaleDateString()}\n</env>`\n}\n\nexport async function getAgentPrompt(): Promise<string[]> {\n return [\n `\nYou are an agent for ${PRODUCT_NAME}. Given the user's prompt, you should use the tools available to you to answer the user's question.\n\nNotes:\n1. IMPORTANT: You should be concise, direct, and to the point, since your responses will be displayed on a command line interface. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\".\n2. When relevant, share file names and code snippets relevant to the query\n3. Any file paths you return in your final response MUST be absolute. DO NOT use relative paths.`,\n `${await getEnvInfo()}`,\n ]\n}\n"],
5
+ "mappings": "AAAA,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,cAAc,cAAc,uBAAuB;AAC5D,SAAS,gBAAgB;AACzB,SAAS,aAAa;AAMf,SAAS,wBAAgC;AAC9C,SAAO,WAAW,YAAY;AAChC;AAEA,eAAsB,kBAAqC;AACzD,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAO2B,YAAY;AAAA;AAAA,8FAEmD,YAAY,gCAAgC,eAAe,cAAc,SAAS,IAAI;AAAA,iCACnJ,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0DASG,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,+IAKyE,YAAY,8HAA8H,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,qKAKhI,SAAS,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,yDA8BzH,iBAAiB,OAAO,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4VAkB6O,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAqBpW;AAAA,EAAK,MAAM,WAAW,CAAC;AAAA,EACzB;AACF;AAEA,eAAsB,aAA8B;AAClD,QAAM,QAAQ,MAAM,SAAS;AAC7B,SAAO;AAAA;AAAA,qBAEY,OAAO,CAAC;AAAA,2BACF,QAAQ,QAAQ,IAAI;AAAA,YACnC,IAAI,QAAQ;AAAA,iBACR,oBAAI,KAAK,GAAE,mBAAmB,CAAC;AAAA;AAE/C;AAEA,eAAsB,iBAAoC;AACxD,SAAO;AAAA,IACL;AAAA,uBACmB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,GAAG,MAAM,WAAW,CAAC;AAAA,EACvB;AACF;",
6
6
  "names": []
7
7
  }