snow-ai 0.4.16 → 0.4.18

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 (352) hide show
  1. package/bundle/cli.mjs +477445 -0
  2. package/bundle/sql-wasm.wasm +0 -0
  3. package/bundle/tiktoken_bg.wasm +0 -0
  4. package/package.json +31 -26
  5. package/dist/agents/codebaseIndexAgent.d.ts +0 -102
  6. package/dist/agents/codebaseIndexAgent.js +0 -641
  7. package/dist/agents/codebaseReviewAgent.d.ts +0 -61
  8. package/dist/agents/codebaseReviewAgent.js +0 -301
  9. package/dist/agents/compactAgent.d.ts +0 -55
  10. package/dist/agents/compactAgent.js +0 -306
  11. package/dist/agents/promptOptimizeAgent.d.ts +0 -54
  12. package/dist/agents/promptOptimizeAgent.js +0 -268
  13. package/dist/agents/reviewAgent.d.ts +0 -50
  14. package/dist/agents/reviewAgent.js +0 -265
  15. package/dist/agents/summaryAgent.d.ts +0 -57
  16. package/dist/agents/summaryAgent.js +0 -260
  17. package/dist/api/anthropic.d.ts +0 -44
  18. package/dist/api/anthropic.js +0 -598
  19. package/dist/api/chat.d.ts +0 -73
  20. package/dist/api/chat.js +0 -386
  21. package/dist/api/embedding.d.ts +0 -34
  22. package/dist/api/embedding.js +0 -80
  23. package/dist/api/gemini.d.ts +0 -31
  24. package/dist/api/gemini.js +0 -445
  25. package/dist/api/models.d.ts +0 -15
  26. package/dist/api/models.js +0 -139
  27. package/dist/api/responses.d.ts +0 -38
  28. package/dist/api/responses.js +0 -515
  29. package/dist/api/systemPrompt.d.ts +0 -4
  30. package/dist/api/systemPrompt.js +0 -408
  31. package/dist/api/types.d.ts +0 -53
  32. package/dist/api/types.js +0 -4
  33. package/dist/app.d.ts +0 -8
  34. package/dist/app.js +0 -112
  35. package/dist/cli.d.ts +0 -2
  36. package/dist/cli.js +0 -199
  37. package/dist/hooks/useAgentPicker.d.ts +0 -14
  38. package/dist/hooks/useAgentPicker.js +0 -119
  39. package/dist/hooks/useClipboard.d.ts +0 -4
  40. package/dist/hooks/useClipboard.js +0 -175
  41. package/dist/hooks/useCommandHandler.d.ts +0 -35
  42. package/dist/hooks/useCommandHandler.js +0 -346
  43. package/dist/hooks/useCommandPanel.d.ts +0 -17
  44. package/dist/hooks/useCommandPanel.js +0 -114
  45. package/dist/hooks/useConversation.d.ts +0 -49
  46. package/dist/hooks/useConversation.js +0 -1052
  47. package/dist/hooks/useFilePicker.d.ts +0 -18
  48. package/dist/hooks/useFilePicker.js +0 -224
  49. package/dist/hooks/useGlobalExit.d.ts +0 -5
  50. package/dist/hooks/useGlobalExit.js +0 -34
  51. package/dist/hooks/useGlobalNavigation.d.ts +0 -6
  52. package/dist/hooks/useGlobalNavigation.js +0 -17
  53. package/dist/hooks/useHistoryNavigation.d.ts +0 -35
  54. package/dist/hooks/useHistoryNavigation.js +0 -133
  55. package/dist/hooks/useInputBuffer.d.ts +0 -6
  56. package/dist/hooks/useInputBuffer.js +0 -45
  57. package/dist/hooks/useKeyboardInput.d.ts +0 -80
  58. package/dist/hooks/useKeyboardInput.js +0 -608
  59. package/dist/hooks/useSessionManagement.d.ts +0 -10
  60. package/dist/hooks/useSessionManagement.js +0 -43
  61. package/dist/hooks/useSessionSave.d.ts +0 -8
  62. package/dist/hooks/useSessionSave.js +0 -63
  63. package/dist/hooks/useSnapshotState.d.ts +0 -26
  64. package/dist/hooks/useSnapshotState.js +0 -28
  65. package/dist/hooks/useStreamingState.d.ts +0 -33
  66. package/dist/hooks/useStreamingState.js +0 -105
  67. package/dist/hooks/useTerminalFocus.d.ts +0 -28
  68. package/dist/hooks/useTerminalFocus.js +0 -87
  69. package/dist/hooks/useTerminalSize.d.ts +0 -4
  70. package/dist/hooks/useTerminalSize.js +0 -20
  71. package/dist/hooks/useTodoPicker.d.ts +0 -16
  72. package/dist/hooks/useTodoPicker.js +0 -94
  73. package/dist/hooks/useToolConfirmation.d.ts +0 -19
  74. package/dist/hooks/useToolConfirmation.js +0 -61
  75. package/dist/hooks/useVSCodeState.d.ts +0 -8
  76. package/dist/hooks/useVSCodeState.js +0 -81
  77. package/dist/i18n/I18nContext.d.ts +0 -14
  78. package/dist/i18n/I18nContext.js +0 -24
  79. package/dist/i18n/index.d.ts +0 -3
  80. package/dist/i18n/index.js +0 -2
  81. package/dist/i18n/lang/en.d.ts +0 -2
  82. package/dist/i18n/lang/en.js +0 -502
  83. package/dist/i18n/lang/es.d.ts +0 -2
  84. package/dist/i18n/lang/es.js +0 -502
  85. package/dist/i18n/lang/ja.d.ts +0 -2
  86. package/dist/i18n/lang/ja.js +0 -502
  87. package/dist/i18n/lang/ko.d.ts +0 -2
  88. package/dist/i18n/lang/ko.js +0 -502
  89. package/dist/i18n/lang/zh-TW.d.ts +0 -2
  90. package/dist/i18n/lang/zh-TW.js +0 -502
  91. package/dist/i18n/lang/zh.d.ts +0 -2
  92. package/dist/i18n/lang/zh.js +0 -502
  93. package/dist/i18n/translations.d.ts +0 -2
  94. package/dist/i18n/translations.js +0 -14
  95. package/dist/i18n/types.d.ts +0 -478
  96. package/dist/i18n/types.js +0 -1
  97. package/dist/mcp/aceCodeSearch.d.ts +0 -247
  98. package/dist/mcp/aceCodeSearch.js +0 -1058
  99. package/dist/mcp/bash.d.ts +0 -50
  100. package/dist/mcp/bash.js +0 -153
  101. package/dist/mcp/codebaseSearch.d.ts +0 -44
  102. package/dist/mcp/codebaseSearch.js +0 -275
  103. package/dist/mcp/filesystem.d.ts +0 -392
  104. package/dist/mcp/filesystem.js +0 -1445
  105. package/dist/mcp/ideDiagnostics.d.ts +0 -36
  106. package/dist/mcp/ideDiagnostics.js +0 -90
  107. package/dist/mcp/notebook.d.ts +0 -10
  108. package/dist/mcp/notebook.js +0 -367
  109. package/dist/mcp/subagent.d.ts +0 -37
  110. package/dist/mcp/subagent.js +0 -113
  111. package/dist/mcp/todo.d.ts +0 -46
  112. package/dist/mcp/todo.js +0 -511
  113. package/dist/mcp/types/aceCodeSearch.types.d.ts +0 -92
  114. package/dist/mcp/types/aceCodeSearch.types.js +0 -4
  115. package/dist/mcp/types/bash.types.d.ts +0 -13
  116. package/dist/mcp/types/bash.types.js +0 -4
  117. package/dist/mcp/types/filesystem.types.d.ts +0 -210
  118. package/dist/mcp/types/filesystem.types.js +0 -27
  119. package/dist/mcp/types/todo.types.d.ts +0 -27
  120. package/dist/mcp/types/todo.types.js +0 -4
  121. package/dist/mcp/types/websearch.types.d.ts +0 -30
  122. package/dist/mcp/types/websearch.types.js +0 -4
  123. package/dist/mcp/utils/aceCodeSearch/filesystem.utils.d.ts +0 -34
  124. package/dist/mcp/utils/aceCodeSearch/filesystem.utils.js +0 -146
  125. package/dist/mcp/utils/aceCodeSearch/language.utils.d.ts +0 -14
  126. package/dist/mcp/utils/aceCodeSearch/language.utils.js +0 -418
  127. package/dist/mcp/utils/aceCodeSearch/search.utils.d.ts +0 -31
  128. package/dist/mcp/utils/aceCodeSearch/search.utils.js +0 -136
  129. package/dist/mcp/utils/aceCodeSearch/symbol.utils.d.ts +0 -20
  130. package/dist/mcp/utils/aceCodeSearch/symbol.utils.js +0 -141
  131. package/dist/mcp/utils/bash/security.utils.d.ts +0 -20
  132. package/dist/mcp/utils/bash/security.utils.js +0 -34
  133. package/dist/mcp/utils/filesystem/batch-operations.utils.d.ts +0 -39
  134. package/dist/mcp/utils/filesystem/batch-operations.utils.js +0 -182
  135. package/dist/mcp/utils/filesystem/code-analysis.utils.d.ts +0 -18
  136. package/dist/mcp/utils/filesystem/code-analysis.utils.js +0 -165
  137. package/dist/mcp/utils/filesystem/match-finder.utils.d.ts +0 -16
  138. package/dist/mcp/utils/filesystem/match-finder.utils.js +0 -85
  139. package/dist/mcp/utils/filesystem/office-parser.utils.d.ts +0 -43
  140. package/dist/mcp/utils/filesystem/office-parser.utils.js +0 -163
  141. package/dist/mcp/utils/filesystem/path-fixer.utils.d.ts +0 -7
  142. package/dist/mcp/utils/filesystem/path-fixer.utils.js +0 -60
  143. package/dist/mcp/utils/filesystem/similarity.utils.d.ts +0 -22
  144. package/dist/mcp/utils/filesystem/similarity.utils.js +0 -75
  145. package/dist/mcp/utils/todo/date.utils.d.ts +0 -9
  146. package/dist/mcp/utils/todo/date.utils.js +0 -14
  147. package/dist/mcp/utils/websearch/browser.utils.d.ts +0 -8
  148. package/dist/mcp/utils/websearch/browser.utils.js +0 -58
  149. package/dist/mcp/utils/websearch/text.utils.d.ts +0 -16
  150. package/dist/mcp/utils/websearch/text.utils.js +0 -39
  151. package/dist/mcp/websearch.d.ts +0 -88
  152. package/dist/mcp/websearch.js +0 -375
  153. package/dist/test/logger-test.d.ts +0 -1
  154. package/dist/test/logger-test.js +0 -7
  155. package/dist/types/index.d.ts +0 -15
  156. package/dist/types/index.js +0 -1
  157. package/dist/ui/components/AgentPickerPanel.d.ts +0 -10
  158. package/dist/ui/components/AgentPickerPanel.js +0 -74
  159. package/dist/ui/components/ChatInput.d.ts +0 -46
  160. package/dist/ui/components/ChatInput.js +0 -384
  161. package/dist/ui/components/CommandPanel.d.ts +0 -15
  162. package/dist/ui/components/CommandPanel.js +0 -80
  163. package/dist/ui/components/DiffViewer.d.ts +0 -11
  164. package/dist/ui/components/DiffViewer.js +0 -178
  165. package/dist/ui/components/FileList.d.ts +0 -15
  166. package/dist/ui/components/FileList.js +0 -360
  167. package/dist/ui/components/FileRollbackConfirmation.d.ts +0 -8
  168. package/dist/ui/components/FileRollbackConfirmation.js +0 -108
  169. package/dist/ui/components/HelpPanel.d.ts +0 -2
  170. package/dist/ui/components/HelpPanel.js +0 -67
  171. package/dist/ui/components/MCPInfoPanel.d.ts +0 -2
  172. package/dist/ui/components/MCPInfoPanel.js +0 -108
  173. package/dist/ui/components/MCPInfoScreen.d.ts +0 -7
  174. package/dist/ui/components/MCPInfoScreen.js +0 -115
  175. package/dist/ui/components/MarkdownRenderer.d.ts +0 -6
  176. package/dist/ui/components/MarkdownRenderer.js +0 -70
  177. package/dist/ui/components/Menu.d.ts +0 -17
  178. package/dist/ui/components/Menu.js +0 -88
  179. package/dist/ui/components/MessageList.d.ts +0 -56
  180. package/dist/ui/components/MessageList.js +0 -97
  181. package/dist/ui/components/PendingMessages.d.ts +0 -13
  182. package/dist/ui/components/PendingMessages.js +0 -29
  183. package/dist/ui/components/PendingToolCalls.d.ts +0 -11
  184. package/dist/ui/components/PendingToolCalls.js +0 -35
  185. package/dist/ui/components/ScrollableSelectInput.d.ts +0 -29
  186. package/dist/ui/components/ScrollableSelectInput.js +0 -157
  187. package/dist/ui/components/SessionListPanel.d.ts +0 -7
  188. package/dist/ui/components/SessionListPanel.js +0 -175
  189. package/dist/ui/components/SessionListScreen.d.ts +0 -7
  190. package/dist/ui/components/SessionListScreen.js +0 -217
  191. package/dist/ui/components/SessionListScreenWrapper.d.ts +0 -7
  192. package/dist/ui/components/SessionListScreenWrapper.js +0 -14
  193. package/dist/ui/components/ShimmerText.d.ts +0 -9
  194. package/dist/ui/components/ShimmerText.js +0 -30
  195. package/dist/ui/components/TodoPickerPanel.d.ts +0 -14
  196. package/dist/ui/components/TodoPickerPanel.js +0 -119
  197. package/dist/ui/components/TodoTree.d.ts +0 -15
  198. package/dist/ui/components/TodoTree.js +0 -60
  199. package/dist/ui/components/ToolConfirmation.d.ts +0 -21
  200. package/dist/ui/components/ToolConfirmation.js +0 -204
  201. package/dist/ui/components/ToolResultPreview.d.ts +0 -13
  202. package/dist/ui/components/ToolResultPreview.js +0 -337
  203. package/dist/ui/components/UsagePanel.d.ts +0 -2
  204. package/dist/ui/components/UsagePanel.js +0 -394
  205. package/dist/ui/contexts/ThemeContext.d.ts +0 -13
  206. package/dist/ui/contexts/ThemeContext.js +0 -28
  207. package/dist/ui/pages/ChatScreen.d.ts +0 -6
  208. package/dist/ui/pages/ChatScreen.js +0 -1519
  209. package/dist/ui/pages/CodeBaseConfigScreen.d.ts +0 -8
  210. package/dist/ui/pages/CodeBaseConfigScreen.js +0 -350
  211. package/dist/ui/pages/ConfigScreen.d.ts +0 -8
  212. package/dist/ui/pages/ConfigScreen.js +0 -1101
  213. package/dist/ui/pages/CustomHeadersScreen.d.ts +0 -6
  214. package/dist/ui/pages/CustomHeadersScreen.js +0 -502
  215. package/dist/ui/pages/HeadlessModeScreen.d.ts +0 -7
  216. package/dist/ui/pages/HeadlessModeScreen.js +0 -381
  217. package/dist/ui/pages/LanguageSettingsScreen.d.ts +0 -7
  218. package/dist/ui/pages/LanguageSettingsScreen.js +0 -91
  219. package/dist/ui/pages/MCPConfigScreen.d.ts +0 -6
  220. package/dist/ui/pages/MCPConfigScreen.js +0 -55
  221. package/dist/ui/pages/ProxyConfigScreen.d.ts +0 -8
  222. package/dist/ui/pages/ProxyConfigScreen.js +0 -149
  223. package/dist/ui/pages/SensitiveCommandConfigScreen.d.ts +0 -7
  224. package/dist/ui/pages/SensitiveCommandConfigScreen.js +0 -271
  225. package/dist/ui/pages/SubAgentConfigScreen.d.ts +0 -9
  226. package/dist/ui/pages/SubAgentConfigScreen.js +0 -435
  227. package/dist/ui/pages/SubAgentListScreen.d.ts +0 -9
  228. package/dist/ui/pages/SubAgentListScreen.js +0 -131
  229. package/dist/ui/pages/SystemPromptConfigScreen.d.ts +0 -6
  230. package/dist/ui/pages/SystemPromptConfigScreen.js +0 -326
  231. package/dist/ui/pages/ThemeSettingsScreen.d.ts +0 -7
  232. package/dist/ui/pages/ThemeSettingsScreen.js +0 -106
  233. package/dist/ui/pages/WelcomeScreen.d.ts +0 -7
  234. package/dist/ui/pages/WelcomeScreen.js +0 -217
  235. package/dist/ui/themes/index.d.ts +0 -23
  236. package/dist/ui/themes/index.js +0 -140
  237. package/dist/utils/apiConfig.d.ts +0 -126
  238. package/dist/utils/apiConfig.js +0 -423
  239. package/dist/utils/autoCompress.d.ts +0 -15
  240. package/dist/utils/autoCompress.js +0 -24
  241. package/dist/utils/chatExporter.d.ts +0 -9
  242. package/dist/utils/chatExporter.js +0 -118
  243. package/dist/utils/checkpointManager.d.ts +0 -74
  244. package/dist/utils/checkpointManager.js +0 -181
  245. package/dist/utils/codebaseConfig.d.ts +0 -16
  246. package/dist/utils/codebaseConfig.js +0 -67
  247. package/dist/utils/codebaseDatabase.d.ts +0 -102
  248. package/dist/utils/codebaseDatabase.js +0 -333
  249. package/dist/utils/codebaseSearchEvents.d.ts +0 -16
  250. package/dist/utils/codebaseSearchEvents.js +0 -13
  251. package/dist/utils/commandExecutor.d.ts +0 -13
  252. package/dist/utils/commandExecutor.js +0 -26
  253. package/dist/utils/commands/agent.d.ts +0 -2
  254. package/dist/utils/commands/agent.js +0 -12
  255. package/dist/utils/commands/clear.d.ts +0 -2
  256. package/dist/utils/commands/clear.js +0 -12
  257. package/dist/utils/commands/compact.d.ts +0 -2
  258. package/dist/utils/commands/compact.js +0 -12
  259. package/dist/utils/commands/export.d.ts +0 -2
  260. package/dist/utils/commands/export.js +0 -12
  261. package/dist/utils/commands/help.d.ts +0 -2
  262. package/dist/utils/commands/help.js +0 -11
  263. package/dist/utils/commands/home.d.ts +0 -2
  264. package/dist/utils/commands/home.js +0 -34
  265. package/dist/utils/commands/ide.d.ts +0 -2
  266. package/dist/utils/commands/ide.js +0 -32
  267. package/dist/utils/commands/init.d.ts +0 -2
  268. package/dist/utils/commands/init.js +0 -93
  269. package/dist/utils/commands/mcp.d.ts +0 -2
  270. package/dist/utils/commands/mcp.js +0 -12
  271. package/dist/utils/commands/resume.d.ts +0 -2
  272. package/dist/utils/commands/resume.js +0 -12
  273. package/dist/utils/commands/review.d.ts +0 -2
  274. package/dist/utils/commands/review.js +0 -81
  275. package/dist/utils/commands/role.d.ts +0 -2
  276. package/dist/utils/commands/role.js +0 -37
  277. package/dist/utils/commands/todoPicker.d.ts +0 -2
  278. package/dist/utils/commands/todoPicker.js +0 -12
  279. package/dist/utils/commands/usage.d.ts +0 -2
  280. package/dist/utils/commands/usage.js +0 -12
  281. package/dist/utils/commands/yolo.d.ts +0 -2
  282. package/dist/utils/commands/yolo.js +0 -12
  283. package/dist/utils/configManager.d.ts +0 -45
  284. package/dist/utils/configManager.js +0 -303
  285. package/dist/utils/contextCompressor.d.ts +0 -16
  286. package/dist/utils/contextCompressor.js +0 -334
  287. package/dist/utils/devMode.d.ts +0 -13
  288. package/dist/utils/devMode.js +0 -54
  289. package/dist/utils/escapeHandler.d.ts +0 -79
  290. package/dist/utils/escapeHandler.js +0 -153
  291. package/dist/utils/fileDialog.d.ts +0 -9
  292. package/dist/utils/fileDialog.js +0 -74
  293. package/dist/utils/fileUtils.d.ts +0 -40
  294. package/dist/utils/fileUtils.js +0 -185
  295. package/dist/utils/historyManager.d.ts +0 -45
  296. package/dist/utils/historyManager.js +0 -159
  297. package/dist/utils/incrementalSnapshot.d.ts +0 -109
  298. package/dist/utils/incrementalSnapshot.js +0 -383
  299. package/dist/utils/index.d.ts +0 -11
  300. package/dist/utils/index.js +0 -18
  301. package/dist/utils/languageConfig.d.ts +0 -21
  302. package/dist/utils/languageConfig.js +0 -61
  303. package/dist/utils/logger.d.ts +0 -37
  304. package/dist/utils/logger.js +0 -122
  305. package/dist/utils/mcpToolsManager.d.ts +0 -52
  306. package/dist/utils/mcpToolsManager.js +0 -878
  307. package/dist/utils/messageFormatter.d.ts +0 -12
  308. package/dist/utils/messageFormatter.js +0 -115
  309. package/dist/utils/notebookManager.d.ts +0 -59
  310. package/dist/utils/notebookManager.js +0 -213
  311. package/dist/utils/patch-highlight.d.ts +0 -5
  312. package/dist/utils/patch-highlight.js +0 -23
  313. package/dist/utils/processManager.d.ts +0 -27
  314. package/dist/utils/processManager.js +0 -75
  315. package/dist/utils/proxyUtils.d.ts +0 -15
  316. package/dist/utils/proxyUtils.js +0 -50
  317. package/dist/utils/resourceMonitor.d.ts +0 -65
  318. package/dist/utils/resourceMonitor.js +0 -175
  319. package/dist/utils/retryUtils.d.ts +0 -49
  320. package/dist/utils/retryUtils.js +0 -303
  321. package/dist/utils/sensitiveCommandManager.d.ts +0 -53
  322. package/dist/utils/sensitiveCommandManager.js +0 -308
  323. package/dist/utils/sessionConverter.d.ts +0 -7
  324. package/dist/utils/sessionConverter.js +0 -306
  325. package/dist/utils/sessionManager.d.ts +0 -53
  326. package/dist/utils/sessionManager.js +0 -371
  327. package/dist/utils/subAgentConfig.d.ts +0 -50
  328. package/dist/utils/subAgentConfig.js +0 -221
  329. package/dist/utils/subAgentExecutor.d.ts +0 -40
  330. package/dist/utils/subAgentExecutor.js +0 -434
  331. package/dist/utils/terminal.d.ts +0 -5
  332. package/dist/utils/terminal.js +0 -13
  333. package/dist/utils/textBuffer.d.ts +0 -99
  334. package/dist/utils/textBuffer.js +0 -547
  335. package/dist/utils/textUtils.d.ts +0 -37
  336. package/dist/utils/textUtils.js +0 -102
  337. package/dist/utils/themeConfig.d.ts +0 -21
  338. package/dist/utils/themeConfig.js +0 -61
  339. package/dist/utils/todoPreprocessor.d.ts +0 -5
  340. package/dist/utils/todoPreprocessor.js +0 -18
  341. package/dist/utils/todoScanner.d.ts +0 -8
  342. package/dist/utils/todoScanner.js +0 -148
  343. package/dist/utils/toolDisplayConfig.d.ts +0 -16
  344. package/dist/utils/toolDisplayConfig.js +0 -47
  345. package/dist/utils/toolExecutor.d.ts +0 -37
  346. package/dist/utils/toolExecutor.js +0 -224
  347. package/dist/utils/usageLogger.d.ts +0 -11
  348. package/dist/utils/usageLogger.js +0 -114
  349. package/dist/utils/vscodeConnection.d.ts +0 -76
  350. package/dist/utils/vscodeConnection.js +0 -430
  351. package/dist/utils/workspaceSnapshot.d.ts +0 -63
  352. package/dist/utils/workspaceSnapshot.js +0 -300
