@mcampa/ai-context-mcp 0.0.1-beta.c518c19

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,447 @@
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 (typeof snapshot === "object" &&
18
+ snapshot !== null &&
19
+ "formatVersion" in snapshot &&
20
+ snapshot.formatVersion === "v2");
21
+ }
22
+ /**
23
+ * Convert v1 format to internal state
24
+ */
25
+ loadV1Format(snapshot) {
26
+ console.log("[SNAPSHOT-DEBUG] Loading v1 format snapshot");
27
+ // Validate that the codebases still exist
28
+ const validCodebases = [];
29
+ for (const codebasePath of snapshot.indexedCodebases) {
30
+ if (fs.existsSync(codebasePath)) {
31
+ validCodebases.push(codebasePath);
32
+ console.log(`[SNAPSHOT-DEBUG] Validated codebase: ${codebasePath}`);
33
+ }
34
+ else {
35
+ console.warn(`[SNAPSHOT-DEBUG] Codebase no longer exists, removing: ${codebasePath}`);
36
+ }
37
+ }
38
+ // Handle indexing codebases - treat them as not indexed since they were interrupted
39
+ let indexingCodebasesList = [];
40
+ if (Array.isArray(snapshot.indexingCodebases)) {
41
+ // Legacy format: string[]
42
+ indexingCodebasesList = snapshot.indexingCodebases;
43
+ console.log(`[SNAPSHOT-DEBUG] Found legacy indexingCodebases array format with ${indexingCodebasesList.length} entries`);
44
+ }
45
+ else if (snapshot.indexingCodebases &&
46
+ typeof snapshot.indexingCodebases === "object") {
47
+ // New format: Record<string, number>
48
+ indexingCodebasesList = Object.keys(snapshot.indexingCodebases);
49
+ console.log(`[SNAPSHOT-DEBUG] Found new indexingCodebases object format with ${indexingCodebasesList.length} entries`);
50
+ }
51
+ for (const codebasePath of indexingCodebasesList) {
52
+ if (fs.existsSync(codebasePath)) {
53
+ console.warn(`[SNAPSHOT-DEBUG] Found interrupted indexing codebase: ${codebasePath}. Treating as not indexed.`);
54
+ // Don't add to validIndexingCodebases - treat as not indexed
55
+ }
56
+ else {
57
+ console.warn(`[SNAPSHOT-DEBUG] Interrupted indexing codebase no longer exists: ${codebasePath}`);
58
+ }
59
+ }
60
+ // Restore state - only fully indexed codebases
61
+ this.indexedCodebases = validCodebases;
62
+ this.indexingCodebases = new Map(); // Reset indexing codebases since they were interrupted
63
+ this.codebaseFileCount = new Map(); // No file count info in v1 format
64
+ // Populate codebaseInfoMap for v1 indexed codebases (with minimal info)
65
+ this.codebaseInfoMap = new Map();
66
+ const now = new Date().toISOString();
67
+ for (const codebasePath of validCodebases) {
68
+ const info = {
69
+ status: "indexed",
70
+ indexedFiles: 0, // Unknown in v1 format
71
+ totalChunks: 0, // Unknown in v1 format
72
+ indexStatus: "completed", // Assume completed for v1 format
73
+ lastUpdated: now,
74
+ };
75
+ this.codebaseInfoMap.set(codebasePath, info);
76
+ }
77
+ }
78
+ /**
79
+ * Convert v2 format to internal state
80
+ */
81
+ loadV2Format(snapshot) {
82
+ console.log("[SNAPSHOT-DEBUG] Loading v2 format snapshot");
83
+ const validIndexedCodebases = [];
84
+ const validIndexingCodebases = new Map();
85
+ const validFileCount = new Map();
86
+ const validCodebaseInfoMap = new Map();
87
+ for (const [codebasePath, info] of Object.entries(snapshot.codebases)) {
88
+ if (!fs.existsSync(codebasePath)) {
89
+ console.warn(`[SNAPSHOT-DEBUG] Codebase no longer exists, removing: ${codebasePath}`);
90
+ continue;
91
+ }
92
+ // Store the complete info for this codebase
93
+ validCodebaseInfoMap.set(codebasePath, info);
94
+ if (info.status === "indexed") {
95
+ validIndexedCodebases.push(codebasePath);
96
+ if ("indexedFiles" in info) {
97
+ validFileCount.set(codebasePath, info.indexedFiles);
98
+ }
99
+ console.log(`[SNAPSHOT-DEBUG] Validated indexed codebase: ${codebasePath} (${info.indexedFiles || "unknown"} files, ${info.totalChunks || "unknown"} chunks)`);
100
+ }
101
+ else if (info.status === "indexing") {
102
+ if ("indexingPercentage" in info) {
103
+ validIndexingCodebases.set(codebasePath, info.indexingPercentage);
104
+ }
105
+ console.warn(`[SNAPSHOT-DEBUG] Found interrupted indexing codebase: ${codebasePath} (${info.indexingPercentage || 0}%). Treating as not indexed.`);
106
+ // Don't add to indexed - treat interrupted indexing as not indexed
107
+ }
108
+ else if (info.status === "indexfailed") {
109
+ console.warn(`[SNAPSHOT-DEBUG] Found failed indexing codebase: ${codebasePath}. Error: ${info.errorMessage}`);
110
+ // Failed indexing codebases are not added to indexed or indexing lists
111
+ // But we keep the info for potential retry
112
+ }
113
+ }
114
+ // Restore state
115
+ this.indexedCodebases = validIndexedCodebases;
116
+ this.indexingCodebases = new Map(); // Reset indexing codebases since they were interrupted
117
+ this.codebaseFileCount = validFileCount;
118
+ this.codebaseInfoMap = validCodebaseInfoMap;
119
+ }
120
+ getIndexedCodebases() {
121
+ // Read from JSON file to ensure consistency and persistence
122
+ try {
123
+ if (!fs.existsSync(this.snapshotFilePath)) {
124
+ return [];
125
+ }
126
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, "utf8");
127
+ const snapshot = JSON.parse(snapshotData);
128
+ if (this.isV2Format(snapshot)) {
129
+ return Object.entries(snapshot.codebases)
130
+ .filter(([_, info]) => info.status === "indexed")
131
+ .map(([path, _]) => path);
132
+ }
133
+ else {
134
+ // V1 format
135
+ return snapshot.indexedCodebases || [];
136
+ }
137
+ }
138
+ catch (error) {
139
+ console.warn(`[SNAPSHOT-DEBUG] Error reading indexed codebases from file:`, error);
140
+ // Fallback to memory if file reading fails
141
+ return [...this.indexedCodebases];
142
+ }
143
+ }
144
+ getIndexingCodebases() {
145
+ // Read from JSON file to ensure consistency and persistence
146
+ try {
147
+ if (!fs.existsSync(this.snapshotFilePath)) {
148
+ return [];
149
+ }
150
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, "utf8");
151
+ const snapshot = JSON.parse(snapshotData);
152
+ if (this.isV2Format(snapshot)) {
153
+ return Object.entries(snapshot.codebases)
154
+ .filter(([_, info]) => info.status === "indexing")
155
+ .map(([path, _]) => path);
156
+ }
157
+ else {
158
+ // V1 format - Handle both legacy array format and new object format
159
+ if (Array.isArray(snapshot.indexingCodebases)) {
160
+ // Legacy format: return the array directly
161
+ return snapshot.indexingCodebases;
162
+ }
163
+ else if (snapshot.indexingCodebases &&
164
+ typeof snapshot.indexingCodebases === "object") {
165
+ // New format: return the keys of the object
166
+ return Object.keys(snapshot.indexingCodebases);
167
+ }
168
+ }
169
+ return [];
170
+ }
171
+ catch (error) {
172
+ console.warn(`[SNAPSHOT-DEBUG] Error reading indexing codebases from file:`, error);
173
+ // Fallback to memory if file reading fails
174
+ return Array.from(this.indexingCodebases.keys());
175
+ }
176
+ }
177
+ /**
178
+ * @deprecated Use getCodebaseInfo() for individual codebases or iterate through codebases for v2 format support
179
+ */
180
+ getIndexingCodebasesWithProgress() {
181
+ return new Map(this.indexingCodebases);
182
+ }
183
+ getIndexingProgress(codebasePath) {
184
+ // Read from JSON file to ensure consistency and persistence
185
+ try {
186
+ if (!fs.existsSync(this.snapshotFilePath)) {
187
+ return undefined;
188
+ }
189
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, "utf8");
190
+ const snapshot = JSON.parse(snapshotData);
191
+ if (this.isV2Format(snapshot)) {
192
+ const info = snapshot.codebases[codebasePath];
193
+ if (info && info.status === "indexing") {
194
+ return info.indexingPercentage || 0;
195
+ }
196
+ return undefined;
197
+ }
198
+ else {
199
+ // V1 format - Handle both legacy array format and new object format
200
+ if (Array.isArray(snapshot.indexingCodebases)) {
201
+ // Legacy format: if path exists in array, assume 0% progress
202
+ return snapshot.indexingCodebases.includes(codebasePath)
203
+ ? 0
204
+ : undefined;
205
+ }
206
+ else if (snapshot.indexingCodebases &&
207
+ typeof snapshot.indexingCodebases === "object") {
208
+ // New format: return the actual progress percentage
209
+ return snapshot.indexingCodebases[codebasePath];
210
+ }
211
+ }
212
+ return undefined;
213
+ }
214
+ catch (error) {
215
+ console.warn(`[SNAPSHOT-DEBUG] Error reading progress from file for ${codebasePath}:`, error);
216
+ // Fallback to memory if file reading fails
217
+ return this.indexingCodebases.get(codebasePath);
218
+ }
219
+ }
220
+ /**
221
+ * @deprecated Use setCodebaseIndexing() instead for v2 format support
222
+ */
223
+ addIndexingCodebase(codebasePath, progress = 0) {
224
+ this.indexingCodebases.set(codebasePath, progress);
225
+ // Also update codebaseInfoMap for v2 compatibility
226
+ const info = {
227
+ status: "indexing",
228
+ indexingPercentage: progress,
229
+ lastUpdated: new Date().toISOString(),
230
+ };
231
+ this.codebaseInfoMap.set(codebasePath, info);
232
+ }
233
+ /**
234
+ * @deprecated Use setCodebaseIndexing() instead for v2 format support
235
+ */
236
+ updateIndexingProgress(codebasePath, progress) {
237
+ if (this.indexingCodebases.has(codebasePath)) {
238
+ this.indexingCodebases.set(codebasePath, progress);
239
+ // Also update codebaseInfoMap for v2 compatibility
240
+ const info = {
241
+ status: "indexing",
242
+ indexingPercentage: progress,
243
+ lastUpdated: new Date().toISOString(),
244
+ };
245
+ this.codebaseInfoMap.set(codebasePath, info);
246
+ }
247
+ }
248
+ /**
249
+ * @deprecated Use removeCodebaseCompletely() or state-specific methods instead for v2 format support
250
+ */
251
+ removeIndexingCodebase(codebasePath) {
252
+ this.indexingCodebases.delete(codebasePath);
253
+ // Also remove from codebaseInfoMap for v2 compatibility
254
+ this.codebaseInfoMap.delete(codebasePath);
255
+ }
256
+ /**
257
+ * @deprecated Use setCodebaseIndexed() instead for v2 format support
258
+ */
259
+ addIndexedCodebase(codebasePath, fileCount) {
260
+ if (!this.indexedCodebases.includes(codebasePath)) {
261
+ this.indexedCodebases.push(codebasePath);
262
+ }
263
+ if (fileCount !== undefined) {
264
+ this.codebaseFileCount.set(codebasePath, fileCount);
265
+ }
266
+ // Also update codebaseInfoMap for v2 compatibility
267
+ const info = {
268
+ status: "indexed",
269
+ indexedFiles: fileCount || 0,
270
+ totalChunks: 0, // Unknown in v1 method
271
+ indexStatus: "completed",
272
+ lastUpdated: new Date().toISOString(),
273
+ };
274
+ this.codebaseInfoMap.set(codebasePath, info);
275
+ }
276
+ /**
277
+ * @deprecated Use removeCodebaseCompletely() or state-specific methods instead for v2 format support
278
+ */
279
+ removeIndexedCodebase(codebasePath) {
280
+ this.indexedCodebases = this.indexedCodebases.filter((path) => path !== codebasePath);
281
+ this.codebaseFileCount.delete(codebasePath);
282
+ // Also remove from codebaseInfoMap for v2 compatibility
283
+ this.codebaseInfoMap.delete(codebasePath);
284
+ }
285
+ /**
286
+ * @deprecated Use setCodebaseIndexed() instead for v2 format support
287
+ */
288
+ moveFromIndexingToIndexed(codebasePath, fileCount) {
289
+ this.removeIndexingCodebase(codebasePath);
290
+ this.addIndexedCodebase(codebasePath, fileCount);
291
+ }
292
+ /**
293
+ * @deprecated Use getCodebaseInfo() and check indexedFiles property instead for v2 format support
294
+ */
295
+ getIndexedFileCount(codebasePath) {
296
+ return this.codebaseFileCount.get(codebasePath);
297
+ }
298
+ /**
299
+ * @deprecated Use setCodebaseIndexed() with complete stats instead for v2 format support
300
+ */
301
+ setIndexedFileCount(codebasePath, fileCount) {
302
+ this.codebaseFileCount.set(codebasePath, fileCount);
303
+ }
304
+ /**
305
+ * Set codebase to indexing status
306
+ */
307
+ setCodebaseIndexing(codebasePath, progress = 0) {
308
+ this.indexingCodebases.set(codebasePath, progress);
309
+ // Remove from other states
310
+ this.indexedCodebases = this.indexedCodebases.filter((path) => path !== codebasePath);
311
+ this.codebaseFileCount.delete(codebasePath);
312
+ // Update info map
313
+ const info = {
314
+ status: "indexing",
315
+ indexingPercentage: progress,
316
+ lastUpdated: new Date().toISOString(),
317
+ };
318
+ this.codebaseInfoMap.set(codebasePath, info);
319
+ }
320
+ /**
321
+ * Set codebase to indexed status with complete statistics
322
+ */
323
+ setCodebaseIndexed(codebasePath, stats) {
324
+ // Add to indexed list if not already there
325
+ if (!this.indexedCodebases.includes(codebasePath)) {
326
+ this.indexedCodebases.push(codebasePath);
327
+ }
328
+ // Remove from indexing state
329
+ this.indexingCodebases.delete(codebasePath);
330
+ // Update file count and info
331
+ this.codebaseFileCount.set(codebasePath, stats.indexedFiles);
332
+ const info = {
333
+ status: "indexed",
334
+ indexedFiles: stats.indexedFiles,
335
+ totalChunks: stats.totalChunks,
336
+ indexStatus: stats.status,
337
+ lastUpdated: new Date().toISOString(),
338
+ };
339
+ this.codebaseInfoMap.set(codebasePath, info);
340
+ }
341
+ /**
342
+ * Set codebase to failed status
343
+ */
344
+ setCodebaseIndexFailed(codebasePath, errorMessage, lastAttemptedPercentage) {
345
+ // Remove from other states
346
+ this.indexedCodebases = this.indexedCodebases.filter((path) => path !== codebasePath);
347
+ this.indexingCodebases.delete(codebasePath);
348
+ this.codebaseFileCount.delete(codebasePath);
349
+ // Update info map
350
+ const info = {
351
+ status: "indexfailed",
352
+ errorMessage: errorMessage,
353
+ lastAttemptedPercentage: lastAttemptedPercentage,
354
+ lastUpdated: new Date().toISOString(),
355
+ };
356
+ this.codebaseInfoMap.set(codebasePath, info);
357
+ }
358
+ /**
359
+ * Get codebase status
360
+ */
361
+ getCodebaseStatus(codebasePath) {
362
+ const info = this.codebaseInfoMap.get(codebasePath);
363
+ if (!info)
364
+ return "not_found";
365
+ return info.status;
366
+ }
367
+ /**
368
+ * Get complete codebase information
369
+ */
370
+ getCodebaseInfo(codebasePath) {
371
+ return this.codebaseInfoMap.get(codebasePath);
372
+ }
373
+ /**
374
+ * Get all failed codebases
375
+ */
376
+ getFailedCodebases() {
377
+ return Array.from(this.codebaseInfoMap.entries())
378
+ .filter(([_, info]) => info.status === "indexfailed")
379
+ .map(([path, _]) => path);
380
+ }
381
+ /**
382
+ * Completely remove a codebase from all tracking (for clear_index operation)
383
+ */
384
+ removeCodebaseCompletely(codebasePath) {
385
+ // Remove from all internal state
386
+ this.indexedCodebases = this.indexedCodebases.filter((path) => path !== codebasePath);
387
+ this.indexingCodebases.delete(codebasePath);
388
+ this.codebaseFileCount.delete(codebasePath);
389
+ this.codebaseInfoMap.delete(codebasePath);
390
+ console.log(`[SNAPSHOT-DEBUG] Completely removed codebase from snapshot: ${codebasePath}`);
391
+ }
392
+ loadCodebaseSnapshot() {
393
+ console.log("[SNAPSHOT-DEBUG] Loading codebase snapshot from:", this.snapshotFilePath);
394
+ try {
395
+ if (!fs.existsSync(this.snapshotFilePath)) {
396
+ console.log("[SNAPSHOT-DEBUG] Snapshot file does not exist. Starting with empty codebase list.");
397
+ return;
398
+ }
399
+ const snapshotData = fs.readFileSync(this.snapshotFilePath, "utf8");
400
+ const snapshot = JSON.parse(snapshotData);
401
+ console.log("[SNAPSHOT-DEBUG] Loaded snapshot:", snapshot);
402
+ if (this.isV2Format(snapshot)) {
403
+ this.loadV2Format(snapshot);
404
+ }
405
+ else {
406
+ this.loadV1Format(snapshot);
407
+ }
408
+ // Always save in v2 format after loading (migration)
409
+ this.saveCodebaseSnapshot();
410
+ }
411
+ catch (error) {
412
+ console.error("[SNAPSHOT-DEBUG] Error loading snapshot:", error);
413
+ console.log("[SNAPSHOT-DEBUG] Starting with empty codebase list due to snapshot error.");
414
+ }
415
+ }
416
+ saveCodebaseSnapshot() {
417
+ console.log("[SNAPSHOT-DEBUG] Saving codebase snapshot to:", this.snapshotFilePath);
418
+ try {
419
+ // Ensure directory exists
420
+ const snapshotDir = path.dirname(this.snapshotFilePath);
421
+ if (!fs.existsSync(snapshotDir)) {
422
+ fs.mkdirSync(snapshotDir, { recursive: true });
423
+ console.log("[SNAPSHOT-DEBUG] Created snapshot directory:", snapshotDir);
424
+ }
425
+ // Build v2 format snapshot using the complete info map
426
+ const codebases = {};
427
+ // Add all codebases from the info map
428
+ for (const [codebasePath, info] of this.codebaseInfoMap) {
429
+ codebases[codebasePath] = info;
430
+ }
431
+ const snapshot = {
432
+ formatVersion: "v2",
433
+ codebases: codebases,
434
+ lastUpdated: new Date().toISOString(),
435
+ };
436
+ fs.writeFileSync(this.snapshotFilePath, JSON.stringify(snapshot, null, 2));
437
+ const indexedCount = this.indexedCodebases.length;
438
+ const indexingCount = this.indexingCodebases.size;
439
+ const failedCount = this.getFailedCodebases().length;
440
+ console.log(`[SNAPSHOT-DEBUG] Snapshot saved successfully in v2 format. Indexed: ${indexedCount}, Indexing: ${indexingCount}, Failed: ${failedCount}`);
441
+ }
442
+ catch (error) {
443
+ console.error("[SNAPSHOT-DEBUG] Error saving snapshot:", error);
444
+ }
445
+ }
446
+ }
447
+ //# 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;IAO1B;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;QAGtG,gCAAgC;QAChC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAC/B,EAAE,CAAC,OAAO,EAAE,EACZ,UAAU,EACV,4BAA4B,CAC7B,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,QAAiB;QAClC,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;YAC5B,QAAQ,KAAK,IAAI;YACjB,eAA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AAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAClC,CAAC;YAEF,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;YAClD,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAClD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC;YAErD,OAAO,CAAC,GAAG,CACT,uEAAuE,YAAY,eAAe,aAAa,aAAa,WAAW,EAAE,CAC1I,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;CACF"}
package/dist/sync.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Context } from "@mcampa/ai-context-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,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,WAAW;IACtB,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;IAiJtC,mBAAmB,IAAI,IAAI;CA2CnC"}
package/dist/sync.js ADDED
@@ -0,0 +1,128 @@
1
+ import * as fs from "fs";
2
+ import { FileSynchronizer } from "@mcampa/ai-context-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
+ const 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
+ if (error instanceof Error) {
64
+ console.error(`[SYNC-DEBUG] Error stack:`, error.stack);
65
+ }
66
+ if (String(error).includes("Failed to query Milvus")) {
67
+ // Collection maybe deleted manually, delete the snapshot file
68
+ await FileSynchronizer.deleteSnapshot(codebasePath);
69
+ }
70
+ // Log additional error details
71
+ const nodeError = error;
72
+ if (nodeError.code) {
73
+ console.error(`[SYNC-DEBUG] Error code: ${nodeError.code}`);
74
+ }
75
+ if (nodeError.errno) {
76
+ console.error(`[SYNC-DEBUG] Error errno: ${nodeError.errno}`);
77
+ }
78
+ // Continue with next codebase even if one fails
79
+ }
80
+ }
81
+ const totalElapsed = Date.now() - syncStartTime;
82
+ console.log(`[SYNC-DEBUG] Total sync stats across all codebases: Added: ${totalStats.added}, Removed: ${totalStats.removed}, Modified: ${totalStats.modified}`);
83
+ console.log(`[SYNC-DEBUG] Index sync completed for all codebases in ${totalElapsed}ms`);
84
+ console.log(`[SYNC] Index sync completed for all codebases. Total changes - Added: ${totalStats.added}, Removed: ${totalStats.removed}, Modified: ${totalStats.modified}`);
85
+ }
86
+ catch (error) {
87
+ const totalElapsed = Date.now() - syncStartTime;
88
+ console.error(`[SYNC-DEBUG] Error during index sync after ${totalElapsed}ms:`, error);
89
+ if (error instanceof Error) {
90
+ console.error(`[SYNC-DEBUG] Error stack:`, error.stack);
91
+ }
92
+ }
93
+ finally {
94
+ this.isSyncing = false;
95
+ const totalElapsed = Date.now() - syncStartTime;
96
+ console.log(`[SYNC-DEBUG] handleSyncIndex() finished at ${new Date().toISOString()}, total duration: ${totalElapsed}ms`);
97
+ }
98
+ }
99
+ startBackgroundSync() {
100
+ console.log("[SYNC-DEBUG] startBackgroundSync() called");
101
+ // Execute initial sync immediately after a short delay to let server initialize
102
+ console.log("[SYNC-DEBUG] Scheduling initial sync in 5 seconds...");
103
+ setTimeout(async () => {
104
+ console.log("[SYNC-DEBUG] Executing initial sync after server startup");
105
+ try {
106
+ await this.handleSyncIndex();
107
+ }
108
+ catch (error) {
109
+ const errorMessage = error instanceof Error ? error.message : String(error);
110
+ if (errorMessage.includes("Failed to query collection")) {
111
+ console.log("[SYNC-DEBUG] Collection not yet established, this is expected for new cluster users. Will retry on next sync cycle.");
112
+ }
113
+ else {
114
+ console.error("[SYNC-DEBUG] Initial sync failed with unexpected error:", error);
115
+ throw error;
116
+ }
117
+ }
118
+ }, 5000); // Initial sync after 5 seconds
119
+ // Periodically check for file changes and update the index
120
+ console.log("[SYNC-DEBUG] Setting up periodic sync every 5 minutes (300000ms)");
121
+ const syncInterval = setInterval(() => {
122
+ console.log("[SYNC-DEBUG] Executing scheduled periodic sync");
123
+ this.handleSyncIndex();
124
+ }, 5 * 60 * 1000); // every 5 minutes
125
+ console.log("[SYNC-DEBUG] Background sync setup complete. Interval ID:", syncInterval);
126
+ }
127
+ }
128
+ //# 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,yBAAyB,CAAC;AA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OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACzD,IAAI,YAAY,CAAC,QAAQ,CAAC,4BAA4B,CAAC,EAAE,CAAC;oBACxD,OAAO,CAAC,GAAG,CACT,qHAAqH,CACtH,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,KAAK,CACX,yDAAyD,EACzD,KAAK,CACN,CAAC;oBACF,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,+BAA+B;QAEzC,2DAA2D;QAC3D,OAAO,CAAC,GAAG,CACT,kEAAkE,CACnE,CAAC;QACF,MAAM,YAAY,GAAG,WAAW,CAC9B,GAAG,EAAE;YACH,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,EACD,CAAC,GAAG,EAAE,GAAG,IAAI,CACd,CAAC,CAAC,kBAAkB;QAErB,OAAO,CAAC,GAAG,CACT,2DAA2D,EAC3D,YAAY,CACb,CAAC;IACJ,CAAC;CACF"}
@@ -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,CAK5D"}