@pleaseai/context-please-mcp 0.1.0

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,439 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ import * as os from "os";
4
+ export class SnapshotManager {
5
+ constructor() {
6
+ this.indexedCodebases = [];
7
+ this.indexingCodebases = new Map(); // Map of codebase path to progress percentage
8
+ this.codebaseFileCount = new Map(); // Map of codebase path to indexed file count
9
+ this.codebaseInfoMap = new Map(); // Map of codebase path to complete info
10
+ // Initialize snapshot file path
11
+ this.snapshotFilePath = path.join(os.homedir(), '.context', 'mcp-codebase-snapshot.json');
12
+ }
13
+ /**
14
+ * Check if snapshot is v2 format
15
+ */
16
+ isV2Format(snapshot) {
17
+ return snapshot && snapshot.formatVersion === 'v2';
18
+ }
19
+ /**
20
+ * Convert v1 format to internal state
21
+ */
22
+ loadV1Format(snapshot) {
23
+ console.log('[SNAPSHOT-DEBUG] Loading v1 format snapshot');
24
+ // Validate that the codebases still exist
25
+ const validCodebases = [];
26
+ for (const codebasePath of snapshot.indexedCodebases) {
27
+ if (fs.existsSync(codebasePath)) {
28
+ validCodebases.push(codebasePath);
29
+ console.log(`[SNAPSHOT-DEBUG] Validated codebase: ${codebasePath}`);
30
+ }
31
+ else {
32
+ console.warn(`[SNAPSHOT-DEBUG] Codebase no longer exists, removing: ${codebasePath}`);
33
+ }
34
+ }
35
+ // Handle indexing codebases - treat them as not indexed since they were interrupted
36
+ let indexingCodebasesList = [];
37
+ if (Array.isArray(snapshot.indexingCodebases)) {
38
+ // Legacy format: string[]
39
+ indexingCodebasesList = snapshot.indexingCodebases;
40
+ console.log(`[SNAPSHOT-DEBUG] Found legacy indexingCodebases array format with ${indexingCodebasesList.length} entries`);
41
+ }
42
+ else if (snapshot.indexingCodebases && typeof snapshot.indexingCodebases === 'object') {
43
+ // New format: Record<string, number>
44
+ indexingCodebasesList = Object.keys(snapshot.indexingCodebases);
45
+ console.log(`[SNAPSHOT-DEBUG] Found new indexingCodebases object format with ${indexingCodebasesList.length} entries`);
46
+ }
47
+ for (const codebasePath of indexingCodebasesList) {
48
+ if (fs.existsSync(codebasePath)) {
49
+ console.warn(`[SNAPSHOT-DEBUG] Found interrupted indexing codebase: ${codebasePath}. Treating as not indexed.`);
50
+ // Don't add to validIndexingCodebases - treat as not indexed
51
+ }
52
+ else {
53
+ console.warn(`[SNAPSHOT-DEBUG] Interrupted indexing codebase no longer exists: ${codebasePath}`);
54
+ }
55
+ }
56
+ // Restore state - only fully indexed codebases
57
+ this.indexedCodebases = validCodebases;
58
+ this.indexingCodebases = new Map(); // Reset indexing codebases since they were interrupted
59
+ this.codebaseFileCount = new Map(); // No file count info in v1 format
60
+ // Populate codebaseInfoMap for v1 indexed codebases (with minimal info)
61
+ this.codebaseInfoMap = new Map();
62
+ const now = new Date().toISOString();
63
+ for (const codebasePath of validCodebases) {
64
+ const info = {
65
+ status: 'indexed',
66
+ indexedFiles: 0, // Unknown in v1 format
67
+ totalChunks: 0, // Unknown in v1 format
68
+ indexStatus: 'completed', // Assume completed for v1 format
69
+ lastUpdated: now
70
+ };
71
+ this.codebaseInfoMap.set(codebasePath, info);
72
+ }
73
+ }
74
+ /**
75
+ * Convert v2 format to internal state
76
+ */
77
+ loadV2Format(snapshot) {
78
+ console.log('[SNAPSHOT-DEBUG] Loading v2 format snapshot');
79
+ const validIndexedCodebases = [];
80
+ const validIndexingCodebases = new Map();
81
+ const validFileCount = new Map();
82
+ const validCodebaseInfoMap = new Map();
83
+ for (const [codebasePath, info] of Object.entries(snapshot.codebases)) {
84
+ if (!fs.existsSync(codebasePath)) {
85
+ console.warn(`[SNAPSHOT-DEBUG] Codebase no longer exists, removing: ${codebasePath}`);
86
+ continue;
87
+ }
88
+ // Store the complete info for this codebase
89
+ validCodebaseInfoMap.set(codebasePath, info);
90
+ if (info.status === 'indexed') {
91
+ validIndexedCodebases.push(codebasePath);
92
+ if ('indexedFiles' in info) {
93
+ validFileCount.set(codebasePath, info.indexedFiles);
94
+ }
95
+ console.log(`[SNAPSHOT-DEBUG] Validated indexed codebase: ${codebasePath} (${info.indexedFiles || 'unknown'} files, ${info.totalChunks || 'unknown'} chunks)`);
96
+ }
97
+ else if (info.status === 'indexing') {
98
+ if ('indexingPercentage' in info) {
99
+ validIndexingCodebases.set(codebasePath, info.indexingPercentage);
100
+ }
101
+ console.warn(`[SNAPSHOT-DEBUG] Found interrupted indexing codebase: ${codebasePath} (${info.indexingPercentage || 0}%). Treating as not indexed.`);
102
+ // Don't add to indexed - treat interrupted indexing as not indexed
103
+ }
104
+ else if (info.status === 'indexfailed') {
105
+ console.warn(`[SNAPSHOT-DEBUG] Found failed indexing codebase: ${codebasePath}. Error: ${info.errorMessage}`);
106
+ // Failed indexing codebases are not added to indexed or indexing lists
107
+ // But we keep the info for potential retry
108
+ }
109
+ }
110
+ // Restore state
111
+ this.indexedCodebases = validIndexedCodebases;
112
+ this.indexingCodebases = new Map(); // Reset indexing codebases since they were interrupted
113
+ this.codebaseFileCount = validFileCount;
114
+ this.codebaseInfoMap = validCodebaseInfoMap;
115
+ }
116
+ getIndexedCodebases() {
117
+ // Read from JSON file to ensure consistency and persistence
118
+ try {
119
+ if (!fs.existsSync(this.snapshotFilePath)) {
120
+ return [];
121
+ }
122
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, 'utf8');
123
+ const snapshot = JSON.parse(snapshotData);
124
+ if (this.isV2Format(snapshot)) {
125
+ return Object.entries(snapshot.codebases)
126
+ .filter(([_, info]) => info.status === 'indexed')
127
+ .map(([path, _]) => path);
128
+ }
129
+ else {
130
+ // V1 format
131
+ return snapshot.indexedCodebases || [];
132
+ }
133
+ }
134
+ catch (error) {
135
+ console.warn(`[SNAPSHOT-DEBUG] Error reading indexed codebases from file:`, error);
136
+ // Fallback to memory if file reading fails
137
+ return [...this.indexedCodebases];
138
+ }
139
+ }
140
+ getIndexingCodebases() {
141
+ // Read from JSON file to ensure consistency and persistence
142
+ try {
143
+ if (!fs.existsSync(this.snapshotFilePath)) {
144
+ return [];
145
+ }
146
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, 'utf8');
147
+ const snapshot = JSON.parse(snapshotData);
148
+ if (this.isV2Format(snapshot)) {
149
+ return Object.entries(snapshot.codebases)
150
+ .filter(([_, info]) => info.status === 'indexing')
151
+ .map(([path, _]) => path);
152
+ }
153
+ else {
154
+ // V1 format - Handle both legacy array format and new object format
155
+ if (Array.isArray(snapshot.indexingCodebases)) {
156
+ // Legacy format: return the array directly
157
+ return snapshot.indexingCodebases;
158
+ }
159
+ else if (snapshot.indexingCodebases && typeof snapshot.indexingCodebases === 'object') {
160
+ // New format: return the keys of the object
161
+ return Object.keys(snapshot.indexingCodebases);
162
+ }
163
+ }
164
+ return [];
165
+ }
166
+ catch (error) {
167
+ console.warn(`[SNAPSHOT-DEBUG] Error reading indexing codebases from file:`, error);
168
+ // Fallback to memory if file reading fails
169
+ return Array.from(this.indexingCodebases.keys());
170
+ }
171
+ }
172
+ /**
173
+ * @deprecated Use getCodebaseInfo() for individual codebases or iterate through codebases for v2 format support
174
+ */
175
+ getIndexingCodebasesWithProgress() {
176
+ return new Map(this.indexingCodebases);
177
+ }
178
+ getIndexingProgress(codebasePath) {
179
+ // Read from JSON file to ensure consistency and persistence
180
+ try {
181
+ if (!fs.existsSync(this.snapshotFilePath)) {
182
+ return undefined;
183
+ }
184
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, 'utf8');
185
+ const snapshot = JSON.parse(snapshotData);
186
+ if (this.isV2Format(snapshot)) {
187
+ const info = snapshot.codebases[codebasePath];
188
+ if (info && info.status === 'indexing') {
189
+ return info.indexingPercentage || 0;
190
+ }
191
+ return undefined;
192
+ }
193
+ else {
194
+ // V1 format - Handle both legacy array format and new object format
195
+ if (Array.isArray(snapshot.indexingCodebases)) {
196
+ // Legacy format: if path exists in array, assume 0% progress
197
+ return snapshot.indexingCodebases.includes(codebasePath) ? 0 : undefined;
198
+ }
199
+ else if (snapshot.indexingCodebases && typeof snapshot.indexingCodebases === 'object') {
200
+ // New format: return the actual progress percentage
201
+ return snapshot.indexingCodebases[codebasePath];
202
+ }
203
+ }
204
+ return undefined;
205
+ }
206
+ catch (error) {
207
+ console.warn(`[SNAPSHOT-DEBUG] Error reading progress from file for ${codebasePath}:`, error);
208
+ // Fallback to memory if file reading fails
209
+ return this.indexingCodebases.get(codebasePath);
210
+ }
211
+ }
212
+ /**
213
+ * @deprecated Use setCodebaseIndexing() instead for v2 format support
214
+ */
215
+ addIndexingCodebase(codebasePath, progress = 0) {
216
+ this.indexingCodebases.set(codebasePath, progress);
217
+ // Also update codebaseInfoMap for v2 compatibility
218
+ const info = {
219
+ status: 'indexing',
220
+ indexingPercentage: progress,
221
+ lastUpdated: new Date().toISOString()
222
+ };
223
+ this.codebaseInfoMap.set(codebasePath, info);
224
+ }
225
+ /**
226
+ * @deprecated Use setCodebaseIndexing() instead for v2 format support
227
+ */
228
+ updateIndexingProgress(codebasePath, progress) {
229
+ if (this.indexingCodebases.has(codebasePath)) {
230
+ this.indexingCodebases.set(codebasePath, progress);
231
+ // Also update codebaseInfoMap for v2 compatibility
232
+ const info = {
233
+ status: 'indexing',
234
+ indexingPercentage: progress,
235
+ lastUpdated: new Date().toISOString()
236
+ };
237
+ this.codebaseInfoMap.set(codebasePath, info);
238
+ }
239
+ }
240
+ /**
241
+ * @deprecated Use removeCodebaseCompletely() or state-specific methods instead for v2 format support
242
+ */
243
+ removeIndexingCodebase(codebasePath) {
244
+ this.indexingCodebases.delete(codebasePath);
245
+ // Also remove from codebaseInfoMap for v2 compatibility
246
+ this.codebaseInfoMap.delete(codebasePath);
247
+ }
248
+ /**
249
+ * @deprecated Use setCodebaseIndexed() instead for v2 format support
250
+ */
251
+ addIndexedCodebase(codebasePath, fileCount) {
252
+ if (!this.indexedCodebases.includes(codebasePath)) {
253
+ this.indexedCodebases.push(codebasePath);
254
+ }
255
+ if (fileCount !== undefined) {
256
+ this.codebaseFileCount.set(codebasePath, fileCount);
257
+ }
258
+ // Also update codebaseInfoMap for v2 compatibility
259
+ const info = {
260
+ status: 'indexed',
261
+ indexedFiles: fileCount || 0,
262
+ totalChunks: 0, // Unknown in v1 method
263
+ indexStatus: 'completed',
264
+ lastUpdated: new Date().toISOString()
265
+ };
266
+ this.codebaseInfoMap.set(codebasePath, info);
267
+ }
268
+ /**
269
+ * @deprecated Use removeCodebaseCompletely() or state-specific methods instead for v2 format support
270
+ */
271
+ removeIndexedCodebase(codebasePath) {
272
+ this.indexedCodebases = this.indexedCodebases.filter(path => path !== codebasePath);
273
+ this.codebaseFileCount.delete(codebasePath);
274
+ // Also remove from codebaseInfoMap for v2 compatibility
275
+ this.codebaseInfoMap.delete(codebasePath);
276
+ }
277
+ /**
278
+ * @deprecated Use setCodebaseIndexed() instead for v2 format support
279
+ */
280
+ moveFromIndexingToIndexed(codebasePath, fileCount) {
281
+ this.removeIndexingCodebase(codebasePath);
282
+ this.addIndexedCodebase(codebasePath, fileCount);
283
+ }
284
+ /**
285
+ * @deprecated Use getCodebaseInfo() and check indexedFiles property instead for v2 format support
286
+ */
287
+ getIndexedFileCount(codebasePath) {
288
+ return this.codebaseFileCount.get(codebasePath);
289
+ }
290
+ /**
291
+ * @deprecated Use setCodebaseIndexed() with complete stats instead for v2 format support
292
+ */
293
+ setIndexedFileCount(codebasePath, fileCount) {
294
+ this.codebaseFileCount.set(codebasePath, fileCount);
295
+ }
296
+ /**
297
+ * Set codebase to indexing status
298
+ */
299
+ setCodebaseIndexing(codebasePath, progress = 0) {
300
+ this.indexingCodebases.set(codebasePath, progress);
301
+ // Remove from other states
302
+ this.indexedCodebases = this.indexedCodebases.filter(path => path !== codebasePath);
303
+ this.codebaseFileCount.delete(codebasePath);
304
+ // Update info map
305
+ const info = {
306
+ status: 'indexing',
307
+ indexingPercentage: progress,
308
+ lastUpdated: new Date().toISOString()
309
+ };
310
+ this.codebaseInfoMap.set(codebasePath, info);
311
+ }
312
+ /**
313
+ * Set codebase to indexed status with complete statistics
314
+ */
315
+ setCodebaseIndexed(codebasePath, stats) {
316
+ // Add to indexed list if not already there
317
+ if (!this.indexedCodebases.includes(codebasePath)) {
318
+ this.indexedCodebases.push(codebasePath);
319
+ }
320
+ // Remove from indexing state
321
+ this.indexingCodebases.delete(codebasePath);
322
+ // Update file count and info
323
+ this.codebaseFileCount.set(codebasePath, stats.indexedFiles);
324
+ const info = {
325
+ status: 'indexed',
326
+ indexedFiles: stats.indexedFiles,
327
+ totalChunks: stats.totalChunks,
328
+ indexStatus: stats.status,
329
+ lastUpdated: new Date().toISOString()
330
+ };
331
+ this.codebaseInfoMap.set(codebasePath, info);
332
+ }
333
+ /**
334
+ * Set codebase to failed status
335
+ */
336
+ setCodebaseIndexFailed(codebasePath, errorMessage, lastAttemptedPercentage) {
337
+ // Remove from other states
338
+ this.indexedCodebases = this.indexedCodebases.filter(path => path !== codebasePath);
339
+ this.indexingCodebases.delete(codebasePath);
340
+ this.codebaseFileCount.delete(codebasePath);
341
+ // Update info map
342
+ const info = {
343
+ status: 'indexfailed',
344
+ errorMessage: errorMessage,
345
+ lastAttemptedPercentage: lastAttemptedPercentage,
346
+ lastUpdated: new Date().toISOString()
347
+ };
348
+ this.codebaseInfoMap.set(codebasePath, info);
349
+ }
350
+ /**
351
+ * Get codebase status
352
+ */
353
+ getCodebaseStatus(codebasePath) {
354
+ const info = this.codebaseInfoMap.get(codebasePath);
355
+ if (!info)
356
+ return 'not_found';
357
+ return info.status;
358
+ }
359
+ /**
360
+ * Get complete codebase information
361
+ */
362
+ getCodebaseInfo(codebasePath) {
363
+ return this.codebaseInfoMap.get(codebasePath);
364
+ }
365
+ /**
366
+ * Get all failed codebases
367
+ */
368
+ getFailedCodebases() {
369
+ return Array.from(this.codebaseInfoMap.entries())
370
+ .filter(([_, info]) => info.status === 'indexfailed')
371
+ .map(([path, _]) => path);
372
+ }
373
+ /**
374
+ * Completely remove a codebase from all tracking (for clear_index operation)
375
+ */
376
+ removeCodebaseCompletely(codebasePath) {
377
+ // Remove from all internal state
378
+ this.indexedCodebases = this.indexedCodebases.filter(path => path !== codebasePath);
379
+ this.indexingCodebases.delete(codebasePath);
380
+ this.codebaseFileCount.delete(codebasePath);
381
+ this.codebaseInfoMap.delete(codebasePath);
382
+ console.log(`[SNAPSHOT-DEBUG] Completely removed codebase from snapshot: ${codebasePath}`);
383
+ }
384
+ loadCodebaseSnapshot() {
385
+ console.log('[SNAPSHOT-DEBUG] Loading codebase snapshot from:', this.snapshotFilePath);
386
+ try {
387
+ if (!fs.existsSync(this.snapshotFilePath)) {
388
+ console.log('[SNAPSHOT-DEBUG] Snapshot file does not exist. Starting with empty codebase list.');
389
+ return;
390
+ }
391
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, 'utf8');
392
+ const snapshot = JSON.parse(snapshotData);
393
+ console.log('[SNAPSHOT-DEBUG] Loaded snapshot:', snapshot);
394
+ if (this.isV2Format(snapshot)) {
395
+ this.loadV2Format(snapshot);
396
+ }
397
+ else {
398
+ this.loadV1Format(snapshot);
399
+ }
400
+ // Always save in v2 format after loading (migration)
401
+ this.saveCodebaseSnapshot();
402
+ }
403
+ catch (error) {
404
+ console.error('[SNAPSHOT-DEBUG] Error loading snapshot:', error);
405
+ console.log('[SNAPSHOT-DEBUG] Starting with empty codebase list due to snapshot error.');
406
+ }
407
+ }
408
+ saveCodebaseSnapshot() {
409
+ console.log('[SNAPSHOT-DEBUG] Saving codebase snapshot to:', this.snapshotFilePath);
410
+ try {
411
+ // Ensure directory exists
412
+ const snapshotDir = path.dirname(this.snapshotFilePath);
413
+ if (!fs.existsSync(snapshotDir)) {
414
+ fs.mkdirSync(snapshotDir, { recursive: true });
415
+ console.log('[SNAPSHOT-DEBUG] Created snapshot directory:', snapshotDir);
416
+ }
417
+ // Build v2 format snapshot using the complete info map
418
+ const codebases = {};
419
+ // Add all codebases from the info map
420
+ for (const [codebasePath, info] of this.codebaseInfoMap) {
421
+ codebases[codebasePath] = info;
422
+ }
423
+ const snapshot = {
424
+ formatVersion: 'v2',
425
+ codebases: codebases,
426
+ lastUpdated: new Date().toISOString()
427
+ };
428
+ fs.writeFileSync(this.snapshotFilePath, JSON.stringify(snapshot, null, 2));
429
+ const indexedCount = this.indexedCodebases.length;
430
+ const indexingCount = this.indexingCodebases.size;
431
+ const failedCount = this.getFailedCodebases().length;
432
+ console.log(`[SNAPSHOT-DEBUG] Snapshot saved successfully in v2 format. Indexed: ${indexedCount}, Indexing: ${indexingCount}, Failed: ${failedCount}`);
433
+ }
434
+ catch (error) {
435
+ console.error('[SNAPSHOT-DEBUG] Error saving snapshot:', error);
436
+ }
437
+ }
438
+ }
439
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../src/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAWzB,MAAM,OAAO,eAAe;IAOxB;QALQ,qBAAgB,GAAa,EAAE,CAAC;QAChC,sBAAiB,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,8CAA8C;QAClG,sBAAiB,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,6CAA6C;QACjG,oBAAe,GAA8B,IAAI,GAAG,EAAE,CAAC,CAAC,wCAAwC;QAGpG,gCAAgC;QAChC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,4BAA4B,CAAC,CAAC;IAC9F,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,QAAa;QAC5B,OAAO,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC;IACvD,CAAC;IAED;;OAEG;IACK,YAAY,CAAC,QAA4B;QAC7C,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,C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AG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAClD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC;YAErD,OAAO,CAAC,GAAG,CAAC,uEAAuE,YAAY,eAAe,aAAa,aAAa,WAAW,EAAE,CAAC,CAAC;QAE3J,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;CACJ"}
package/dist/sync.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Context } from "@pleaseai/context-please-core";
2
+ import { SnapshotManager } from "./snapshot.js";
3
+ export declare class SyncManager {
4
+ private context;
5
+ private snapshotManager;
6
+ private isSyncing;
7
+ constructor(context: Context, snapshotManager: SnapshotManager);
8
+ handleSyncIndex(): Promise<void>;
9
+ startBackgroundSync(): void;
10
+ }
11
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAoB,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,WAAW;IACpB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,SAAS,CAAkB;gBAEvB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe;IAKjD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAmGtC,mBAAmB,IAAI,IAAI;CA6BrC"}
package/dist/sync.js ADDED
@@ -0,0 +1,123 @@
1
+ import * as fs from "fs";
2
+ import { FileSynchronizer } from "@pleaseai/context-please-core";
3
+ export class SyncManager {
4
+ constructor(context, snapshotManager) {
5
+ this.isSyncing = false;
6
+ this.context = context;
7
+ this.snapshotManager = snapshotManager;
8
+ }
9
+ async handleSyncIndex() {
10
+ const syncStartTime = Date.now();
11
+ console.log(`[SYNC-DEBUG] handleSyncIndex() called at ${new Date().toISOString()}`);
12
+ const indexedCodebases = this.snapshotManager.getIndexedCodebases();
13
+ if (indexedCodebases.length === 0) {
14
+ console.log('[SYNC-DEBUG] No codebases indexed. Skipping sync.');
15
+ return;
16
+ }
17
+ console.log(`[SYNC-DEBUG] Found ${indexedCodebases.length} indexed codebases:`, indexedCodebases);
18
+ if (this.isSyncing) {
19
+ console.log('[SYNC-DEBUG] Index sync already in progress. Skipping.');
20
+ return;
21
+ }
22
+ this.isSyncing = true;
23
+ console.log(`[SYNC-DEBUG] Starting index sync for all ${indexedCodebases.length} codebases...`);
24
+ try {
25
+ let totalStats = { added: 0, removed: 0, modified: 0 };
26
+ for (let i = 0; i < indexedCodebases.length; i++) {
27
+ const codebasePath = indexedCodebases[i];
28
+ const codebaseStartTime = Date.now();
29
+ console.log(`[SYNC-DEBUG] [${i + 1}/${indexedCodebases.length}] Starting sync for codebase: '${codebasePath}'`);
30
+ // Check if codebase path still exists
31
+ try {
32
+ const pathExists = fs.existsSync(codebasePath);
33
+ console.log(`[SYNC-DEBUG] Codebase path exists: ${pathExists}`);
34
+ if (!pathExists) {
35
+ console.warn(`[SYNC-DEBUG] Codebase path '${codebasePath}' no longer exists. Skipping sync.`);
36
+ continue;
37
+ }
38
+ }
39
+ catch (pathError) {
40
+ console.error(`[SYNC-DEBUG] Error checking codebase path '${codebasePath}':`, pathError);
41
+ continue;
42
+ }
43
+ try {
44
+ console.log(`[SYNC-DEBUG] Calling context.reindexByChange() for '${codebasePath}'`);
45
+ const stats = await this.context.reindexByChange(codebasePath);
46
+ const codebaseElapsed = Date.now() - codebaseStartTime;
47
+ console.log(`[SYNC-DEBUG] Reindex stats for '${codebasePath}':`, stats);
48
+ console.log(`[SYNC-DEBUG] Codebase sync completed in ${codebaseElapsed}ms`);
49
+ // Accumulate total stats
50
+ totalStats.added += stats.added;
51
+ totalStats.removed += stats.removed;
52
+ totalStats.modified += stats.modified;
53
+ if (stats.added > 0 || stats.removed > 0 || stats.modified > 0) {
54
+ console.log(`[SYNC] Sync complete for '${codebasePath}'. Added: ${stats.added}, Removed: ${stats.removed}, Modified: ${stats.modified} (${codebaseElapsed}ms)`);
55
+ }
56
+ else {
57
+ console.log(`[SYNC] No changes detected for '${codebasePath}' (${codebaseElapsed}ms)`);
58
+ }
59
+ }
60
+ catch (error) {
61
+ const codebaseElapsed = Date.now() - codebaseStartTime;
62
+ console.error(`[SYNC-DEBUG] Error syncing codebase '${codebasePath}' after ${codebaseElapsed}ms:`, error);
63
+ console.error(`[SYNC-DEBUG] Error stack:`, error.stack);
64
+ if (error.message.includes('Failed to query Milvus')) {
65
+ // Collection maybe deleted manually, delete the snapshot file
66
+ await FileSynchronizer.deleteSnapshot(codebasePath);
67
+ }
68
+ // Log additional error details
69
+ if (error.code) {
70
+ console.error(`[SYNC-DEBUG] Error code: ${error.code}`);
71
+ }
72
+ if (error.errno) {
73
+ console.error(`[SYNC-DEBUG] Error errno: ${error.errno}`);
74
+ }
75
+ // Continue with next codebase even if one fails
76
+ }
77
+ }
78
+ const totalElapsed = Date.now() - syncStartTime;
79
+ console.log(`[SYNC-DEBUG] Total sync stats across all codebases: Added: ${totalStats.added}, Removed: ${totalStats.removed}, Modified: ${totalStats.modified}`);
80
+ console.log(`[SYNC-DEBUG] Index sync completed for all codebases in ${totalElapsed}ms`);
81
+ console.log(`[SYNC] Index sync completed for all codebases. Total changes - Added: ${totalStats.added}, Removed: ${totalStats.removed}, Modified: ${totalStats.modified}`);
82
+ }
83
+ catch (error) {
84
+ const totalElapsed = Date.now() - syncStartTime;
85
+ console.error(`[SYNC-DEBUG] Error during index sync after ${totalElapsed}ms:`, error);
86
+ console.error(`[SYNC-DEBUG] Error stack:`, error.stack);
87
+ }
88
+ finally {
89
+ this.isSyncing = false;
90
+ const totalElapsed = Date.now() - syncStartTime;
91
+ console.log(`[SYNC-DEBUG] handleSyncIndex() finished at ${new Date().toISOString()}, total duration: ${totalElapsed}ms`);
92
+ }
93
+ }
94
+ startBackgroundSync() {
95
+ console.log('[SYNC-DEBUG] startBackgroundSync() called');
96
+ // Execute initial sync immediately after a short delay to let server initialize
97
+ console.log('[SYNC-DEBUG] Scheduling initial sync in 5 seconds...');
98
+ setTimeout(async () => {
99
+ console.log('[SYNC-DEBUG] Executing initial sync after server startup');
100
+ try {
101
+ await this.handleSyncIndex();
102
+ }
103
+ catch (error) {
104
+ const errorMessage = error instanceof Error ? error.message : String(error);
105
+ if (errorMessage.includes('Failed to query collection')) {
106
+ console.log('[SYNC-DEBUG] Collection not yet established, this is expected for new cluster users. Will retry on next sync cycle.');
107
+ }
108
+ else {
109
+ console.error('[SYNC-DEBUG] Initial sync failed with unexpected error:', error);
110
+ throw error;
111
+ }
112
+ }
113
+ }, 5000); // Initial sync after 5 seconds
114
+ // Periodically check for file changes and update the index
115
+ console.log('[SYNC-DEBUG] Setting up periodic sync every 5 minutes (300000ms)');
116
+ const syncInterval = setInterval(() => {
117
+ console.log('[SYNC-DEBUG] Executing scheduled periodic sync');
118
+ this.handleSyncIndex();
119
+ }, 5 * 60 * 1000); // every 5 minutes
120
+ console.log('[SYNC-DEBUG] Background sync setup complete. Interval ID:', syncInterval);
121
+ }
122
+ }
123
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAW,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,OAAO,WAAW;IAKpB,YAAY,OAAgB,EAAE,eAAgC;QAFtD,cAAS,GAAY,KAAK,CAAC;QAG/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,eAAe;QACxB,MAAM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AC,CAAC,+BAA+B;QAEzC,2DAA2D;QAC3D,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;QAChF,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;YAClC,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,EAAE,CAAC;QAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,kBAAkB;QAErC,OAAO,CAAC,GAAG,CAAC,2DAA2D,EAAE,YAAY,CAAC,CAAC;IAC3F,CAAC;CACJ"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Truncate content to specified length
3
+ */
4
+ export declare function truncateContent(content: string, maxLength: number): string;
5
+ /**
6
+ * Ensure path is absolute. If relative path is provided, resolve it properly.
7
+ */
8
+ export declare function ensureAbsolutePath(inputPath: string): string;
9
+ export declare function trackCodebasePath(codebasePath: string): void;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAG5D"}
package/dist/utils.js ADDED
@@ -0,0 +1,27 @@
1
+ import * as path from "path";
2
+ /**
3
+ * Truncate content to specified length
4
+ */
5
+ export function truncateContent(content, maxLength) {
6
+ if (content.length <= maxLength) {
7
+ return content;
8
+ }
9
+ return content.substring(0, maxLength) + '...';
10
+ }
11
+ /**
12
+ * Ensure path is absolute. If relative path is provided, resolve it properly.
13
+ */
14
+ export function ensureAbsolutePath(inputPath) {
15
+ // If already absolute, return as is
16
+ if (path.isAbsolute(inputPath)) {
17
+ return inputPath;
18
+ }
19
+ // For relative paths, resolve to absolute path
20
+ const resolved = path.resolve(inputPath);
21
+ return resolved;
22
+ }
23
+ export function trackCodebasePath(codebasePath) {
24
+ const absolutePath = ensureAbsolutePath(codebasePath);
25
+ console.log(`[TRACKING] Tracked codebase path: ${absolutePath} (not marked as indexed)`);
26
+ }
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,SAAiB;IAC9D,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,oCAAoC;IACpC,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,+CAA+C;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAoB;IAClD,MAAM,YAAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,qCAAqC,YAAY,0BAA0B,CAAC,CAAC;AAC7F,CAAC"}