@sdsrs/code-graph 0.5.16 → 0.5.18

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.
@@ -4,6 +4,6 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.5.15",
7
+ "version": "0.5.18",
8
8
  "keywords": ["code-graph", "ast", "navigation", "mcp", "knowledge-graph"]
9
9
  }
@@ -8,7 +8,30 @@ const { findBinary } = require('./find-binary');
8
8
  const { install, update, readManifest, getPluginVersion, checkScopeConflict } = require('./lifecycle');
9
9
  const { checkForUpdate } = require('./auto-update');
10
10
 
11
- const BIN = findBinary();
11
+ let BIN = findBinary();
12
+
13
+ // --- 0. Auto-install binary if missing ---
14
+ if (!BIN) {
15
+ const version = getPluginVersion();
16
+ process.stderr.write(`[code-graph] Binary not found, installing @sdsrs/code-graph@${version}...\n`);
17
+ try {
18
+ execFileSync('npm', ['install', '-g', `@sdsrs/code-graph@${version}`], {
19
+ timeout: 60000, stdio: 'pipe'
20
+ });
21
+ // Clear cached path so findBinary picks up the new install
22
+ try { fs.unlinkSync(path.join(os.homedir(), '.cache', 'code-graph', 'binary-path')); } catch {}
23
+ BIN = findBinary();
24
+ if (BIN) {
25
+ process.stderr.write(`[code-graph] Installed v${version} at ${BIN}\n`);
26
+ } else {
27
+ process.stderr.write('[code-graph] Install succeeded but binary not found in PATH. Try: npx @sdsrs/code-graph@latest\n');
28
+ }
29
+ } catch {
30
+ process.stderr.write(
31
+ `[code-graph] Auto-install failed. Run manually: npm install -g @sdsrs/code-graph@${version}\n`
32
+ );
33
+ }
34
+ }
12
35
 
13
36
  // --- 1. Health check (always runs) ---
14
37
  if (BIN) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.5.16",
3
+ "version": "0.5.18",
4
4
  "description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,10 +33,10 @@
33
33
  "node": ">=16"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@sdsrs/code-graph-linux-x64": "0.5.16",
37
- "@sdsrs/code-graph-linux-arm64": "0.5.16",
38
- "@sdsrs/code-graph-darwin-x64": "0.5.16",
39
- "@sdsrs/code-graph-darwin-arm64": "0.5.16",
40
- "@sdsrs/code-graph-win32-x64": "0.5.16"
36
+ "@sdsrs/code-graph-linux-x64": "0.5.18",
37
+ "@sdsrs/code-graph-linux-arm64": "0.5.18",
38
+ "@sdsrs/code-graph-darwin-x64": "0.5.18",
39
+ "@sdsrs/code-graph-darwin-arm64": "0.5.18",
40
+ "@sdsrs/code-graph-win32-x64": "0.5.18"
41
41
  }
42
42
  }