snow-ai 0.2.15 → 0.2.17

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 (67) hide show
  1. package/dist/api/anthropic.d.ts +1 -1
  2. package/dist/api/anthropic.js +52 -76
  3. package/dist/api/chat.d.ts +4 -4
  4. package/dist/api/chat.js +32 -17
  5. package/dist/api/gemini.d.ts +1 -1
  6. package/dist/api/gemini.js +20 -13
  7. package/dist/api/models.d.ts +3 -0
  8. package/dist/api/models.js +101 -17
  9. package/dist/api/responses.d.ts +5 -5
  10. package/dist/api/responses.js +29 -27
  11. package/dist/app.js +4 -1
  12. package/dist/hooks/useClipboard.d.ts +4 -0
  13. package/dist/hooks/useClipboard.js +120 -0
  14. package/dist/hooks/useCommandHandler.d.ts +26 -0
  15. package/dist/hooks/useCommandHandler.js +158 -0
  16. package/dist/hooks/useCommandPanel.d.ts +16 -0
  17. package/dist/hooks/useCommandPanel.js +53 -0
  18. package/dist/hooks/useConversation.d.ts +9 -1
  19. package/dist/hooks/useConversation.js +152 -58
  20. package/dist/hooks/useFilePicker.d.ts +17 -0
  21. package/dist/hooks/useFilePicker.js +91 -0
  22. package/dist/hooks/useHistoryNavigation.d.ts +21 -0
  23. package/dist/hooks/useHistoryNavigation.js +50 -0
  24. package/dist/hooks/useInputBuffer.d.ts +6 -0
  25. package/dist/hooks/useInputBuffer.js +29 -0
  26. package/dist/hooks/useKeyboardInput.d.ts +51 -0
  27. package/dist/hooks/useKeyboardInput.js +272 -0
  28. package/dist/hooks/useSnapshotState.d.ts +12 -0
  29. package/dist/hooks/useSnapshotState.js +28 -0
  30. package/dist/hooks/useStreamingState.d.ts +24 -0
  31. package/dist/hooks/useStreamingState.js +96 -0
  32. package/dist/hooks/useVSCodeState.d.ts +8 -0
  33. package/dist/hooks/useVSCodeState.js +63 -0
  34. package/dist/mcp/filesystem.d.ts +24 -5
  35. package/dist/mcp/filesystem.js +52 -17
  36. package/dist/mcp/todo.js +4 -8
  37. package/dist/ui/components/ChatInput.js +71 -560
  38. package/dist/ui/components/DiffViewer.js +57 -30
  39. package/dist/ui/components/FileList.js +70 -26
  40. package/dist/ui/components/MessageList.d.ts +6 -0
  41. package/dist/ui/components/MessageList.js +47 -15
  42. package/dist/ui/components/ShimmerText.d.ts +9 -0
  43. package/dist/ui/components/ShimmerText.js +30 -0
  44. package/dist/ui/components/TodoTree.d.ts +1 -1
  45. package/dist/ui/components/TodoTree.js +0 -4
  46. package/dist/ui/components/ToolConfirmation.js +14 -6
  47. package/dist/ui/pages/ChatScreen.js +174 -373
  48. package/dist/ui/pages/CustomHeadersScreen.d.ts +6 -0
  49. package/dist/ui/pages/CustomHeadersScreen.js +104 -0
  50. package/dist/ui/pages/WelcomeScreen.js +5 -0
  51. package/dist/utils/apiConfig.d.ts +10 -0
  52. package/dist/utils/apiConfig.js +51 -0
  53. package/dist/utils/incrementalSnapshot.d.ts +8 -0
  54. package/dist/utils/incrementalSnapshot.js +63 -0
  55. package/dist/utils/mcpToolsManager.js +6 -1
  56. package/dist/utils/retryUtils.d.ts +22 -0
  57. package/dist/utils/retryUtils.js +180 -0
  58. package/dist/utils/sessionConverter.js +80 -17
  59. package/dist/utils/sessionManager.js +35 -4
  60. package/dist/utils/textUtils.d.ts +4 -0
  61. package/dist/utils/textUtils.js +19 -0
  62. package/dist/utils/todoPreprocessor.d.ts +1 -1
  63. package/dist/utils/todoPreprocessor.js +0 -1
  64. package/dist/utils/vscodeConnection.d.ts +8 -0
  65. package/dist/utils/vscodeConnection.js +44 -0
  66. package/package.json +1 -1
  67. package/readme.md +3 -1
@@ -300,26 +300,45 @@ export class FilesystemMCPService {
300
300
  }
301
301
  }
302
302
  /**
303
- * Delete a file
304
- * @param filePath - Path to the file to delete
305
- * @returns Success message
303
+ * Delete one or multiple files
304
+ * @param filePaths - Single file path or array of file paths to delete
305
+ * @returns Success message with details
306
306
  * @throws Error if file deletion fails
307
307
  */
