@sdsrs/code-graph 0.5.3 → 0.5.4
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.
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
4
7
|
const { findBinary } = require('./find-binary');
|
|
5
8
|
const { install, update, readManifest, getPluginVersion, checkScopeConflict } = require('./lifecycle');
|
|
6
9
|
const { checkForUpdate } = require('./auto-update');
|
|
@@ -26,6 +29,37 @@ if (BIN) {
|
|
|
26
29
|
);
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
// --- 1c. Binary version sync (plugin may update before npm binary) ---
|
|
33
|
+
if (BIN) {
|
|
34
|
+
try {
|
|
35
|
+
const binOut = execFileSync(BIN, ['--version'], { timeout: 2000, stdio: 'pipe' }).toString().trim();
|
|
36
|
+
const binVersion = binOut.replace(/^code-graph-mcp\s+/, '');
|
|
37
|
+
const pluginVersion = getPluginVersion();
|
|
38
|
+
if (binVersion && pluginVersion && /^\d+\.\d+\.\d+$/.test(binVersion)) {
|
|
39
|
+
const bv = binVersion.split('.').map(Number);
|
|
40
|
+
const pv = pluginVersion.split('.').map(Number);
|
|
41
|
+
const pluginNewer = (pv[0] > bv[0]) ||
|
|
42
|
+
(pv[0] === bv[0] && pv[1] > bv[1]) ||
|
|
43
|
+
(pv[0] === bv[0] && pv[1] === bv[1] && pv[2] > bv[2]);
|
|
44
|
+
if (pluginNewer) {
|
|
45
|
+
process.stderr.write(`[code-graph] Binary v${binVersion} < plugin v${pluginVersion}, updating...\n`);
|
|
46
|
+
try {
|
|
47
|
+
execFileSync('npm', ['install', '-g', `@sdsrs/code-graph@${pluginVersion}`], {
|
|
48
|
+
timeout: 30000, stdio: 'pipe'
|
|
49
|
+
});
|
|
50
|
+
// Clear cached binary path so next lookup finds the new binary
|
|
51
|
+
try { fs.unlinkSync(path.join(os.homedir(), '.cache', 'code-graph', 'binary-path')); } catch {}
|
|
52
|
+
process.stderr.write(`[code-graph] Binary updated to v${pluginVersion}\n`);
|
|
53
|
+
} catch {
|
|
54
|
+
process.stderr.write(
|
|
55
|
+
`[code-graph] Auto-update failed. Run: npm install -g @sdsrs/code-graph@${pluginVersion}\n`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch { /* version check failed — not critical */ }
|
|
61
|
+
}
|
|
62
|
+
|
|
29
63
|
// --- 2. Scope conflict warning ---
|
|
30
64
|
const conflict = checkScopeConflict();
|
|
31
65
|
if (conflict) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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.
|
|
37
|
-
"@sdsrs/code-graph-linux-arm64": "0.5.
|
|
38
|
-
"@sdsrs/code-graph-darwin-x64": "0.5.
|
|
39
|
-
"@sdsrs/code-graph-darwin-arm64": "0.5.
|
|
40
|
-
"@sdsrs/code-graph-win32-x64": "0.5.
|
|
36
|
+
"@sdsrs/code-graph-linux-x64": "0.5.4",
|
|
37
|
+
"@sdsrs/code-graph-linux-arm64": "0.5.4",
|
|
38
|
+
"@sdsrs/code-graph-darwin-x64": "0.5.4",
|
|
39
|
+
"@sdsrs/code-graph-darwin-arm64": "0.5.4",
|
|
40
|
+
"@sdsrs/code-graph-win32-x64": "0.5.4"
|
|
41
41
|
}
|
|
42
42
|
}
|