@within-7/minto 0.3.6 → 0.3.10

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 (238) hide show
  1. package/{cli.js → cli.cjs} +25 -23
  2. package/dist/commands/agents/AgentsCommand.js +459 -655
  3. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  4. package/dist/commands/agents/types.js +1 -0
  5. package/dist/commands/agents/types.js.map +2 -2
  6. package/dist/commands/agents/utils/fileOperations.js +96 -36
  7. package/dist/commands/agents/utils/fileOperations.js.map +3 -3
  8. package/dist/commands/agents/utils/index.js +3 -1
  9. package/dist/commands/agents/utils/index.js.map +2 -2
  10. package/dist/commands/context.js +54 -23
  11. package/dist/commands/context.js.map +2 -2
  12. package/dist/commands/export.js +673 -93
  13. package/dist/commands/export.js.map +2 -2
  14. package/dist/commands/language.js +110 -0
  15. package/dist/commands/language.js.map +7 -0
  16. package/dist/commands/mcp-interactive.js +419 -217
  17. package/dist/commands/mcp-interactive.js.map +2 -2
  18. package/dist/commands/model.js +415 -66
  19. package/dist/commands/model.js.map +2 -2
  20. package/dist/commands/new.js +56 -0
  21. package/dist/commands/new.js.map +7 -0
  22. package/dist/commands/permissions.js +75 -49
  23. package/dist/commands/permissions.js.map +2 -2
  24. package/dist/commands/plugin.js +882 -185
  25. package/dist/commands/plugin.js.map +3 -3
  26. package/dist/commands/resume.js +251 -16
  27. package/dist/commands/resume.js.map +2 -2
  28. package/dist/commands/sandbox.js +168 -70
  29. package/dist/commands/sandbox.js.map +2 -2
  30. package/dist/commands/sessions.js +224 -0
  31. package/dist/commands/sessions.js.map +7 -0
  32. package/dist/commands/setup.js +596 -109
  33. package/dist/commands/setup.js.map +2 -2
  34. package/dist/commands/stats.js +292 -0
  35. package/dist/commands/stats.js.map +7 -0
  36. package/dist/commands/status.js +75 -7
  37. package/dist/commands/status.js.map +2 -2
  38. package/dist/commands/undo.js +154 -180
  39. package/dist/commands/undo.js.map +2 -2
  40. package/dist/commands.js +6 -0
  41. package/dist/commands.js.map +2 -2
  42. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js +3 -2
  43. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js.map +2 -2
  44. package/dist/components/Config.js +9 -8
  45. package/dist/components/Config.js.map +2 -2
  46. package/dist/components/HeaderBar.js +2 -1
  47. package/dist/components/HeaderBar.js.map +2 -2
  48. package/dist/components/Help.js +166 -32
  49. package/dist/components/Help.js.map +2 -2
  50. package/dist/components/HotkeyHelpPanel.js +46 -44
  51. package/dist/components/HotkeyHelpPanel.js.map +2 -2
  52. package/dist/components/InfoPanel/InfoPanel.js +123 -0
  53. package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
  54. package/dist/components/InfoPanel/index.js +5 -0
  55. package/dist/components/InfoPanel/index.js.map +7 -0
  56. package/dist/components/InfoPanel/types.js +1 -0
  57. package/dist/components/InfoPanel/types.js.map +7 -0
  58. package/dist/components/Logo.js +5 -2
  59. package/dist/components/Logo.js.map +2 -2
  60. package/dist/components/MCPServerApprovalDialog.js +6 -5
  61. package/dist/components/MCPServerApprovalDialog.js.map +2 -2
  62. package/dist/components/MCPServerMultiselectDialog.js +5 -4
  63. package/dist/components/MCPServerMultiselectDialog.js.map +2 -2
  64. package/dist/components/MessageSelector.js +4 -3
  65. package/dist/components/MessageSelector.js.map +2 -2
  66. package/dist/components/ModelConfig.js +13 -12
  67. package/dist/components/ModelConfig.js.map +2 -2
  68. package/dist/components/ModelListManager.js +4 -3
  69. package/dist/components/ModelListManager.js.map +2 -2
  70. package/dist/components/ModelSelector/BrandTextInput.js +43 -0
  71. package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
  72. package/dist/components/ModelSelector/ModelSelector.js +419 -501
  73. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  74. package/dist/components/ModelSelector/WizardContainer.js +45 -0
  75. package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
  76. package/dist/components/ModelSelector/index.js +1 -3
  77. package/dist/components/ModelSelector/index.js.map +2 -2
  78. package/dist/components/PromptInput.js +77 -44
  79. package/dist/components/PromptInput.js.map +2 -2
  80. package/dist/components/SensitiveFileWarning.js +12 -8
  81. package/dist/components/SensitiveFileWarning.js.map +2 -2
  82. package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
  83. package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
  84. package/dist/components/SimpleSelector/index.js +5 -0
  85. package/dist/components/SimpleSelector/index.js.map +7 -0
  86. package/dist/components/SimpleSelector/types.js +1 -0
  87. package/dist/components/SimpleSelector/types.js.map +7 -0
  88. package/dist/components/StatusOverlayContent.js +21 -0
  89. package/dist/components/StatusOverlayContent.js.map +7 -0
  90. package/dist/components/TabbedListView/ScrollableList.js +117 -0
  91. package/dist/components/TabbedListView/ScrollableList.js.map +7 -0
  92. package/dist/components/TabbedListView/SearchInput.js +23 -0
  93. package/dist/components/TabbedListView/SearchInput.js.map +7 -0
  94. package/dist/components/TabbedListView/TabBar.js +20 -0
  95. package/dist/components/TabbedListView/TabBar.js.map +7 -0
  96. package/dist/components/TabbedListView/TabbedListView.js +246 -0
  97. package/dist/components/TabbedListView/TabbedListView.js.map +7 -0
  98. package/dist/components/TabbedListView/index.js +11 -0
  99. package/dist/components/TabbedListView/index.js.map +7 -0
  100. package/dist/components/TabbedListView/types.js +1 -0
  101. package/dist/components/TabbedListView/types.js.map +7 -0
  102. package/dist/components/TodoChangeBlock.js +6 -5
  103. package/dist/components/TodoChangeBlock.js.map +3 -3
  104. package/dist/components/TodoPanel.js +6 -3
  105. package/dist/components/TodoPanel.js.map +3 -3
  106. package/dist/components/TrustDialog.js +6 -5
  107. package/dist/components/TrustDialog.js.map +2 -2
  108. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +2 -1
  109. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js.map +2 -2
  110. package/dist/constants/macros.js +1 -1
  111. package/dist/constants/macros.js.map +1 -1
  112. package/dist/constants/product.js +2 -2
  113. package/dist/constants/product.js.map +1 -1
  114. package/dist/constants/prompts.js +17 -0
  115. package/dist/constants/prompts.js.map +2 -2
  116. package/dist/constants/toolInputExamples.js +5 -1
  117. package/dist/constants/toolInputExamples.js.map +2 -2
  118. package/dist/core/backupHook.js +29 -0
  119. package/dist/core/backupHook.js.map +7 -0
  120. package/dist/core/config/defaults.js +8 -2
  121. package/dist/core/config/defaults.js.map +2 -2
  122. package/dist/core/config/schema.js +14 -2
  123. package/dist/core/config/schema.js.map +2 -2
  124. package/dist/core/costTracker.js +0 -16
  125. package/dist/core/costTracker.js.map +2 -2
  126. package/dist/core/tokenStatsManager.js +5 -0
  127. package/dist/core/tokenStatsManager.js.map +2 -2
  128. package/dist/cost-tracker.js +0 -16
  129. package/dist/cost-tracker.js.map +2 -2
  130. package/dist/entrypoints/bootstrap.js +56 -0
  131. package/dist/entrypoints/bootstrap.js.map +7 -0
  132. package/dist/entrypoints/cli.js +164 -23
  133. package/dist/entrypoints/cli.js.map +3 -3
  134. package/dist/history.js +75 -15
  135. package/dist/history.js.map +2 -2
  136. package/dist/i18n/index.js +2 -2
  137. package/dist/i18n/index.js.map +2 -2
  138. package/dist/i18n/locales/en.js +582 -1
  139. package/dist/i18n/locales/en.js.map +2 -2
  140. package/dist/i18n/locales/zh-CN.js +582 -1
  141. package/dist/i18n/locales/zh-CN.js.map +2 -2
  142. package/dist/i18n/types.js.map +1 -1
  143. package/dist/index.js +1 -1
  144. package/dist/index.js.map +2 -2
  145. package/dist/messages.js +11 -0
  146. package/dist/messages.js.map +2 -2
  147. package/dist/permissions.js.map +2 -2
  148. package/dist/query.js +9 -0
  149. package/dist/query.js.map +2 -2
  150. package/dist/screens/REPL.js +45 -7
  151. package/dist/screens/REPL.js.map +2 -2
  152. package/dist/services/customCommands.js +44 -16
  153. package/dist/services/customCommands.js.map +2 -2
  154. package/dist/services/plugins/lspServers.js +1 -1
  155. package/dist/services/plugins/lspServers.js.map +2 -2
  156. package/dist/services/plugins/pluginRuntime.js +2 -1
  157. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  158. package/dist/services/plugins/pluginValidation.js +10 -3
  159. package/dist/services/plugins/pluginValidation.js.map +2 -2
  160. package/dist/services/plugins/skillMarketplace.js +16 -8
  161. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  162. package/dist/services/systemReminder.js +17 -6
  163. package/dist/services/systemReminder.js.map +2 -2
  164. package/dist/tools/FileEditTool/FileEditTool.js +7 -0
  165. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  166. package/dist/tools/FileWriteTool/FileWriteTool.js +7 -0
  167. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  168. package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
  169. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  170. package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
  171. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  172. package/dist/tools/TaskTool/TaskTool.js +179 -1
  173. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  174. package/dist/tools/TodoWriteTool/prompt.js +21 -0
  175. package/dist/tools/TodoWriteTool/prompt.js.map +2 -2
  176. package/dist/tools/URLFetcherTool/prompt.js +14 -9
  177. package/dist/tools/URLFetcherTool/prompt.js.map +2 -2
  178. package/dist/tools/WebSearchTool/prompt.js +12 -6
  179. package/dist/tools/WebSearchTool/prompt.js.map +2 -2
  180. package/dist/types/PermissionMode.js +30 -1
  181. package/dist/types/PermissionMode.js.map +2 -2
  182. package/dist/types/plugin.js +2 -4
  183. package/dist/types/plugin.js.map +2 -2
  184. package/dist/utils/agentHookExecutor.js +103 -0
  185. package/dist/utils/agentHookExecutor.js.map +7 -0
  186. package/dist/utils/agentLoader.js +272 -32
  187. package/dist/utils/agentLoader.js.map +2 -2
  188. package/dist/utils/agentMemory.js +134 -0
  189. package/dist/utils/agentMemory.js.map +7 -0
  190. package/dist/utils/claudeCodeSync.js +439 -0
  191. package/dist/utils/claudeCodeSync.js.map +7 -0
  192. package/dist/utils/config.js +52 -24
  193. package/dist/utils/config.js.map +2 -2
  194. package/dist/utils/configPaths.js +199 -0
  195. package/dist/utils/configPaths.js.map +7 -0
  196. package/dist/utils/execFileNoThrow.js +2 -1
  197. package/dist/utils/execFileNoThrow.js.map +2 -2
  198. package/dist/utils/historyManager.js +234 -0
  199. package/dist/utils/historyManager.js.map +7 -0
  200. package/dist/utils/marketplaceManager.js +80 -43
  201. package/dist/utils/marketplaceManager.js.map +2 -2
  202. package/dist/utils/messages.js +13 -8
  203. package/dist/utils/messages.js.map +2 -2
  204. package/dist/utils/migration/index.js +37 -0
  205. package/dist/utils/migration/index.js.map +7 -0
  206. package/dist/utils/migration/migrateHistory.js +273 -0
  207. package/dist/utils/migration/migrateHistory.js.map +7 -0
  208. package/dist/utils/migration/migrateTodos.js +323 -0
  209. package/dist/utils/migration/migrateTodos.js.map +7 -0
  210. package/dist/utils/pasteCache.js +309 -0
  211. package/dist/utils/pasteCache.js.map +7 -0
  212. package/dist/utils/pluginInstaller.js +34 -24
  213. package/dist/utils/pluginInstaller.js.map +2 -2
  214. package/dist/utils/pluginLoader.js +54 -28
  215. package/dist/utils/pluginLoader.js.map +2 -2
  216. package/dist/utils/repoFetcher.js +110 -0
  217. package/dist/utils/repoFetcher.js.map +7 -0
  218. package/dist/utils/sessionIndex.js +192 -0
  219. package/dist/utils/sessionIndex.js.map +7 -0
  220. package/dist/utils/sessionTracker.js +170 -0
  221. package/dist/utils/sessionTracker.js.map +7 -0
  222. package/dist/utils/skillLoader.js +103 -5
  223. package/dist/utils/skillLoader.js.map +2 -2
  224. package/dist/utils/stats.js +417 -0
  225. package/dist/utils/stats.js.map +7 -0
  226. package/dist/utils/stringSubstitution.js +106 -0
  227. package/dist/utils/stringSubstitution.js.map +7 -0
  228. package/dist/utils/teamConfig.js +156 -14
  229. package/dist/utils/teamConfig.js.map +2 -2
  230. package/dist/utils/terminal.js +1 -1
  231. package/dist/utils/terminal.js.map +2 -2
  232. package/dist/utils/todoStorage.js +51 -19
  233. package/dist/utils/todoStorage.js.map +2 -2
  234. package/dist/utils/tooling/safeRender.js.map +2 -2
  235. package/dist/version.js +2 -2
  236. package/dist/version.js.map +1 -1
  237. package/package.json +71 -28
  238. package/scripts/{postinstall.js → postinstall.cjs} +1 -1
