snow-ai 0.2.25 → 0.2.27

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.
@@ -46,12 +46,18 @@ export declare class FilesystemMCPService {
46
46
  */
47
47
  private calculateSimilarity;
48
48
  /**
49
- * Calculate Levenshtein distance between two strings
49
+ * Calculate Levenshtein distance between two strings with early termination
50
+ * @param str1 First string
51
+ * @param str2 Second string
52
+ * @param maxDistance Maximum distance to compute (early exit if exceeded)
53
+ * @returns Levenshtein distance, or maxDistance+1 if exceeded
50
54
  */
51
55
  private levenshteinDistance;
52
56
  /**
53
57
  * Find the closest matching candidates in the file content
54
58
  * Returns top N candidates sorted by similarity
59
+ * Optimized with safe pre-filtering and early exit
60
+ * ASYNC to prevent terminal freeze during search
55
61
  */
56
62
  private findClosestMatches;
57
63
  /**
@@ -71,17 +77,26 @@ export declare class FilesystemMCPService {
71
77
  private findSmartContextBoundaries;
72
78
  /**
73
79
  * Get the content of a file with optional line range
74
- * @param filePath - Path to the file (relative to base path or absolute)
80
+ * @param filePath - Path to the file (relative to base path or absolute) or array of file paths
75
81
  * @param startLine - Starting line number (1-indexed, inclusive, optional - defaults to 1)
76
82
  * @param endLine - Ending line number (1-indexed, inclusive, optional - defaults to 500 or file end)
77
83
  * @returns Object containing the requested content with line numbers and metadata
78
84
  * @throws Error if file doesn't exist or cannot be read
79
85
  */
80
- getFileContent(filePath: string, startLine?: number, endLine?: number): Promise<{
86
+ getFileContent(filePath: string | string[], startLine?: number, endLine?: number): Promise<{
81
87
  content: string;
82
88
  startLine: number;
83
89
  endLine: number;
84
90
  totalLines: number;
91
+ } | {
92
+ content: string;
93
+ files: Array<{
94
+ path: string;
95
+ startLine: number;
96
+ endLine: number;
97
+ totalLines: number;
98
+ }>;
99
+ totalFiles: number;
85
100
  }>;
86
101
  /**
87
102
  * Create a new file with specified content
@@ -134,7 +149,7 @@ export declare class FilesystemMCPService {
134
149
  * @param replaceContent - New content to replace the search content with
135
150
  * @param occurrence - Which occurrence to replace (1-indexed, default: 1, use -1 for all)
136
151
  * @param contextLines - Number of context lines to return before and after the edit (default: 8)
137
- * @returns Object containing success message, before/after comparison, and diagnostics
152
+ * @returns Object containing success message, before/after comparison, and diagnostics from IDE (VSCode or JetBrains)
138
153
  * @throws Error if search content is not found or multiple matches exist
139
154
  */
140
155
  editFileBySearch(filePath: string, searchContent: string, replaceContent: string, occurrence?: number, contextLines?: number): Promise<{
@@ -162,7 +177,7 @@ export declare class FilesystemMCPService {
162
177
  * @param endLine - Ending line number (1-indexed, inclusive) - get from filesystem_read output
163
178
  * @param newContent - New content to replace the specified lines (WITHOUT line numbers)
164
179
  * @param contextLines - Number of context lines to return before and after the edit (default: 8)
165
- * @returns Object containing success message, precise before/after comparison, and diagnostics
180
+ * @returns Object containing success message, precise before/after comparison, and diagnostics from IDE (VSCode or JetBrains)
166
181
  * @throws Error if file editing fails
167
182
  */
168
183
  editFile(filePath: string, startLine: number, endLine: number, newContent: string, contextLines?: number): Promise<{
@@ -189,29 +204,6 @@ export declare class FilesystemMCPService {
189
204
  private validatePath;
190
205
  }
191
206
  export declare const filesystemService: FilesystemMCPService;
192
- /**
193
- * MCP Tool definitions for integration
194
- *
195
- * 🎯 **RECOMMENDED WORKFLOW FOR AI AGENTS**:
196
- *
197
- * 1️⃣ **SEARCH FIRST** (DON'T skip this!):
198
- * - Use ace_text_search() to find code patterns/strings
199
- * - Use ace_search_symbols() to find functions/classes by name
200
- * - Use ace_file_outline() to understand file structure
201
- *
202
- * 2️⃣ **READ STRATEGICALLY** (Only after search):
203
- * - Use filesystem_read() WITHOUT line numbers to read entire file
204
- * - OR use filesystem_read(filePath, startLine, endLine) to read specific range
205
- * - ⚠️ AVOID reading files line-by-line from top - wastes tokens!
206
- *
207
- * 3️⃣ **EDIT SAFELY**:
208
- * - PREFER filesystem_edit_search() for modifying existing code (no line counting!)
209
- * - Use filesystem_edit() only for adding new code or when search-replace doesn't fit
210
- *
211
- * 📊 **TOKEN EFFICIENCY**:
212
- * - ❌ BAD: Read file top-to-bottom, repeat reading, blind scanning
213
- * - ✅ GOOD: Search → Targeted read → Edit with context
214
- */
215
207
  export declare const mcpTools: ({
216
208
  name: string;
217
209
  description: string;
@@ -219,8 +211,19 @@ export declare const mcpTools: ({
219
211
  type: string;
220
212
  properties: {
221
213
  filePath: {
222
- type: string;
214
+ oneOf: ({
215
+ type: string;
216
+ description: string;
217
+ items?: undefined;
218
+ } | {
219
+ type: string;
220
+ items: {
221
+ type: string;
222
+ };
223
+ description: string;
224
+ })[];
223
225
  description: string;
226
+ type?: undefined;
224
227
  };
225
228
  startLine: {
226
229
  type: string;
@@ -251,6 +254,7 @@ export declare const mcpTools: ({
251
254
  filePath: {
252
255
  type: string;
253
256
  description: string;
257
+ oneOf?: undefined;
254
258
  };
255
259
  content: {
256
260
  type: string;
@@ -282,6 +286,7 @@ export declare const mcpTools: ({
282
286
  filePath: {
283
287
  type: string;
284
288
  description: string;
289
+ oneOf?: undefined;
285
290
  };
286
291
  filePaths: {
287
292
  oneOf: ({
@@ -344,6 +349,7 @@ export declare const mcpTools: ({
344
349
  filePath: {
345
350
  type: string;
346
351
  description: string;
352
+ oneOf?: undefined;
347
353
  };
348
354
  searchContent: {
349
355
  type: string;
@@ -382,6 +388,7 @@ export declare const mcpTools: ({
382
388
  filePath: {
383
389
  type: string;
384
390
  description: string;
391
+ oneOf?: undefined;
385
392
  };
386
393
  startLine: {
387
394
  type: string;