snow-ai 0.3.30 → 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.
@@ -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
+ }