@@ -2,6 +2,7 @@ import { Box, Text } from "ink";
2
2
  import React from "react";
3
3
  import { TodoChangeLine } from "./TodoChangeLine.js";
4
4
  import { getTheme } from "../utils/theme.js";
5
+ import { t } from "../i18n/index.js";
5
6
  function TodoChangeBlock({
6
7
  changes,
7
8
  todos,
@@ -9,18 +10,18 @@ function TodoChangeBlock({
9
10
  }) {
10
11
  const theme = getTheme();
11
12
  const stats = {
12
- pending: todos.filter((t) => t.status === "pending").length,
13
- inProgress: todos.filter((t) => t.status === "in_progress").length,
14
- completed: todos.filter((t) => t.status === "completed").length
13
+ pending: todos.filter((t2) => t2.status === "pending").length,
14
+ inProgress: todos.filter((t2) => t2.status === "in_progress").length,
15
+ completed: todos.filter((t2) => t2.status === "completed").length
15
16
  };
16
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: indent * 2 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, { color: theme.brand }, "\u{1F527} "), /* @__PURE__ */ React.createElement(Text, null, "Updated task list")), changes.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2 }, changes.map((change, idx) => /* @__PURE__ */ React.createElement(Box, { key: `${change.todoId}-${idx}` }, /* @__PURE__ */ React.createElement(TodoChangeLine, { change })))), /* @__PURE__ */ React.createElement(
17
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: indent * 2 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, { color: theme.brand }, "\u{1F527} "), /* @__PURE__ */ React.createElement(Text, null, t("ui.todo.updatedTaskList"))), changes.length > 0 && /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginLeft: 2 }, changes.map((change, idx) => /* @__PURE__ */ React.createElement(Box, { key: `${change.todoId}-${idx}` }, /* @__PURE__ */ React.createElement(TodoChangeLine, { change })))), /* @__PURE__ */ React.createElement(
17
18
  Box,
18
19
  {
19
20
  flexDirection: "row",
20
21
  marginLeft: 2,
21
22
  marginTop: changes.length > 0 ? 1 : 0
22
23
  },
23
- /* @__PURE__ */ React.createElement(Text, { color: theme.dim }, stats.pending, " pending \xB7 ", stats.inProgress, " in progress \xB7", " ", stats.completed, " done")
24
+ /* @__PURE__ */ React.createElement(Text, { color: theme.dim }, stats.pending, " ", t("ui.todo.pending"), " \xB7 ", stats.inProgress, " ", t("ui.todo.inProgress"), " \xB7 ", stats.completed, " ", t("ui.todo.done"))
24
25
  ));
25
26
  }
26
27
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/TodoChangeBlock.tsx"],
4
- "sourcesContent": ["/**\n * TodoChangeBlock - Renders Todo changes in the conversation flow\n *\n * Displays:\n * - Tool call header \"\uD83D\uDD27 Updated task list\"\n * - Individual changes via TodoChangeLine\n * - Summary statistics (pending/in_progress/completed)\n *\n * When TodoWriteTool is called, this component shows what changed\n * in the conversation timeline, separate from the TodoPanel.\n */\n\nimport { Box, Text } from 'ink'\nimport React from 'react'\nimport type { TodoChange } from '@utils/todoChangeCalculator'\nimport type { TodoItem } from '@utils/todoStorage'\nimport { TodoChangeLine } from './TodoChangeLine'\nimport { getTheme } from '@utils/theme'\n\ninterface TodoChangeBlockProps {\n /** List of changes to display */\n changes: TodoChange[]\n /** Current complete todo list (for statistics) */\n todos: TodoItem[]\n /** Indentation level (default: 1) */\n indent?: number\n}\n\nexport function TodoChangeBlock({\n changes,\n todos,\n indent = 1,\n}: TodoChangeBlockProps) {\n const theme = getTheme()\n\n // Calculate statistics\n const stats = {\n pending: todos.filter(t => t.status === 'pending').length,\n inProgress: todos.filter(t => t.status === 'in_progress').length,\n completed: todos.filter(t => t.status === 'completed').length,\n }\n\n return (\n <Box flexDirection=\"column\" marginLeft={indent * 2}>\n {/* Tool call header */}\n <Box flexDirection=\"row\">\n <Text color={theme.brand}>\uD83D\uDD27 </Text>\n <Text>Updated task list</Text>\n </Box>\n\n {/* Changes display */}\n {changes.length > 0 && (\n <Box flexDirection=\"column\" marginLeft={2}>\n {changes.map((change, idx) => (\n <Box key={`${change.todoId}-${idx}`}>\n <TodoChangeLine change={change} />\n </Box>\n ))}\n </Box>\n )}\n\n {/* Summary statistics */}\n <Box\n flexDirection=\"row\"\n marginLeft={2}\n marginTop={changes.length > 0 ? 1 : 0}\n >\n <Text color={theme.dim}>\n {stats.pending} pending \u00B7 {stats.inProgress} in progress \u00B7{' '}\n {stats.completed} done\n </Text>\n </Box>\n </Box>\n )\n}\n"],
5
- "mappings": "AAYA,SAAS,KAAK,YAAY;AAC1B,OAAO,WAAW;AAGlB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AAWlB,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAAyB;AACvB,QAAM,QAAQ,SAAS;AAGvB,QAAM,QAAQ;AAAA,IACZ,SAAS,MAAM,OAAO,OAAK,EAAE,WAAW,SAAS,EAAE;AAAA,IACnD,YAAY,MAAM,OAAO,OAAK,EAAE,WAAW,aAAa,EAAE;AAAA,IAC1D,WAAW,MAAM,OAAO,OAAK,EAAE,WAAW,WAAW,EAAE;AAAA,EACzD;AAEA,SACE,oCAAC,OAAI,eAAc,UAAS,YAAY,SAAS,KAE/C,oCAAC,OAAI,eAAc,SACjB,oCAAC,QAAK,OAAO,MAAM,SAAO,YAAG,GAC7B,oCAAC,YAAK,mBAAiB,CACzB,GAGC,QAAQ,SAAS,KAChB,oCAAC,OAAI,eAAc,UAAS,YAAY,KACrC,QAAQ,IAAI,CAAC,QAAQ,QACpB,oCAAC,OAAI,KAAK,GAAG,OAAO,MAAM,IAAI,GAAG,MAC/B,oCAAC,kBAAe,QAAgB,CAClC,CACD,CACH,GAIF;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,YAAY;AAAA,MACZ,WAAW,QAAQ,SAAS,IAAI,IAAI;AAAA;AAAA,IAEpC,oCAAC,QAAK,OAAO,MAAM,OAChB,MAAM,SAAQ,kBAAY,MAAM,YAAW,qBAAe,KAC1D,MAAM,WAAU,OACnB;AAAA,EACF,CACF;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["/**\n * TodoChangeBlock - Renders Todo changes in the conversation flow\n *\n * Displays:\n * - Tool call header \"\uD83D\uDD27 Updated task list\"\n * - Individual changes via TodoChangeLine\n * - Summary statistics (pending/in_progress/completed)\n *\n * When TodoWriteTool is called, this component shows what changed\n * in the conversation timeline, separate from the TodoPanel.\n */\n\nimport { Box, Text } from 'ink'\nimport React from 'react'\nimport type { TodoChange } from '@utils/todoChangeCalculator'\nimport type { TodoItem } from '@utils/todoStorage'\nimport { TodoChangeLine } from './TodoChangeLine'\nimport { getTheme } from '@utils/theme'\nimport { t } from '@i18n'\n\ninterface TodoChangeBlockProps {\n /** List of changes to display */\n changes: TodoChange[]\n /** Current complete todo list (for statistics) */\n todos: TodoItem[]\n /** Indentation level (default: 1) */\n indent?: number\n}\n\nexport function TodoChangeBlock({\n changes,\n todos,\n indent = 1,\n}: TodoChangeBlockProps) {\n const theme = getTheme()\n\n // Calculate statistics\n const stats = {\n pending: todos.filter(t => t.status === 'pending').length,\n inProgress: todos.filter(t => t.status === 'in_progress').length,\n completed: todos.filter(t => t.status === 'completed').length,\n }\n\n return (\n <Box flexDirection=\"column\" marginLeft={indent * 2}>\n {/* Tool call header */}\n <Box flexDirection=\"row\">\n <Text color={theme.brand}>\uD83D\uDD27 </Text>\n <Text>{t('ui.todo.updatedTaskList')}</Text>\n </Box>\n\n {/* Changes display */}\n {changes.length > 0 && (\n <Box flexDirection=\"column\" marginLeft={2}>\n {changes.map((change, idx) => (\n <Box key={`${change.todoId}-${idx}`}>\n <TodoChangeLine change={change} />\n </Box>\n ))}\n </Box>\n )}\n\n {/* Summary statistics */}\n <Box\n flexDirection=\"row\"\n marginLeft={2}\n marginTop={changes.length > 0 ? 1 : 0}\n >\n <Text color={theme.dim}>\n {stats.pending} {t('ui.todo.pending')} \u00B7 {stats.inProgress}{' '}\n {t('ui.todo.inProgress')} \u00B7 {stats.completed} {t('ui.todo.done')}\n </Text>\n </Box>\n </Box>\n )\n}\n"],
5
+ "mappings": "AAYA,SAAS,KAAK,YAAY;AAC1B,OAAO,WAAW;AAGlB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,SAAS;AAWX,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAAyB;AACvB,QAAM,QAAQ,SAAS;AAGvB,QAAM,QAAQ;AAAA,IACZ,SAAS,MAAM,OAAO,CAAAA,OAAKA,GAAE,WAAW,SAAS,EAAE;AAAA,IACnD,YAAY,MAAM,OAAO,CAAAA,OAAKA,GAAE,WAAW,aAAa,EAAE;AAAA,IAC1D,WAAW,MAAM,OAAO,CAAAA,OAAKA,GAAE,WAAW,WAAW,EAAE;AAAA,EACzD;AAEA,SACE,oCAAC,OAAI,eAAc,UAAS,YAAY,SAAS,KAE/C,oCAAC,OAAI,eAAc,SACjB,oCAAC,QAAK,OAAO,MAAM,SAAO,YAAG,GAC7B,oCAAC,YAAM,EAAE,yBAAyB,CAAE,CACtC,GAGC,QAAQ,SAAS,KAChB,oCAAC,OAAI,eAAc,UAAS,YAAY,KACrC,QAAQ,IAAI,CAAC,QAAQ,QACpB,oCAAC,OAAI,KAAK,GAAG,OAAO,MAAM,IAAI,GAAG,MAC/B,oCAAC,kBAAe,QAAgB,CAClC,CACD,CACH,GAIF;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,YAAY;AAAA,MACZ,WAAW,QAAQ,SAAS,IAAI,IAAI;AAAA;AAAA,IAEpC,oCAAC,QAAK,OAAO,MAAM,OAChB,MAAM,SAAQ,KAAE,EAAE,iBAAiB,GAAE,UAAI,MAAM,YAAY,KAC3D,EAAE,oBAAoB,GAAE,UAAI,MAAM,WAAU,KAAE,EAAE,cAAc,CACjE;AAAA,EACF,CACF;AAEJ;",
6
+ "names": ["t"]
7
7
  }
@@ -13,6 +13,7 @@ import {
13
13
  SYMBOL_COLORS
14
14
  } from "../constants/colors.js";
15
15
  import { getIndent } from "../constants/formatRules.js";
