snow-ai 0.2.25 → 0.2.26
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/systemPrompt.d.ts +1 -1
- package/dist/api/systemPrompt.js +20 -10
- package/dist/cli.js +8 -0
- package/dist/hooks/useClipboard.js +4 -4
- package/dist/hooks/useKeyboardInput.d.ts +1 -0
- package/dist/hooks/useKeyboardInput.js +8 -4
- package/dist/hooks/useTerminalFocus.d.ts +5 -0
- package/dist/hooks/useTerminalFocus.js +22 -2
- package/dist/mcp/aceCodeSearch.d.ts +58 -4
- package/dist/mcp/aceCodeSearch.js +563 -20
- package/dist/mcp/filesystem.d.ts +35 -29
- package/dist/mcp/filesystem.js +272 -122
- package/dist/mcp/ideDiagnostics.d.ts +36 -0
- package/dist/mcp/ideDiagnostics.js +92 -0
- package/dist/ui/components/ChatInput.js +6 -3
- package/dist/ui/pages/ConfigProfileScreen.d.ts +7 -0
- package/dist/ui/pages/ConfigProfileScreen.js +300 -0
- package/dist/ui/pages/ConfigScreen.js +228 -29
- package/dist/ui/pages/WelcomeScreen.js +1 -1
- package/dist/utils/apiConfig.js +12 -0
- package/dist/utils/configManager.d.ts +45 -0
- package/dist/utils/configManager.js +274 -0
- package/dist/utils/contextCompressor.js +0 -8
- package/dist/utils/escapeHandler.d.ts +79 -0
- package/dist/utils/escapeHandler.js +153 -0
- package/dist/utils/incrementalSnapshot.js +2 -1
- package/dist/utils/mcpToolsManager.js +44 -0
- package/dist/utils/textBuffer.js +13 -15
- package/dist/utils/vscodeConnection.js +26 -11
- package/dist/utils/workspaceSnapshot.js +2 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* System prompt configuration for Snow AI CLI
|
|
3
3
|
*/
|
|
4
|
-
export declare const SYSTEM_PROMPT = "You are Snow AI CLI, an intelligent command-line assistant. Your PRIMARY mission: WRITE CODE, not investigate endlessly.\n\n## \uD83C\uDFAF Core Principles\n\n1. **Language Adaptation**: ALWAYS respond in the SAME language as the user's query\n2. **ACTION FIRST**: Write code immediately when task is clear - stop overthinking\n3. **Smart Context**: Read what's needed for correctness, skip excessive exploration\n4. **Quality Verification**: Run build/test after changes\n\n## \uD83D\uDE80 Execution Strategy - BALANCE ACTION & ANALYSIS\n\n### \u26A1 Smart Action Mode\n**Principle: Understand enough to code correctly, but don't over-investigate**\n\n**Examples:**\n- \"Fix timeout in parser.ts\" \u2192 Read file + check imports if needed \u2192 Fix \u2192 Done\n- \"Add validation to form\" \u2192 Read form component + related validation utils \u2192 Add code \u2192 Done\n- \"Refactor error handling\" \u2192 Read error handler + callers \u2192 Refactor \u2192 Done\n\n**Your workflow:**\n1. Read the primary file(s) mentioned\n2. Check dependencies/imports that directly impact the change\n3. Read related files ONLY if they're critical to understanding the task\n4. Write/modify code with proper context\n5. Verify with build\n6. \u274C NO excessive exploration beyond what's needed\n7. \u274C NO reading entire modules \"for reference\"\n8. \u274C NO over-planning multi-step workflows for simple tasks\n\n**Golden Rule: Read what you need to write correct code, nothing more.**\n\n### \uD83D\uDCCB TODO Lists -
|
|
4
|
+
export declare const SYSTEM_PROMPT = "You are Snow AI CLI, an intelligent command-line assistant. Your PRIMARY mission: WRITE CODE, not investigate endlessly.\n\n## \uD83C\uDFAF Core Principles\n\n1. **Language Adaptation**: ALWAYS respond in the SAME language as the user's query\n2. **ACTION FIRST**: Write code immediately when task is clear - stop overthinking\n3. **Smart Context**: Read what's needed for correctness, skip excessive exploration\n4. **Quality Verification**: Run build/test after changes\n\n## \uD83D\uDE80 Execution Strategy - BALANCE ACTION & ANALYSIS\n\n### \u26A1 Smart Action Mode\n**Principle: Understand enough to code correctly, but don't over-investigate**\n\n**Examples:**\n- \"Fix timeout in parser.ts\" \u2192 Read file + check imports if needed \u2192 Fix \u2192 Done\n- \"Add validation to form\" \u2192 Read form component + related validation utils \u2192 Add code \u2192 Done\n- \"Refactor error handling\" \u2192 Read error handler + callers \u2192 Refactor \u2192 Done\n\n**Your workflow:**\n1. Read the primary file(s) mentioned\n2. Check dependencies/imports that directly impact the change\n3. Read related files ONLY if they're critical to understanding the task\n4. Write/modify code with proper context\n5. Verify with build\n6. \u274C NO excessive exploration beyond what's needed\n7. \u274C NO reading entire modules \"for reference\"\n8. \u274C NO over-planning multi-step workflows for simple tasks\n\n**Golden Rule: Read what you need to write correct code, nothing more.**\n\n### \uD83D\uDCCB TODO Lists - Essential for Programming Tasks\n\n**\u2705 ALWAYS CREATE TODO WHEN encountering programming tasks:**\n- Any code implementation task (new features, bug fixes, refactoring)\n- Tasks involving multiple steps or files\n- When you need to track progress and ensure completion\n- To give users clear visibility into your work plan\n\n**TODO Guidelines:**\n1. **Create Early**: Set up TODO list BEFORE starting implementation\n2. **Be Specific**: Each item should be a concrete action\n3. **Update Immediately**: Mark as in_progress when starting, completed when done\n4. **One Active Task**: Only one item should be in_progress at a time\n\n**TODO = Action List, NOT Investigation Plan**\n- \u2705 \"Create AuthService with login/logout methods\"\n- \u2705 \"Add validation to UserForm component\"\n- \u2705 \"Fix timeout bug in parser.ts\"\n- \u2705 \"Update API routes to use new auth middleware\"\n- \u2705 \"Run build and fix any errors\"\n- \u274C \"Read authentication files\"\n- \u274C \"Analyze current implementation\"\n- \u274C \"Investigate error handling patterns\"\n\n**CRITICAL: Update TODO status IMMEDIATELY after completing each task!**\n\n**Workflow Example:**\n1. User asks to add feature \u2192 Create TODO list immediately\n2. Mark first item as in_progress\n3. Complete the task \u2192 Mark as completed\n4. Move to next item \u2192 Mark as in_progress\n5. Repeat until all tasks completed\n\n## \uD83D\uDEE0\uFE0F Available Tools\n\n**Filesystem:**\n- `filesystem-read` - Read files before editing\n- `filesystem-edit` - Modify existing files\n- `filesystem-create` - Create new files\n\n**Code Search (ACE):**\n- `ace-search-symbols` - Find functions/classes/variables\n- `ace-find-definition` - Go to definition\n- `ace-find-references` - Find all usages\n- `ace-text-search` - Fast text/regex search\n\n**Web Search:**\n- `websearch_search` - Search web for latest docs/solutions\n- `websearch_fetch` - Read web page content (always provide userQuery)\n\n**Terminal:**\n- Use for: `npm run build`, `npm test`, `git status`\n\n## \uD83D\uDD0D Quality Assurance\n\nAfter code changes:\n1. Run build: `npm run build` or `tsc`\n2. Fix any errors immediately\n3. Never leave broken code\n\n## \uD83D\uDCDA Project Context (SNOW.md)\n\n- Read ONLY when implementing large features or unfamiliar architecture\n- Skip for simple tasks where you understand the structure\n- Contains: project overview, architecture, tech stack\n\nRemember: **ACTION > ANALYSIS**. Write code first, investigate only when blocked.";
|
package/dist/api/systemPrompt.js
CHANGED
|
@@ -32,29 +32,39 @@ export const SYSTEM_PROMPT = `You are Snow AI CLI, an intelligent command-line a
|
|
|
32
32
|
|
|
33
33
|
**Golden Rule: Read what you need to write correct code, nothing more.**
|
|
34
34
|
|
|
35
|
-
### 📋 TODO Lists -
|
|
35
|
+
### 📋 TODO Lists - Essential for Programming Tasks
|
|
36
36
|
|
|
37
|
-
**✅ CREATE TODO
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
37
|
+
**✅ ALWAYS CREATE TODO WHEN encountering programming tasks:**
|
|
38
|
+
- Any code implementation task (new features, bug fixes, refactoring)
|
|
39
|
+
- Tasks involving multiple steps or files
|
|
40
|
+
- When you need to track progress and ensure completion
|
|
41
|
+
- To give users clear visibility into your work plan
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
**TODO Guidelines:**
|
|
44
|
+
1. **Create Early**: Set up TODO list BEFORE starting implementation
|
|
45
|
+
2. **Be Specific**: Each item should be a concrete action
|
|
46
|
+
3. **Update Immediately**: Mark as in_progress when starting, completed when done
|
|
47
|
+
4. **One Active Task**: Only one item should be in_progress at a time
|
|
47
48
|
|
|
48
49
|
**TODO = Action List, NOT Investigation Plan**
|
|
49
50
|
- ✅ "Create AuthService with login/logout methods"
|
|
50
51
|
- ✅ "Add validation to UserForm component"
|
|
52
|
+
- ✅ "Fix timeout bug in parser.ts"
|
|
51
53
|
- ✅ "Update API routes to use new auth middleware"
|
|
54
|
+
- ✅ "Run build and fix any errors"
|
|
52
55
|
- ❌ "Read authentication files"
|
|
53
56
|
- ❌ "Analyze current implementation"
|
|
54
57
|
- ❌ "Investigate error handling patterns"
|
|
55
58
|
|
|
56
59
|
**CRITICAL: Update TODO status IMMEDIATELY after completing each task!**
|
|
57
60
|
|
|
61
|
+
**Workflow Example:**
|
|
62
|
+
1. User asks to add feature → Create TODO list immediately
|
|
63
|
+
2. Mark first item as in_progress
|
|
64
|
+
3. Complete the task → Mark as completed
|
|
65
|
+
4. Move to next item → Mark as in_progress
|
|
66
|
+
5. Repeat until all tasks completed
|
|
67
|
+
|
|
58
68
|
## 🛠️ Available Tools
|
|
59
69
|
|
|
60
70
|
**Filesystem:**
|
package/dist/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import { promisify } from 'util';
|
|
|
8
8
|
import App from './app.js';
|
|
9
9
|
import { vscodeConnection } from './utils/vscodeConnection.js';
|
|
10
10
|
import { resourceMonitor } from './utils/resourceMonitor.js';
|
|
11
|
+
import { initializeProfiles } from './utils/configManager.js';
|
|
11
12
|
const execAsync = promisify(exec);
|
|
12
13
|
// Check for updates asynchronously
|
|
13
14
|
async function checkForUpdates(currentVersion) {
|
|
@@ -80,6 +81,13 @@ const Startup = ({ version, skipWelcome, }) => {
|
|
|
80
81
|
React.useEffect(() => {
|
|
81
82
|
let mounted = true;
|
|
82
83
|
const init = async () => {
|
|
84
|
+
// Initialize profiles system first
|
|
85
|
+
try {
|
|
86
|
+
initializeProfiles();
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error('Failed to initialize profiles:', error);
|
|
90
|
+
}
|
|
83
91
|
// Check for updates with timeout
|
|
84
92
|
const updateCheckPromise = version
|
|
85
93
|
? checkForUpdates(version)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
|
+
import { logger } from '../utils/logger.js';
|
|
3
4
|
export function useClipboard(buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate) {
|
|
4
5
|
const pasteFromClipboard = useCallback(async () => {
|
|
5
6
|
try {
|
|
@@ -74,8 +75,7 @@ end try'`;
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
catch (imgError) {
|
|
77
|
-
|
|
78
|
-
console.error('Failed to read image from macOS clipboard:', imgError);
|
|
78
|
+
logger.error('Failed to read image from macOS clipboard:', imgError);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
// If no image, try to read text from clipboard
|
|
@@ -109,11 +109,11 @@ end try'`;
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
catch (textError) {
|
|
112
|
-
|
|
112
|
+
logger.error('Failed to read text from clipboard:', textError);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
catch (error) {
|
|
116
|
-
|
|
116
|
+
logger.error('Failed to read from clipboard:', error);
|
|
117
117
|
}
|
|
118
118
|
}, [buffer, updateCommandPanelState, updateFilePickerState, triggerUpdate]);
|
|
119
119
|
return { pasteFromClipboard };
|
|
@@ -2,7 +2,7 @@ import { useRef, useEffect } from 'react';
|
|
|
2
2
|
import { useInput } from 'ink';
|
|
3
3
|
import { executeCommand } from '../utils/commandExecutor.js';
|
|
4
4
|
export function useKeyboardInput(options) {
|
|
5
|
-
const { buffer, disabled, triggerUpdate, forceUpdate, showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, onCommand, showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, setFileQuery, setAtSymbolPosition, filteredFileCount, updateFilePickerState, handleFileSelect, fileListRef, showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, pasteFromClipboard, onSubmit, } = options;
|
|
5
|
+
const { buffer, disabled, triggerUpdate, forceUpdate, showCommands, setShowCommands, commandSelectedIndex, setCommandSelectedIndex, getFilteredCommands, updateCommandPanelState, onCommand, showFilePicker, setShowFilePicker, fileSelectedIndex, setFileSelectedIndex, setFileQuery, setAtSymbolPosition, filteredFileCount, updateFilePickerState, handleFileSelect, fileListRef, showHistoryMenu, setShowHistoryMenu, historySelectedIndex, setHistorySelectedIndex, escapeKeyCount, setEscapeKeyCount, escapeKeyTimer, getUserMessages, handleHistorySelect, pasteFromClipboard, onSubmit, ensureFocus, } = options;
|
|
6
6
|
// Track paste detection
|
|
7
7
|
const inputBuffer = useRef('');
|
|
8
8
|
const inputTimer = useRef(null);
|
|
@@ -31,6 +31,7 @@ export function useKeyboardInput(options) {
|
|
|
31
31
|
// Some terminals may send these with or without ESC, and they might appear
|
|
32
32
|
// anywhere in the input string (especially during drag-and-drop with Shift held)
|
|
33
33
|
// We need to filter them out but NOT remove legitimate user input
|
|
34
|
+
const focusEventPattern = /(\s|^)\[(?:I|O)(?=(?:\s|$|["'~\\\/]|[A-Za-z]:))/;
|
|
34
35
|
if (
|
|
35
36
|
// Complete escape sequences
|
|
36
37
|
input === '\x1b[I' ||
|
|
@@ -38,9 +39,8 @@ export function useKeyboardInput(options) {
|
|
|
38
39
|
// Standalone sequences (exact match only)
|
|
39
40
|
input === '[I' ||
|
|
40
41
|
input === '[O' ||
|
|
41
|
-
// Filter if input ONLY contains focus events and
|
|
42
|
-
|
|
43
|
-
/^[\s\x1b\[IO]+$/.test(input) && (input.includes('[I') || input.includes('[O'))) {
|
|
42
|
+
// Filter if input ONLY contains focus events, whitespace, and optional ESC prefix
|
|
43
|
+
(/^[\s\x1b\[IO]+$/.test(input) && focusEventPattern.test(input))) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
// Shift+Tab - Toggle YOLO mode
|
|
@@ -273,6 +273,10 @@ export function useKeyboardInput(options) {
|
|
|
273
273
|
}
|
|
274
274
|
// Regular character input
|
|
275
275
|
if (input && !key.ctrl && !key.meta && !key.escape) {
|
|
276
|
+
// Ensure focus is active when user is typing (handles delayed focus events)
|
|
277
|
+
// This is especially important for drag-and-drop operations where focus
|
|
278
|
+
// events may arrive out of order or be filtered by sanitizeInput
|
|
279
|
+
ensureFocus();
|
|
276
280
|
// Accumulate input for paste detection
|
|
277
281
|
inputBuffer.current += input;
|
|
278
282
|
// Clear existing timer
|
|
@@ -16,8 +16,13 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Also provides a function to check if input contains focus events
|
|
18
18
|
* so they can be filtered from normal input processing.
|
|
19
|
+
*
|
|
20
|
+
* Auto-focus recovery: If user input is detected while in unfocused state,
|
|
21
|
+
* automatically restore focus state to ensure cursor visibility during
|
|
22
|
+
* operations like Shift+drag file drop where focus events may be delayed.
|
|
19
23
|
*/
|
|
20
24
|
export declare function useTerminalFocus(): {
|
|
21
25
|
hasFocus: boolean;
|
|
22
26
|
isFocusEvent: (input: string) => boolean;
|
|
27
|
+
ensureFocus: () => void;
|
|
23
28
|
};
|
|
@@ -17,6 +17,10 @@ import { useState, useEffect } from 'react';
|
|
|
17
17
|
*
|
|
18
18
|
* Also provides a function to check if input contains focus events
|
|
19
19
|
* so they can be filtered from normal input processing.
|
|
20
|
+
*
|
|
21
|
+
* Auto-focus recovery: If user input is detected while in unfocused state,
|
|
22
|
+
* automatically restore focus state to ensure cursor visibility during
|
|
23
|
+
* operations like Shift+drag file drop where focus events may be delayed.
|
|
20
24
|
*/
|
|
21
25
|
export function useTerminalFocus() {
|
|
22
26
|
const [hasFocus, setHasFocus] = useState(true); // Default to focused
|
|
@@ -27,10 +31,22 @@ export function useTerminalFocus() {
|
|
|
27
31
|
// Focus gained: ESC[I
|
|
28
32
|
if (str === '\x1b[I') {
|
|
29
33
|
setHasFocus(true);
|
|
34
|
+
return;
|
|
30
35
|
}
|
|
31
36
|
// Focus lost: ESC[O
|
|
32
37
|
if (str === '\x1b[O') {
|
|
33
38
|
setHasFocus(false);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Auto-recovery: If we receive any input that's NOT a focus event
|
|
42
|
+
// while in unfocused state, treat it as an implicit focus gain.
|
|
43
|
+
// This handles cases where focus events are delayed (e.g., Shift+drag operations)
|
|
44
|
+
// Filter out escape sequences and other non-printable characters
|
|
45
|
+
const isPrintableInput = str.length > 0 &&
|
|
46
|
+
!str.startsWith('\x1b') && // Not an escape sequence
|
|
47
|
+
!/^[\x00-\x1f\x7f]+$/.test(str); // Not only control characters
|
|
48
|
+
if (!hasFocus && isPrintableInput) {
|
|
49
|
+
setHasFocus(true);
|
|
34
50
|
}
|
|
35
51
|
};
|
|
36
52
|
// Listen to stdin data
|
|
@@ -48,10 +64,14 @@ export function useTerminalFocus() {
|
|
|
48
64
|
process.stdout.write('\x1b[?1004l');
|
|
49
65
|
process.stdin.off('data', handleData);
|
|
50
66
|
};
|
|
51
|
-
}, []);
|
|
67
|
+
}, [hasFocus]); // Add hasFocus to dependencies to access current state
|
|
52
68
|
// Helper function to check if input is a focus event
|
|
53
69
|
const isFocusEvent = (input) => {
|
|
54
70
|
return input === '\x1b[I' || input === '\x1b[O';
|
|
55
71
|
};
|
|
56
|
-
|
|
72
|
+
// Manual focus restoration function (can be called externally if needed)
|
|
73
|
+
const ensureFocus = () => {
|
|
74
|
+
setHasFocus(true);
|
|
75
|
+
};
|
|
76
|
+
return { hasFocus, isFocusEvent, ensureFocus };
|
|
57
77
|
}
|
|
@@ -43,7 +43,21 @@ export declare class ACECodeSearchService {
|
|
|
43
43
|
private indexCache;
|
|
44
44
|
private lastIndexTime;
|
|
45
45
|
private readonly INDEX_CACHE_DURATION;
|
|
46
|
+
private fzfIndex;
|
|
47
|
+
private allIndexedFiles;
|
|
48
|
+
private fileModTimes;
|
|
49
|
+
private customExcludes;
|
|
50
|
+
private excludesLoaded;
|
|
51
|
+
private readonly DEFAULT_EXCLUDES;
|
|
46
52
|
constructor(basePath?: string);
|
|
53
|
+
/**
|
|
54
|
+
* Load custom exclusion patterns from .gitignore and .snowignore
|
|
55
|
+
*/
|
|
56
|
+
private loadExclusionPatterns;
|
|
57
|
+
/**
|
|
58
|
+
* Check if a directory should be excluded based on exclusion patterns
|
|
59
|
+
*/
|
|
60
|
+
private shouldExcludeDirectory;
|
|
47
61
|
/**
|
|
48
62
|
* Detect programming language from file extension
|
|
49
63
|
*/
|
|
@@ -57,13 +71,33 @@ export declare class ACECodeSearchService {
|
|
|
57
71
|
*/
|
|
58
72
|
private getContext;
|
|
59
73
|
/**
|
|
60
|
-
*
|
|
74
|
+
* Check if a directory is a Git repository
|
|
75
|
+
*/
|
|
76
|
+
private isGitRepository;
|
|
77
|
+
/**
|
|
78
|
+
* Check if a command is available in the system PATH
|
|
79
|
+
*/
|
|
80
|
+
private isCommandAvailable;
|
|
81
|
+
/**
|
|
82
|
+
* Parse grep output (format: filePath:lineNumber:lineContent)
|
|
83
|
+
*/
|
|
84
|
+
private parseGrepOutput;
|
|
85
|
+
/**
|
|
86
|
+
* Build or refresh the code symbol index with incremental updates
|
|
61
87
|
*/
|
|
62
88
|
private buildIndex;
|
|
63
89
|
/**
|
|
64
|
-
*
|
|
90
|
+
* Build fzf index for fast fuzzy symbol name matching
|
|
91
|
+
*/
|
|
92
|
+
private buildFzfIndex;
|
|
93
|
+
/**
|
|
94
|
+
* Search for symbols by name with fuzzy matching using fzf
|
|
65
95
|
*/
|
|
66
96
|
searchSymbols(query: string, symbolType?: CodeSymbol['type'], language?: string, maxResults?: number): Promise<SemanticSearchResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Fallback symbol search using manual fuzzy matching
|
|
99
|
+
*/
|
|
100
|
+
private searchSymbolsManual;
|
|
67
101
|
/**
|
|
68
102
|
* Find all references to a symbol
|
|
69
103
|
*/
|
|
@@ -73,7 +107,22 @@ export declare class ACECodeSearchService {
|
|
|
73
107
|
*/
|
|
74
108
|
findDefinition(symbolName: string, contextFile?: string): Promise<CodeSymbol | null>;
|
|
75
109
|
/**
|
|
76
|
-
*
|
|
110
|
+
* Strategy 1: Use git grep for fast searching in Git repositories
|
|
111
|
+
*/
|
|
112
|
+
private gitGrepSearch;
|
|
113
|
+
/**
|
|
114
|
+
* Strategy 2: Use system grep (or ripgrep if available) for fast searching
|
|
115
|
+
*/
|
|
116
|
+
private systemGrepSearch;
|
|
117
|
+
/**
|
|
118
|
+
* Strategy 3: Pure JavaScript fallback search
|
|
119
|
+
*/
|
|
120
|
+
private jsTextSearch;
|
|
121
|
+
/**
|
|
122
|
+
* Fast text search with multi-layer strategy
|
|
123
|
+
* Strategy 1: git grep (fastest, uses git index)
|
|
124
|
+
* Strategy 2: system grep/ripgrep (fast, system-optimized)
|
|
125
|
+
* Strategy 3: JavaScript fallback (slower, but always works)
|
|
77
126
|
* Searches for text patterns across files with glob filtering
|
|
78
127
|
*/
|
|
79
128
|
textSearch(pattern: string, fileGlob?: string, isRegex?: boolean, maxResults?: number): Promise<Array<{
|
|
@@ -82,6 +131,11 @@ export declare class ACECodeSearchService {
|
|
|
82
131
|
column: number;
|
|
83
132
|
content: string;
|
|
84
133
|
}>>;
|
|
134
|
+
/**
|
|
135
|
+
* Sort search results by file modification time (recent files first)
|
|
136
|
+
* Files modified within last 24 hours are prioritized
|
|
137
|
+
*/
|
|
138
|
+
private sortResultsByRecency;
|
|
85
139
|
/**
|
|
86
140
|
* Convert glob pattern to RegExp
|
|
87
141
|
* Supports: *, **, ?, [abc], {js,ts}
|
|
@@ -96,7 +150,7 @@ export declare class ACECodeSearchService {
|
|
|
96
150
|
*/
|
|
97
151
|
semanticSearch(query: string, searchType?: 'definition' | 'usage' | 'implementation' | 'all', language?: string, maxResults?: number): Promise<SemanticSearchResult>;
|
|
98
152
|
/**
|
|
99
|
-
* Clear the symbol index cache
|
|
153
|
+
* Clear the symbol index cache and force full re-index on next search
|
|
100
154
|
*/
|
|
101
155
|
clearCache(): void;
|
|
102
156
|
/**
|