grepmax 0.11.0 → 0.11.1

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.
@@ -239,6 +239,7 @@ const TOOLS = [
239
239
  ref: { type: "string", description: "Git ref to diff against (e.g. main, HEAD~5)" },
240
240
  query: { type: "string", description: "Semantic search within changed files" },
241
241
  limit: { type: "number", description: "Max results (default 10)" },
242
+ role: { type: "string", description: "Filter by role: ORCHESTRATION, DEFINITION, IMPLEMENTATION" },
242
243
  },
243
244
  },
244
245
  },
@@ -274,6 +275,7 @@ const TOOLS = [
274
275
  properties: {
275
276
  target: { type: "string", description: "Symbol name or file path" },
276
277
  limit: { type: "number", description: "Max results (default 5)" },
278
+ threshold: { type: "number", description: "Min similarity 0-1 (default 0)" },
277
279
  },
278
280
  required: ["target"],
279
281
  },
@@ -1577,6 +1579,7 @@ exports.mcp = new commander_1.Command("mcp")
1577
1579
  const ref = typeof args.ref === "string" ? args.ref : undefined;
1578
1580
  const query = typeof args.query === "string" ? args.query : undefined;
1579
1581
  const limit = Math.min(Math.max(Number(args.limit) || 10, 1), 50);
1582
+ const role = typeof args.role === "string" ? args.role.toUpperCase() : undefined;
1580
1583
  try {
1581
1584
  const changedFiles = getChangedFiles(ref, projectRoot);
1582
1585
  if (changedFiles.length === 0) {
@@ -1587,7 +1590,9 @@ exports.mcp = new commander_1.Command("mcp")
1587
1590
  const searcher = getSearcher();
1588
1591
  const response = yield searcher.search(query, limit, { rerank: true }, {}, projectRoot);
1589
1592
  const changedSet = new Set(changedFiles);
1590
- const filtered = response.data.filter((r) => changedSet.has(String(r.path || "")));
1593
+ let filtered = response.data.filter((r) => changedSet.has(String(r.path || "")));
1594
+ if (role)
1595
+ filtered = filtered.filter((r) => String(r.role || "").toUpperCase().startsWith(role));
1591
1596
  if (filtered.length === 0)
1592
1597
  return ok("No indexed results found in changed files for that query.");
1593
1598
  const lines = filtered.slice(0, limit).map((r) => {
@@ -1700,6 +1705,7 @@ exports.mcp = new commander_1.Command("mcp")
1700
1705
  if (!target)
1701
1706
  return err("Missing required parameter: target");
1702
1707
  const limit = Math.min(Math.max(Number(args.limit) || 5, 1), 25);
1708
+ const threshold = Number(args.threshold) || 0;
1703
1709
  try {
1704
1710
  const db = getVectorDb();
1705
1711
  const table = yield db.ensureTable();
@@ -1728,7 +1734,9 @@ exports.mcp = new commander_1.Command("mcp")
1728
1734
  .select(["path", "start_line", "defined_symbols", "role", "_distance"])
1729
1735
  .where(`path LIKE '${(0, filter_builder_1.escapeSqlString)(projectRoot)}/%'`)
1730
1736
  .limit(limit + 5).toArray();
1731
- const filtered = results.filter((r) => !(r.path === source.path && r.start_line === source.start_line));
1737
+ let filtered = results.filter((r) => !(r.path === source.path && r.start_line === source.start_line));
1738
+ if (threshold > 0)
1739
+ filtered = filtered.filter((r) => { var _a; return 1 / (1 + ((_a = r._distance) !== null && _a !== void 0 ? _a : 0)) >= threshold; });
1732
1740
  if (filtered.length === 0)
1733
1741
  return ok(`No similar code found for ${target}.`);
1734
1742
  const rel = (p) => p.startsWith(`${projectRoot}/`) ? p.slice(projectRoot.length + 1) : p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
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.11.0",
3
+ "version": "0.11.1",
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",