grepmax 0.26.32 → 0.26.33

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.
Files changed (50) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/commands/context.js +12 -8
  3. package/dist/commands/doctor.js +7 -9
  4. package/dist/commands/droid.js +2 -1
  5. package/dist/commands/extract.js +8 -11
  6. package/dist/commands/impact.js +5 -8
  7. package/dist/commands/mcp.js +38 -41
  8. package/dist/commands/peek.js +6 -9
  9. package/dist/commands/search-output.js +10 -11
  10. package/dist/commands/search-run.js +5 -4
  11. package/dist/commands/search-skeletons.js +2 -1
  12. package/dist/commands/search.js +5 -4
  13. package/dist/commands/serve.js +2 -1
  14. package/dist/commands/similar.js +7 -6
  15. package/dist/commands/skeleton.js +17 -22
  16. package/dist/commands/test-find.js +5 -8
  17. package/dist/config.js +6 -5
  18. package/dist/eval-oss.js +4 -3
  19. package/dist/eval-tokens.js +4 -4
  20. package/dist/eval.js +2 -5
  21. package/dist/index.js +4 -3
  22. package/dist/lib/daemon/daemon.js +36 -29
  23. package/dist/lib/daemon/graph-handler.js +2 -1
  24. package/dist/lib/daemon/mlx-server-manager.js +10 -9
  25. package/dist/lib/daemon/rows-handler.js +11 -13
  26. package/dist/lib/daemon/search-handler.js +6 -5
  27. package/dist/lib/daemon/vector-handler.js +2 -1
  28. package/dist/lib/daemon/watcher-manager.js +4 -2
  29. package/dist/lib/graph/graph-builder.js +4 -10
  30. package/dist/lib/graph/graph-traversal.js +0 -0
  31. package/dist/lib/index/batch-processor.js +13 -12
  32. package/dist/lib/index/chunker.js +22 -23
  33. package/dist/lib/index/syncer.js +2 -2
  34. package/dist/lib/llm/investigate.js +5 -4
  35. package/dist/lib/llm/review.js +2 -1
  36. package/dist/lib/llm/tools.js +6 -5
  37. package/dist/lib/output/agent-search-formatter.js +3 -2
  38. package/dist/lib/output/compact-results.js +16 -12
  39. package/dist/lib/search/searcher.js +11 -13
  40. package/dist/lib/setup/model-loader.js +1 -1
  41. package/dist/lib/skeleton/body-fields.js +2 -1
  42. package/dist/lib/skeleton/skeletonizer.js +8 -7
  43. package/dist/lib/store/vector-db.js +6 -5
  44. package/dist/lib/utils/formatter.js +5 -4
  45. package/dist/lib/utils/stale-hint.js +4 -3
  46. package/dist/lib/utils/store-access.js +2 -1
  47. package/dist/lib/workers/embeddings/granite.js +2 -1
  48. package/dist/lib/workers/pool.js +14 -10
  49. package/package.json +2 -3
  50. package/plugins/grepmax/.claude-plugin/plugin.json +1 -1
