grepmax 0.9.2 → 0.9.3

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.
@@ -82,9 +82,10 @@ class ProjectBatchProcessor {
82
82
  return;
83
83
  try {
84
84
  yield this.vectorDb.createFTSIndex();
85
+ yield this.vectorDb.optimize();
85
86
  }
86
87
  catch (err) {
87
- console.error(`[${this.wtag}] FTS rebuild failed:`, err);
88
+ console.error(`[${this.wtag}] FTS rebuild / compaction failed:`, err);
88
89
  }
89
90
  }), FTS_REBUILD_INTERVAL_MS);
90
91
  this.ftsInterval.unref();
@@ -18,6 +18,7 @@ function getStoredSkeleton(db, filePath) {
18
18
  // LanceDB query
19
19
  const results = yield table
20
20
  .query()
21
+ .select(["file_skeleton"])
21
22
  .where(`path = '${(0, filter_builder_1.escapeSqlString)(filePath)}' AND is_anchor = true`)
22
23
  .limit(1)
23
24
  .toArray();
@@ -74,6 +74,7 @@ class MetaCache {
74
74
  this.db = (0, lmdb_1.open)({
75
75
  path: lmdbPath,
76
76
  compression: true,
77
+ cache: true,
77
78
  });
78
79
  this.unregisterCleanup = (0, cleanup_1.registerCleanup)(() => this.close());
79
80
  }
@@ -274,6 +274,22 @@ class VectorDB {
274
274
  }
275
275
  });
276
276
  }
277
+ optimize() {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ const table = yield this.ensureTable();
280
+ try {
281
+ yield table.optimize({
282
+ cleanupOlderThan: new Date(),
283
+ });
284
+ }
285
+ catch (e) {
286
+ const msg = e instanceof Error ? e.message : String(e);
287
+ if (!msg.includes("Nothing to do")) {
288
+ (0, logger_1.log)("vectordb", `Optimize failed: ${msg}`);
289
+ }
290
+ }
291
+ });
292
+ }
277
293
  hasAnyRows() {
278
294
  return __awaiter(this, void 0, void 0, function* () {
279
295
  const table = yield this.ensureTable();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "author": "Robert Owens <robowens@me.com>",
5
5
  "homepage": "https://github.com/reowens/grepmax",
6
6
  "bugs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Semantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.",
5
5
  "author": {
6
6
  "name": "Robert Owens",