cf-memory-mcp 3.8.4 ā 3.8.5
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/bin/cf-memory-mcp-indexer.js +24 -32
- package/package.json +1 -1
|
@@ -302,49 +302,41 @@ class IncrementalIndexer {
|
|
|
302
302
|
// Initial index
|
|
303
303
|
await this.index();
|
|
304
304
|
|
|
305
|
-
//
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
console.log('\nš Changes detected, re-indexing...');
|
|
320
|
-
await this.index();
|
|
321
|
-
console.log('');
|
|
322
|
-
}, 1000);
|
|
305
|
+
// Use Node's built-in fs.watch (no external deps needed)
|
|
306
|
+
const fs = require('fs');
|
|
307
|
+
const watchDir = (dir) => {
|
|
308
|
+
let watcher;
|
|
309
|
+
try {
|
|
310
|
+
watcher = fs.watch(dir, { recursive: true }, (eventType, filename) => {
|
|
311
|
+
if (filename) {
|
|
312
|
+
this.handleFileChange(dir, filename);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
} catch (err) {
|
|
316
|
+
// Ignore errors for now
|
|
317
|
+
}
|
|
318
|
+
return watcher;
|
|
323
319
|
};
|
|
324
320
|
|
|
325
|
-
watcher
|
|
326
|
-
.on('add', path => handleChange())
|
|
327
|
-
.on('change', path => handleChange())
|
|
328
|
-
.on('unlink', path => handleChange());
|
|
321
|
+
const watcher = watchDir(this.projectPath);
|
|
329
322
|
|
|
330
323
|
// Keep process alive
|
|
331
324
|
process.on('SIGINT', () => {
|
|
332
325
|
console.log('\nš Stopping watcher...');
|
|
333
|
-
watcher.close();
|
|
326
|
+
if (watcher) watcher.close();
|
|
334
327
|
process.exit(0);
|
|
335
328
|
});
|
|
336
329
|
}
|
|
337
330
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
console.log(
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return require('chokidar');
|
|
346
|
-
}
|
|
331
|
+
handleFileChange(baseDir, filename) {
|
|
332
|
+
// Debounce rapid changes
|
|
333
|
+
if (this._debounceTimer) clearTimeout(this._debounceTimer);
|
|
334
|
+
this._debounceTimer = setTimeout(async () => {
|
|
335
|
+
console.log(`\nš File changed: ${filename}`);
|
|
336
|
+
await this.index();
|
|
337
|
+
}, 1000);
|
|
347
338
|
}
|
|
339
|
+
|
|
348
340
|
}
|
|
349
341
|
|
|
350
342
|
// CLI
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5",
|
|
4
4
|
"description": "Best-in-class MCP server with CONTEXTUAL CHUNKING (Anthropic-style, 35-67% better retrieval), Optimized LLM stack (Llama-3.1-8B), BGE-M3 embeddings, Query Expansion Caching, Hybrid Embedding Strategy, and Unified Project Intelligence",
|
|
5
5
|
"main": "bin/cf-memory-mcp.js",
|
|
6
6
|
"bin": {
|