grepmax 0.26.30 → 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.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +4 -2
- package/dist/commands/context.js +12 -8
- package/dist/commands/doctor.js +7 -9
- package/dist/commands/droid.js +2 -1
- package/dist/commands/extract.js +8 -11
- package/dist/commands/impact.js +5 -8
- package/dist/commands/mcp.js +38 -41
- package/dist/commands/peek.js +6 -9
- package/dist/commands/search-output.js +10 -11
- package/dist/commands/search-run.js +5 -4
- package/dist/commands/search-skeletons.js +2 -1
- package/dist/commands/search.js +5 -4
- package/dist/commands/serve.js +2 -1
- package/dist/commands/similar.js +7 -6
- package/dist/commands/skeleton.js +17 -22
- package/dist/commands/test-find.js +5 -8
- package/dist/config.js +6 -5
- package/dist/eval-oss.js +4 -3
- package/dist/eval-tokens.js +4 -4
- package/dist/eval.js +2 -5
- package/dist/index.js +4 -3
- package/dist/lib/daemon/daemon.js +36 -29
- package/dist/lib/daemon/graph-handler.js +2 -1
- package/dist/lib/daemon/mlx-server-manager.js +10 -9
- package/dist/lib/daemon/rows-handler.js +11 -13
- package/dist/lib/daemon/search-handler.js +6 -5
- package/dist/lib/daemon/vector-handler.js +2 -1
- package/dist/lib/daemon/watcher-manager.js +4 -2
- package/dist/lib/graph/graph-builder.js +4 -10
- package/dist/lib/graph/graph-traversal.js +0 -0
- package/dist/lib/index/batch-processor.js +13 -12
- package/dist/lib/index/chunker.js +22 -23
- package/dist/lib/index/syncer.js +2 -2
- package/dist/lib/llm/investigate.js +5 -4
- package/dist/lib/llm/review.js +2 -1
- package/dist/lib/llm/tools.js +6 -5
- package/dist/lib/output/agent-search-formatter.js +3 -2
- package/dist/lib/output/compact-results.js +16 -12
- package/dist/lib/search/searcher.js +11 -13
- package/dist/lib/setup/model-loader.js +1 -1
- package/dist/lib/skeleton/body-fields.js +2 -1
- package/dist/lib/skeleton/skeletonizer.js +8 -7
- package/dist/lib/store/vector-db.js +6 -5
- package/dist/lib/utils/formatter.js +5 -4
- package/dist/lib/utils/stale-hint.js +4 -3
- package/dist/lib/utils/store-access.js +2 -1
- package/dist/lib/workers/embeddings/granite.js +2 -1
- package/dist/lib/workers/pool.js +14 -10
- package/package.json +13 -15
- 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
|
|
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 = (
|
|
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 ((
|
|
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 ((
|
|
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
|
|
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 = (
|
|
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 = (
|
|
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
|
|
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
|
|
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.
|
package/dist/lib/workers/pool.js
CHANGED
|
@@ -327,7 +327,8 @@ class WorkerPool {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
handleWorkerExit(worker, code, signal, reason = "exit", err) {
|
|
330
|
-
var _a, _b
|
|
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 = (
|
|
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
|
|
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 = (
|
|
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 = (
|
|
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
|
|
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 = (
|
|
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
|
|
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 = (
|
|
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 = (
|
|
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.
|
|
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": {
|
|
@@ -77,37 +77,35 @@
|
|
|
77
77
|
"license": "Apache-2.0",
|
|
78
78
|
"description": "Semantic code search for coding agents. Local embeddings, LLM summaries, call graph tracing.",
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@clack/prompts": "^1.
|
|
81
|
-
"@huggingface/transformers": "^4.
|
|
80
|
+
"@clack/prompts": "^1.8.1",
|
|
81
|
+
"@huggingface/transformers": "^4.3.0",
|
|
82
82
|
"@lancedb/lancedb": "0.38.0",
|
|
83
83
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
84
84
|
"@parcel/watcher": "^2.6.0",
|
|
85
85
|
"apache-arrow": "^18.1.0",
|
|
86
|
-
"chalk": "^5.6.2",
|
|
87
86
|
"cli-highlight": "^2.1.11",
|
|
88
87
|
"commander": "^15.0.0",
|
|
89
88
|
"dotenv": "^17.4.2",
|
|
90
89
|
"fast-glob": "^3.3.3",
|
|
91
|
-
"ignore": "^7.0.
|
|
90
|
+
"ignore": "^7.0.9",
|
|
92
91
|
"lmdb": "^3.5.6",
|
|
93
92
|
"numkong": "^7.8.2",
|
|
94
|
-
"onnxruntime-node": "1.
|
|
95
|
-
"openai": "^
|
|
93
|
+
"onnxruntime-node": "1.30.0",
|
|
94
|
+
"openai": "^7.15.0",
|
|
96
95
|
"ora": "^9.4.1",
|
|
97
96
|
"proper-lockfile": "^4.1.2",
|
|
98
97
|
"uuid": "^14.0.2",
|
|
99
|
-
"web-tree-sitter": "^0.
|
|
100
|
-
"zod": "^4.5
|
|
98
|
+
"web-tree-sitter": "^0.27.0",
|
|
99
|
+
"zod": "^4.6.5"
|
|
101
100
|
},
|
|
102
101
|
"devDependencies": {
|
|
103
|
-
"@biomejs/biome": "2.5.
|
|
104
|
-
"@types/node": "^26.
|
|
102
|
+
"@biomejs/biome": "2.5.13",
|
|
103
|
+
"@types/node": "^26.6.1",
|
|
105
104
|
"@types/proper-lockfile": "^4.1.4",
|
|
106
105
|
"node-gyp": "^13.0.2",
|
|
107
|
-
"ts-node": "^10.9.2",
|
|
108
106
|
"tsx": "^4.23.13",
|
|
109
|
-
"typescript": "^
|
|
110
|
-
"vite": "^8.
|
|
111
|
-
"vitest": "^
|
|
107
|
+
"typescript": "^7.0.2",
|
|
108
|
+
"vite": "^8.3.0",
|
|
109
|
+
"vitest": "^5.0.1"
|
|
112
110
|
}
|
|
113
111
|
}
|