@sdsrs/code-graph 0.5.28 → 0.5.30
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.
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
const { spawn } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
5
6
|
const {
|
|
6
7
|
install, update, readManifest, getPluginVersion, checkScopeConflict,
|
|
7
|
-
cleanupDisabledStatusline, isPluginInactive,
|
|
8
|
+
cleanupDisabledStatusline, isPluginInactive, readJson,
|
|
8
9
|
} = require('./lifecycle');
|
|
9
10
|
|
|
10
11
|
function launchBackgroundAutoUpdate(spawnFn = spawn, env = process.env) {
|
|
@@ -33,6 +34,15 @@ function syncLifecycleConfig() {
|
|
|
33
34
|
update();
|
|
34
35
|
return 'updated';
|
|
35
36
|
}
|
|
37
|
+
// Self-heal: version matches but statusLine may have been lost
|
|
38
|
+
// (e.g. plugin removed and reinstalled without lifecycle uninstall).
|
|
39
|
+
// install() is idempotent — isOurComposite guard prevents duplicate work.
|
|
40
|
+
const settings = readJson(path.join(os.homedir(), '.claude', 'settings.json')) || {};
|
|
41
|
+
if (!settings.statusLine || !settings.statusLine.command ||
|
|
42
|
+
!settings.statusLine.command.includes('statusline-composite')) {
|
|
43
|
+
install();
|
|
44
|
+
return 'self-healed';
|
|
45
|
+
}
|
|
36
46
|
return 'noop';
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
const { execFileSync } = require('child_process');
|
|
9
9
|
const path = require('path');
|
|
10
|
-
const
|
|
10
|
+
const lifecycle = require('./lifecycle');
|
|
11
|
+
const { readRegistry } = lifecycle;
|
|
12
|
+
const cleanupDisabledStatusline = lifecycle.cleanupDisabledStatusline || (() => ({ cleaned: false }));
|
|
11
13
|
|
|
12
14
|
const SEPARATOR = ' \x1b[2m|\x1b[0m ';
|
|
13
15
|
|
|
@@ -31,8 +33,16 @@ function run(stdin) {
|
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
// Display order: pre-existing statuslines (_previous) first, then our providers.
|
|
37
|
+
// This ensures plugins installed earlier appear before ours.
|
|
38
|
+
const sorted = registry.slice().sort((a, b) => {
|
|
39
|
+
if (a.id === '_previous') return -1;
|
|
40
|
+
if (b.id === '_previous') return 1;
|
|
41
|
+
return 0;
|
|
42
|
+
});
|
|
43
|
+
|
|
34
44
|
const outputs = [];
|
|
35
|
-
for (const provider of
|
|
45
|
+
for (const provider of sorted) {
|
|
36
46
|
const out = runProvider(provider.command, provider.needsStdin, stdin);
|
|
37
47
|
if (out) outputs.push(out);
|
|
38
48
|
}
|
|
@@ -4,16 +4,35 @@ const { execFileSync } = require('child_process');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const { findBinary } = require('./find-binary');
|
|
7
|
-
const
|
|
7
|
+
const lifecycle = require('./lifecycle');
|
|
8
|
+
const cleanupDisabledStatusline = lifecycle.cleanupDisabledStatusline || (() => ({ cleaned: false }));
|
|
8
9
|
|
|
9
10
|
const disabledCleanup = cleanupDisabledStatusline();
|
|
10
11
|
if (disabledCleanup.cleaned) process.exit(0);
|
|
11
12
|
|
|
12
|
-
// Only show status in projects that have a code-graph
|
|
13
|
+
// Only show status in projects that have a code-graph directory.
|
|
13
14
|
// The statusLine config is global, so we must exit silently for
|
|
14
15
|
// directories that aren't code-graph projects.
|
|
15
16
|
const cwd = process.cwd();
|
|
16
|
-
|
|
17
|
+
const codeGraphDir = path.join(cwd, '.code-graph');
|
|
18
|
+
if (!fs.existsSync(codeGraphDir)) {
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Check for background indexing progress file first
|
|
23
|
+
const progressFile = path.join(codeGraphDir, 'indexing-status.json');
|
|
24
|
+
try {
|
|
25
|
+
const raw = fs.readFileSync(progressFile, 'utf8');
|
|
26
|
+
const p = JSON.parse(raw);
|
|
27
|
+
if (p.s === 'indexing' && p.t > 0) {
|
|
28
|
+
const pct = Math.round((p.d / p.t) * 100);
|
|
29
|
+
process.stdout.write(`code-graph: \u21BB indexing ${p.d}/${p.t} (${pct}%)`);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
} catch { /* no progress file or parse error — continue to health check */ }
|
|
33
|
+
|
|
34
|
+
// No indexing in progress — show normal health status
|
|
35
|
+
if (!fs.existsSync(path.join(codeGraphDir, 'index.db'))) {
|
|
17
36
|
process.exit(0);
|
|
18
37
|
}
|
|
19
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.30",
|
|
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.30",
|
|
37
|
+
"@sdsrs/code-graph-linux-arm64": "0.5.30",
|
|
38
|
+
"@sdsrs/code-graph-darwin-x64": "0.5.30",
|
|
39
|
+
"@sdsrs/code-graph-darwin-arm64": "0.5.30",
|
|
40
|
+
"@sdsrs/code-graph-win32-x64": "0.5.30"
|
|
41
41
|
}
|
|
42
42
|
}
|