16
+ import { t } from "../i18n/index.js";
16
17
  const SHIMMER_COLORS = [
17
18
  BRAND_GRADIENT.START,
18
19
  // #667EEA purple-blue
@@ -53,7 +54,7 @@ const SpinnerLine = memo(function SpinnerLine2({
53
54
  if (currentTaskActiveForm) {
54
55
  return currentTaskActiveForm;
55
56
  }
56
- const inProgressTodo = todos.find((t) => t.status === "in_progress");
57
+ const inProgressTodo = todos.find((t2) => t2.status === "in_progress");
57
58
  if (inProgressTodo?.activeForm) {
58
59
  return inProgressTodo.activeForm;
59
60
  }
@@ -116,11 +117,13 @@ const TodoPanel = memo(function TodoPanel2({
116
117
  const theme = getTheme();
117
118
  const fallbackMessage = useRef(sample(SPINNER_MESSAGES) || "Thinking");
118
119
  const hasTodos = todos.length > 0;
119
- const hasIncompleteTasks = todos.some((t) => t.status !== "completed");
120
+ const hasIncompleteTasks = todos.some((t2) => t2.status !== "completed");
120
121
  const shouldShowTodos = hasTodos && hasIncompleteTasks && isVisible && showTodoList;
121
122
  if (!isLoading) {
122
123
  if (shouldShowTodos) {
123
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u25CB "), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, hasIncompleteTasks ? `${todos.filter((t) => t.status !== "completed").length} tasks remaining` : "All done")), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, todos.map((todo, idx) => /* @__PURE__ */ React.createElement(React.Fragment, { key: `todo-${idx}-${todo.content.slice(0, 20)}` }, /* @__PURE__ */ React.createElement(
124
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, "\u25CB "), /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, hasIncompleteTasks ? t("ui.todo.tasksRemaining", {
125
+ count: todos.filter((todo) => todo.status !== "completed").length
126
+ }) : t("ui.todo.allDone"))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, todos.map((todo, idx) => /* @__PURE__ */ React.createElement(React.Fragment, { key: `todo-${idx}-${todo.content.slice(0, 20)}` }, /* @__PURE__ */ React.createElement(
124
127
  TodoItemClaudeStyle,
125
128
  {
126
129
  todo,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/TodoPanel.tsx"],
4
- "sourcesContent": ["import React, { useRef, useMemo, memo } from 'react'\nimport { Box, Text } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { SYMBOLS, getTodoStatusSymbol } from '@constants/symbols'\nimport { formatNumber, formatTokenUsage } from '@utils/format'\nimport type { TodoItem as TodoItemType } from '@utils/todoStorage'\nimport { sample } from 'lodash-es'\nimport { getMainStreamingState } from './Spinner'\nimport { getSessionState } from '@utils/sessionState'\nimport { useUnifiedAnimation } from '@utils/animationManager'\nimport {\n SEMANTIC_COLORS,\n BRAND_GRADIENT,\n SYMBOL_COLORS,\n} from '@constants/colors'\nimport { getIndent } from '@constants/formatRules'\n\n/**\n * Isolated Spinner component to prevent animation updates from re-rendering the entire panel\n * This component handles all animation state internally\n */\ninterface SpinnerLineProps {\n currentTaskActiveForm?: string\n todos: TodoItemType[]\n shouldShowTodos: boolean\n fallbackMessage: string\n}\n\n/**\n * Shimmer effect colors - creates a light sweep animation across text\n * Uses brand gradient colors cycling through: purple-blue \u2192 pink-purple \u2192 coral \u2192 pink-purple \u2192 purple-blue\n */\nconst SHIMMER_COLORS = [\n BRAND_GRADIENT.START, // #667EEA purple-blue\n '#8673D9', // blend\n BRAND_GRADIENT.MIDDLE, // #B668C8 pink-purple\n '#D560A0', // blend\n BRAND_GRADIENT.END, // #F5576C coral\n '#D560A0', // blend back\n BRAND_GRADIENT.MIDDLE, // #B668C8\n '#8673D9', // blend back\n] as const\n\n/**\n * Get shimmer color based on animation frame\n * Creates a smooth color transition effect\n */\nfunction getShimmerColor(frame: number): string {\n return SHIMMER_COLORS[frame % SHIMMER_COLORS.length]!\n}\n\nconst SpinnerLine = memo(function SpinnerLine({\n currentTaskActiveForm,\n todos,\n shouldShowTodos,\n fallbackMessage,\n}: SpinnerLineProps) {\n const theme = getTheme()\n const startTimeRef = useRef(Date.now())\n\n // Animation state is isolated in this component\n // Use 8 frames for shimmer effect (matching SHIMMER_COLORS length)\n const { spinnerFrame, elapsedTime } = useUnifiedAnimation({\n enabled: true,\n startTime: startTimeRef.current,\n spinnerFrameCount: SHIMMER_COLORS.length,\n componentId: 'todo-panel-spinner',\n })\n\n // Get streaming state - only updates when this component re-renders\n // Use main streaming state to avoid subagent interference\n const streamState = useMemo(() => getMainStreamingState(), [spinnerFrame])\n\n // Get current task display\n const getCurrentTaskDisplay = (): string => {\n if (currentTaskActiveForm) {\n return currentTaskActiveForm\n }\n const inProgressTodo = todos.find(t => t.status === 'in_progress')\n if (inProgressTodo?.activeForm) {\n return inProgressTodo.activeForm\n }\n switch (streamState.phase) {\n case 'tool_use':\n return streamState.toolName\n ? `Using ${streamState.toolName}`\n : 'Executing tool'\n case 'generating':\n return 'Generating response'\n case 'waiting':\n return 'Waiting for response'\n case 'thinking':\n default:\n return fallbackMessage || 'Thinking'\n }\n }\n\n // Format time display\n const formatTime = (seconds: number): string => {\n if (seconds < 60) return `${seconds}s`\n const mins = Math.floor(seconds / 60)\n const secs = seconds % 60\n return secs > 0 ? `${mins}m ${secs}s` : `${mins}m`\n }\n\n // Get shimmer color for the main text (light sweep effect)\n const shimmerColor = getShimmerColor(spinnerFrame)\n\n // Spinner icon uses thinking frames\n const spinnerIconFrame = spinnerFrame % SYMBOLS.THINKING_FRAMES.length\n\n // Get token usage from streaming state (API values or approximate from chars)\n const getTokenDisplay = () => {\n // Prefer API-provided token counts - always show bidirectional if available\n if (streamState.inputTokens || streamState.outputTokens) {\n return formatTokenUsage(streamState.inputTokens, streamState.outputTokens)\n }\n // Fallback: approximate from received characters (~3 chars per token for mixed content)\n // Only show output approximation since we don't have input char count in this path\n if (streamState.receivedChars && streamState.receivedChars > 0) {\n const approxOutputTokens = Math.round(streamState.receivedChars / 3)\n // If we have sentChars, show both directions\n if (streamState.sentChars && streamState.sentChars > 0) {\n const approxInputTokens = Math.round(streamState.sentChars / 3)\n return `\u2191 ~${formatNumber(approxInputTokens)} \u00B7 \u2193 ~${formatNumber(approxOutputTokens)}`\n }\n return `\u2193 ~${formatNumber(approxOutputTokens)}`\n }\n return ''\n }\n\n const tokenUsage = getTokenDisplay()\n\n // Get thinking duration if available\n const thinkingDuration = streamState.thinkingDurationMs\n ? Math.floor(streamState.thinkingDurationMs / 1000)\n : null\n\n return (\n <Box flexDirection=\"row\" flexWrap=\"nowrap\">\n {/* Spinner icon with shimmer effect */}\n <Text color={shimmerColor}>\n {SYMBOLS.THINKING_FRAMES[spinnerIconFrame]}{' '}\n </Text>\n {/* Main task description with shimmer effect */}\n <Text color={shimmerColor} bold>\n {getCurrentTaskDisplay()}\n </Text>\n <Text color={shimmerColor}>\u2026 </Text>\n {/* Meta info with brand gradient accent */}\n <Text color={BRAND_GRADIENT.START}>\n (<Text color={SEMANTIC_COLORS.secondary}>esc esc</Text> to cancel \u00B7{' '}\n <Text color={SEMANTIC_COLORS.secondary}>{formatTime(elapsedTime)}</Text>\n {tokenUsage && (\n <Text color={SEMANTIC_COLORS.secondary}> \u00B7 {tokenUsage}</Text>\n )}\n {thinkingDuration !== null && thinkingDuration > 0 && (\n <Text color={SEMANTIC_COLORS.secondary}>\n {' '}\n \u00B7 thinking {thinkingDuration}s\n </Text>\n )}\n {shouldShowTodos && (\n <Text color={SEMANTIC_COLORS.secondary}>\n {' '}\n \u00B7 <Text color={SEMANTIC_COLORS.secondary}>ctrl+t</Text> to hide\n </Text>\n )}\n )\n </Text>\n {getSessionState('currentError') && (\n <Text color={SYMBOL_COLORS.error}>\n {' '}\n \u00B7 {getSessionState('currentError')}\n </Text>\n )}\n </Box>\n )\n})\n\n// Spinner messages for fallback when no todos\nconst SPINNER_MESSAGES = [\n 'Thinking',\n 'Processing',\n 'Working',\n 'Computing',\n 'Analyzing',\n 'Generating',\n 'Executing',\n 'Preparing',\n]\n\ninterface TodoPanelProps {\n /** TODO \u5217\u8868 */\n todos: TodoItemType[]\n /** \u662F\u5426\u663E\u793A\u9762\u677F\uFF08\u7531 Ctrl+T \u63A7\u5236\uFF09 */\n isVisible: boolean\n /** \u5F53\u524D\u4E3B\u4EFB\u52A1\u7684 activeForm\uFF08\u8FDB\u884C\u4E2D\u7684\u4EFB\u52A1\u63CF\u8FF0\uFF09 */\n currentTaskActiveForm?: string\n /** \u8FD0\u884C\u65F6\u95F4\uFF08\u79D2\uFF09 */\n elapsedTime?: number\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D\uFF08\u63A7\u5236\u52A8\u753B\uFF09 */\n isLoading?: boolean\n /** \u662F\u5426\u663E\u793A\u4EFB\u52A1\u5217\u8868\u8BE6\u60C5 */\n showTodoList?: boolean\n}\n\n/**\n * \u7EDF\u4E00\u7684 Spinner + TODO \u9762\u677F\u7EC4\u4EF6 - Claude Code CLI \u98CE\u683C\n *\n * \u5F53\u6709 TODO \u65F6\u663E\u793A\uFF1A\n * ```\n * \u273D Fixing async tool description bug\u2026 (esc to interrupt \u00B7 ctrl+t to hide todos \u00B7 2m 52s \u00B7 \u2191 5.1k tokens)\n * \u23BF \u2610 Phase 1.1: Fix async tool description bug\n * \u2610 Phase 1.2: Add memory safety fixes\n * ```\n *\n * \u65E0 TODO \u65F6\u663E\u793A\u666E\u901A Spinner\uFF1A\n * ```\n * \u273D Thinking\u2026 (3s \u00B7 esc to interrupt)\n * ```\n *\n * Performance optimization: Animation is isolated in SpinnerLine component\n * to prevent the entire panel from re-rendering on each animation frame.\n */\nexport const TodoPanel = memo(function TodoPanel({\n todos,\n isVisible,\n currentTaskActiveForm,\n elapsedTime: initialElapsedTime = 0,\n isLoading = true,\n showTodoList = true,\n}: TodoPanelProps) {\n const theme = getTheme()\n const fallbackMessage = useRef(sample(SPINNER_MESSAGES) || 'Thinking')\n\n // \u5224\u65AD\u662F\u5426\u6709\u5F85\u529E\u4E8B\u9879\n const hasTodos = todos.length > 0\n const hasIncompleteTasks = todos.some(t => t.status !== 'completed')\n const shouldShowTodos =\n hasTodos && hasIncompleteTasks && isVisible && showTodoList\n\n // \u5982\u679C\u4E0D\u5728\u52A0\u8F7D\u72B6\u6001\uFF0C\u53EA\u663E\u793A todo \u5217\u8868\uFF08\u5982\u679C\u6709\u672A\u5B8C\u6210\u4EFB\u52A1\uFF09\n if (!isLoading) {\n // \u5373\u4F7F\u4E0D\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5982\u679C\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52A1\u4E5F\u663E\u793A\u5217\u8868\n if (shouldShowTodos) {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n {/* \u9759\u6001\u6807\u9898 - \u663E\u793A\u8FD8\u6709\u672A\u5B8C\u6210\u4EFB\u52A1 */}\n <Box flexDirection=\"row\">\n <Text color={SEMANTIC_COLORS.dim}>\u25CB </Text>\n <Text color={SEMANTIC_COLORS.dim}>\n {hasIncompleteTasks\n ? `${todos.filter(t => t.status !== 'completed').length} tasks remaining`\n : 'All done'}\n </Text>\n </Box>\n {/* TODO \u5217\u8868 */}\n <Box flexDirection=\"column\">\n {todos.map((todo, idx) => (\n <React.Fragment key={`todo-${idx}-${todo.content.slice(0, 20)}`}>\n <TodoItemClaudeStyle\n todo={todo}\n theme={theme}\n isFirst={idx === 0}\n />\n </React.Fragment>\n ))}\n </Box>\n </Box>\n )\n }\n return null\n }\n\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n {/* \u7B2C\u4E00\u884C\uFF1A\u52A8\u753B + \u5F53\u524D\u4EFB\u52A1 + \u7EDF\u8BA1\u4FE1\u606F - \u9694\u79BB\u5728 SpinnerLine \u7EC4\u4EF6\u4E2D */}\n <SpinnerLine\n currentTaskActiveForm={currentTaskActiveForm}\n todos={todos}\n shouldShowTodos={shouldShowTodos}\n fallbackMessage={fallbackMessage.current}\n />\n\n {/* TODO \u5217\u8868 - \u4EC5\u5F53\u53EF\u89C1\u4E14\u6709\u672A\u5B8C\u6210\u4EFB\u52A1\u65F6\u663E\u793A */}\n {shouldShowTodos && <TodoList todos={todos} theme={theme} />}\n </Box>\n )\n})\n\n/**\n * Memoized TODO list to prevent re-rendering when only the spinner updates\n */\ninterface TodoListProps {\n todos: TodoItemType[]\n theme: ReturnType<typeof getTheme>\n}\n\nconst TodoList = memo(function TodoList({ todos, theme }: TodoListProps) {\n return (\n <Box flexDirection=\"column\">\n {todos.map((todo, idx) => (\n <React.Fragment key={`todo-${idx}-${todo.content.slice(0, 20)}`}>\n <TodoItemClaudeStyle todo={todo} theme={theme} isFirst={idx === 0} />\n </React.Fragment>\n ))}\n </Box>\n )\n})\n\n/**\n * Claude Code \u98CE\u683C\u7684 TODO \u9879\n *\n * \u683C\u5F0F\uFF1A\n * ```\n * \u23BF \u2612 \u5DF2\u5B8C\u6210\u4EFB\u52A1 (\u7070\u8272 + \u5220\u9664\u7EBF)\n * \u2610 \u5F85\u5B8C\u6210\u4EFB\u52A1\n * ```\n */\ninterface TodoItemClaudeStyleProps {\n todo: TodoItemType\n theme: ReturnType<typeof getTheme>\n isFirst: boolean\n}\n\n/**\n * Memoized TODO item component with brand-consistent colors\n */\nconst TodoItemClaudeStyle = memo(function TodoItemClaudeStyle({\n todo,\n theme,\n isFirst,\n}: TodoItemClaudeStyleProps) {\n const isCompleted = todo.status === 'completed'\n const isInProgress = todo.status === 'in_progress'\n\n // \u7B26\u53F7\uFF1A\u2610 \u672A\u5B8C\u6210 / \u2612 \u5DF2\u5B8C\u6210\n const symbol = getTodoStatusSymbol(todo.status)\n\n // \u4F7F\u7528\u54C1\u724C\u914D\u8272\uFF1A\n // - \u5DF2\u5B8C\u6210\uFF1Adim \u7070\u8272\n // - \u8FDB\u884C\u4E2D\uFF1A\u54C1\u724C\u4E2D\u95F4\u8272\uFF08\u7C89\u7D2B\uFF09\n // - \u5F85\u5904\u7406\uFF1A\u54C1\u724C\u8D77\u59CB\u8272\uFF08\u7D2B\u84DD\uFF09\n const symbolColor = isCompleted\n ? SEMANTIC_COLORS.dim\n : isInProgress\n ? BRAND_GRADIENT.MIDDLE\n : BRAND_GRADIENT.START\n\n const textColor = isCompleted\n ? SEMANTIC_COLORS.dim\n : SEMANTIC_COLORS.secondary\n\n // \u4F7F\u7528 REPL \u89C4\u8303\u5B9A\u4E49\u7684\u7ED3\u6784\u7B26\u53F7\uFF1A\u7B2C\u4E00\u4E2A\u7528 \" \u23BF \"\uFF0C\u5176\u4ED6\u7528\u7F29\u8FDB\u5BF9\u9F50\n const indent = isFirst\n ? `${getIndent('L1')}${SYMBOLS.CHILD_OUTPUT} `\n : `${getIndent('L1')} `\n\n return (\n <Box flexDirection=\"row\">\n {/* \u7F29\u8FDB - \u4F7F\u7528\u54C1\u724C\u8272 */}\n <Text color={SYMBOL_COLORS.child}>{indent}</Text>\n\n {/* \u72B6\u6001\u7B26\u53F7 - \u4F7F\u7528\u54C1\u724C\u914D\u8272 */}\n <Text color={symbolColor}>{symbol} </Text>\n\n {/* \u4EFB\u52A1\u63CF\u8FF0 */}\n <Text color={textColor} strikethrough={isCompleted}>\n {todo.content}\n </Text>\n </Box>\n )\n})\n"],
5
- "mappings": "AAAA,OAAO,SA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,GAG1C,oCAAC,QAAK,OAAO,eAAc,QAAO,GAAC,GAGnC,oCAAC,QAAK,OAAO,WAAW,eAAe,eACpC,KAAK,OACR,CACF;AAEJ,CAAC;",
6
- "names": ["SpinnerLine", "TodoPanel", "TodoList", "TodoItemClaudeStyle"]
4
+ "sourcesContent": ["import React, { useRef, useMemo, memo } from 'react'\nimport { Box, Text } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { SYMBOLS, getTodoStatusSymbol } from '@constants/symbols'\nimport { formatNumber, formatTokenUsage } from '@utils/format'\nimport type { TodoItem as TodoItemType } from '@utils/todoStorage'\nimport { sample } from 'lodash-es'\nimport { getMainStreamingState } from './Spinner'\nimport { getSessionState } from '@utils/sessionState'\nimport { useUnifiedAnimation } from '@utils/animationManager'\nimport {\n SEMANTIC_COLORS,\n BRAND_GRADIENT,\n SYMBOL_COLORS,\n} from '@constants/colors'\nimport { getIndent } from '@constants/formatRules'\nimport { t } from '@i18n'\n\n/**\n * Isolated Spinner component to prevent animation updates from re-rendering the entire panel\n * This component handles all animation state internally\n */\ninterface SpinnerLineProps {\n currentTaskActiveForm?: string\n todos: TodoItemType[]\n shouldShowTodos: boolean\n fallbackMessage: string\n}\n\n/**\n * Shimmer effect colors - creates a light sweep animation across text\n * Uses brand gradient colors cycling through: purple-blue \u2192 pink-purple \u2192 coral \u2192 pink-purple \u2192 purple-blue\n */\nconst SHIMMER_COLORS = [\n BRAND_GRADIENT.START, // #667EEA purple-blue\n '#8673D9', // blend\n BRAND_GRADIENT.MIDDLE, // #B668C8 pink-purple\n '#D560A0', // blend\n BRAND_GRADIENT.END, // #F5576C coral\n '#D560A0', // blend back\n BRAND_GRADIENT.MIDDLE, // #B668C8\n '#8673D9', // blend back\n] as const\n\n/**\n * Get shimmer color based on animation frame\n * Creates a smooth color transition effect\n */\nfunction getShimmerColor(frame: number): string {\n return SHIMMER_COLORS[frame % SHIMMER_COLORS.length]!\n}\n\nconst SpinnerLine = memo(function SpinnerLine({\n currentTaskActiveForm,\n todos,\n shouldShowTodos,\n fallbackMessage,\n}: SpinnerLineProps) {\n const theme = getTheme()\n const startTimeRef = useRef(Date.now())\n\n // Animation state is isolated in this component\n // Use 8 frames for shimmer effect (matching SHIMMER_COLORS length)\n const { spinnerFrame, elapsedTime } = useUnifiedAnimation({\n enabled: true,\n startTime: startTimeRef.current,\n spinnerFrameCount: SHIMMER_COLORS.length,\n componentId: 'todo-panel-spinner',\n })\n\n // Get streaming state - only updates when this component re-renders\n // Use main streaming state to avoid subagent interference\n const streamState = useMemo(() => getMainStreamingState(), [spinnerFrame])\n\n // Get current task display\n const getCurrentTaskDisplay = (): string => {\n if (currentTaskActiveForm) {\n return currentTaskActiveForm\n }\n const inProgressTodo = todos.find(t => t.status === 'in_progress')\n if (inProgressTodo?.activeForm) {\n return inProgressTodo.activeForm\n }\n switch (streamState.phase) {\n case 'tool_use':\n return streamState.toolName\n ? `Using ${streamState.toolName}`\n : 'Executing tool'\n case 'generating':\n return 'Generating response'\n case 'waiting':\n return 'Waiting for response'\n case 'thinking':\n default:\n return fallbackMessage || 'Thinking'\n }\n }\n\n // Format time display\n const formatTime = (seconds: number): string => {\n if (seconds < 60) return `${seconds}s`\n const mins = Math.floor(seconds / 60)\n const secs = seconds % 60\n return secs > 0 ? `${mins}m ${secs}s` : `${mins}m`\n }\n\n // Get shimmer color for the main text (light sweep effect)\n const shimmerColor = getShimmerColor(spinnerFrame)\n\n // Spinner icon uses thinking frames\n const spinnerIconFrame = spinnerFrame % SYMBOLS.THINKING_FRAMES.length\n\n // Get token usage from streaming state (API values or approximate from chars)\n const getTokenDisplay = () => {\n // Prefer API-provided token counts - always show bidirectional if available\n if (streamState.inputTokens || streamState.outputTokens) {\n return formatTokenUsage(streamState.inputTokens, streamState.outputTokens)\n }\n // Fallback: approximate from received characters (~3 chars per token for mixed content)\n // Only show output approximation since we don't have input char count in this path\n if (streamState.receivedChars && streamState.receivedChars > 0) {\n const approxOutputTokens = Math.round(streamState.receivedChars / 3)\n // If we have sentChars, show both directions\n if (streamState.sentChars && streamState.sentChars > 0) {\n const approxInputTokens = Math.round(streamState.sentChars / 3)\n return `\u2191 ~${formatNumber(approxInputTokens)} \u00B7 \u2193 ~${formatNumber(approxOutputTokens)}`\n }\n return `\u2193 ~${formatNumber(approxOutputTokens)}`\n }\n return ''\n }\n\n const tokenUsage = getTokenDisplay()\n\n // Get thinking duration if available\n const thinkingDuration = streamState.thinkingDurationMs\n ? Math.floor(streamState.thinkingDurationMs / 1000)\n : null\n\n return (\n <Box flexDirection=\"row\" flexWrap=\"nowrap\">\n {/* Spinner icon with shimmer effect */}\n <Text color={shimmerColor}>\n {SYMBOLS.THINKING_FRAMES[spinnerIconFrame]}{' '}\n </Text>\n {/* Main task description with shimmer effect */}\n <Text color={shimmerColor} bold>\n {getCurrentTaskDisplay()}\n </Text>\n <Text color={shimmerColor}>\u2026 </Text>\n {/* Meta info with brand gradient accent */}\n <Text color={BRAND_GRADIENT.START}>\n (<Text color={SEMANTIC_COLORS.secondary}>esc esc</Text> to cancel \u00B7{' '}\n <Text color={SEMANTIC_COLORS.secondary}>{formatTime(elapsedTime)}</Text>\n {tokenUsage && (\n <Text color={SEMANTIC_COLORS.secondary}> \u00B7 {tokenUsage}</Text>\n )}\n {thinkingDuration !== null && thinkingDuration > 0 && (\n <Text color={SEMANTIC_COLORS.secondary}>\n {' '}\n \u00B7 thinking {thinkingDuration}s\n </Text>\n )}\n {shouldShowTodos && (\n <Text color={SEMANTIC_COLORS.secondary}>\n {' '}\n \u00B7 <Text color={SEMANTIC_COLORS.secondary}>ctrl+t</Text> to hide\n </Text>\n )}\n )\n </Text>\n {getSessionState('currentError') && (\n <Text color={SYMBOL_COLORS.error}>\n {' '}\n \u00B7 {getSessionState('currentError')}\n </Text>\n )}\n </Box>\n )\n})\n\n// Spinner messages for fallback when no todos\nconst SPINNER_MESSAGES = [\n 'Thinking',\n 'Processing',\n 'Working',\n 'Computing',\n 'Analyzing',\n 'Generating',\n 'Executing',\n 'Preparing',\n]\n\ninterface TodoPanelProps {\n /** TODO \u5217\u8868 */\n todos: TodoItemType[]\n /** \u662F\u5426\u663E\u793A\u9762\u677F\uFF08\u7531 Ctrl+T \u63A7\u5236\uFF09 */\n isVisible: boolean\n /** \u5F53\u524D\u4E3B\u4EFB\u52A1\u7684 activeForm\uFF08\u8FDB\u884C\u4E2D\u7684\u4EFB\u52A1\u63CF\u8FF0\uFF09 */\n currentTaskActiveForm?: string\n /** \u8FD0\u884C\u65F6\u95F4\uFF08\u79D2\uFF09 */\n elapsedTime?: number\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D\uFF08\u63A7\u5236\u52A8\u753B\uFF09 */\n isLoading?: boolean\n /** \u662F\u5426\u663E\u793A\u4EFB\u52A1\u5217\u8868\u8BE6\u60C5 */\n showTodoList?: boolean\n}\n\n/**\n * \u7EDF\u4E00\u7684 Spinner + TODO \u9762\u677F\u7EC4\u4EF6 - Claude Code CLI \u98CE\u683C\n *\n * \u5F53\u6709 TODO \u65F6\u663E\u793A\uFF1A\n * ```\n * \u273D Fixing async tool description bug\u2026 (esc to interrupt \u00B7 ctrl+t to hide todos \u00B7 2m 52s \u00B7 \u2191 5.1k tokens)\n * \u23BF \u2610 Phase 1.1: Fix async tool description bug\n * \u2610 Phase 1.2: Add memory safety fixes\n * ```\n *\n * \u65E0 TODO \u65F6\u663E\u793A\u666E\u901A Spinner\uFF1A\n * ```\n * \u273D Thinking\u2026 (3s \u00B7 esc to interrupt)\n * ```\n *\n * Performance optimization: Animation is isolated in SpinnerLine component\n * to prevent the entire panel from re-rendering on each animation frame.\n */\nexport const TodoPanel = memo(function TodoPanel({\n todos,\n isVisible,\n currentTaskActiveForm,\n elapsedTime: initialElapsedTime = 0,\n isLoading = true,\n showTodoList = true,\n}: TodoPanelProps) {\n const theme = getTheme()\n const fallbackMessage = useRef(sample(SPINNER_MESSAGES) || 'Thinking')\n\n // \u5224\u65AD\u662F\u5426\u6709\u5F85\u529E\u4E8B\u9879\n const hasTodos = todos.length > 0\n const hasIncompleteTasks = todos.some(t => t.status !== 'completed')\n const shouldShowTodos =\n hasTodos && hasIncompleteTasks && isVisible && showTodoList\n\n // \u5982\u679C\u4E0D\u5728\u52A0\u8F7D\u72B6\u6001\uFF0C\u53EA\u663E\u793A todo \u5217\u8868\uFF08\u5982\u679C\u6709\u672A\u5B8C\u6210\u4EFB\u52A1\uFF09\n if (!isLoading) {\n // \u5373\u4F7F\u4E0D\u5728\u52A0\u8F7D\u4E2D\uFF0C\u5982\u679C\u6709\u672A\u5B8C\u6210\u7684\u4EFB\u52A1\u4E5F\u663E\u793A\u5217\u8868\n if (shouldShowTodos) {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n {/* \u9759\u6001\u6807\u9898 - \u663E\u793A\u8FD8\u6709\u672A\u5B8C\u6210\u4EFB\u52A1 */}\n <Box flexDirection=\"row\">\n <Text color={SEMANTIC_COLORS.dim}>\u25CB </Text>\n <Text color={SEMANTIC_COLORS.dim}>\n {hasIncompleteTasks\n ? t('ui.todo.tasksRemaining', {\n count: todos.filter(todo => todo.status !== 'completed')\n .length,\n })\n : t('ui.todo.allDone')}\n </Text>\n </Box>\n {/* TODO \u5217\u8868 */}\n <Box flexDirection=\"column\">\n {todos.map((todo, idx) => (\n <React.Fragment key={`todo-${idx}-${todo.content.slice(0, 20)}`}>\n <TodoItemClaudeStyle\n todo={todo}\n theme={theme}\n isFirst={idx === 0}\n />\n </React.Fragment>\n ))}\n </Box>\n </Box>\n )\n }\n return null\n }\n\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n {/* \u7B2C\u4E00\u884C\uFF1A\u52A8\u753B + \u5F53\u524D\u4EFB\u52A1 + \u7EDF\u8BA1\u4FE1\u606F - \u9694\u79BB\u5728 SpinnerLine \u7EC4\u4EF6\u4E2D */}\n <SpinnerLine\n currentTaskActiveForm={currentTaskActiveForm}\n todos={todos}\n shouldShowTodos={shouldShowTodos}\n fallbackMessage={fallbackMessage.current}\n />\n\n {/* TODO \u5217\u8868 - \u4EC5\u5F53\u53EF\u89C1\u4E14\u6709\u672A\u5B8C\u6210\u4EFB\u52A1\u65F6\u663E\u793A */}\n {shouldShowTodos && <TodoList todos={todos} theme={theme} />}\n </Box>\n )\n})\n\n/**\n * Memoized TODO list to prevent re-rendering when only the spinner updates\n */\ninterface TodoListProps {\n todos: TodoItemType[]\n theme: ReturnType<typeof getTheme>\n}\n\nconst TodoList = memo(function TodoList({ todos, theme }: TodoListProps) {\n return (\n <Box flexDirection=\"column\">\n {todos.map((todo, idx) => (\n <React.Fragment key={`todo-${idx}-${todo.content.slice(0, 20)}`}>\n <TodoItemClaudeStyle todo={todo} theme={theme} isFirst={idx === 0} />\n </React.Fragment>\n ))}\n </Box>\n )\n})\n\n/**\n * Claude Code \u98CE\u683C\u7684 TODO \u9879\n *\n * \u683C\u5F0F\uFF1A\n * ```\n * \u23BF \u2612 \u5DF2\u5B8C\u6210\u4EFB\u52A1 (\u7070\u8272 + \u5220\u9664\u7EBF)\n * \u2610 \u5F85\u5B8C\u6210\u4EFB\u52A1\n * ```\n */\ninterface TodoItemClaudeStyleProps {\n todo: TodoItemType\n theme: ReturnType<typeof getTheme>\n isFirst: boolean\n}\n\n/**\n * Memoized TODO item component with brand-consistent colors\n */\nconst TodoItemClaudeStyle = memo(function TodoItemClaudeStyle({\n todo,\n theme,\n isFirst,\n}: TodoItemClaudeStyleProps) {\n const isCompleted = todo.status === 'completed'\n const isInProgress = todo.status === 'in_progress'\n\n // \u7B26\u53F7\uFF1A\u2610 \u672A\u5B8C\u6210 / \u2612 \u5DF2\u5B8C\u6210\n const symbol = getTodoStatusSymbol(todo.status)\n\n // \u4F7F\u7528\u54C1\u724C\u914D\u8272\uFF1A\n // - \u5DF2\u5B8C\u6210\uFF1Adim \u7070\u8272\n // - \u8FDB\u884C\u4E2D\uFF1A\u54C1\u724C\u4E2D\u95F4\u8272\uFF08\u7C89\u7D2B\uFF09\n // - \u5F85\u5904\u7406\uFF1A\u54C1\u724C\u8D77\u59CB\u8272\uFF08\u7D2B\u84DD\uFF09\n const symbolColor = isCompleted\n ? SEMANTIC_COLORS.dim\n : isInProgress\n ? BRAND_GRADIENT.MIDDLE\n : BRAND_GRADIENT.START\n\n const textColor = isCompleted\n ? SEMANTIC_COLORS.dim\n : SEMANTIC_COLORS.secondary\n\n // \u4F7F\u7528 REPL \u89C4\u8303\u5B9A\u4E49\u7684\u7ED3\u6784\u7B26\u53F7\uFF1A\u7B2C\u4E00\u4E2A\u7528 \" \u23BF \"\uFF0C\u5176\u4ED6\u7528\u7F29\u8FDB\u5BF9\u9F50\n const indent = isFirst\n ? `${getIndent('L1')}${SYMBOLS.CHILD_OUTPUT} `\n : `${getIndent('L1')} `\n\n return (\n <Box flexDirection=\"row\">\n {/* \u7F29\u8FDB - \u4F7F\u7528\u54C1\u724C\u8272 */}\n <Text color={SYMBOL_COLORS.child}>{indent}</Text>\n\n {/* \u72B6\u6001\u7B26\u53F7 - \u4F7F\u7528\u54C1\u724C\u914D\u8272 */}\n <Text color={symbolColor}>{symbol} </Text>\n\n {/* \u4EFB\u52A1\u63CF\u8FF0 */}\n <Text color={textColor} strikethrough={isCompleted}>\n {todo.content}\n </Text>\n </Box>\n )\n})\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,QAAQ,SAAS,YAAY;AAC7C,SAAS,KAAK,YAAY;AAC1B,SAAS,gBAAgB;AACzB,SAAS,SAAS,2BAA2B;AAC7C,SAAS,cAAc,wBAAwB;AAE/C,SAAS,cAAc;AACvB,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAiBlB,MAAM,iBAAiB;AAAA,EACrB,eAAe;AAAA;AAAA,EACf;AAAA;AAAA,EACA,eAAe;AAAA;AAAA,EACf;AAAA;AAAA,EACA,eAAe;AAAA;AAAA,EACf;AAAA;AAAA,EACA,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AAAA,MACA,iBAAiB,gBAAgB;AAAA;AAAA,EACnC,GAGC,mBAAmB,oCAAC,YAAS,OAAc,OAAc,CAC5D;AAEJ,CAAC;AAUD,MAAM,WAAW,KAAK,SAASE,UAAS,EAAE,OAAO,MAAM,GAAkB;AACvE,SACE,oCAAC,OAAI,eAAc,YAChB,MAAM,IAAI,CAAC,MAAM,QAChB,oCAAC,MAAM,UAAN,EAAe,KAAK,QAAQ,GAAG,IAAI,KAAK,QAAQ,MAAM,GAAG,EAAE,CAAC,MAC3D,oCAAC,uBAAoB,MAAY,OAAc,SAAS,QAAQ,GAAG,CACrE,CACD,CACH;AAEJ,CAAC;AAoBD,MAAM,sBAAsB,KAAK,SAASC,qBAAoB;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAC3B,QAAM,cAAc,KAAK,WAAW;AACpC,QAAM,eAAe,KAAK,WAAW;AAGrC,QAAM,SAAS,oBAAoB,KAAK,MAAM;AAM9C,QAAM,cAAc,cAChB,gBAAgB,MAChB,eACE,eAAe,SACf,eAAe;AAErB,QAAM,YAAY,cACd,gBAAgB,MAChB,gBAAgB;AAGpB,QAAM,SAAS,UACX,GAAG,UAAU,IAAI,CAAC,GAAG,QAAQ,YAAY,OACzC,GAAG,UAAU,IAAI,CAAC;AAEtB,SACE,oCAAC,OAAI,eAAc,SAEjB,oCAAC,QAAK,OAAO,cAAc,SAAQ,MAAO,GAG1C,oCAAC,QAAK,OAAO,eAAc,QAAO,GAAC,GAGnC,oCAAC,QAAK,OAAO,WAAW,eAAe,eACpC,KAAK,OACR,CACF;AAEJ,CAAC;",
6
+ "names": ["SpinnerLine", "t", "TodoPanel", "TodoList", "TodoItemClaudeStyle"]
7
7
  }
@@ -11,6 +11,7 @@ import { useExitOnCtrlCD } from "../hooks/useExitOnCtrlCD.js";
11
11
  import { homedir } from "os";
12
12
  import { getCwd } from "../utils/state.js";
13
13
  import { SEMANTIC_COLORS } from "../constants/colors.js";
14
+ import { t } from "../i18n/index.js";
14
15
  function TrustDialog({ onDone }) {
15
16
  const theme = getTheme();
16
17
  React.useEffect(() => {
@@ -51,20 +52,20 @@ function TrustDialog({ onDone }) {
51
52
  borderStyle: "round",
52
53
  borderColor: theme.warning
53
54
  },
54
- /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.warning }, "Do you trust the files in this folder?"),
55
+ /* @__PURE__ */ React.createElement(Text, { bold: true, color: theme.warning }, t("dialog.trustTitle")),
55
56
  /* @__PURE__ */ React.createElement(Text, { bold: true }, process.cwd()),
56
- /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React.createElement(Text, null, PRODUCT_NAME, " may read files in this folder. Reading untrusted files may lead to ", PRODUCT_NAME, " to behave in an unexpected ways."), /* @__PURE__ */ React.createElement(Text, null, "With your permission ", PRODUCT_NAME, " may execute files in this folder. Executing untrusted code is unsafe.")),
57
+ /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React.createElement(Text, null, t("dialog.trustWarning1", { product: PRODUCT_NAME })), /* @__PURE__ */ React.createElement(Text, null, t("dialog.trustWarning2", { product: PRODUCT_NAME }))),
57
58
  /* @__PURE__ */ React.createElement(
58
59
  Select,
59
60
  {
60
61
  options: [
61
- { label: "Yes, proceed", value: "yes" },
62
- { label: "No, exit", value: "no" }
62
+ { label: t("dialog.yesProceed"), value: "yes" },
63
+ { label: t("dialog.noExit"), value: "no" }
63
64
  ],
64
65
  onChange: (value) => onChange(value)
65
66
  }
66
67
  )
67
- ), /* @__PURE__ */ React.createElement(Box, { marginLeft: 3 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, exitState.pending ? /* @__PURE__ */ React.createElement(React.Fragment, null, "Press ", exitState.keyName, " again to exit") : /* @__PURE__ */ React.createElement(React.Fragment, null, "Enter to confirm \xB7 Esc to exit"))));
68
+ ), /* @__PURE__ */ React.createElement(Box, { marginLeft: 3 }, /* @__PURE__ */ React.createElement(Text, { color: SEMANTIC_COLORS.dim }, exitState.pending ? /* @__PURE__ */ React.createElement(React.Fragment, null, t("prompts.pressCtrlDAgain")) : /* @__PURE__ */ React.createElement(React.Fragment, null, t("dialog.confirmExitPrompt")))));
68
69
  }
69
70
  export {
70
71
  TrustDialog
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/TrustDialog.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { Select } from './CustomSelect/select'\nimport {\n saveCurrentProjectConfig,\n getCurrentProjectConfig,\n} from '@utils/config'\nimport { PRODUCT_NAME } from '@constants/product'\nimport { useExitOnCtrlCD } from '@hooks/useExitOnCtrlCD'\nimport { homedir } from 'os'\nimport { getCwd } from '@utils/state'\nimport Link from './Link'\nimport { SEMANTIC_COLORS } from '@constants/colors'\n\ntype Props = {\n onDone(): void\n}\n\nexport function TrustDialog({ onDone }: Props): React.ReactNode {\n const theme = getTheme()\n React.useEffect(() => {}, [])\n\n function onChange(value: 'yes' | 'no') {\n const config = getCurrentProjectConfig()\n switch (value) {\n case 'yes': {\n const isHomeDir = homedir() === getCwd()\n\n if (!isHomeDir) {\n saveCurrentProjectConfig({\n ...config,\n hasTrustDialogAccepted: true,\n })\n }\n onDone()\n break\n }\n case 'no': {\n process.exit(1)\n break\n }\n }\n }\n\n const exitState = useExitOnCtrlCD(() => process.exit(0))\n\n useInput((_input, key) => {\n if (key.escape) {\n process.exit(0)\n return\n }\n })\n\n return (\n <>\n <Box\n flexDirection=\"column\"\n gap={1}\n padding={1}\n borderStyle=\"round\"\n borderColor={theme.warning}\n >\n <Text bold color={theme.warning}>\n Do you trust the files in this folder?\n </Text>\n <Text bold>{process.cwd()}</Text>\n\n <Box flexDirection=\"column\" gap={1}>\n <Text>\n {PRODUCT_NAME} may read files in this folder. Reading untrusted\n files may lead to {PRODUCT_NAME} to behave in an unexpected ways.\n </Text>\n <Text>\n With your permission {PRODUCT_NAME} may execute files in this\n folder. Executing untrusted code is unsafe.\n </Text>\n </Box>\n\n <Select\n options={[\n { label: 'Yes, proceed', value: 'yes' },\n { label: 'No, exit', value: 'no' },\n ]}\n onChange={value => onChange(value as 'yes' | 'no')}\n />\n </Box>\n <Box marginLeft={3}>\n <Text color={SEMANTIC_COLORS.dim}>\n {exitState.pending ? (\n <>Press {exitState.keyName} again to exit</>\n ) : (\n <>Enter to confirm \u00B7 Esc to exit</>\n )}\n </Text>\n </Box>\n </>\n )\n}\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,MAAM,gBAAgB;AACpC,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AACxB,SAAS,cAAc;AAEvB,SAAS,uBAAuB;AAMzB,SAAS,YAAY,EAAE,OAAO,GAA2B;AAC9D,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,MAAM;AAAA,EAAC,GAAG,CAAC,CAAC;AAE5B,WAAS,SAAS,OAAqB;AACrC,UAAM,SAAS,wBAAwB;AACvC,YAAQ,OAAO;AAAA,MACb,KAAK,OAAO;AACV,cAAM,YAAY,QAAQ,MAAM,OAAO;AAEvC,YAAI,CAAC,WAAW;AACd,mCAAyB;AAAA,YACvB,GAAG;AAAA,YACH,wBAAwB;AAAA,UAC1B,CAAC;AAAA,QACH;AACA,eAAO;AACP;AAAA,MACF;AAAA,MACA,KAAK,MAAM;AACT,gBAAQ,KAAK,CAAC;AACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,YAAY,gBAAgB,MAAM,QAAQ,KAAK,CAAC,CAAC;AAEvD,WAAS,CAAC,QAAQ,QAAQ;AACxB,QAAI,IAAI,QAAQ;AACd,cAAQ,KAAK,CAAC;AACd;AAAA,IACF;AAAA,EACF,CAAC;AAED,SACE,0DACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,KAAK;AAAA,MACL,SAAS;AAAA,MACT,aAAY;AAAA,MACZ,aAAa,MAAM;AAAA;AAAA,IAEnB,oCAAC,QAAK,MAAI,MAAC,OAAO,MAAM,WAAS,wCAEjC;AAAA,IACA,oCAAC,QAAK,MAAI,QAAE,QAAQ,IAAI,CAAE;AAAA,IAE1B,oCAAC,OAAI,eAAc,UAAS,KAAK,KAC/B,oCAAC,YACE,cAAa,wEACK,cAAa,mCAClC,GACA,oCAAC,YAAK,yBACkB,cAAa,wEAErC,CACF;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,UACP,EAAE,OAAO,gBAAgB,OAAO,MAAM;AAAA,UACtC,EAAE,OAAO,YAAY,OAAO,KAAK;AAAA,QACnC;AAAA,QACA,UAAU,WAAS,SAAS,KAAqB;AAAA;AAAA,IACnD;AAAA,EACF,GACA,oCAAC,OAAI,YAAY,KACf,oCAAC,QAAK,OAAO,gBAAgB,OAC1B,UAAU,UACT,0DAAE,UAAO,UAAU,SAAQ,gBAAc,IAEzC,0DAAE,mCAA8B,CAEpC,CACF,CACF;AAEJ;",
4
+ "sourcesContent": ["import React from 'react'\nimport { Box, Text, useInput } from 'ink'\nimport { getTheme } from '@utils/theme'\nimport { Select } from './CustomSelect/select'\nimport {\n saveCurrentProjectConfig,\n getCurrentProjectConfig,\n} from '@utils/config'\nimport { PRODUCT_NAME } from '@constants/product'\nimport { useExitOnCtrlCD } from '@hooks/useExitOnCtrlCD'\nimport { homedir } from 'os'\nimport { getCwd } from '@utils/state'\nimport Link from './Link'\nimport { SEMANTIC_COLORS } from '@constants/colors'\nimport { t } from '@i18n'\n\ntype Props = {\n onDone(): void\n}\n\nexport function TrustDialog({ onDone }: Props): React.ReactNode {\n const theme = getTheme()\n React.useEffect(() => {}, [])\n\n function onChange(value: 'yes' | 'no') {\n const config = getCurrentProjectConfig()\n switch (value) {\n case 'yes': {\n const isHomeDir = homedir() === getCwd()\n\n if (!isHomeDir) {\n saveCurrentProjectConfig({\n ...config,\n hasTrustDialogAccepted: true,\n })\n }\n onDone()\n break\n }\n case 'no': {\n process.exit(1)\n break\n }\n }\n }\n\n const exitState = useExitOnCtrlCD(() => process.exit(0))\n\n useInput((_input, key) => {\n if (key.escape) {\n process.exit(0)\n return\n }\n })\n\n return (\n <>\n <Box\n flexDirection=\"column\"\n gap={1}\n padding={1}\n borderStyle=\"round\"\n borderColor={theme.warning}\n >\n <Text bold color={theme.warning}>\n {t('dialog.trustTitle')}\n </Text>\n <Text bold>{process.cwd()}</Text>\n\n <Box flexDirection=\"column\" gap={1}>\n <Text>{t('dialog.trustWarning1', { product: PRODUCT_NAME })}</Text>\n <Text>{t('dialog.trustWarning2', { product: PRODUCT_NAME })}</Text>\n </Box>\n\n <Select\n options={[\n { label: t('dialog.yesProceed'), value: 'yes' },\n { label: t('dialog.noExit'), value: 'no' },\n ]}\n onChange={value => onChange(value as 'yes' | 'no')}\n />\n </Box>\n <Box marginLeft={3}>\n <Text color={SEMANTIC_COLORS.dim}>\n {exitState.pending ? (\n <>{t('prompts.pressCtrlDAgain')}</>\n ) : (\n <>{t('dialog.confirmExitPrompt')}</>\n )}\n </Text>\n </Box>\n </>\n )\n}\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,KAAK,MAAM,gBAAgB;AACpC,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AACxB,SAAS,cAAc;AAEvB,SAAS,uBAAuB;AAChC,SAAS,SAAS;AAMX,SAAS,YAAY,EAAE,OAAO,GAA2B;AAC9D,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,MAAM;AAAA,EAAC,GAAG,CAAC,CAAC;AAE5B,WAAS,SAAS,OAAqB;AACrC,UAAM,SAAS,wBAAwB;AACvC,YAAQ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B,CAAE,IAEhC,0DAAG,EAAE,0BAA0B,CAAE,CAErC,CACF,CACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,9 @@
1
1
  import { Text } from "ink";
2
2
  import * as React from "react";
3
3
  import { getTheme } from "../../../utils/theme.js";
4
+ import { t } from "../../../i18n/index.js";
4
5
  function UserToolCanceledMessage() {
5
- return /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React.createElement(Text, { color: getTheme().error }, "Interrupted by user"));
6
+ return /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React.createElement(Text, { color: getTheme().error }, t("prompts.interruptedByUser")));
6
7
  }
7
8
  export {
8
9
  UserToolCanceledMessage
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx"],
4
- "sourcesContent": ["import { Text } from 'ink'\nimport * as React from 'react'\nimport { getTheme } from '@utils/theme'\n\nexport function UserToolCanceledMessage(): React.ReactNode {\n return (\n <Text>\n &nbsp;&nbsp;\u23BF &nbsp;\n <Text color={getTheme().error}>Interrupted by user</Text>\n </Text>\n )\n}\n"],
5
- "mappings": "AAAA,SAAS,YAAY;AACrB,YAAY,WAAW;AACvB,SAAS,gBAAgB;AAElB,SAAS,0BAA2C;AACzD,SACE,oCAAC,YAAK,uBAEJ,oCAAC,QAAK,OAAO,SAAS,EAAE,SAAO,qBAAmB,CACpD;AAEJ;",
4
+ "sourcesContent": ["import { Text } from 'ink'\nimport * as React from 'react'\nimport { getTheme } from '@utils/theme'\nimport { t } from '@i18n'\n\nexport function UserToolCanceledMessage(): React.ReactNode {\n return (\n <Text>\n &nbsp;&nbsp;\u23BF &nbsp;\n <Text color={getTheme().error}>{t('prompts.interruptedByUser')}</Text>\n </Text>\n )\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY;AACrB,YAAY,WAAW;AACvB,SAAS,gBAAgB;AACzB,SAAS,SAAS;AAEX,SAAS,0BAA2C;AACzD,SACE,oCAAC,YAAK,uBAEJ,oCAAC,QAAK,OAAO,SAAS,EAAE,SAAQ,EAAE,2BAA2B,CAAE,CACjE;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { VERSION } from "../version.js";
2
2
  const MACRO = {
3
3
  VERSION,
4
- README_URL: "https://within-7.com/minto#readme",
4
+ README_URL: "https://minto.within-7.com/",
5
5
  PACKAGE_URL: "@within-7/minto",
6
6
  ISSUES_EXPLAINER: "report the issue to within-7 team"
7
7
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/macros.ts"],
4
- "sourcesContent": ["import { VERSION } from '../version.js'\n\nexport const MACRO = {\n VERSION: VERSION,\n README_URL: 'https://within-7.com/minto#readme',\n PACKAGE_URL: '@within-7/minto',\n ISSUES_EXPLAINER: 'report the issue to within-7 team',\n}\n"],
4
+ "sourcesContent": ["import { VERSION } from '../version.js'\n\nexport const MACRO = {\n VERSION: VERSION,\n README_URL: 'https://minto.within-7.com/',\n PACKAGE_URL: '@within-7/minto',\n ISSUES_EXPLAINER: 'report the issue to within-7 team',\n}\n"],
5
5
  "mappings": "AAAA,SAAS,eAAe;AAEjB,MAAM,QAAQ;AAAA,EACnB;AAAA,EACA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB;AACpB;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,10 @@
1
1
  const PRODUCT_NAME = "Minto";
2
- const PRODUCT_URL = "https://within-7.com/minto";
2
+ const PRODUCT_URL = "https://minto.within-7.com/";
3
3
  const PROJECT_FILE = "MINTO.md";
4
4
  const PRODUCT_COMMAND = "minto";
5
5
  const CONFIG_BASE_DIR = ".minto";
6
6
  const CONFIG_FILE = ".minto.json";
7
- const GITHUB_ISSUES_REPO_URL = "https://within-7.com/minto/issues";
7
+ const GITHUB_ISSUES_REPO_URL = "https://github.com/within-7/minto/issues";
8
8
  const ASCII_LOGO = `
9
9
  \u2588\u2588\u2588\u2557\u2591\u2591\u2591\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557\u2591\u2591\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2588\u2557\u2591
10
10
  \u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/product.ts"],
4
- "sourcesContent": ["export const PRODUCT_NAME = 'Minto'\nexport const PRODUCT_URL = 'https://within-7.com/minto'\nexport const PROJECT_FILE = 'MINTO.md'\nexport const PRODUCT_COMMAND = 'minto'\nexport const CONFIG_BASE_DIR = '.minto'\nexport const CONFIG_FILE = '.minto.json'\nexport const GITHUB_ISSUES_REPO_URL = 'https://within-7.com/minto/issues'\n\nexport const ASCII_LOGO = `\n\u2588\u2588\u2588\u2557\u2591\u2591\u2591\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557\u2591\u2591\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2588\u2557\u2591\n\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2588\u2588\u2551\n\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2588\u2588\u2551\n\u2588\u2588\u2551\u2591\u255A\u2550\u255D\u2591\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u2591\u255A\u2588\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D\n\u255A\u2550\u255D\u2591\u2591\u2591\u2591\u2591\u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D\u2591\u2591\u255A\u2550\u2550\u255D\u2591\u2591\u2591\u255A\u2550\u255D\u2591\u2591\u2591\u2591\u255A\u2550\u2550\u2550\u2550\u255D\u2591\n`\n"],
4
+ "sourcesContent": ["export const PRODUCT_NAME = 'Minto'\nexport const PRODUCT_URL = 'https://minto.within-7.com/'\nexport const PROJECT_FILE = 'MINTO.md'\nexport const PRODUCT_COMMAND = 'minto'\nexport const CONFIG_BASE_DIR = '.minto'\nexport const CONFIG_FILE = '.minto.json'\nexport const GITHUB_ISSUES_REPO_URL = 'https://github.com/within-7/minto/issues'\n\nexport const ASCII_LOGO = `\n\u2588\u2588\u2588\u2557\u2591\u2591\u2591\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557\u2591\u2591\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2588\u2557\u2591\n\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557\u2591\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2588\u2588\u2551\n\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2588\u2588\u2551\n\u2588\u2588\u2551\u2591\u255A\u2550\u255D\u2591\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2551\u2591\u255A\u2588\u2588\u2588\u2551\u2591\u2591\u2591\u2588\u2588\u2551\u2591\u2591\u2591\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D\n\u255A\u2550\u255D\u2591\u2591\u2591\u2591\u2591\u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u255D\u2591\u2591\u255A\u2550\u2550\u255D\u2591\u2591\u2591\u255A\u2550\u255D\u2591\u2591\u2591\u2591\u255A\u2550\u2550\u2550\u2550\u255D\u2591\n`\n"],
5
5
  "mappings": "AAAO,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,yBAAyB;AAE/B,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -130,6 +130,23 @@ If MCP (Model Context Protocol) servers are configured, you have access to MCP R
130
130
  - 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.
131
131
  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.
132
132
 
133
+ # MCP Tools
134
+ When MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix "mcp__" (e.g., mcp__BrightData__search_engine).
135
+ - Review each tool's description to understand its capabilities and limitations
136
+ - Choose the most appropriate tool based on the task requirements, not a fixed priority
137
+ - MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)
138
+
139
+ # Tool Failure Recovery (IMPORTANT)
140
+ When a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:
141
+ 1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry
142
+ 2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities
143
+ - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown
144
+ - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown
145
+ 3. **Try different strategies**: Break down the task or use alternative approaches
146
+ 4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried
147
+
148
+ Never tell the user "I cannot do this" after a single tool failure if alternative tools are available.
149
+
133
150
  You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
134
151
  `,
135
152
  `
@@ -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...\".\n- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.\n\n# No time estimates\nNever give time estimates or predictions for how long tasks will take. Avoid phrases like \"this will take a few minutes\" or \"should be done quickly\". Focus on what needs to be done, not how long it might take.\n\n# Professional objectivity\nPrioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.\n\nExamples 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# Git Safety Protocol\n- NEVER update the git config\n- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions\n- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n- NEVER run force push to main/master, warn the user if they request it\n- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen \u2014 so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n- When staging files, prefer adding specific files by name rather than using \"git add -A\" or \"git add .\", which can accidentally include sensitive files (.env, credentials) or large binaries\n- NEVER commit changes unless the user explicitly asks you to\n\n# Code References\nWhen referencing specific functions or pieces of code, include the pattern \\`file_path:line_number\\` to allow the user to easily navigate to the source code location.\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;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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...\".\n- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.\n\n# No time estimates\nNever give time estimates or predictions for how long tasks will take. Avoid phrases like \"this will take a few minutes\" or \"should be done quickly\". Focus on what needs to be done, not how long it might take.\n\n# Professional objectivity\nPrioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.\n\nExamples 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# Git Safety Protocol\n- NEVER update the git config\n- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions\n- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n- NEVER run force push to main/master, warn the user if they request it\n- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen \u2014 so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n- When staging files, prefer adding specific files by name rather than using \"git add -A\" or \"git add .\", which can accidentally include sensitive files (.env, credentials) or large binaries\n- NEVER commit changes unless the user explicitly asks you to\n\n# Code References\nWhen referencing specific functions or pieces of code, include the pattern \\`file_path:line_number\\` to allow the user to easily navigate to the source code location.\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\n# MCP Tools\nWhen MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix \"mcp__\" (e.g., mcp__BrightData__search_engine).\n- Review each tool's description to understand its capabilities and limitations\n- Choose the most appropriate tool based on the task requirements, not a fixed priority\n- MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)\n\n# Tool Failure Recovery (IMPORTANT)\nWhen a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:\n1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry\n2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities\n - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown\n - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown\n3. **Try different strategies**: Break down the task or use alternative approaches\n4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried\n\nNever tell the user \"I cannot do this\" after a single tool failure if alternative tools are available.\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yDAuCzH,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;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,IAkDpW;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
  }
@@ -16,7 +16,7 @@ const TOOL_INPUT_EXAMPLES = {
16
16
  KillShell: '{"shell_id": "shell_id_to_kill"}',
17
17
  // Task Management
18
18
  Task: '{"prompt": "task description", "description": "short description", "subagent_type": "agent-type"}',
19
- TodoWrite: '{"todos": [{"subject": "Task name", "description": "Details", "status": "pending"}]}',
19
+ TodoWrite: '{"todos": [{"content": "Task description", "status": "pending", "priority": "medium"}]}',
20
20
  // Web and API
21
21
  WebSearch: '{"query": "search query"}',
22
22
  URLFetcher: '{"url": "https://example.com", "prompt": "what to extract from page"}',
@@ -42,6 +42,7 @@ const TOOL_DESCRIPTIONS = {
42
42
  NotebookEdit: "For Jupyter notebooks. Requires notebook_path and new_source for the cell content.",
43
43
  Grep: 'Searches file contents with regex. Optional "glob" parameter filters files by pattern.',
44
44
  Task: "Creates a task for an AI agent. subagent_type determines which agent handles the task.",
45
+ TodoWrite: "Manages a task list. Each todo requires content (description), status (pending/in_progress/completed), and priority (high/medium/low).",
45
46
  URLFetcher: 'Fetches web content. The "prompt" parameter guides what to extract from the page.',
46
47
  AskExpertModel: "Queries an alternative LLM model. Useful for specialized tasks requiring different models.",
47
48
  Lsp: "Language Server Protocol queries for code intelligence. Method and params depend on LSP spec."
@@ -74,6 +75,9 @@ const PARAMETER_DESCRIPTIONS = {
74
75
  pattern: "Regular expression pattern to search for",
75
76
  path: "Directory to search in (optional, defaults to current directory)",
76
77
  glob: "Additional glob pattern to filter files being searched"
78
+ },
79
+ TodoWrite: {
80
+ todos: "Array of todo items. Each item must have: content (string), status (pending/in_progress/completed), priority (high/medium/low). Optional: id, activeForm."
77
81
  }
78
82
  };
79
83
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/toolInputExamples.ts"],
4
- "sourcesContent": ["/**\n * Tool Input Examples and Descriptions\n *\n * Provides user-friendly examples and descriptions for all tools to help with\n * error messaging when tool input validation fails. Each entry includes:\n * - A canonical example showing required parameters\n * - Optional description for complex tools\n */\n\nexport const TOOL_INPUT_EXAMPLES: Record<string, string> = {\n // File Operations\n Read: '{\"file_path\": \"/path/to/file.txt\"}',\n Write: '{\"file_path\": \"/path/to/file.txt\", \"content\": \"file contents\"}',\n Edit: '{\"file_path\": \"/path/to/file.txt\", \"old_string\": \"old text\", \"new_string\": \"new text\"}',\n MultiEdit:\n '{\"file_path\": \"/path/to/file.txt\", \"edits\": [{\"old_string\": \"old\", \"new_string\": \"new\"}]}',\n NotebookEdit:\n '{\"notebook_path\": \"/path/to/notebook.ipynb\", \"new_source\": \"cell source code\"}',\n NotebookRead: '{\"notebook_path\": \"/path/to/notebook.ipynb\"}',\n\n // Directory and Search\n Glob: '{\"pattern\": \"**/*.ts\", \"path\": \"/optional/search/path\"}',\n Grep: '{\"pattern\": \"search_term\", \"path\": \"/optional/search/path\", \"glob\": \"*.ts\"}',\n Ls: '{\"path\": \"/path/to/directory\"}',\n\n // Shell Execution\n Bash: '{\"command\": \"ls -la\"}',\n BashOutput: '{\"command\": \"ls -la\", \"shell_id\": \"optional_shell_id\"}',\n KillShell: '{\"shell_id\": \"shell_id_to_kill\"}',\n\n // Task Management\n Task: '{\"prompt\": \"task description\", \"description\": \"short description\", \"subagent_type\": \"agent-type\"}',\n TodoWrite:\n '{\"todos\": [{\"subject\": \"Task name\", \"description\": \"Details\", \"status\": \"pending\"}]}',\n\n // Web and API\n WebSearch: '{\"query\": \"search query\"}',\n URLFetcher:\n '{\"url\": \"https://example.com\", \"prompt\": \"what to extract from page\"}',\n\n // LLM Interactions\n AskExpertModel:\n '{\"model\": \"model-name\", \"prompt\": \"question for expert\", \"context\": \"optional context\"}',\n AskUserQuestion:\n '{\"question\": \"question to ask user\", \"default\": \"optional default\"}',\n\n // Memory (Anthropic-only)\n MemoryRead: '{\"name\": \"memory_block_name\"}',\n MemoryWrite: '{\"name\": \"memory_block_name\", \"content\": \"memory content\"}',\n\n // Planning and Reasoning\n Think: '{\"reasoning\": \"your thinking process\", \"plan\": \"optional plan\"}',\n EnterPlanMode: '{}',\n ExitPlanMode: '{}',\n\n // Code Intelligence\n Lsp: '{\"method\": \"textDocument/definition\", \"params\": {\"position\": {\"line\": 10, \"character\": 5}}}',\n Skill: '{\"skill\": \"skill_name\", \"args\": \"optional arguments\"}',\n\n // MCP Resources\n ListMcpResources:\n '{\"server\": \"server_name\", \"uri\": \"optional_resource_uri\", \"include\": \"resource_type\"}',\n ReadMcpResource: '{\"uri\": \"resource://path\"}',\n}\n\n/**\n * Tool Input Descriptions\n *\n * Provides helpful descriptions for complex tools to include in error messages\n */\nexport const TOOL_DESCRIPTIONS: Record<string, string> = {\n MultiEdit:\n 'Allows multiple edits in a single file. The \"edits\" parameter is an array of edit objects.',\n NotebookEdit:\n 'For Jupyter notebooks. Requires notebook_path and new_source for the cell content.',\n Grep: 'Searches file contents with regex. Optional \"glob\" parameter filters files by pattern.',\n Task: 'Creates a task for an AI agent. subagent_type determines which agent handles the task.',\n URLFetcher:\n 'Fetches web content. The \"prompt\" parameter guides what to extract from the page.',\n AskExpertModel:\n 'Queries an alternative LLM model. Useful for specialized tasks requiring different models.',\n Lsp: 'Language Server Protocol queries for code intelligence. Method and params depend on LSP spec.',\n}\n\n/**\n * Parameter Descriptions for Common Tool Parameters\n *\n * Helps provide more specific error messages when particular parameters are invalid\n */\nexport const PARAMETER_DESCRIPTIONS: Record<string, Record<string, string>> = {\n Read: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n offset: 'Optional line number to start reading from (0-indexed)',\n limit: 'Optional number of lines to read from the offset',\n },\n Write: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n content: 'The file contents to write',\n },\n Edit: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n old_string: 'The exact text to find and replace (must match exactly)',\n new_string: 'The text to replace it with',\n },\n Bash: {\n command:\n 'The shell command to execute (will run in current working directory)',\n timeout: 'Maximum execution time in milliseconds (max 600000 = 10 minutes)',\n run_in_background:\n 'Set to true to run command without waiting for completion',\n },\n Glob: {\n pattern: 'Glob pattern like **/*.ts or src/**/*.{ts,tsx}',\n path: 'Directory to search in (optional, defaults to current directory)',\n },\n Grep: {\n pattern: 'Regular expression pattern to search for',\n path: 'Directory to search in (optional, defaults to current directory)',\n glob: 'Additional glob pattern to filter files being searched',\n },\n}\n"],
5
- "mappings": "AASO,MAAM,sBAA8C;AAAA;AAAA,EAEzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WACE;AAAA,EACF,cACE;AAAA,EACF,cAAc;AAAA;AAAA,EAGd,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AAAA;AAAA,EAGJ,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AAAA;AAAA,EAGX,MAAM;AAAA,EACN,WACE;AAAA;AAAA,EAGF,WAAW;AAAA,EACX,YACE;AAAA;AAAA,EAGF,gBACE;AAAA,EACF,iBACE;AAAA;AAAA,EAGF,YAAY;AAAA,EACZ,aAAa;AAAA;AAAA,EAGb,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA;AAAA,EAGd,KAAK;AAAA,EACL,OAAO;AAAA;AAAA,EAGP,kBACE;AAAA,EACF,iBAAiB;AACnB;AAOO,MAAM,oBAA4C;AAAA,EACvD,WACE;AAAA,EACF,cACE;AAAA,EACF,MAAM;AAAA,EACN,MAAM;AAAA,EACN,YACE;AAAA,EACF,gBACE;AAAA,EACF,KAAK;AACP;AAOO,MAAM,yBAAiE;AAAA,EAC5E,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,SAAS;AAAA,IACT,mBACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;",
4
+ "sourcesContent": ["/**\n * Tool Input Examples and Descriptions\n *\n * Provides user-friendly examples and descriptions for all tools to help with\n * error messaging when tool input validation fails. Each entry includes:\n * - A canonical example showing required parameters\n * - Optional description for complex tools\n */\n\nexport const TOOL_INPUT_EXAMPLES: Record<string, string> = {\n // File Operations\n Read: '{\"file_path\": \"/path/to/file.txt\"}',\n Write: '{\"file_path\": \"/path/to/file.txt\", \"content\": \"file contents\"}',\n Edit: '{\"file_path\": \"/path/to/file.txt\", \"old_string\": \"old text\", \"new_string\": \"new text\"}',\n MultiEdit:\n '{\"file_path\": \"/path/to/file.txt\", \"edits\": [{\"old_string\": \"old\", \"new_string\": \"new\"}]}',\n NotebookEdit:\n '{\"notebook_path\": \"/path/to/notebook.ipynb\", \"new_source\": \"cell source code\"}',\n NotebookRead: '{\"notebook_path\": \"/path/to/notebook.ipynb\"}',\n\n // Directory and Search\n Glob: '{\"pattern\": \"**/*.ts\", \"path\": \"/optional/search/path\"}',\n Grep: '{\"pattern\": \"search_term\", \"path\": \"/optional/search/path\", \"glob\": \"*.ts\"}',\n Ls: '{\"path\": \"/path/to/directory\"}',\n\n // Shell Execution\n Bash: '{\"command\": \"ls -la\"}',\n BashOutput: '{\"command\": \"ls -la\", \"shell_id\": \"optional_shell_id\"}',\n KillShell: '{\"shell_id\": \"shell_id_to_kill\"}',\n\n // Task Management\n Task: '{\"prompt\": \"task description\", \"description\": \"short description\", \"subagent_type\": \"agent-type\"}',\n TodoWrite:\n '{\"todos\": [{\"content\": \"Task description\", \"status\": \"pending\", \"priority\": \"medium\"}]}',\n\n // Web and API\n WebSearch: '{\"query\": \"search query\"}',\n URLFetcher:\n '{\"url\": \"https://example.com\", \"prompt\": \"what to extract from page\"}',\n\n // LLM Interactions\n AskExpertModel:\n '{\"model\": \"model-name\", \"prompt\": \"question for expert\", \"context\": \"optional context\"}',\n AskUserQuestion:\n '{\"question\": \"question to ask user\", \"default\": \"optional default\"}',\n\n // Memory (Anthropic-only)\n MemoryRead: '{\"name\": \"memory_block_name\"}',\n MemoryWrite: '{\"name\": \"memory_block_name\", \"content\": \"memory content\"}',\n\n // Planning and Reasoning\n Think: '{\"reasoning\": \"your thinking process\", \"plan\": \"optional plan\"}',\n EnterPlanMode: '{}',\n ExitPlanMode: '{}',\n\n // Code Intelligence\n Lsp: '{\"method\": \"textDocument/definition\", \"params\": {\"position\": {\"line\": 10, \"character\": 5}}}',\n Skill: '{\"skill\": \"skill_name\", \"args\": \"optional arguments\"}',\n\n // MCP Resources\n ListMcpResources:\n '{\"server\": \"server_name\", \"uri\": \"optional_resource_uri\", \"include\": \"resource_type\"}',\n ReadMcpResource: '{\"uri\": \"resource://path\"}',\n}\n\n/**\n * Tool Input Descriptions\n *\n * Provides helpful descriptions for complex tools to include in error messages\n */\nexport const TOOL_DESCRIPTIONS: Record<string, string> = {\n MultiEdit:\n 'Allows multiple edits in a single file. The \"edits\" parameter is an array of edit objects.',\n NotebookEdit:\n 'For Jupyter notebooks. Requires notebook_path and new_source for the cell content.',\n Grep: 'Searches file contents with regex. Optional \"glob\" parameter filters files by pattern.',\n Task: 'Creates a task for an AI agent. subagent_type determines which agent handles the task.',\n TodoWrite:\n 'Manages a task list. Each todo requires content (description), status (pending/in_progress/completed), and priority (high/medium/low).',\n URLFetcher:\n 'Fetches web content. The \"prompt\" parameter guides what to extract from the page.',\n AskExpertModel:\n 'Queries an alternative LLM model. Useful for specialized tasks requiring different models.',\n Lsp: 'Language Server Protocol queries for code intelligence. Method and params depend on LSP spec.',\n}\n\n/**\n * Parameter Descriptions for Common Tool Parameters\n *\n * Helps provide more specific error messages when particular parameters are invalid\n */\nexport const PARAMETER_DESCRIPTIONS: Record<string, Record<string, string>> = {\n Read: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n offset: 'Optional line number to start reading from (0-indexed)',\n limit: 'Optional number of lines to read from the offset',\n },\n Write: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n content: 'The file contents to write',\n },\n Edit: {\n file_path: 'Must be an absolute file path (e.g., /home/user/file.txt)',\n old_string: 'The exact text to find and replace (must match exactly)',\n new_string: 'The text to replace it with',\n },\n Bash: {\n command:\n 'The shell command to execute (will run in current working directory)',\n timeout: 'Maximum execution time in milliseconds (max 600000 = 10 minutes)',\n run_in_background:\n 'Set to true to run command without waiting for completion',\n },\n Glob: {\n pattern: 'Glob pattern like **/*.ts or src/**/*.{ts,tsx}',\n path: 'Directory to search in (optional, defaults to current directory)',\n },\n Grep: {\n pattern: 'Regular expression pattern to search for',\n path: 'Directory to search in (optional, defaults to current directory)',\n glob: 'Additional glob pattern to filter files being searched',\n },\n TodoWrite: {\n todos:\n 'Array of todo items. Each item must have: content (string), status (pending/in_progress/completed), priority (high/medium/low). Optional: id, activeForm.',\n },\n}\n"],
5
+ "mappings": "AASO,MAAM,sBAA8C;AAAA;AAAA,EAEzD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WACE;AAAA,EACF,cACE;AAAA,EACF,cAAc;AAAA;AAAA,EAGd,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AAAA;AAAA,EAGJ,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AAAA;AAAA,EAGX,MAAM;AAAA,EACN,WACE;AAAA;AAAA,EAGF,WAAW;AAAA,EACX,YACE;AAAA;AAAA,EAGF,gBACE;AAAA,EACF,iBACE;AAAA;AAAA,EAGF,YAAY;AAAA,EACZ,aAAa;AAAA;AAAA,EAGb,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA;AAAA,EAGd,KAAK;AAAA,EACL,OAAO;AAAA;AAAA,EAGP,kBACE;AAAA,EACF,iBAAiB;AACnB;AAOO,MAAM,oBAA4C;AAAA,EACvD,WACE;AAAA,EACF,cACE;AAAA,EACF,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WACE;AAAA,EACF,YACE;AAAA,EACF,gBACE;AAAA,EACF,KAAK;AACP;AAOO,MAAM,yBAAiE;AAAA,EAC5E,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,SAAS;AAAA,IACT,mBACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,WAAW;AAAA,IACT,OACE;AAAA,EACJ;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,29 @@
1
+ import { createBackup } from "./backupManager.js";
2
+ import { loadGlobalConfig } from "./config/loader.js";
3
+ const EXCLUDED_PATTERNS = [
4
+ "/node_modules/",
5
+ "/.git/",
6
+ "/.minto/backups/",
7
+ "/.claude/backups/"
8
+ ];
9
+ function isExcludedPath(filePath) {
10
+ return EXCLUDED_PATTERNS.some((pattern) => filePath.includes(pattern));
11
+ }
12
+ function triggerBackup(filePath, oldContent, newContent, operation) {
13
+ if (isExcludedPath(filePath)) {
14
+ return;
15
+ }
16
+ try {
17
+ const config = loadGlobalConfig();
18
+ if (config.backupEnabled === false) {
19
+ return;
20
+ }
21
+ } catch {
22
+ }
23
+ createBackup(filePath, oldContent, newContent, operation).catch(() => {
24
+ });
25
+ }
26
+ export {
27
+ triggerBackup
28
+ };
29
+ //# sourceMappingURL=backupHook.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/core/backupHook.ts"],
4
+ "sourcesContent": ["/**\n * Backup Hook\n *\n * Thin wrapper around createBackup() for use in file-writing tools.\n * Fire-and-forget: sync signature, internally async with silent failure.\n */\n\nimport { createBackup, type BackupOperation } from './backupManager'\nimport { loadGlobalConfig } from './config/loader'\n\n/** Paths that should never be backed up */\nconst EXCLUDED_PATTERNS = [\n '/node_modules/',\n '/.git/',\n '/.minto/backups/',\n '/.claude/backups/',\n]\n\n/**\n * Check if a file path should be excluded from backup\n */\nfunction isExcludedPath(filePath: string): boolean {\n return EXCLUDED_PATTERNS.some(pattern => filePath.includes(pattern))\n}\n\n/**\n * Trigger a backup for a file before modification.\n *\n * Fire-and-forget: returns void synchronously, runs createBackup async\n * in the background. Checks config and path exclusions before triggering.\n *\n * @param filePath - Absolute path to the file being modified\n * @param oldContent - Previous content (null for new files)\n * @param newContent - New content being written\n * @param operation - Type of operation (create, update, delete)\n */\nexport function triggerBackup(\n filePath: string,\n oldContent: string | null,\n newContent: string | null,\n operation: BackupOperation,\n): void {\n // Skip excluded paths\n if (isExcludedPath(filePath)) {\n return\n }\n\n // Check config (sync read, cached by loader)\n try {\n const config = loadGlobalConfig()\n if (config.backupEnabled === false) {\n return\n }\n } catch {\n // Config read failure \u2014 default to backing up\n }\n\n // Fire and forget \u2014 createBackup handles its own errors\n createBackup(filePath, oldContent, newContent, operation).catch(() => {\n // Silently ignore \u2014 createBackup already logs internally\n })\n}\n"],
5
+ "mappings": "AAOA,SAAS,oBAA0C;AACnD,SAAS,wBAAwB;AAGjC,MAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKA,SAAS,eAAe,UAA2B;AACjD,SAAO,kBAAkB,KAAK,aAAW,SAAS,SAAS,OAAO,CAAC;AACrE;AAaO,SAAS,cACd,UACA,YACA,YACA,WACM;AAEN,MAAI,eAAe,QAAQ,GAAG;AAC5B;AAAA,EACF;AAGA,MAAI;AACF,UAAM,SAAS,iBAAiB;AAChC,QAAI,OAAO,kBAAkB,OAAO;AAClC;AAAA,IACF;AAAA,EACF,QAAQ;AAAA,EAER;AAGA,eAAa,UAAU,YAAY,YAAY,SAAS,EAAE,MAAM,MAAM;AAAA,EAEtE,CAAC;AACH;",
6
+ "names": []
7
+ }