grepmax 0.7.36 → 0.7.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.36",
3
+ "version": "0.7.37",
4
4
  "author": "Robert Owens <robowens@me.com>",
5
5
  "homepage": "https://github.com/reowens/grepmax",
6
6
  "bugs": {
@@ -23,6 +23,7 @@
23
23
  "files": [
24
24
  "dist",
25
25
  "plugins",
26
+ "scripts/postinstall.js",
26
27
  "mlx-embed-server",
27
28
  "README.md",
28
29
  "LICENSE",
@@ -62,6 +63,7 @@
62
63
  "vitest": "^1.6.1"
63
64
  },
64
65
  "scripts": {
66
+ "postinstall": "node scripts/postinstall.js",
65
67
  "prebuild": "mkdir -p dist",
66
68
  "build": "tsc",
67
69
  "postbuild": "chmod +x dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.36",
3
+ "version": "0.7.37",
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",
@@ -4,12 +4,13 @@ description: Semantic code search. Use alongside grep - grep for exact strings,
4
4
  allowed-tools: "mcp__grepmax__semantic_search, mcp__grepmax__code_skeleton, mcp__grepmax__trace_calls, mcp__grepmax__list_symbols, mcp__grepmax__index_status, mcp__grepmax__summarize_directory, mcp__grepmax__summarize_project, mcp__grepmax__related_files, mcp__grepmax__recent_changes, Bash(gmax:*), Read"
5
5
  ---
6
6
 
7
- ## What gmax does
7
+ ## When to use what
8
8
 
9
- Semantic code search finds code by meaning, not just strings.
10
-
11
- - grep/ripgrep: exact string match
12
- - gmax: concept match ("where do we handle auth?", "how does booking flow work?")
9
+ - **Know the exact string/symbol?** `Grep` tool (fastest, zero overhead)
10
+ - **Know the file already?** → `Read` tool directly
11
+ - **Searching by concept/behavior?** `Bash(gmax "query" --agent)` (semantic search)
12
+ - **Need file structure?** → `Bash(gmax skeleton <path>)`
13
+ - **Need call flow?** → `Bash(gmax trace <symbol>)`
13
14
 
14
15
  ## IMPORTANT: Use CLI, not MCP tools
15
16
 
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall: sync plugin files (SKILL.md, hooks, plugin.json) to
4
+ * the Claude Code plugin cache if it exists. This ensures `npm update -g grepmax`
5
+ * automatically updates the skill instructions without needing `gmax install-claude-code`.
6
+ */
7
+ const fs = require("node:fs");
8
+ const path = require("node:path");
9
+ const os = require("node:os");
10
+
11
+ const pluginCacheBase = path.join(os.homedir(), ".claude", "plugins", "cache", "grepmax", "grepmax");
12
+ const sourcePlugin = path.join(__dirname, "..", "plugins", "grepmax");
13
+
14
+ if (!fs.existsSync(pluginCacheBase) || !fs.existsSync(sourcePlugin)) {
15
+ // Plugin not installed via Claude Code — skip silently
16
+ process.exit(0);
17
+ }
18
+
19
+ // Find installed version directories
20
+ let entries;
21
+ try {
22
+ entries = fs.readdirSync(pluginCacheBase, { withFileTypes: true });
23
+ } catch {
24
+ process.exit(0);
25
+ }
26
+
27
+ const versionDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
28
+ if (versionDirs.length === 0) process.exit(0);
29
+
30
+ // Sync files to each installed version
31
+ function copyRecursive(src, dest) {
32
+ if (!fs.existsSync(src)) return;
33
+ const stat = fs.statSync(src);
34
+ if (stat.isDirectory()) {
35
+ fs.mkdirSync(dest, { recursive: true });
36
+ for (const entry of fs.readdirSync(src)) {
37
+ copyRecursive(path.join(src, entry), path.join(dest, entry));
38
+ }
39
+ } else {
40
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
41
+ fs.copyFileSync(src, dest);
42
+ }
43
+ }
44
+
45
+ for (const ver of versionDirs) {
46
+ const destDir = path.join(pluginCacheBase, ver);
47
+ try {
48
+ // Sync skills
49
+ copyRecursive(
50
+ path.join(sourcePlugin, "skills"),
51
+ path.join(destDir, "skills"),
52
+ );
53
+ // Sync hooks
54
+ copyRecursive(
55
+ path.join(sourcePlugin, "hooks"),
56
+ path.join(destDir, "hooks"),
57
+ );
58
+ // Sync hooks.json
59
+ const hooksJson = path.join(sourcePlugin, "hooks.json");
60
+ if (fs.existsSync(hooksJson)) {
61
+ fs.copyFileSync(hooksJson, path.join(destDir, "hooks.json"));
62
+ }
63
+ } catch {
64
+ // Best-effort — don't fail the install
65
+ }
66
+ }