@@ -87,7 +87,8 @@ function cleanSnippetLines(snippet) {
87
87
  * Supports compact (paths only), score display, and content truncation options.
88
88
  */
89
89
  function formatTextResults(results, query, root, options) {
90
- var _a, _b, _c;
90
+ var _a, _b;
91
+ var _c;
91
92
  if (results.length === 0)
92
93
  return `gmax: No results found for "${query}".`;
93
94
  // --- MODE: COMPACT (File paths only) ---
@@ -149,7 +150,7 @@ function formatTextResults(results, query, root, options) {
149
150
  // 1. Sort by score descending (best matches first)
150
151
  chunks.sort((a, b) => b.score - a.score);
151
152
  // 2. Apply per-file limit
152
- const limit = (_a = options.perFile) !== null && _a !== void 0 ? _a : 1000;
153
+ const limit = (_c = options.perFile) !== null && _c !== void 0 ? _c : 1000;
153
154
  const limitedChunks = chunks.slice(0, limit);
154
155
  // 3. Re-sort by line number for display
155
156
  limitedChunks.sort((a, b) => a.start_line - b.start_line);
@@ -162,7 +163,7 @@ function formatTextResults(results, query, root, options) {
162
163
  if (next.start_line <= current.end_line + 10) {
163
164
  current.content += `\n // ...\n${next.content}`;
164
165
  current.end_line = next.end_line;
165
- if ((_b = next.chunk_type) === null || _b === void 0 ? void 0 : _b.match(/function|class/))
166
+ if ((_a = next.chunk_type) === null || _a === void 0 ? void 0 : _a.match(/function|class/))
166
167
  current.chunk_type = next.chunk_type;
167
168
  }
168
169
  else {
@@ -181,7 +182,7 @@ function formatTextResults(results, query, root, options) {
181
182
  const relPath = path.relative(root, filePath);
182
183
  for (const item of merged) {
183
184
  const tags = [];
184
- if ((_c = item.chunk_type) === null || _c === void 0 ? void 0 : _c.match(/function|class/))
185
+ if ((_b = item.chunk_type) === null || _b === void 0 ? void 0 : _b.match(/function|class/))
185
186
  tags.push("Definition");
186
187
  const tagStr = tags.length > 0 ? ` ${style.blue(`[${tags.join(", ")}]`)}` : "";
187
188
  const line = Math.max(1, item.start_line + 1);
@@ -122,7 +122,8 @@ function maybeWarnStaleEmbedding(projectRoot, opts) {
122
122
  * silently returning invalid cross-project rankings.
123
123
  */
124
124
  function maybeWarnCrossProjectDim(roots, opts) {
125
- var _a, _b, _c, _d, _e, _f, _g;
125
+ var _a, _b;
126
+ var _c, _d, _e, _f, _g;
126
127
  if (crossDimEmitted)
127
128
  return;
128
129
  if (process.env.GMAX_NO_STALE_HINT === "1")
@@ -130,7 +131,7 @@ function maybeWarnCrossProjectDim(roots, opts) {
130
131
  if (!roots || roots.length === 0)
131
132
  return;
132
133
  const current = (0, index_config_1.readGlobalConfig)();
133
- const currentDim = (_d = (_a = current.vectorDim) !== null && _a !== void 0 ? _a : (_c = config_1.MODEL_TIERS[(_b = current.modelTier) !== null && _b !== void 0 ? _b : config_1.DEFAULT_MODEL_TIER]) === null || _c === void 0 ? void 0 : _c.vectorDim) !== null && _d !== void 0 ? _d : config_1.CONFIG.VECTOR_DIM;
134
+ const currentDim = (_e = (_c = current.vectorDim) !== null && _c !== void 0 ? _c : (_a = config_1.MODEL_TIERS[(_d = current.modelTier) !== null && _d !== void 0 ? _d : config_1.DEFAULT_MODEL_TIER]) === null || _a === void 0 ? void 0 : _a.vectorDim) !== null && _e !== void 0 ? _e : config_1.CONFIG.VECTOR_DIM;
134
135
  const byRoot = new Map((0, project_registry_1.listProjects)().map((p) => [p.root, p]));
135
136
  const dims = new Set([currentDim]);
136
137
  const mismatched = [];
@@ -138,7 +139,7 @@ function maybeWarnCrossProjectDim(roots, opts) {
138
139
  const p = byRoot.get(r.root);
139
140
  if (!p)
140
141
  continue;
141
- const dim = (_g = (_e = p.vectorDim) !== null && _e !== void 0 ? _e : (_f = config_1.MODEL_TIERS[p.modelTier]) === null || _f === void 0 ? void 0 : _f.vectorDim) !== null && _g !== void 0 ? _g : currentDim;
142
+ const dim = (_g = (_f = p.vectorDim) !== null && _f !== void 0 ? _f : (_b = config_1.MODEL_TIERS[p.modelTier]) === null || _b === void 0 ? void 0 : _b.vectorDim) !== null && _g !== void 0 ? _g : currentDim;
142
143
  dims.add(dim);
143
144
  if (dim !== currentDim)
144
145
  mismatched.push({ name: p.name || r.name, dim });
@@ -272,7 +272,8 @@ function isDaemonBypassed() {
272
272
  */
273
273
  function withStoreRead(name, opts) {
274
274
  return __awaiter(this, void 0, void 0, function* () {
275
- var _a, _b;
275
+ var _a;
276
+ var _b;
276
277
  const runInProcess = () => __awaiter(this, void 0, void 0, function* () {
277
278
  try {
278
279
  return yield opts.inProcess();
@@ -147,7 +147,8 @@ class GraniteModel {
147
147
  }
148
148
  runBatch(texts) {
149
149
  return __awaiter(this, void 0, void 0, function* () {
150
- var _a, _b, _c;
150
+ var _a;
151
+ var _b, _c;
151
152
  // Lazy-load: in the normal path MLX/GPU handles dense embedding and this
152
153
  // ONNX model is never used, so we avoid paying its resident cost in every
153
154
  // worker. load() is idempotent and only runs on the first fallback batch.
@@ -327,7 +327,8 @@ class WorkerPool {
327
327
  }
328
328
  }
329
329
  handleWorkerExit(worker, code, signal, reason = "exit", err) {
330
- var _a, _b, _c, _d;
330
+ var _a, _b;
331
+ var _c, _d;
331
332
  // Crash paths can fire both 'error' and 'exit'. Either is sufficient
332
333
  // to clean up; running this twice would double-respawn.
333
334
  if (worker.cleanedUp)
@@ -337,7 +338,7 @@ class WorkerPool {
337
338
  const failedTasks = Array.from(this.tasks.values()).filter((t) => t.worker === worker);
338
339
  for (const task of failedTasks) {
339
340
  this.clearTaskTimeout(task);
340
- const filePath = (_d = (_b = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : (_c = task.payload) === null || _c === void 0 ? void 0 : _c.absolutePath) !== null && _d !== void 0 ? _d : "unknown";
341
+ const filePath = (_d = (_c = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _c !== void 0 ? _c : (_b = task.payload) === null || _b === void 0 ? void 0 : _b.absolutePath) !== null && _d !== void 0 ? _d : "unknown";
341
342
  (0, logger_1.debug)("pool", `${reason} killed task=${task.id} method=${task.method} file=${filePath}`);
342
343
  const exitDetail = err
343
344
  ? `: ${err.message}`
@@ -360,7 +361,8 @@ class WorkerPool {
360
361
  const worker = new ProcessWorker(this.modulePath, this.execArgv, this.embeddingEnvironment, config_1.MAX_WORKER_MEMORY_MB);
361
362
  (0, logger_1.log)("pool", `spawn PID:${worker.child.pid} (${this.workers.length + 1}/${Math.max(1, config_1.CONFIG.WORKER_THREADS)})`);
362
363
  const onMessage = (msg) => {
363
- var _a, _b, _c, _d, _e, _f, _g, _h;
364
+ var _a, _b, _c, _d;
365
+ var _e, _f, _g, _h;
364
366
  if (typeof msg.rss === "number")
365
367
  worker.lastRssBytes = msg.rss;
366
368
  const task = this.tasks.get(msg.id);
@@ -380,7 +382,7 @@ class WorkerPool {
380
382
  return;
381
383
  }
382
384
  if ("error" in msg) {
383
- const filePath = (_d = (_b = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : (_c = task.payload) === null || _c === void 0 ? void 0 : _c.absolutePath) !== null && _d !== void 0 ? _d : "unknown";
385
+ const filePath = (_f = (_e = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _e !== void 0 ? _e : (_b = task.payload) === null || _b === void 0 ? void 0 : _b.absolutePath) !== null && _f !== void 0 ? _f : "unknown";
384
386
  (0, logger_1.debug)("pool", `error task=${task.id} method=${task.method} file=${filePath}: ${msg.error}`);
385
387
  task.reject(new Error(msg.error));
386
388
  }
@@ -388,7 +390,7 @@ class WorkerPool {
388
390
  const elapsed = task.startTime
389
391
  ? `${Date.now() - task.startTime}ms`
390
392
  : "?ms";
391
- const filePath = (_h = (_f = (_e = task.payload) === null || _e === void 0 ? void 0 : _e.path) !== null && _f !== void 0 ? _f : (_g = task.payload) === null || _g === void 0 ? void 0 : _g.absolutePath) !== null && _h !== void 0 ? _h : "";
393
+ const filePath = (_h = (_g = (_c = task.payload) === null || _c === void 0 ? void 0 : _c.path) !== null && _g !== void 0 ? _g : (_d = task.payload) === null || _d === void 0 ? void 0 : _d.absolutePath) !== null && _h !== void 0 ? _h : "";
392
394
  (0, logger_1.debug)("pool", `complete task=${task.id} method=${task.method} ${elapsed}${filePath ? ` file=${filePath}` : ""}`);
393
395
  task.resolve(msg.result);
394
396
  }
@@ -471,12 +473,13 @@ class WorkerPool {
471
473
  });
472
474
  }
473
475
  handleTaskTimeout(task, worker, reason = "no progress") {
474
- var _a, _b, _c, _d;
476
+ var _a, _b;
477
+ var _c, _d;
475
478
  if (this.destroyed || !this.tasks.has(task.id))
476
479
  return;
477
480
  this.clearTaskTimeout(task);
478
481
  const limitMs = reason === "hard deadline" ? HARD_DEADLINE_MS : TASK_TIMEOUT_MS;
479
- const filePath = (_d = (_b = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : (_c = task.payload) === null || _c === void 0 ? void 0 : _c.absolutePath) !== null && _d !== void 0 ? _d : "unknown";
482
+ const filePath = (_d = (_c = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _c !== void 0 ? _c : (_b = task.payload) === null || _b === void 0 ? void 0 : _b.absolutePath) !== null && _d !== void 0 ? _d : "unknown";
480
483
  (0, logger_1.log)("pool", `timeout task=${task.id} method=${task.method} file=${filePath} (${reason}, ${limitMs}ms) — killing worker PID:${worker.child.pid}`);
481
484
  this.completeTask(task, null);
482
485
  task.reject(new Error(`Worker task ${task.method} exceeded ${reason} limit (${limitMs}ms) on ${filePath}`));
@@ -495,7 +498,8 @@ class WorkerPool {
495
498
  this.dispatch();
496
499
  }
497
500
  dispatch() {
498
- var _a, _b, _c, _d, _e;
501
+ var _a, _b;
502
+ var _c, _d, _e;
499
503
  if (this.destroyed)
500
504
  return;
501
505
  let idle = this.workers.find((w) => !w.busy);
@@ -505,7 +509,7 @@ class WorkerPool {
505
509
  const t = this.tasks.get(id);
506
510
  return t && !t.worker;
507
511
  });
508
- const nextTaskId = (_a = findUnassigned(this.priorityQueue)) !== null && _a !== void 0 ? _a : findUnassigned(this.taskQueue);
512
+ const nextTaskId = (_c = findUnassigned(this.priorityQueue)) !== null && _c !== void 0 ? _c : findUnassigned(this.taskQueue);
509
513
  if (nextTaskId === undefined) {
510
514
  this.clearScaleUpTimer();
511
515
  return;
@@ -544,7 +548,7 @@ class WorkerPool {
544
548
  // Absolute deadline: never cleared/re-armed by heartbeats, so a task that
545
549
  // keeps emitting progress but never completes is still bounded.
546
550
  task.hardTimeout = setTimeout(() => this.handleTaskTimeout(task, idle, "hard deadline"), HARD_DEADLINE_MS);
547
- const filePath = (_e = (_c = (_b = task.payload) === null || _b === void 0 ? void 0 : _b.path) !== null && _c !== void 0 ? _c : (_d = task.payload) === null || _d === void 0 ? void 0 : _d.absolutePath) !== null && _e !== void 0 ? _e : "";
551
+ const filePath = (_e = (_d = (_a = task.payload) === null || _a === void 0 ? void 0 : _a.path) !== null && _d !== void 0 ? _d : (_b = task.payload) === null || _b === void 0 ? void 0 : _b.absolutePath) !== null && _e !== void 0 ? _e : "";
548
552
  const busyCount = this.workers.filter((w) => w.busy).length;
549
553
  (0, logger_1.debug)("pool", `dispatch task=${task.id} method=${task.method}${filePath ? ` file=${filePath}` : ""} → PID:${idle.child.pid} (busy=${busyCount}/${this.workers.length} queue=${this.taskQueue.length}+${this.priorityQueue.length}p)`);
550
554
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.26.32",
3
+ "version": "0.26.33",
4
4
  "author": "Robert Owens <78518764+reowens@users.noreply.github.com>",
5
5
  "homepage": "https://github.com/reowens/grepmax",
6
6
  "bugs": {
@@ -103,9 +103,8 @@
103
103
  "@types/node": "^26.6.1",
104
104
  "@types/proper-lockfile": "^4.1.4",
105
105
  "node-gyp": "^13.0.2",
106
- "ts-node": "^10.9.2",
107
106
  "tsx": "^4.23.13",
108
- "typescript": "^6.0.3",
107
+ "typescript": "^7.0.2",
109
108
  "vite": "^8.3.0",
110
109
  "vitest": "^5.0.1"
111
110
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.26.32",
3
+ "version": "0.26.33",
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",