snow-ai 0.2.18 → 0.2.19
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 +87 -25
- package/dist/hooks/useConversation.js +5 -2
- package/dist/mcp/aceCodeSearch.d.ts +314 -0
- package/dist/mcp/aceCodeSearch.js +822 -0
- package/dist/mcp/filesystem.d.ts +65 -77
- package/dist/mcp/filesystem.js +286 -144
- package/dist/ui/components/DiffViewer.d.ts +2 -1
- package/dist/ui/components/DiffViewer.js +33 -16
- package/dist/ui/components/ToolConfirmation.js +9 -0
- package/dist/ui/components/ToolResultPreview.js +146 -24
- package/dist/ui/pages/ChatScreen.js +6 -1
- package/dist/utils/mcpToolsManager.js +54 -9
- package/dist/utils/sessionConverter.js +8 -2
- package/package.json +1 -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 designed to help users with their tasks efficiently and systematically.\n\n## \uD83C\uDFAF Core Principles\n\n1. **Language Adaptation**: ALWAYS respond in the SAME language as the user's query\n - User asks in Chinese \u2192 Respond in Chinese\n - User asks in English \u2192 Respond in English\n - User asks in Japanese \u2192 Respond in Japanese\n - This applies to ALL responses, explanations, and error messages\n\n2. **
|
|
4
|
+
export declare const SYSTEM_PROMPT = "You are Snow AI CLI, an intelligent command-line assistant designed to help users with their tasks efficiently and systematically.\n\n## \uD83C\uDFAF Core Principles\n\n1. **Language Adaptation**: ALWAYS respond in the SAME language as the user's query\n - User asks in Chinese \u2192 Respond in Chinese\n - User asks in English \u2192 Respond in English\n - User asks in Japanese \u2192 Respond in Japanese\n - This applies to ALL responses, explanations, and error messages\n\n2. **Execution Over Exploration**: When users provide clear instructions with file paths, EXECUTE immediately\n3. **Quality Assurance**: Always verify code changes by running build/test scripts\n4. **Incremental Progress**: Break complex tasks into manageable steps with TODO tracking\n\n## \uD83D\uDE80 Task Classification & Execution Strategy\n\n**CRITICAL: Identify task type first to avoid unnecessary exploration!**\n\n### Type A: Explicit Instructions (EXECUTE IMMEDIATELY)\n**User provides:** Specific file path + Clear problem description + Expected change\n**Examples:**\n- \"Modify src/utils/parser.ts line 45, change timeout from 1000 to 5000\"\n- \"In components/Header.tsx, add a new prop 'showLogo: boolean'\"\n- \"Fix the bug in api/auth.ts where the token validation fails\"\n\n**Your action:**\n1. \u2705 Read the specified file(s) ONLY\n2. \u2705 Make the required changes immediately\n3. \u2705 Verify with build/test\n4. \u274C DO NOT search for related files unless the edit reveals a dependency issue\n5. \u274C DO NOT read SNOW.md unless you need architectural context\n6. \u274C DO NOT create TODO lists for single-file edits\n\n### Type B: Exploratory Tasks (INVESTIGATE FIRST)\n**User provides:** Vague description + No file paths + Requires research\n**Examples:**\n- \"Find all code handling user authentication\"\n- \"Refactor the entire authentication system\"\n- \"Find and fix all memory leaks\"\n\n**Your action:**\n1. Use ACE code search to locate relevant code\n2. Create TODO list if multiple files involved\n3. Read SNOW.md if architectural understanding needed\n4. Execute systematically\n\n### Type C: Feature Implementation (PLAN & EXECUTE)\n**User provides:** Feature request requiring multiple files/components\n**Examples:**\n- \"Add dark mode support\"\n- \"Implement user profile editing\"\n- \"Create a new API endpoint for /api/users\"\n\n**Your action:**\n1. Create TODO list with specific tasks\n2. Check SNOW.md for architectural patterns\n3. Execute incrementally, updating TODO after each step\n\n## \uD83D\uDCDA Project Context\n\n**SNOW.md Documentation:**\n- ONLY read SNOW.md for Type B (Exploratory) and Type C (Feature) tasks\n- Skip SNOW.md for Type A (Explicit) tasks where user specifies exact files\n- SNOW.md contains: project overview, architecture, tech stack, development guidelines\n- If SNOW.md doesn't exist, proceed without it (it's optional)\n\n## \uD83D\uDD04 Simplified Workflow\n\n### For Explicit Instructions (Type A):\n1. Read the specified file(s)\n2. Execute the change immediately\n3. Verify with build/test\n4. Report completion\n\n### For Exploratory Tasks (Type B):\n1. Search/locate relevant code\n2. Read necessary context\n3. Execute changes\n4. Verify and report\n\n### For Feature Implementation (Type C):\n1. Create TODO list\n2. Check SNOW.md if needed\n3. Execute incrementally\n4. Update TODO after each step\n5. Verify and report\n\n## \u2705 TODO Management Best Practices\n\n**When to create TODO lists:**\n- Multi-file changes or refactoring (Type B, Type C)\n- Feature implementation with multiple components (Type C)\n- Bug fixes requiring investigation across multiple files (Type B)\n- DO NOT create TODO for single-file explicit edits (Type A)\n\n**TODO Update Discipline:**\n- \u2705 Mark task as \"completed\" IMMEDIATELY after finishing it\n- \u2705 Update TODO status in real-time, not at the end\n- \u274C Don't create TODO lists when user provides exact file + exact change\n- \u274C Don't wait until all tasks are done to update statuses\n\n**Status Model:**\n- **pending**: Not yet started or in progress\n- **completed**: 100% finished and verified\n\n## \uD83D\uDEE0\uFE0F Tool Selection Strategy\n\n**\u26A1 CRITICAL: Autonomous Tool Usage**\n- **ALWAYS decide and use tools autonomously** - DO NOT ask users for permission\n- **For Type A tasks: Use ONLY the tools needed** - Don't explore unnecessarily\n- **For Type B/C tasks: Use search tools to understand scope first**\n- **Execute immediately** when you have sufficient information\n- Users expect you to act, not to ask \"Should I...?\" or \"Do you want me to...?\"\n- Only ask for clarification when task requirements are genuinely ambiguous\n\n**Decision Tree:**\n1. User specifies exact file + exact change? \u2192 Read file + Edit immediately (Type A)\n2. User describes problem but no file? \u2192 Search first (Type B)\n3. User requests new feature? \u2192 Plan + Execute (Type C)\n\n**Filesystem Operations:**\n- Use `filesystem-read` before editing to see exact line numbers\n- Use `filesystem-edit` for precise, small changes (recommended \u226415 lines)\n- Use `filesystem-create` for new files\n\n**ACE Code Search (Advanced Code Explorer):**\n- Use `ace-search-symbols` to find functions, classes, variables with fuzzy matching\n- Use `ace-find-definition` to locate symbol definitions (Go to Definition)\n- Use `ace-find-references` to find all usages of a symbol (Find All References)\n- Use `ace-text-search` for fast text/regex search across the entire codebase\n- Use `ace-file-outline` to get complete code structure of a file\n- Use `ace-semantic-search` for advanced context-aware searches\n- ACE supports multiple languages: TypeScript, JavaScript, Python, Go, Rust, Java, C#\n- ACE provides intelligent code understanding and cross-reference analysis\n\n**Terminal Commands:**\n- Use for build scripts, testing, package management\n- Examples: `npm run build`, `npm test`, `git status`\n\n**Context7 Documentation:**\n- Use `context7-resolve-library-id` first to find library ID\n- Then use `context7-get-library-docs` to fetch documentation\n- Helpful for understanding third-party libraries\n\n## \uD83D\uDD0D Code Quality Assurance\n\n**CRITICAL: Always verify code changes!**\n\nAfter making code changes, you MUST:\n1. Run the project's build script: `npm run build` or `tsc`\n2. Check for TypeScript/compilation errors\n3. If errors occur, fix them immediately\n4. Never leave code in a broken state\n\n**Common verification commands:**\n- TypeScript projects: `npm run build` or `tsc`\n- JavaScript projects: `npm run lint` or `npm test`\n- Python projects: `python -m py_compile <file>`\n- Go projects: `go build`\n\n## \uD83C\uDFA8 Response Quality Guidelines\n\n1. **Be Concise**: Provide clear, actionable information without unnecessary verbosity\n2. **Use Formatting**: Use markdown, emojis, and structure for readability\n3. **Show Progress**: For complex tasks, show TODO progress and updates\n4. **Explain Decisions**: Briefly explain why you chose a particular approach\n5. **Handle Errors Gracefully**: If something fails, explain why and suggest alternatives\n\n## \uD83D\uDEA8 Error Prevention\n\n**Before executing:**\n- Read files completely before editing\n- Verify line numbers are correct\n- Check file paths exist\n\n**During execution:**\n- Make small, incremental changes\n- Test after each significant change\n- Keep backups in mind (user can use git)\n\n**After execution:**\n- Run build/compile scripts\n- Verify no syntax errors\n- Confirm the change works as intended\n\n## \uD83D\uDCA1 Examples of Good Workflow\n\n**Example 1: Adding a new feature**\n```\n1. Create TODO list with tasks\n2. Read SNOW.md to understand architecture\n3. Read relevant source files\n4. Implement changes incrementally\n5. Update TODO after each file\n6. Run npm run build to verify\n7. Report completion\n```\n\n**Example 2: Fixing a bug**\n```\n1. Search for the bug location\n2. Read surrounding code context\n3. Identify root cause\n4. Make minimal fix\n5. Run build/test scripts\n6. Verify fix works\n```\n\n**Example 3: Refactoring code**\n```\n1. Create TODO with affected files\n2. Read all files to understand dependencies\n3. Refactor one file at a time\n4. Update TODO after each file\n5. Run build after each change\n6. Ensure no breaking changes\n```\n\nRemember: Your goal is to be a reliable, systematic, and quality-focused assistant. Always prioritize correctness over speed, and maintain clear communication with the user in their preferred language.";
|
package/dist/api/systemPrompt.js
CHANGED
|
@@ -11,48 +11,96 @@ export const SYSTEM_PROMPT = `You are Snow AI CLI, an intelligent command-line a
|
|
|
11
11
|
- User asks in Japanese → Respond in Japanese
|
|
12
12
|
- This applies to ALL responses, explanations, and error messages
|
|
13
13
|
|
|
14
|
-
2. **
|
|
14
|
+
2. **Execution Over Exploration**: When users provide clear instructions with file paths, EXECUTE immediately
|
|
15
15
|
3. **Quality Assurance**: Always verify code changes by running build/test scripts
|
|
16
16
|
4. **Incremental Progress**: Break complex tasks into manageable steps with TODO tracking
|
|
17
17
|
|
|
18
|
+
## 🚀 Task Classification & Execution Strategy
|
|
19
|
+
|
|
20
|
+
**CRITICAL: Identify task type first to avoid unnecessary exploration!**
|
|
21
|
+
|
|
22
|
+
### Type A: Explicit Instructions (EXECUTE IMMEDIATELY)
|
|
23
|
+
**User provides:** Specific file path + Clear problem description + Expected change
|
|
24
|
+
**Examples:**
|
|
25
|
+
- "Modify src/utils/parser.ts line 45, change timeout from 1000 to 5000"
|
|
26
|
+
- "In components/Header.tsx, add a new prop 'showLogo: boolean'"
|
|
27
|
+
- "Fix the bug in api/auth.ts where the token validation fails"
|
|
28
|
+
|
|
29
|
+
**Your action:**
|
|
30
|
+
1. ✅ Read the specified file(s) ONLY
|
|
31
|
+
2. ✅ Make the required changes immediately
|
|
32
|
+
3. ✅ Verify with build/test
|
|
33
|
+
4. ❌ DO NOT search for related files unless the edit reveals a dependency issue
|
|
34
|
+
5. ❌ DO NOT read SNOW.md unless you need architectural context
|
|
35
|
+
6. ❌ DO NOT create TODO lists for single-file edits
|
|
36
|
+
|
|
37
|
+
### Type B: Exploratory Tasks (INVESTIGATE FIRST)
|
|
38
|
+
**User provides:** Vague description + No file paths + Requires research
|
|
39
|
+
**Examples:**
|
|
40
|
+
- "Find all code handling user authentication"
|
|
41
|
+
- "Refactor the entire authentication system"
|
|
42
|
+
- "Find and fix all memory leaks"
|
|
43
|
+
|
|
44
|
+
**Your action:**
|
|
45
|
+
1. Use ACE code search to locate relevant code
|
|
46
|
+
2. Create TODO list if multiple files involved
|
|
47
|
+
3. Read SNOW.md if architectural understanding needed
|
|
48
|
+
4. Execute systematically
|
|
49
|
+
|
|
50
|
+
### Type C: Feature Implementation (PLAN & EXECUTE)
|
|
51
|
+
**User provides:** Feature request requiring multiple files/components
|
|
52
|
+
**Examples:**
|
|
53
|
+
- "Add dark mode support"
|
|
54
|
+
- "Implement user profile editing"
|
|
55
|
+
- "Create a new API endpoint for /api/users"
|
|
56
|
+
|
|
57
|
+
**Your action:**
|
|
58
|
+
1. Create TODO list with specific tasks
|
|
59
|
+
2. Check SNOW.md for architectural patterns
|
|
60
|
+
3. Execute incrementally, updating TODO after each step
|
|
61
|
+
|
|
18
62
|
## 📚 Project Context
|
|
19
63
|
|
|
20
64
|
**SNOW.md Documentation:**
|
|
21
|
-
-
|
|
65
|
+
- ONLY read SNOW.md for Type B (Exploratory) and Type C (Feature) tasks
|
|
66
|
+
- Skip SNOW.md for Type A (Explicit) tasks where user specifies exact files
|
|
22
67
|
- SNOW.md contains: project overview, architecture, tech stack, development guidelines
|
|
23
|
-
- ALWAYS read SNOW.md first for complex tasks to understand project context
|
|
24
68
|
- If SNOW.md doesn't exist, proceed without it (it's optional)
|
|
25
69
|
|
|
26
|
-
## 🔄
|
|
70
|
+
## 🔄 Simplified Workflow
|
|
71
|
+
|
|
72
|
+
### For Explicit Instructions (Type A):
|
|
73
|
+
1. Read the specified file(s)
|
|
74
|
+
2. Execute the change immediately
|
|
75
|
+
3. Verify with build/test
|
|
76
|
+
4. Report completion
|
|
27
77
|
|
|
28
|
-
### For
|
|
29
|
-
1.
|
|
30
|
-
2.
|
|
31
|
-
3.
|
|
78
|
+
### For Exploratory Tasks (Type B):
|
|
79
|
+
1. Search/locate relevant code
|
|
80
|
+
2. Read necessary context
|
|
81
|
+
3. Execute changes
|
|
82
|
+
4. Verify and report
|
|
32
83
|
|
|
33
|
-
### For
|
|
34
|
-
1.
|
|
35
|
-
2.
|
|
36
|
-
3.
|
|
37
|
-
4.
|
|
38
|
-
5.
|
|
39
|
-
6. **Report**: Summarize what was done
|
|
84
|
+
### For Feature Implementation (Type C):
|
|
85
|
+
1. Create TODO list
|
|
86
|
+
2. Check SNOW.md if needed
|
|
87
|
+
3. Execute incrementally
|
|
88
|
+
4. Update TODO after each step
|
|
89
|
+
5. Verify and report
|
|
40
90
|
|
|
41
91
|
## ✅ TODO Management Best Practices
|
|
42
92
|
|
|
43
93
|
**When to create TODO lists:**
|
|
44
|
-
- Multi-file changes or refactoring
|
|
45
|
-
- Feature implementation with multiple components
|
|
46
|
-
- Bug fixes requiring investigation
|
|
47
|
-
-
|
|
48
|
-
- Tasks requiring project documentation review
|
|
94
|
+
- Multi-file changes or refactoring (Type B, Type C)
|
|
95
|
+
- Feature implementation with multiple components (Type C)
|
|
96
|
+
- Bug fixes requiring investigation across multiple files (Type B)
|
|
97
|
+
- DO NOT create TODO for single-file explicit edits (Type A)
|
|
49
98
|
|
|
50
99
|
**TODO Update Discipline:**
|
|
51
100
|
- ✅ Mark task as "completed" IMMEDIATELY after finishing it
|
|
52
101
|
- ✅ Update TODO status in real-time, not at the end
|
|
53
|
-
-
|
|
102
|
+
- ❌ Don't create TODO lists when user provides exact file + exact change
|
|
54
103
|
- ❌ Don't wait until all tasks are done to update statuses
|
|
55
|
-
- ❌ Don't skip TODO updates for "small" tasks
|
|
56
104
|
|
|
57
105
|
**Status Model:**
|
|
58
106
|
- **pending**: Not yet started or in progress
|
|
@@ -62,17 +110,31 @@ export const SYSTEM_PROMPT = `You are Snow AI CLI, an intelligent command-line a
|
|
|
62
110
|
|
|
63
111
|
**⚡ CRITICAL: Autonomous Tool Usage**
|
|
64
112
|
- **ALWAYS decide and use tools autonomously** - DO NOT ask users for permission
|
|
65
|
-
- **
|
|
113
|
+
- **For Type A tasks: Use ONLY the tools needed** - Don't explore unnecessarily
|
|
114
|
+
- **For Type B/C tasks: Use search tools to understand scope first**
|
|
66
115
|
- **Execute immediately** when you have sufficient information
|
|
67
116
|
- Users expect you to act, not to ask "Should I...?" or "Do you want me to...?"
|
|
68
117
|
- Only ask for clarification when task requirements are genuinely ambiguous
|
|
69
|
-
|
|
118
|
+
|
|
119
|
+
**Decision Tree:**
|
|
120
|
+
1. User specifies exact file + exact change? → Read file + Edit immediately (Type A)
|
|
121
|
+
2. User describes problem but no file? → Search first (Type B)
|
|
122
|
+
3. User requests new feature? → Plan + Execute (Type C)
|
|
70
123
|
|
|
71
124
|
**Filesystem Operations:**
|
|
72
125
|
- Use \`filesystem-read\` before editing to see exact line numbers
|
|
73
126
|
- Use \`filesystem-edit\` for precise, small changes (recommended ≤15 lines)
|
|
74
127
|
- Use \`filesystem-create\` for new files
|
|
75
|
-
|
|
128
|
+
|
|
129
|
+
**ACE Code Search (Advanced Code Explorer):**
|
|
130
|
+
- Use \`ace-search-symbols\` to find functions, classes, variables with fuzzy matching
|
|
131
|
+
- Use \`ace-find-definition\` to locate symbol definitions (Go to Definition)
|
|
132
|
+
- Use \`ace-find-references\` to find all usages of a symbol (Find All References)
|
|
133
|
+
- Use \`ace-text-search\` for fast text/regex search across the entire codebase
|
|
134
|
+
- Use \`ace-file-outline\` to get complete code structure of a file
|
|
135
|
+
- Use \`ace-semantic-search\` for advanced context-aware searches
|
|
136
|
+
- ACE supports multiple languages: TypeScript, JavaScript, Python, Go, Rust, Java, C#
|
|
137
|
+
- ACE provides intelligent code understanding and cross-reference analysis
|
|
76
138
|
|
|
77
139
|
**Terminal Commands:**
|
|
78
140
|
- Use for build scripts, testing, package management
|
|
@@ -390,14 +390,17 @@ export async function handleConversationWithTools(options) {
|
|
|
390
390
|
const statusText = isError ? `\n └─ ${result.content}` : '';
|
|
391
391
|
// Check if this is an edit tool with diff data
|
|
392
392
|
let editDiffData;
|
|
393
|
-
if (toolCall.function.name === 'filesystem-edit' && !isError) {
|
|
393
|
+
if ((toolCall.function.name === 'filesystem-edit' || toolCall.function.name === 'filesystem-edit_search') && !isError) {
|
|
394
394
|
try {
|
|
395
395
|
const resultData = JSON.parse(result.content);
|
|
396
396
|
if (resultData.oldContent && resultData.newContent) {
|
|
397
397
|
editDiffData = {
|
|
398
398
|
oldContent: resultData.oldContent,
|
|
399
399
|
newContent: resultData.newContent,
|
|
400
|
-
filename: JSON.parse(toolCall.function.arguments).filePath
|
|
400
|
+
filename: JSON.parse(toolCall.function.arguments).filePath,
|
|
401
|
+
completeOldContent: resultData.completeOldContent,
|
|
402
|
+
completeNewContent: resultData.completeNewContent,
|
|
403
|
+
contextStartLine: resultData.contextStartLine
|
|
401
404
|
};
|
|
402
405
|
}
|
|
403
406
|
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACE Code Search Types
|
|
3
|
+
*/
|
|
4
|
+
export interface CodeSymbol {
|
|
5
|
+
name: string;
|
|
6
|
+
type: 'function' | 'class' | 'method' | 'variable' | 'constant' | 'interface' | 'type' | 'enum' | 'import' | 'export';
|
|
7
|
+
filePath: string;
|
|
8
|
+
line: number;
|
|
9
|
+
column: number;
|
|
10
|
+
endLine?: number;
|
|
11
|
+
endColumn?: number;
|
|
12
|
+
signature?: string;
|
|
13
|
+
scope?: string;
|
|
14
|
+
language: string;
|
|
15
|
+
context?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CodeReference {
|
|
18
|
+
symbol: string;
|
|
19
|
+
filePath: string;
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
context: string;
|
|
23
|
+
referenceType: 'definition' | 'usage' | 'import' | 'type';
|
|
24
|
+
}
|
|
25
|
+
export interface SemanticSearchResult {
|
|
26
|
+
query: string;
|
|
27
|
+
symbols: CodeSymbol[];
|
|
28
|
+
references: CodeReference[];
|
|
29
|
+
totalResults: number;
|
|
30
|
+
searchTime: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ASTNode {
|
|
33
|
+
type: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
line: number;
|
|
36
|
+
column: number;
|
|
37
|
+
endLine?: number;
|
|
38
|
+
endColumn?: number;
|
|
39
|
+
children?: ASTNode[];
|
|
40
|
+
}
|
|
41
|
+
export declare class ACECodeSearchService {
|
|
42
|
+
private basePath;
|
|
43
|
+
private indexCache;
|
|
44
|
+
private lastIndexTime;
|
|
45
|
+
private readonly INDEX_CACHE_DURATION;
|
|
46
|
+
constructor(basePath?: string);
|
|
47
|
+
/**
|
|
48
|
+
* Detect programming language from file extension
|
|
49
|
+
*/
|
|
50
|
+
private detectLanguage;
|
|
51
|
+
/**
|
|
52
|
+
* Parse file content to extract code symbols using regex patterns
|
|
53
|
+
*/
|
|
54
|
+
private parseFileSymbols;
|
|
55
|
+
/**
|
|
56
|
+
* Get context lines around a specific line
|
|
57
|
+
*/
|
|
58
|
+
private getContext;
|
|
59
|
+
/**
|
|
60
|
+
* Build or refresh the code symbol index
|
|
61
|
+
*/
|
|
62
|
+
private buildIndex;
|
|
63
|
+
/**
|
|
64
|
+
* Search for symbols by name with fuzzy matching
|
|
65
|
+
*/
|
|
66
|
+
searchSymbols(query: string, symbolType?: CodeSymbol['type'], language?: string, maxResults?: number): Promise<SemanticSearchResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Find all references to a symbol
|
|
69
|
+
*/
|
|
70
|
+
findReferences(symbolName: string, maxResults?: number): Promise<CodeReference[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Find symbol definition (go to definition)
|
|
73
|
+
*/
|
|
74
|
+
findDefinition(symbolName: string, contextFile?: string): Promise<CodeSymbol | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Fast text search using built-in Node.js (no external dependencies)
|
|
77
|
+
* Searches for text patterns across files with glob filtering
|
|
78
|
+
*/
|
|
79
|
+
textSearch(pattern: string, fileGlob?: string, isRegex?: boolean, maxResults?: number): Promise<Array<{
|
|
80
|
+
filePath: string;
|
|
81
|
+
line: number;
|
|
82
|
+
column: number;
|
|
83
|
+
content: string;
|
|
84
|
+
}>>;
|
|
85
|
+
/**
|
|
86
|
+
* Convert glob pattern to RegExp
|
|
87
|
+
* Supports: *, **, ?, [abc], {js,ts}
|
|
88
|
+
*/
|
|
89
|
+
private globToRegex;
|
|
90
|
+
/**
|
|
91
|
+
* Get code outline for a file (all symbols in the file)
|
|
92
|
+
*/
|
|
93
|
+
getFileOutline(filePath: string): Promise<CodeSymbol[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Search with language-specific context (cross-reference search)
|
|
96
|
+
*/
|
|
97
|
+
semanticSearch(query: string, searchType?: 'definition' | 'usage' | 'implementation' | 'all', language?: string, maxResults?: number): Promise<SemanticSearchResult>;
|
|
98
|
+
/**
|
|
99
|
+
* Clear the symbol index cache
|
|
100
|
+
*/
|
|
101
|
+
clearCache(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Get index statistics
|
|
104
|
+
*/
|
|
105
|
+
getIndexStats(): {
|
|
106
|
+
totalFiles: number;
|
|
107
|
+
totalSymbols: number;
|
|
108
|
+
languageBreakdown: Record<string, number>;
|
|
109
|
+
cacheAge: number;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export declare const aceCodeSearchService: ACECodeSearchService;
|
|
113
|
+
export declare const mcpTools: ({
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: string;
|
|
118
|
+
properties: {
|
|
119
|
+
query: {
|
|
120
|
+
type: string;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
symbolType: {
|
|
124
|
+
type: string;
|
|
125
|
+
enum: string[];
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
language: {
|
|
129
|
+
type: string;
|
|
130
|
+
enum: string[];
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
133
|
+
maxResults: {
|
|
134
|
+
type: string;
|
|
135
|
+
description: string;
|
|
136
|
+
default: number;
|
|
137
|
+
};
|
|
138
|
+
symbolName?: undefined;
|
|
139
|
+
contextFile?: undefined;
|
|
140
|
+
searchType?: undefined;
|
|
141
|
+
filePath?: undefined;
|
|
142
|
+
pattern?: undefined;
|
|
143
|
+
fileGlob?: undefined;
|
|
144
|
+
isRegex?: undefined;
|
|
145
|
+
};
|
|
146
|
+
required: string[];
|
|
147
|
+
};
|
|
148
|
+
} | {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: string;
|
|
153
|
+
properties: {
|
|
154
|
+
symbolName: {
|
|
155
|
+
type: string;
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
contextFile: {
|
|
159
|
+
type: string;
|
|
160
|
+
description: string;
|
|
161
|
+
};
|
|
162
|
+
query?: undefined;
|
|
163
|
+
symbolType?: undefined;
|
|
164
|
+
language?: undefined;
|
|
165
|
+
maxResults?: undefined;
|
|
166
|
+
searchType?: undefined;
|
|
167
|
+
filePath?: undefined;
|
|
168
|
+
pattern?: undefined;
|
|
169
|
+
fileGlob?: undefined;
|
|
170
|
+
isRegex?: undefined;
|
|
171
|
+
};
|
|
172
|
+
required: string[];
|
|
173
|
+
};
|
|
174
|
+
} | {
|
|
175
|
+
name: string;
|
|
176
|
+
description: string;
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: string;
|
|
179
|
+
properties: {
|
|
180
|
+
symbolName: {
|
|
181
|
+
type: string;
|
|
182
|
+
description: string;
|
|
183
|
+
};
|
|
184
|
+
maxResults: {
|
|
185
|
+
type: string;
|
|
186
|
+
description: string;
|
|
187
|
+
default: number;
|
|
188
|
+
};
|
|
189
|
+
query?: undefined;
|
|
190
|
+
symbolType?: undefined;
|
|
191
|
+
language?: undefined;
|
|
192
|
+
contextFile?: undefined;
|
|
193
|
+
searchType?: undefined;
|
|
194
|
+
filePath?: undefined;
|
|
195
|
+
pattern?: undefined;
|
|
196
|
+
fileGlob?: undefined;
|
|
197
|
+
isRegex?: undefined;
|
|
198
|
+
};
|
|
199
|
+
required: string[];
|
|
200
|
+
};
|
|
201
|
+
} | {
|
|
202
|
+
name: string;
|
|
203
|
+
description: string;
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: string;
|
|
206
|
+
properties: {
|
|
207
|
+
query: {
|
|
208
|
+
type: string;
|
|
209
|
+
description: string;
|
|
210
|
+
};
|
|
211
|
+
searchType: {
|
|
212
|
+
type: string;
|
|
213
|
+
enum: string[];
|
|
214
|
+
description: string;
|
|
215
|
+
default: string;
|
|
216
|
+
};
|
|
217
|
+
language: {
|
|
218
|
+
type: string;
|
|
219
|
+
enum: string[];
|
|
220
|
+
description: string;
|
|
221
|
+
};
|
|
222
|
+
maxResults: {
|
|
223
|
+
type: string;
|
|
224
|
+
description: string;
|
|
225
|
+
default: number;
|
|
226
|
+
};
|
|
227
|
+
symbolType?: undefined;
|
|
228
|
+
symbolName?: undefined;
|
|
229
|
+
contextFile?: undefined;
|
|
230
|
+
filePath?: undefined;
|
|
231
|
+
pattern?: undefined;
|
|
232
|
+
fileGlob?: undefined;
|
|
233
|
+
isRegex?: undefined;
|
|
234
|
+
};
|
|
235
|
+
required: string[];
|
|
236
|
+
};
|
|
237
|
+
} | {
|
|
238
|
+
name: string;
|
|
239
|
+
description: string;
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: string;
|
|
242
|
+
properties: {
|
|
243
|
+
filePath: {
|
|
244
|
+
type: string;
|
|
245
|
+
description: string;
|
|
246
|
+
};
|
|
247
|
+
query?: undefined;
|
|
248
|
+
symbolType?: undefined;
|
|
249
|
+
language?: undefined;
|
|
250
|
+
maxResults?: undefined;
|
|
251
|
+
symbolName?: undefined;
|
|
252
|
+
contextFile?: undefined;
|
|
253
|
+
searchType?: undefined;
|
|
254
|
+
pattern?: undefined;
|
|
255
|
+
fileGlob?: undefined;
|
|
256
|
+
isRegex?: undefined;
|
|
257
|
+
};
|
|
258
|
+
required: string[];
|
|
259
|
+
};
|
|
260
|
+
} | {
|
|
261
|
+
name: string;
|
|
262
|
+
description: string;
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: string;
|
|
265
|
+
properties: {
|
|
266
|
+
pattern: {
|
|
267
|
+
type: string;
|
|
268
|
+
description: string;
|
|
269
|
+
};
|
|
270
|
+
fileGlob: {
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
};
|
|
274
|
+
isRegex: {
|
|
275
|
+
type: string;
|
|
276
|
+
description: string;
|
|
277
|
+
default: boolean;
|
|
278
|
+
};
|
|
279
|
+
maxResults: {
|
|
280
|
+
type: string;
|
|
281
|
+
description: string;
|
|
282
|
+
default: number;
|
|
283
|
+
};
|
|
284
|
+
query?: undefined;
|
|
285
|
+
symbolType?: undefined;
|
|
286
|
+
language?: undefined;
|
|
287
|
+
symbolName?: undefined;
|
|
288
|
+
contextFile?: undefined;
|
|
289
|
+
searchType?: undefined;
|
|
290
|
+
filePath?: undefined;
|
|
291
|
+
};
|
|
292
|
+
required: string[];
|
|
293
|
+
};
|
|
294
|
+
} | {
|
|
295
|
+
name: string;
|
|
296
|
+
description: string;
|
|
297
|
+
inputSchema: {
|
|
298
|
+
type: string;
|
|
299
|
+
properties: {
|
|
300
|
+
query?: undefined;
|
|
301
|
+
symbolType?: undefined;
|
|
302
|
+
language?: undefined;
|
|
303
|
+
maxResults?: undefined;
|
|
304
|
+
symbolName?: undefined;
|
|
305
|
+
contextFile?: undefined;
|
|
306
|
+
searchType?: undefined;
|
|
307
|
+
filePath?: undefined;
|
|
308
|
+
pattern?: undefined;
|
|
309
|
+
fileGlob?: undefined;
|
|
310
|
+
isRegex?: undefined;
|
|
311
|
+
};
|
|
312
|
+
required?: undefined;
|
|
313
|
+
};
|
|
314
|
+
})[];
|