308
- async deleteFile(filePath) {
308
+ async deleteFile(filePaths) {
309
309
  try {
310
- const fullPath = this.resolvePath(filePath);
311
- await this.validatePath(fullPath);
312
- const stats = await fs.stat(fullPath);
313
- if (!stats.isFile()) {
314
- throw new Error(`Path is not a file: ${filePath}`);
310
+ const paths = Array.isArray(filePaths) ? filePaths : [filePaths];
311
+ const results = [];
312
+ const errors = [];
313
+ for (const filePath of paths) {
314
+ try {
315
+ const fullPath = this.resolvePath(filePath);
316
+ await this.validatePath(fullPath);
317
+ const stats = await fs.stat(fullPath);
318
+ if (!stats.isFile()) {
319
+ throw new Error(`Path is not a file: ${filePath}`);
320
+ }
321
+ // Backup file before deletion
322
+ await incrementalSnapshotManager.backupFile(fullPath);
323
+ await fs.unlink(fullPath);
324
+ results.push(`✅ ${filePath}`);
325
+ }
326
+ catch (error) {
327
+ const errorMsg = error instanceof Error ? error.message : 'Unknown error';
328
+ errors.push(`❌ ${filePath}: ${errorMsg}`);
329
+ }
315
330
  }
316
- // Backup file before deletion
317
- await incrementalSnapshotManager.backupFile(fullPath);
318
- await fs.unlink(fullPath);
319
- return `File deleted successfully: ${filePath}`;
331
+ const summary = [];
332
+ if (results.length > 0) {
333
+ summary.push(`Successfully deleted ${results.length} file(s):\n${results.join('\n')}`);
334
+ }
335
+ if (errors.length > 0) {
336
+ summary.push(`Failed to delete ${errors.length} file(s):\n${errors.join('\n')}`);
337
+ }
338
+ return summary.join('\n\n');
320
339
  }
321
340
  catch (error) {
322
- throw new Error(`Failed to delete file ${filePath}: ${error instanceof Error ? error.message : 'Unknown error'}`);
341
+ throw new Error(`Failed to delete files: ${error instanceof Error ? error.message : 'Unknown error'}`);
323
342
  }
324
343
  }
325
344
  /**
@@ -778,16 +797,32 @@ export const mcpTools = [
778
797
  },
779
798
  {
780
799
  name: 'filesystem_delete',
781
- description: 'Delete a file',
800
+ description: 'Delete one or multiple files. Supports both single file and batch deletion.',
782
801
  inputSchema: {
783
802
  type: 'object',
784
803
  properties: {
785
804
  filePath: {
786
805
  type: 'string',
787
- description: 'Path to the file to delete',
806
+ description: 'Path to a single file to delete (deprecated: use filePaths for single or multiple files)',
807
+ },
808
+ filePaths: {
809
+ oneOf: [
810
+ {
811
+ type: 'string',
812
+ description: 'Path to a single file to delete'
813
+ },
814
+ {
815
+ type: 'array',
816
+ items: {
817
+ type: 'string'
818
+ },
819
+ description: 'Array of file paths to delete'
820
+ }
821
+ ],
822
+ description: 'Single file path or array of file paths to delete'
788
823
  },
789
824
  },
790
- required: ['filePath'],
825
+ // Make both optional, but at least one is required (validated in code)
791
826
  },
792
827
  },
793
828
  {
package/dist/mcp/todo.js CHANGED
@@ -192,28 +192,24 @@ Complete TODO list with all task IDs, content, status, and hierarchy.`,
192
192
  name: 'todo-update',
193
193
  description: `Update TODO status or content - USE ONLY WHEN COMPLETING TASKS.
194
194
 
195
- ## CORE PRINCIPLE - WORK FIRST, UPDATES LAST:
196
- Focus on COMPLETING TASKS, not updating status. Only update TODO when a task is 100% finished and verified.
195
+ ## CORE PRINCIPLE - WORK FIRST, completed in an orderly manner:
197
196
 
198
- ## SIMPLIFIED STATUS MODEL:
197
+ ## STATUS MODEL:
199
198
  - **pending**: Task not yet completed (default)
200
199
  - **completed**: Task is 100% finished and verified
201
200
 
202
201
  ## WHEN TO UPDATE:
203
202
  ✅ **Mark "completed"** ONLY when:
204
- - Task is 100% finished (no partial work)
205
- - Tests/builds passed (if applicable)
203
+ - When completing a task in the List
206
204
  - No errors or blockers
207
205
  - You've actually verified it works
208
206
 
209
207
  ## WHEN NOT TO UPDATE:
210
208
  ❌ Don't update status to track "in progress" - just do the work
211
- ❌ Don't update multiple times per task - once when done is enough
212
209
  ❌ Don't update before verifying the work is complete
213
- ❌ Don't update content unless there's a genuine error in the description
214
210
 
215
211
  ## BEST PRACTICE:
216
- Complete 3-5 tasks, then batch update them all to "completed" at once. This is more efficient than constant status updates.`,
212
+ Every time you complete a task in Task, it will be updated to "Completed" immediately.`,
217
213
  inputSchema: {
218
214
  type: 'object',
219
215
  properties: {