grepmax 0.12.6 → 0.12.8
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/lib/index/batch-processor.js +11 -6
- package/dist/lib/index/walker.js +6 -1
- package/dist/lib/index/watcher.js +2 -0
- package/dist/lib/store/vector-db.js +21 -2
- package/mlx-embed-server/summarizer.py +1 -0
- package/package.json +1 -1
- package/plugins/grepmax/.claude-plugin/plugin.json +1 -1
- package/plugins/grepmax/hooks/start.js +2 -2
|
@@ -80,12 +80,19 @@ class ProjectBatchProcessor {
|
|
|
80
80
|
this.ftsInterval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
81
81
|
if (this.closed || this.processing)
|
|
82
82
|
return;
|
|
83
|
+
this.processing = true;
|
|
83
84
|
try {
|
|
84
85
|
yield this.vectorDb.runMaintenance();
|
|
85
86
|
}
|
|
86
87
|
catch (err) {
|
|
87
88
|
console.error(`[${this.wtag}] Maintenance failed:`, err);
|
|
88
89
|
}
|
|
90
|
+
finally {
|
|
91
|
+
this.processing = false;
|
|
92
|
+
// Process any events that queued during maintenance
|
|
93
|
+
if (this.pending.size > 0)
|
|
94
|
+
this.scheduleBatch();
|
|
95
|
+
}
|
|
89
96
|
}), FTS_REBUILD_INTERVAL_MS);
|
|
90
97
|
this.ftsInterval.unref();
|
|
91
98
|
}
|
|
@@ -93,12 +100,10 @@ class ProjectBatchProcessor {
|
|
|
93
100
|
var _a;
|
|
94
101
|
if (this.closed)
|
|
95
102
|
return;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
103
|
+
const ext = path.extname(absPath).toLowerCase();
|
|
104
|
+
const bn = path.basename(absPath).toLowerCase();
|
|
105
|
+
if (!config_1.INDEXABLE_EXTENSIONS.has(ext) && !config_1.INDEXABLE_EXTENSIONS.has(bn))
|
|
106
|
+
return;
|
|
102
107
|
this.pending.set(absPath, event);
|
|
103
108
|
(_a = this.onActivity) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
104
109
|
this.scheduleBatch();
|
package/dist/lib/index/walker.js
CHANGED
|
@@ -132,10 +132,15 @@ function _walk(currentDir, rootDir, stack, ignoreFiles) {
|
|
|
132
132
|
const absPath = path.join(currentDir, entry.name);
|
|
133
133
|
const relPathToRoot = path.relative(rootDir, absPath);
|
|
134
134
|
// 1. Check if ignored by any scope in the stack
|
|
135
|
+
const isDir = entry.isDirectory();
|
|
135
136
|
let isIgnored = false;
|
|
136
137
|
for (const scope of stack) {
|
|
137
138
|
const relToScope = path.relative(scope.dir, absPath);
|
|
138
|
-
if (relToScope
|
|
139
|
+
if (!relToScope)
|
|
140
|
+
continue;
|
|
141
|
+
// Append trailing slash for directories so patterns like "dist/" match
|
|
142
|
+
const testPath = isDir ? `${relToScope}/` : relToScope;
|
|
143
|
+
if (scope.filter.ignores(testPath)) {
|
|
139
144
|
isIgnored = true;
|
|
140
145
|
break;
|
|
141
146
|
}
|
|
@@ -62,6 +62,8 @@ exports.WATCHER_IGNORE_GLOBS = [
|
|
|
62
62
|
".next",
|
|
63
63
|
"lancedb",
|
|
64
64
|
".*", // dotfiles
|
|
65
|
+
"**/*.tmp.*", // editor atomic save artifacts
|
|
66
|
+
"**/*.sb-*", // Xcode swap files
|
|
65
67
|
];
|
|
66
68
|
function startWatcher(opts) {
|
|
67
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -405,7 +405,17 @@ class VectorDB {
|
|
|
405
405
|
for (let i = 0; i < unique.length; i += batchSize) {
|
|
406
406
|
const slice = unique.slice(i, i + batchSize);
|
|
407
407
|
const values = slice.map((p) => `'${(0, filter_builder_1.escapeSqlString)(p)}'`).join(",");
|
|
408
|
-
|
|
408
|
+
const where = `path IN (${values})`;
|
|
409
|
+
// Skip no-op deletes to avoid creating empty LanceDB versions
|
|
410
|
+
const existing = yield table
|
|
411
|
+
.query()
|
|
412
|
+
.select(["id"])
|
|
413
|
+
.where(where)
|
|
414
|
+
.limit(1)
|
|
415
|
+
.toArray();
|
|
416
|
+
if (existing.length > 0) {
|
|
417
|
+
yield table.delete(where);
|
|
418
|
+
}
|
|
409
419
|
}
|
|
410
420
|
});
|
|
411
421
|
}
|
|
@@ -439,7 +449,16 @@ class VectorDB {
|
|
|
439
449
|
const values = slice
|
|
440
450
|
.map((p) => `'${(0, filter_builder_1.escapeSqlString)(p)}'`)
|
|
441
451
|
.join(",");
|
|
442
|
-
|
|
452
|
+
const where = `path IN (${values})${idExclusion}`;
|
|
453
|
+
const existing = yield table
|
|
454
|
+
.query()
|
|
455
|
+
.select(["id"])
|
|
456
|
+
.where(where)
|
|
457
|
+
.limit(1)
|
|
458
|
+
.toArray();
|
|
459
|
+
if (existing.length > 0) {
|
|
460
|
+
yield table.delete(where);
|
|
461
|
+
}
|
|
443
462
|
}
|
|
444
463
|
});
|
|
445
464
|
}
|
|
@@ -148,6 +148,7 @@ async def summarize(request: SummarizeRequest) -> SummarizeResponse:
|
|
|
148
148
|
summaries.append(summary)
|
|
149
149
|
except Exception as e:
|
|
150
150
|
summaries.append(f"(summary failed: {e})")
|
|
151
|
+
mx.metal.clear_cache()
|
|
151
152
|
|
|
152
153
|
return SummarizeResponse(summaries=summaries)
|
|
153
154
|
|
package/package.json
CHANGED
|
@@ -108,8 +108,8 @@ async function main() {
|
|
|
108
108
|
startPythonServer(serverDir, "server.py", "mlx-embed-server");
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
// Start LLM summarizer server (port 8101)
|
|
112
|
-
if (serverDir && !(await isServerRunning(8101))) {
|
|
111
|
+
// Start LLM summarizer server (port 8101) — opt-in only
|
|
112
|
+
if (process.env.GMAX_SUMMARIZER === "1" && serverDir && !(await isServerRunning(8101))) {
|
|
113
113
|
startPythonServer(serverDir, "summarizer.py", "mlx-summarizer");
|
|
114
114
|
}
|
|
115
115
|
}
|