@@ -1,21 +0,0 @@
1
- import type { ThemeType } from '../ui/themes/index.js';
2
- interface ThemeConfig {
3
- theme: ThemeType;
4
- }
5
- /**
6
- * Load theme configuration from file system
7
- */
8
- export declare function loadThemeConfig(): ThemeConfig;
9
- /**
10
- * Save theme configuration to file system
11
- */
12
- export declare function saveThemeConfig(config: ThemeConfig): void;
13
- /**
14
- * Get current theme setting
15
- */
16
- export declare function getCurrentTheme(): ThemeType;
17
- /**
18
- * Set theme and persist to file system
19
- */
20
- export declare function setCurrentTheme(theme: ThemeType): void;
21
- export {};
@@ -1,61 +0,0 @@
1
- import { homedir } from 'os';
2
- import { join } from 'path';
3
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
4
- const CONFIG_DIR = join(homedir(), '.snow');
5
- const THEME_CONFIG_FILE = join(CONFIG_DIR, 'theme.json');
6
- const DEFAULT_CONFIG = {
7
- theme: 'dark',
8
- };
9
- function ensureConfigDirectory() {
10
- if (!existsSync(CONFIG_DIR)) {
11
- mkdirSync(CONFIG_DIR, { recursive: true });
12
- }
13
- }
14
- /**
15
- * Load theme configuration from file system
16
- */
17
- export function loadThemeConfig() {
18
- ensureConfigDirectory();
19
- if (!existsSync(THEME_CONFIG_FILE)) {
20
- saveThemeConfig(DEFAULT_CONFIG);
21
- return DEFAULT_CONFIG;
22
- }
23
- try {
24
- const configData = readFileSync(THEME_CONFIG_FILE, 'utf-8');
25
- const config = JSON.parse(configData);
26
- return {
27
- ...DEFAULT_CONFIG,
28
- ...config,
29
- };
30
- }
31
- catch (error) {
32
- // If config file is corrupted, return default config
33
- return DEFAULT_CONFIG;
34
- }
35
- }
36
- /**
37
- * Save theme configuration to file system
38
- */
39
- export function saveThemeConfig(config) {
40
- ensureConfigDirectory();
41
- try {
42
- const configData = JSON.stringify(config, null, 2);
43
- writeFileSync(THEME_CONFIG_FILE, configData, 'utf-8');
44
- }
45
- catch (error) {
46
- console.error('Failed to save theme config:', error);
47
- }
48
- }
49
- /**
50
- * Get current theme setting
51
- */
52
- export function getCurrentTheme() {
53
- const config = loadThemeConfig();
54
- return config.theme;
55
- }
56
- /**
57
- * Set theme and persist to file system
58
- */
59
- export function setCurrentTheme(theme) {
60
- saveThemeConfig({ theme });
61
- }
@@ -1,5 +0,0 @@
1
- export declare function formatTodoContext(todos: Array<{
2
- id: string;
3
- content: string;
4
- status: 'pending' | 'completed';
5
- }>): string;
@@ -1,18 +0,0 @@
1
- export function formatTodoContext(todos) {
2
- if (todos.length === 0) {
3
- return '';
4
- }
5
- const statusSymbol = {
6
- pending: '[ ]',
7
- completed: '[x]',
8
- };
9
- const lines = [
10
- '## Current TODO List',
11
- '',
12
- ...todos.map(t => `${statusSymbol[t.status]} ${t.content} (ID: ${t.id})`),
13
- '',
14
- '**Important**: Update TODO status immediately after completing each task using todo-update tool.',
15
- '',
16
- ];
17
- return lines.join('\n');
18
- }
@@ -1,8 +0,0 @@
1
- export interface TodoItem {
2
- id: string;
3
- file: string;
4
- line: number;
5
- content: string;
6
- fullLine: string;
7
- }
8
- export declare function scanProjectTodos(projectRoot: string): TodoItem[];
@@ -1,148 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- const IGNORE_PATTERNS = [
4
- 'node_modules',
5
- '.git',
6
- 'dist',
7
- 'build',
8
- 'coverage',
9
- '.next',
10
- '.nuxt',
11
- '.output',
12
- 'out',
13
- '.DS_Store',
14
- '*.log',
15
- '*.lock',
16
- 'yarn.lock',
17
- 'package-lock.json',
18
- 'pnpm-lock.yaml',
19
- ];
20
- // Common task markers - support various formats
21
- // Only include markers that clearly indicate actionable tasks
22
- const TODO_PATTERNS = [
23
- // Single-line comments with markers (// TODO, // FIXME, etc.)
24
- /\/\/\s*(?:TODO|FIXME|HACK|XXX|BUG):?\s*(.+)/i,
25
- // Block comments (/* TODO */)
26
- /\/\*\s*(?:TODO|FIXME|HACK|XXX|BUG):?\s*(.+?)\s*\*\//i,
27
- // Hash comments (# TODO) for Python, Ruby, Shell, etc.
28
- /#\s*(?:TODO|FIXME|HACK|XXX|BUG):?\s*(.+)/i,
29
- // HTML/XML comments (<!-- TODO -->)
30
- /<!--\s*(?:TODO|FIXME|HACK|XXX|BUG):?\s*(.+?)\s*-->/i,
31
- // JSDoc/PHPDoc style (@todo)
32
- /\/\*\*?\s*@(?:todo|fixme):?\s*(.+?)(?:\s*\*\/|\n)/i,
33
- // TODO with brackets/parentheses (common format for task assignment)
34
- /\/\/\s*TODO\s*[\(\[\{]\s*(.+?)\s*[\)\]\}]/i,
35
- /#\s*TODO\s*[\(\[\{]\s*(.+?)\s*[\)\]\}]/i,
36
- // Multi-line block comment TODO (catches TODO on its own line)
37
- /\/\*[\s\S]*?\bTODO:?\s*(.+?)[\s\S]*?\*\//i,
38
- ];
39
- function shouldIgnore(filePath) {
40
- const relativePath = filePath;
41
- return IGNORE_PATTERNS.some(pattern => {
42
- if (pattern.includes('*')) {
43
- const regex = new RegExp(pattern.replace(/\*/g, '.*'));
44
- return regex.test(relativePath);
45
- }
46
- return relativePath.includes(pattern);
47
- });
48
- }
49
- function scanFileForTodos(filePath, rootDir) {
50
- try {
51
- const content = fs.readFileSync(filePath, 'utf-8');
52
- const lines = content.split('\n');
53
- const todos = [];
54
- lines.forEach((line, index) => {
55
- for (const pattern of TODO_PATTERNS) {
56
- const match = line.match(pattern);
57
- if (match) {
58
- const todoContent = match[1]?.trim() || '';
59
- const relativePath = path.relative(rootDir, filePath);
60
- todos.push({
61
- id: `${relativePath}:${index + 1}`,
62
- file: relativePath,
63
- line: index + 1,
64
- content: todoContent,
65
- fullLine: line.trim(),
66
- });
67
- break;
68
- }
69
- }
70
- });
71
- return todos;
72
- }
73
- catch (error) {
74
- // Ignore files that can't be read
75
- return [];
76
- }
77
- }
78
- function scanDirectory(dir, rootDir) {
79
- let todos = [];
80
- try {
81
- const entries = fs.readdirSync(dir, { withFileTypes: true });
82
- for (const entry of entries) {
83
- const fullPath = path.join(dir, entry.name);
84
- const relativePath = path.relative(rootDir, fullPath);
85
- if (shouldIgnore(relativePath)) {
86
- continue;
87
- }
88
- if (entry.isDirectory()) {
89
- todos = todos.concat(scanDirectory(fullPath, rootDir));
90
- }
91
- else if (entry.isFile()) {
92
- // Only scan text files
93
- const ext = path.extname(entry.name).toLowerCase();
94
- const textExtensions = [
95
- '.ts',
96
- '.tsx',
97
- '.js',
98
- '.jsx',
99
- '.py',
100
- '.go',
101
- '.rs',
102
- '.java',
103
- '.c',
104
- '.cpp',
105
- '.h',
106
- '.hpp',
107
- '.cs',
108
- '.php',
109
- '.rb',
110
- '.swift',
111
- '.kt',
112
- '.scala',
113
- '.sh',
114
- '.bash',
115
- '.zsh',
116
- '.fish',
117
- '.vim',
118
- '.lua',
119
- '.sql',
120
- '.html',
121
- '.css',
122
- '.scss',
123
- '.sass',
124
- '.less',
125
- '.vue',
126
- '.svelte',
127
- '.md',
128
- '.txt',
129
- '.json',
130
- '.yaml',
131
- '.yml',
132
- '.toml',
133
- '.xml',
134
- ];
135
- if (textExtensions.includes(ext) || ext === '') {
136
- todos = todos.concat(scanFileForTodos(fullPath, rootDir));
137
- }
138
- }
139
- }
140
- }
141
- catch (error) {
142
- // Ignore directories that can't be read
143
- }
144
- return todos;
145
- }
146
- export function scanProjectTodos(projectRoot) {
147
- return scanDirectory(projectRoot, projectRoot);
148
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * 工具显示配置
3
- * 用于判断哪些工具需要显示两步状态(进行中+完成),哪些工具只需要显示完成状态
4
- */
5
- /**
6
- * 判断工具是否需要显示两步状态
7
- * @param toolName - 工具名称
8
- * @returns 是否需要显示进行中和完成两个状态
9
- */
10
- export declare function isToolNeedTwoStepDisplay(toolName: string): boolean;
11
- /**
12
- * 判断工具是否只需要在静态区显示完成状态
13
- * @param toolName - 工具名称
14
- * @returns 是否只需要显示完成状态
15
- */
16
- export declare function isToolOnlyShowCompleted(toolName: string): boolean;
@@ -1,47 +0,0 @@
1
- /**
2
- * 工具显示配置
3
- * 用于判断哪些工具需要显示两步状态(进行中+完成),哪些工具只需要显示完成状态
4
- */
5
- /**
6
- * 需要显示两步状态的工具(进行中 → 完成)
7
- * 这些通常是耗时较长的工具,用户需要看到执行进度
8
- */
9
- const TWO_STEP_TOOLS = new Set([
10
- // 文件编辑工具 - 耗时较长,需要显示进度
11
- 'filesystem-edit',
12
- 'filesystem-edit_search',
13
- 'filesystem-create',
14
- // 终端执行工具 - 执行时间不确定,需要显示进度
15
- 'terminal-execute',
16
- // 代码库搜索工具 - 需要生成 embedding 和搜索,耗时较长
17
- 'codebase-search',
18
- // 联网搜索工具 - 需要启动浏览器、网络请求、内容处理,耗时较长
19
- 'websearch-search',
20
- 'websearch-fetch',
21
- // 子代理工具 - 执行复杂任务,需要显示进度
22
- // 所有以 'subagent-' 开头的工具都需要两步显示
23
- ]);
24
- /**
25
- * 判断工具是否需要显示两步状态
26
- * @param toolName - 工具名称
27
- * @returns 是否需要显示进行中和完成两个状态
28
- */
29
- export function isToolNeedTwoStepDisplay(toolName) {
30
- // 检查是否在固定列表中
31
- if (TWO_STEP_TOOLS.has(toolName)) {
32
- return true;
33
- }
34
- // 检查是否是子代理工具 (subagent- 开头)
35
- if (toolName.startsWith('subagent-')) {
36
- return true;
37
- }
38
- return false;
39
- }
40
- /**
41
- * 判断工具是否只需要在静态区显示完成状态
42
- * @param toolName - 工具名称
43
- * @returns 是否只需要显示完成状态
44
- */
45
- export function isToolOnlyShowCompleted(toolName) {
46
- return !isToolNeedTwoStepDisplay(toolName);
47
- }
@@ -1,37 +0,0 @@
1
- import type { SubAgentMessage } from './subAgentExecutor.js';
2
- import type { ConfirmationResult } from '../ui/components/ToolConfirmation.js';
3
- import type { ImageContent } from '../api/types.js';
4
- export interface ToolCall {
5
- id: string;
6
- type: 'function';
7
- function: {
8
- name: string;
9
- arguments: string;
10
- };
11
- }
12
- export interface ToolResult {
13
- tool_call_id: string;
14
- role: 'tool';
15
- content: string;
16
- images?: ImageContent[];
17
- }
18
- export type SubAgentMessageCallback = (message: SubAgentMessage) => void;
19
- export interface ToolConfirmationCallback {
20
- (toolCall: ToolCall, batchToolNames?: string, allTools?: ToolCall[]): Promise<ConfirmationResult>;
21
- }
22
- export interface ToolApprovalChecker {
23
- (toolName: string): boolean;
24
- }
25
- export interface AddToAlwaysApprovedCallback {
26
- (toolName: string): void;
27
- }
28
- /**
29
- * Execute a single tool call and return the result
30
- */
31
- export declare function executeToolCall(toolCall: ToolCall, abortSignal?: AbortSignal, onTokenUpdate?: (tokenCount: number) => void, onSubAgentMessage?: SubAgentMessageCallback, requestToolConfirmation?: ToolConfirmationCallback, isToolAutoApproved?: ToolApprovalChecker, yoloMode?: boolean, addToAlwaysApproved?: AddToAlwaysApprovedCallback): Promise<ToolResult>;
32
- /**
33
- * Execute multiple tool calls with intelligent sequencing
34
- * - Tools modifying the same resource execute sequentially
35
- * - Independent tools execute in parallel
36
- */
37
- export declare function executeToolCalls(toolCalls: ToolCall[], abortSignal?: AbortSignal, onTokenUpdate?: (tokenCount: number) => void, onSubAgentMessage?: SubAgentMessageCallback, requestToolConfirmation?: ToolConfirmationCallback, isToolAutoApproved?: ToolApprovalChecker, yoloMode?: boolean, addToAlwaysApproved?: AddToAlwaysApprovedCallback): Promise<ToolResult[]>;
@@ -1,224 +0,0 @@
1
- import { executeMCPTool } from './mcpToolsManager.js';
2
- import { subAgentService } from '../mcp/subagent.js';
3
- /**
4
- * Check if a value is a multimodal content array
5
- */
6
- function isMultimodalContent(value) {
7
- return (Array.isArray(value) &&
8
- value.length > 0 &&
9
- value.every((item) => item &&
10
- typeof item === 'object' &&
11
- (item.type === 'text' || item.type === 'image')));
12
- }
13
- /**
14
- * Extract images and text content from a result that may be multimodal
15
- */
16
- function extractMultimodalContent(result) {
17
- // Check if result has multimodal content array
18
- let contentToCheck = result;
19
- // Handle wrapped results (e.g., {content: [...], files: [...], totalFiles: n})
20
- if (result && typeof result === 'object' && result.content) {
21
- contentToCheck = result.content;
22
- }
23
- if (isMultimodalContent(contentToCheck)) {
24
- const textParts = [];
25
- const images = [];
26
- for (const item of contentToCheck) {
27
- if (item.type === 'text') {
28
- textParts.push(item.text);
29
- }
30
- else if (item.type === 'image') {
31
- images.push({
32
- type: 'image',
33
- data: item.data,
34
- mimeType: item.mimeType,
35
- });
36
- }
37
- }
38
- // If we extracted the content, we need to rebuild the result
39
- if (result && typeof result === 'object' && result.content === contentToCheck) {
40
- // Check if result has only 'content' field (pure MCP response)
41
- // In this case, return the extracted text directly without wrapping
42
- const resultKeys = Object.keys(result);
43
- if (resultKeys.length === 1 && resultKeys[0] === 'content') {
44
- // Pure MCP response - return extracted text directly
45
- return {
46
- textContent: textParts.join('\n\n'),
47
- images: images.length > 0 ? images : undefined,
48
- };
49
- }
50
- // Result has additional fields (e.g., files, totalFiles) - preserve them
51
- const newResult = { ...result, content: textParts.join('\n\n') };
52
- return {
53
- textContent: JSON.stringify(newResult),
54
- images: images.length > 0 ? images : undefined,
55
- };
56
- }
57
- return {
58
- textContent: textParts.join('\n\n'),
59
- images: images.length > 0 ? images : undefined,
60
- };
61
- }
62
- // Not multimodal, return as JSON string
63
- return {
64
- textContent: JSON.stringify(result),
65
- };
66
- }
67
- /**
68
- * Execute a single tool call and return the result
69
- */
70
- export async function executeToolCall(toolCall, abortSignal, onTokenUpdate, onSubAgentMessage, requestToolConfirmation, isToolAutoApproved, yoloMode, addToAlwaysApproved) {
71
- try {
72
- const args = JSON.parse(toolCall.function.arguments);
73
- // Check if this is a sub-agent tool
74
- if (toolCall.function.name.startsWith('subagent-')) {
75
- const agentId = toolCall.function.name.substring('subagent-'.length);
76
- // Create a tool confirmation adapter for sub-agent
77
- const subAgentToolConfirmation = requestToolConfirmation
78
- ? async (toolName, toolArgs) => {
79
- // Create a fake tool call for confirmation
80
- const fakeToolCall = {
81
- id: 'subagent-tool',
82
- type: 'function',
83
- function: {
84
- name: toolName,
85
- arguments: JSON.stringify(toolArgs),
86
- },
87
- };
88
- return await requestToolConfirmation(fakeToolCall);
89
- }
90
- : undefined;
91
- const result = await subAgentService.execute({
92
- agentId,
93
- prompt: args.prompt,
94
- onMessage: onSubAgentMessage,
95
- abortSignal,
96
- requestToolConfirmation: subAgentToolConfirmation
97
- ? async (toolCall) => {
98
- // Use the adapter to convert to the expected signature
99
- const args = JSON.parse(toolCall.function.arguments);
100
- return await subAgentToolConfirmation(toolCall.function.name, args);
101
- }
102
- : undefined,
103
- isToolAutoApproved,
104
- yoloMode,
105
- addToAlwaysApproved,
106
- });
107
- return {
108
- tool_call_id: toolCall.id,
109
- role: 'tool',
110
- content: JSON.stringify(result),
111
- };
112
- }
113
- // Regular tool execution
114
- const result = await executeMCPTool(toolCall.function.name, args, abortSignal, onTokenUpdate);
115
- // Extract multimodal content (text + images)
116
- const { textContent, images } = extractMultimodalContent(result);
117
- return {
118
- tool_call_id: toolCall.id,
119
- role: 'tool',
120
- content: textContent,
121
- images,
122
- };
123
- }
124
- catch (error) {
125
- return {
126
- tool_call_id: toolCall.id,
127
- role: 'tool',
128
- content: `Error: ${error instanceof Error ? error.message : 'Tool execution failed'}`,
129
- };
130
- }
131
- }
132
- /**
133
- * Categorize tools by their resource type for proper execution sequencing
134
- */
135
- function getToolResourceType(toolName) {
136
- // TODO tools all modify the same TODO file - must be sequential
137
- if (toolName === 'todo-create' ||
138
- toolName === 'todo-update' ||
139
- toolName === 'todo-add' ||
140
- toolName === 'todo-delete') {
141
- return 'todo-state';
142
- }
143
- // Terminal commands must be sequential to avoid race conditions
144
- // (e.g., npm install -> npm build, port conflicts, file locks)
145
- if (toolName === 'terminal-execute') {
146
- return 'terminal-execution';
147
- }
148
- // Each file is a separate resource
149
- if (toolName === 'filesystem-edit' ||
150
- toolName === 'filesystem-edit_search' ||
151
- toolName === 'filesystem-create') {
152
- return 'filesystem'; // Will be further refined by file path
153
- }
154
- // Other tools are independent
155
- return 'independent';
156
- }
157
- /**
158
- * Get resource identifier for a tool call
159
- * Tools modifying the same resource will have the same identifier
160
- */
161
- function getResourceIdentifier(toolCall) {
162
- const toolName = toolCall.function.name;
163
- const resourceType = getToolResourceType(toolName);
164
- if (resourceType === 'todo-state') {
165
- return 'todo-state'; // All TODO operations share same resource
166
- }
167
- if (resourceType === 'terminal-execution') {
168
- return 'terminal-execution'; // All terminal commands share same execution context
169
- }
170
- if (resourceType === 'filesystem') {
171
- try {
172
- const args = JSON.parse(toolCall.function.arguments);
173
- // Support both single file and array of files
174
- const filePath = args.filePath;
175
- if (typeof filePath === 'string') {
176
- return `filesystem:${filePath}`;
177
- }
178
- else if (Array.isArray(filePath)) {
179
- // For batch operations, treat as independent (already handling multiple files)
180
- return `filesystem-batch:${toolCall.id}`;
181
- }
182
- }
183
- catch {
184
- // Parsing error, treat as independent
185
- }
186
- }
187
- // Each independent tool gets its own unique identifier
188
- return `independent:${toolCall.id}`;
189
- }
190
- /**
191
- * Execute multiple tool calls with intelligent sequencing
192
- * - Tools modifying the same resource execute sequentially
193
- * - Independent tools execute in parallel
194
- */
195
- export async function executeToolCalls(toolCalls, abortSignal, onTokenUpdate, onSubAgentMessage, requestToolConfirmation, isToolAutoApproved, yoloMode, addToAlwaysApproved) {
196
- // Group tool calls by their resource identifier
197
- const resourceGroups = new Map();
198
- for (const toolCall of toolCalls) {
199
- const resourceId = getResourceIdentifier(toolCall);
200
- const group = resourceGroups.get(resourceId) || [];
201
- group.push(toolCall);
202
- resourceGroups.set(resourceId, group);
203
- }
204
- // Execute each resource group sequentially, but execute different groups in parallel
205
- const results = await Promise.all(Array.from(resourceGroups.values()).map(async (group) => {
206
- // Within the same resource group, execute sequentially
207
- const groupResults = [];
208
- for (const toolCall of group) {
209
- const result = await executeToolCall(toolCall, abortSignal, onTokenUpdate, onSubAgentMessage, requestToolConfirmation, isToolAutoApproved, yoloMode, addToAlwaysApproved);
210
- groupResults.push(result);
211
- }
212
- return groupResults;
213
- }));
214
- // Flatten results and restore original order
215
- const flatResults = results.flat();
216
- const resultMap = new Map(flatResults.map(r => [r.tool_call_id, r]));
217
- return toolCalls.map(tc => {
218
- const result = resultMap.get(tc.id);
219
- if (!result) {
220
- throw new Error(`Result not found for tool call ${tc.id}`);
221
- }
222
- return result;
223
- });
224
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Save usage data to file system
3
- * This is called directly from API layers to ensure all usage is tracked
4
- */
5
- export declare function saveUsageToFile(model: string, usage: {
6
- prompt_tokens?: number;
7
- completion_tokens?: number;
8
- cache_creation_input_tokens?: number;
9
- cache_read_input_tokens?: number;
10
- cached_tokens?: number;
11
- }): void;