grepmax 0.26.44 → 0.26.46
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 -0
- package/dist/commands/mcp.js +647 -547
- package/dist/lib/output/mcp-results.js +177 -0
- package/package.json +13 -11
- package/plugins/grepmax/.claude-plugin/plugin.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCP_READ_OUTPUT_SCHEMAS = exports.compactionSchema = void 0;
|
|
4
|
+
exports.traceResult = traceResult;
|
|
5
|
+
exports.deadResult = deadResult;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const location = zod_1.z.object({
|
|
8
|
+
path: zod_1.z.string(),
|
|
9
|
+
line: zod_1.z.number().int().positive().describe("One-based source line"),
|
|
10
|
+
});
|
|
11
|
+
const graphNode = zod_1.z.object({
|
|
12
|
+
symbol: zod_1.z.string(),
|
|
13
|
+
location: location.nullable(),
|
|
14
|
+
role: zod_1.z.string(),
|
|
15
|
+
resolution: zod_1.z.enum(["indexed", "not_indexed", "ambiguous_member"]),
|
|
16
|
+
edgeKind: zod_1.z.enum(["free", "member", "type"]).optional(),
|
|
17
|
+
confidence: zod_1.z.enum(["EXTRACTED", "INFERRED"]).optional(),
|
|
18
|
+
});
|
|
19
|
+
const search = {
|
|
20
|
+
schemaVersion: zod_1.z.literal(1),
|
|
21
|
+
query: zod_1.z.string(),
|
|
22
|
+
roots: zod_1.z.array(zod_1.z.string()),
|
|
23
|
+
warnings: zod_1.z.array(zod_1.z.string()),
|
|
24
|
+
matches: zod_1.z
|
|
25
|
+
.array(zod_1.z.object({
|
|
26
|
+
path: zod_1.z.string(),
|
|
27
|
+
startLine: zod_1.z.number().int().positive(),
|
|
28
|
+
endLine: zod_1.z.number().int().positive(),
|
|
29
|
+
symbols: zod_1.z.array(zod_1.z.string()),
|
|
30
|
+
role: zod_1.z.string(),
|
|
31
|
+
score: zod_1.z
|
|
32
|
+
.number()
|
|
33
|
+
.nullable()
|
|
34
|
+
.describe("Search score; null when unavailable"),
|
|
35
|
+
}))
|
|
36
|
+
.max(50),
|
|
37
|
+
};
|
|
38
|
+
exports.compactionSchema = zod_1.z.object({
|
|
39
|
+
status: zod_1.z.enum(["completed", "skipped", "failed"]),
|
|
40
|
+
at: zod_1.z.number(),
|
|
41
|
+
attempts: zod_1.z.number(),
|
|
42
|
+
elapsedMs: zod_1.z.number(),
|
|
43
|
+
reason: zod_1.z.string().optional(),
|
|
44
|
+
logicalBytes: zod_1.z.number().optional(),
|
|
45
|
+
diskBytesBefore: zod_1.z.number().optional(),
|
|
46
|
+
diskBytesAfter: zod_1.z.number().optional(),
|
|
47
|
+
freeBytesBefore: zod_1.z.number().optional(),
|
|
48
|
+
freeBytesAfter: zod_1.z.number().optional(),
|
|
49
|
+
bytesReclaimed: zod_1.z.number().optional(),
|
|
50
|
+
});
|
|
51
|
+
const embedding = zod_1.z.object({
|
|
52
|
+
tier: zod_1.z.string(),
|
|
53
|
+
vectorDim: zod_1.z.number(),
|
|
54
|
+
fingerprint: zod_1.z.string(),
|
|
55
|
+
});
|
|
56
|
+
/** Only tools with a complete success contract advertise an output schema. */
|
|
57
|
+
exports.MCP_READ_OUTPUT_SCHEMAS = {
|
|
58
|
+
semantic_search: search,
|
|
59
|
+
trace_calls: {
|
|
60
|
+
schemaVersion: zod_1.z.literal(1),
|
|
61
|
+
symbol: zod_1.z.string(),
|
|
62
|
+
root: zod_1.z.string(),
|
|
63
|
+
found: zod_1.z.boolean(),
|
|
64
|
+
center: graphNode.nullable(),
|
|
65
|
+
callers: zod_1.z.array(zod_1.z.object({
|
|
66
|
+
node: graphNode,
|
|
67
|
+
depth: zod_1.z.number().int().positive(),
|
|
68
|
+
parentIndex: zod_1.z
|
|
69
|
+
.number()
|
|
70
|
+
.int()
|
|
71
|
+
.nonnegative()
|
|
72
|
+
.nullable()
|
|
73
|
+
.describe("Index of the parent in callers; null for a direct caller of center"),
|
|
74
|
+
})),
|
|
75
|
+
callees: zod_1.z.array(graphNode).max(15),
|
|
76
|
+
importers: zod_1.z.array(zod_1.z.string()).max(10),
|
|
77
|
+
omittedCallees: zod_1.z.number().int().nonnegative(),
|
|
78
|
+
omittedImporters: zod_1.z.number().int().nonnegative(),
|
|
79
|
+
approximate: zod_1.z.literal(true),
|
|
80
|
+
},
|
|
81
|
+
dead: {
|
|
82
|
+
schemaVersion: zod_1.z.literal(1),
|
|
83
|
+
symbol: zod_1.z.string(),
|
|
84
|
+
root: zod_1.z.string(),
|
|
85
|
+
status: zod_1.z.enum(["not_found", "public_export", "dead", "live"]),
|
|
86
|
+
definition: location.nullable(),
|
|
87
|
+
isExported: zod_1.z.boolean(),
|
|
88
|
+
callerCount: zod_1.z.number().int().nonnegative(),
|
|
89
|
+
callers: zod_1.z.array(location),
|
|
90
|
+
approximate: zod_1.z.literal(true),
|
|
91
|
+
},
|
|
92
|
+
index_status: {
|
|
93
|
+
schemaVersion: zod_1.z.literal(1),
|
|
94
|
+
root: zod_1.z.string(),
|
|
95
|
+
store: zod_1.z.string(),
|
|
96
|
+
secondary: zod_1.z.boolean(),
|
|
97
|
+
chunks: zod_1.z.number().int().nonnegative(),
|
|
98
|
+
files: zod_1.z.number().int().nonnegative(),
|
|
99
|
+
projects: zod_1.z.number().int().nonnegative(),
|
|
100
|
+
embedding: zod_1.z.object({
|
|
101
|
+
state: zod_1.z.string(),
|
|
102
|
+
configured: embedding,
|
|
103
|
+
built: embedding.nullable(),
|
|
104
|
+
}),
|
|
105
|
+
watcher: zod_1.z.object({
|
|
106
|
+
status: zod_1.z.string(),
|
|
107
|
+
indexState: zod_1.z
|
|
108
|
+
.object({
|
|
109
|
+
indexing: zod_1.z.boolean(),
|
|
110
|
+
pendingFiles: zod_1.z.number(),
|
|
111
|
+
verifying: zod_1.z.boolean().optional(),
|
|
112
|
+
failedFiles: zod_1.z.number().optional(),
|
|
113
|
+
degraded: zod_1.z.boolean().optional(),
|
|
114
|
+
watcherMode: zod_1.z.enum(["native", "polling", "recovering"]).optional(),
|
|
115
|
+
catchupRunning: zod_1.z.boolean().optional(),
|
|
116
|
+
lastReconciledAt: zod_1.z.number().optional(),
|
|
117
|
+
overflowCount: zod_1.z.number().optional(),
|
|
118
|
+
catchupMs: zod_1.z.number().optional(),
|
|
119
|
+
})
|
|
120
|
+
.nullable(),
|
|
121
|
+
}),
|
|
122
|
+
compaction: exports.compactionSchema.nullable(),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
function nodeResult(node) {
|
|
126
|
+
return Object.assign(Object.assign({ symbol: node.symbol, location: node.file ? { path: node.file, line: node.line + 1 } : null, role: node.role, resolution: node.file
|
|
127
|
+
? "indexed"
|
|
128
|
+
: node.resolution === "ambiguous-member"
|
|
129
|
+
? "ambiguous_member"
|
|
130
|
+
: "not_indexed" }, (node.edgeKind ? { edgeKind: node.edgeKind } : {})), (node.confidence ? { confidence: node.confidence } : {}));
|
|
131
|
+
}
|
|
132
|
+
function traceResult(symbol, root, graph) {
|
|
133
|
+
const callers = [];
|
|
134
|
+
function visit(trees, depth, parentIndex) {
|
|
135
|
+
for (const tree of trees) {
|
|
136
|
+
const index = callers.length;
|
|
137
|
+
callers.push({ node: nodeResult(tree.node), depth, parentIndex });
|
|
138
|
+
visit(tree.callers, depth + 1, index);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
visit(graph.callerTree, 1, null);
|
|
142
|
+
const importers = graph.importers.filter((p) => { var _a; return p !== ((_a = graph.center) === null || _a === void 0 ? void 0 : _a.file); });
|
|
143
|
+
return {
|
|
144
|
+
schemaVersion: 1,
|
|
145
|
+
symbol,
|
|
146
|
+
root,
|
|
147
|
+
found: graph.center !== null,
|
|
148
|
+
center: graph.center ? nodeResult(graph.center) : null,
|
|
149
|
+
callers,
|
|
150
|
+
callees: graph.callees.slice(0, 15).map(nodeResult),
|
|
151
|
+
importers: importers.slice(0, 10),
|
|
152
|
+
omittedCallees: Math.max(0, graph.callees.length - 15),
|
|
153
|
+
omittedImporters: Math.max(0, importers.length - 10),
|
|
154
|
+
approximate: true,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function deadResult(symbol, root, facts) {
|
|
158
|
+
return {
|
|
159
|
+
schemaVersion: 1,
|
|
160
|
+
symbol,
|
|
161
|
+
root,
|
|
162
|
+
status: !facts.found
|
|
163
|
+
? "not_found"
|
|
164
|
+
: facts.callerCount > 0
|
|
165
|
+
? "live"
|
|
166
|
+
: facts.isExported
|
|
167
|
+
? "public_export"
|
|
168
|
+
: "dead",
|
|
169
|
+
definition: facts.found
|
|
170
|
+
? { path: facts.defPath, line: facts.defLine + 1 }
|
|
171
|
+
: null,
|
|
172
|
+
isExported: facts.isExported,
|
|
173
|
+
callerCount: facts.callerCount,
|
|
174
|
+
callers: facts.topCallers.map((c) => ({ path: c.file, line: c.line + 1 })),
|
|
175
|
+
approximate: true,
|
|
176
|
+
};
|
|
177
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grepmax",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.46",
|
|
4
4
|
"author": "Robert Owens <78518764+reowens@users.noreply.github.com>",
|
|
5
5
|
"homepage": "https://github.com/reowens/grepmax",
|
|
6
6
|
"bugs": {
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@clack/prompts": "^1.8.1",
|
|
82
82
|
"@huggingface/transformers": "^4.3.0",
|
|
83
|
-
"@modelcontextprotocol/
|
|
83
|
+
"@modelcontextprotocol/server": "2.3.0",
|
|
84
|
+
"@opentelemetry/api": "^1.9.0",
|
|
84
85
|
"@parcel/watcher": "^2.6.0",
|
|
85
86
|
"apache-arrow": "^18.1.0",
|
|
86
87
|
"cli-highlight": "^2.1.11",
|
|
@@ -93,30 +94,31 @@
|
|
|
93
94
|
"openai": "^7.15.0",
|
|
94
95
|
"ora": "^9.4.1",
|
|
95
96
|
"proper-lockfile": "^4.1.2",
|
|
97
|
+
"reflect-metadata": "^0.2.2",
|
|
96
98
|
"uuid": "^14.0.2",
|
|
97
99
|
"web-tree-sitter": "^0.27.0",
|
|
98
|
-
"zod": "^4.6.5"
|
|
99
|
-
"@opentelemetry/api": "^1.9.0",
|
|
100
|
-
"reflect-metadata": "^0.2.2"
|
|
100
|
+
"zod": "^4.6.5"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@biomejs/biome": "2.5.13",
|
|
104
|
+
"@lancedb/lancedb": "0.38.0",
|
|
105
|
+
"@modelcontextprotocol/client": "2.3.0",
|
|
104
106
|
"@types/node": "^26.6.1",
|
|
105
107
|
"@types/proper-lockfile": "^4.1.4",
|
|
108
|
+
"mcp-sdk-v1-fixture": "npm:@modelcontextprotocol/sdk@1.30.0",
|
|
106
109
|
"node-gyp": "^13.0.2",
|
|
107
110
|
"tsx": "^4.23.13",
|
|
108
111
|
"typescript": "^7.0.2",
|
|
109
112
|
"vite": "^8.3.0",
|
|
110
|
-
"vitest": "^5.0.1"
|
|
111
|
-
"@lancedb/lancedb": "0.38.0"
|
|
113
|
+
"vitest": "^5.0.1"
|
|
112
114
|
},
|
|
113
115
|
"optionalDependencies": {
|
|
114
116
|
"@lancedb/lancedb-darwin-arm64": "0.38.0",
|
|
115
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.38.0",
|
|
116
117
|
"@lancedb/lancedb-linux-arm64-gnu": "0.38.0",
|
|
117
|
-
"@lancedb/lancedb-linux-x64-musl": "0.38.0",
|
|
118
118
|
"@lancedb/lancedb-linux-arm64-musl": "0.38.0",
|
|
119
|
-
"@lancedb/lancedb-
|
|
120
|
-
"@lancedb/lancedb-
|
|
119
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.38.0",
|
|
120
|
+
"@lancedb/lancedb-linux-x64-musl": "0.38.0",
|
|
121
|
+
"@lancedb/lancedb-win32-arm64-msvc": "0.38.0",
|
|
122
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.38.0"
|
|
121
123
|
}
|
|
122
124
|
}
|