snow-ai 0.3.31 → 0.3.32
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/agents/codebaseIndexAgent.d.ts +102 -0
- package/dist/agents/codebaseIndexAgent.js +640 -0
- package/dist/api/embedding.d.ts +34 -0
- package/dist/api/embedding.js +74 -0
- package/dist/api/systemPrompt.d.ts +5 -1
- package/dist/api/systemPrompt.js +86 -16
- package/dist/hooks/useConversation.js +1 -1
- package/dist/mcp/aceCodeSearch.d.ts +0 -33
- package/dist/mcp/aceCodeSearch.js +0 -46
- package/dist/mcp/codebaseSearch.d.ts +44 -0
- package/dist/mcp/codebaseSearch.js +146 -0
- package/dist/ui/pages/ChatScreen.js +175 -1
- package/dist/ui/pages/CodeBaseConfigScreen.d.ts +8 -0
- package/dist/ui/pages/CodeBaseConfigScreen.js +323 -0
- package/dist/ui/pages/SubAgentConfigScreen.js +4 -0
- package/dist/ui/pages/WelcomeScreen.js +12 -1
- package/dist/utils/codebaseConfig.d.ts +20 -0
- package/dist/utils/codebaseConfig.js +75 -0
- package/dist/utils/codebaseDatabase.d.ts +102 -0
- package/dist/utils/codebaseDatabase.js +333 -0
- package/dist/utils/commands/home.js +14 -1
- package/dist/utils/mcpToolsManager.js +74 -10
- package/dist/utils/toolDisplayConfig.js +2 -0
- package/package.json +4 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress callback for UI updates
|
|
3
|
+
*/
|
|
4
|
+
export type ProgressCallback = (progress: {
|
|
5
|
+
totalFiles: number;
|
|
6
|
+
processedFiles: number;
|
|
7
|
+
totalChunks: number;
|
|
8
|
+
currentFile: string;
|
|
9
|
+
status: 'scanning' | 'indexing' | 'completed' | 'error';
|
|
10
|
+
error?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Codebase Index Agent
|
|
14
|
+
* Handles automatic code scanning, chunking, and embedding
|
|
15
|
+
*/
|
|
16
|
+
export declare class CodebaseIndexAgent {
|
|
17
|
+
private db;
|
|
18
|
+
private config;
|
|
19
|
+
private projectRoot;
|
|
20
|
+
private ignoreFilter;
|
|
21
|
+
private isRunning;
|
|
22
|
+
private shouldStop;
|
|
23
|
+
private progressCallback?;
|
|
24
|
+
private consecutiveFailures;
|
|
25
|
+
private readonly MAX_CONSECUTIVE_FAILURES;
|
|
26
|
+
private fileWatcher;
|
|
27
|
+
private watchDebounceTimers;
|
|
28
|
+
private static readonly CODE_EXTENSIONS;
|
|
29
|
+
constructor(projectRoot: string);
|
|
30
|
+
/**
|
|
31
|
+
* Start indexing process
|
|
32
|
+
*/
|
|
33
|
+
start(progressCallback?: ProgressCallback): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Stop indexing gracefully
|
|
36
|
+
*/
|
|
37
|
+
stop(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Check if indexing is in progress
|
|
40
|
+
*/
|
|
41
|
+
isIndexing(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get current progress
|
|
44
|
+
*/
|
|
45
|
+
getProgress(): import("../utils/codebaseDatabase.js").IndexProgress;
|
|
46
|
+
/**
|
|
47
|
+
* Clear all indexed data
|
|
48
|
+
*/
|
|
49
|
+
clear(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Close database connection
|
|
52
|
+
*/
|
|
53
|
+
close(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Check if watcher is enabled in database
|
|
56
|
+
*/
|
|
57
|
+
isWatcherEnabled(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Start watching for file changes
|
|
60
|
+
*/
|
|
61
|
+
startWatching(progressCallback?: ProgressCallback): void;
|
|
62
|
+
/**
|
|
63
|
+
* Stop watching for file changes
|
|
64
|
+
*/
|
|
65
|
+
stopWatching(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Debounce file changes to avoid multiple rapid updates
|
|
68
|
+
*/
|
|
69
|
+
private debounceFileChange;
|
|
70
|
+
/**
|
|
71
|
+
* Handle file change event
|
|
72
|
+
*/
|
|
73
|
+
private handleFileChange;
|
|
74
|
+
/**
|
|
75
|
+
* Load .gitignore file
|
|
76
|
+
*/
|
|
77
|
+
private loadGitignore;
|
|
78
|
+
/**
|
|
79
|
+
* Add default ignore patterns
|
|
80
|
+
*/
|
|
81
|
+
private addDefaultIgnorePatterns;
|
|
82
|
+
/**
|
|
83
|
+
* Scan project directory for code files
|
|
84
|
+
*/
|
|
85
|
+
private scanFiles;
|
|
86
|
+
/**
|
|
87
|
+
* Process files with concurrency control
|
|
88
|
+
*/
|
|
89
|
+
private processFiles;
|
|
90
|
+
/**
|
|
91
|
+
* Process single file
|
|
92
|
+
*/
|
|
93
|
+
private processFile;
|
|
94
|
+
/**
|
|
95
|
+
* Split file content into chunks
|
|
96
|
+
*/
|
|
97
|
+
private splitIntoChunks;
|
|
98
|
+
/**
|
|
99
|
+
* Notify progress to callback
|
|
100
|
+
*/
|
|
101
|
+
private notifyProgress;
|
|
102
|
+
}
|