grepmax 0.7.18 → 0.7.19
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/commands/mcp.js
CHANGED
|
@@ -140,6 +140,10 @@ const TOOLS = [
|
|
|
140
140
|
type: "boolean",
|
|
141
141
|
description: "Prepend the file's import/require statements to each result. Deduped per file.",
|
|
142
142
|
},
|
|
143
|
+
name_pattern: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Regex to filter by symbol name (e.g. 'handle.*Auth'). Case-insensitive. Applied after search.",
|
|
146
|
+
},
|
|
143
147
|
},
|
|
144
148
|
required: ["query"],
|
|
145
149
|
},
|
|
@@ -202,6 +206,10 @@ const TOOLS = [
|
|
|
202
206
|
type: "boolean",
|
|
203
207
|
description: "Prepend file's import statements to each result.",
|
|
204
208
|
},
|
|
209
|
+
name_pattern: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Regex to filter by symbol name (e.g. 'handle.*Auth').",
|
|
212
|
+
},
|
|
205
213
|
},
|
|
206
214
|
required: ["query"],
|
|
207
215
|
},
|
|
@@ -724,6 +732,7 @@ exports.mcp = new commander_1.Command("mcp")
|
|
|
724
732
|
absPath,
|
|
725
733
|
text,
|
|
726
734
|
score: typeof r.score === "number" ? r.score : 0,
|
|
735
|
+
symbols: defs,
|
|
727
736
|
};
|
|
728
737
|
});
|
|
729
738
|
if (minScore > 0) {
|
|
@@ -739,6 +748,18 @@ exports.mcp = new commander_1.Command("mcp")
|
|
|
739
748
|
return true;
|
|
740
749
|
});
|
|
741
750
|
}
|
|
751
|
+
const namePattern = typeof args.name_pattern === "string"
|
|
752
|
+
? args.name_pattern
|
|
753
|
+
: "";
|
|
754
|
+
if (namePattern) {
|
|
755
|
+
try {
|
|
756
|
+
const regex = new RegExp(namePattern, "i");
|
|
757
|
+
results = results.filter((r) => r.symbols.some((s) => regex.test(s)));
|
|
758
|
+
}
|
|
759
|
+
catch (_b) {
|
|
760
|
+
// Invalid regex — skip filter
|
|
761
|
+
}
|
|
762
|
+
}
|
|
742
763
|
let output = results.map((r) => r.text).join("\n\n");
|
|
743
764
|
// Symbol mode: append call graph
|
|
744
765
|
const mode = typeof args.mode === "string" ? args.mode : "default";
|
|
@@ -779,7 +800,7 @@ exports.mcp = new commander_1.Command("mcp")
|
|
|
779
800
|
output += `\n${traceLines.join("\n")}`;
|
|
780
801
|
}
|
|
781
802
|
}
|
|
782
|
-
catch (
|
|
803
|
+
catch (_c) {
|
|
783
804
|
// Trace failed — return search results without trace
|
|
784
805
|
}
|
|
785
806
|
}
|
package/package.json
CHANGED
|
@@ -49,6 +49,7 @@ Parameters:
|
|
|
49
49
|
- `role` (optional): Filter by chunk role: "ORCHESTRATION" (logic/flow), "DEFINITION" (types), or "IMPLEMENTATION"
|
|
50
50
|
- `mode` (optional): `"default"` (semantic only) or `"symbol"` (semantic + call graph appended). Use "symbol" when query is a function or class name — gets search results + callers/callees in one call.
|
|
51
51
|
- `include_imports` (optional): Prepend file's import/require statements to each result. Deduped per file — see dependencies at a glance.
|
|
52
|
+
- `name_pattern` (optional): Regex to filter by symbol name (e.g. "handle.*Auth"). Case-insensitive. Applied after search.
|
|
52
53
|
|
|
53
54
|
**When to use which mode:**
|
|
54
55
|
- `pointer` — navigation, finding locations, understanding architecture
|
|
@@ -108,11 +109,13 @@ Generate LLM summaries for indexed code in a directory. Summaries are stored and
|
|
|
108
109
|
|
|
109
110
|
## Workflow
|
|
110
111
|
|
|
111
|
-
1. **
|
|
112
|
-
2. **
|
|
113
|
-
3. **
|
|
114
|
-
4. **
|
|
115
|
-
5. **
|
|
112
|
+
1. **Explore** — `summarize_project` for high-level overview of a new codebase
|
|
113
|
+
2. **Search** — `semantic_search` to find relevant code (pointers by default). Use `mode: "symbol"` for function/class names.
|
|
114
|
+
3. **Read** — `Read file:line` for the specific ranges you need
|
|
115
|
+
4. **Skeleton** — `code_skeleton` before reading large files or directories
|
|
116
|
+
5. **Trace** — `trace_calls` to understand call flow, imports, and callers (use `depth: 2` for full chains)
|
|
117
|
+
6. **Context** — `related_files` to see what else you need to look at when editing
|
|
118
|
+
7. **Changes** — `recent_changes` after pulls to see what's been modified
|
|
116
119
|
|
|
117
120
|
## If results seem stale
|
|
118
121
|
|