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.
- package/dist/api/anthropic.d.ts +1 -1
- package/dist/api/anthropic.js +52 -76
- package/dist/api/chat.d.ts +4 -4
- package/dist/api/chat.js +32 -17
- package/dist/api/gemini.d.ts +1 -1
- package/dist/api/gemini.js +20 -13
- package/dist/api/models.d.ts +3 -0
- package/dist/api/models.js +101 -17
- package/dist/api/responses.d.ts +5 -5
- package/dist/api/responses.js +29 -27
- package/dist/app.js +4 -1
- package/dist/hooks/useClipboard.d.ts +4 -0
- package/dist/hooks/useClipboard.js +120 -0
- package/dist/hooks/useCommandHandler.d.ts +26 -0
- package/dist/hooks/useCommandHandler.js +158 -0
- package/dist/hooks/useCommandPanel.d.ts +16 -0
- package/dist/hooks/useCommandPanel.js +53 -0
- package/dist/hooks/useConversation.d.ts +9 -1
- package/dist/hooks/useConversation.js +152 -58
- package/dist/hooks/useFilePicker.d.ts +17 -0
- package/dist/hooks/useFilePicker.js +91 -0
- package/dist/hooks/useHistoryNavigation.d.ts +21 -0
- package/dist/hooks/useHistoryNavigation.js +50 -0
- package/dist/hooks/useInputBuffer.d.ts +6 -0
- package/dist/hooks/useInputBuffer.js +29 -0
- package/dist/hooks/useKeyboardInput.d.ts +51 -0
- package/dist/hooks/useKeyboardInput.js +272 -0
- package/dist/hooks/useSnapshotState.d.ts +12 -0
- package/dist/hooks/useSnapshotState.js +28 -0
- package/dist/hooks/useStreamingState.d.ts +24 -0
- package/dist/hooks/useStreamingState.js +96 -0
- package/dist/hooks/useVSCodeState.d.ts +8 -0
- package/dist/hooks/useVSCodeState.js +63 -0
- package/dist/mcp/filesystem.d.ts +24 -5
- package/dist/mcp/filesystem.js +52 -17
- package/dist/mcp/todo.js +4 -8
- package/dist/ui/components/ChatInput.js +71 -560
- package/dist/ui/components/DiffViewer.js +57 -30
- package/dist/ui/components/FileList.js +70 -26
- package/dist/ui/components/MessageList.d.ts +6 -0
- package/dist/ui/components/MessageList.js +47 -15
- package/dist/ui/components/ShimmerText.d.ts +9 -0
- package/dist/ui/components/ShimmerText.js +30 -0
- package/dist/ui/components/TodoTree.d.ts +1 -1
- package/dist/ui/components/TodoTree.js +0 -4
- package/dist/ui/components/ToolConfirmation.js +14 -6
- package/dist/ui/pages/ChatScreen.js +174 -373
- package/dist/ui/pages/CustomHeadersScreen.d.ts +6 -0
- package/dist/ui/pages/CustomHeadersScreen.js +104 -0
- package/dist/ui/pages/WelcomeScreen.js +5 -0
- package/dist/utils/apiConfig.d.ts +10 -0
- package/dist/utils/apiConfig.js +51 -0
- package/dist/utils/incrementalSnapshot.d.ts +8 -0
- package/dist/utils/incrementalSnapshot.js +63 -0
- package/dist/utils/mcpToolsManager.js +6 -1
- package/dist/utils/retryUtils.d.ts +22 -0
- package/dist/utils/retryUtils.js +180 -0
- package/dist/utils/sessionConverter.js +80 -17
- package/dist/utils/sessionManager.js +35 -4
- package/dist/utils/textUtils.d.ts +4 -0
- package/dist/utils/textUtils.js +19 -0
- package/dist/utils/todoPreprocessor.d.ts +1 -1
- package/dist/utils/todoPreprocessor.js +0 -1
- package/dist/utils/vscodeConnection.d.ts +8 -0
- package/dist/utils/vscodeConnection.js +44 -0
- package/package.json +1 -1
- package/readme.md +3 -1
package/dist/mcp/filesystem.js
CHANGED
|
@@ -300,26 +300,45 @@ export class FilesystemMCPService {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
|
-
* Delete
|
|
304
|
-
* @param
|
|
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(
|
|
308
|
+
async deleteFile(filePaths) {
|
|
309
309
|
try {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
##
|
|
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
|
-
-
|
|
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
|
-
|
|
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: {
|