@sdsrs/code-graph 0.5.28 → 0.5.29

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,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.5.28",
7
+ "version": "0.5.29",
8
8
  "keywords": [
9
9
  "code-graph",
10
10
  "ast",
@@ -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
 
@@ -31,8 +31,16 @@ function run(stdin) {
31
31
  return;
32
32
  }
33
33
 
34
+ // Display order: pre-existing statuslines (_previous) first, then our providers.
35
+ // This ensures plugins installed earlier appear before ours.
36
+ const sorted = registry.slice().sort((a, b) => {
37
+ if (a.id === '_previous') return -1;
38
+ if (b.id === '_previous') return 1;
39
+ return 0;
40
+ });
41
+
34
42
  const outputs = [];
35
- for (const provider of registry) {
43
+ for (const provider of sorted) {
36
44
  const out = runProvider(provider.command, provider.needsStdin, stdin);
37
45
  if (out) outputs.push(out);
38
46
  }
@@ -9,11 +9,29 @@ const { cleanupDisabledStatusline } = require('./lifecycle');
9
9
  const disabledCleanup = cleanupDisabledStatusline();
10
10
  if (disabledCleanup.cleaned) process.exit(0);
11
11
 
12
- // Only show status in projects that have a code-graph index.
12
+ // Only show status in projects that have a code-graph directory.
13
13
  // The statusLine config is global, so we must exit silently for
14
14
  // directories that aren't code-graph projects.
15
15
  const cwd = process.cwd();
16
- if (!fs.existsSync(path.join(cwd, '.code-graph', 'index.db'))) {
16
+ const codeGraphDir = path.join(cwd, '.code-graph');
17
+ if (!fs.existsSync(codeGraphDir)) {
18
+ process.exit(0);
19
+ }
20
+
21
+ // Check for background indexing progress file first
22
+ const progressFile = path.join(codeGraphDir, 'indexing-status.json');
23
+ try {
24
+ const raw = fs.readFileSync(progressFile, 'utf8');
25
+ const p = JSON.parse(raw);
26
+ if (p.s === 'indexing' && p.t > 0) {
27
+ const pct = Math.round((p.d / p.t) * 100);
28
+ process.stdout.write(`code-graph: \u21BB indexing ${p.d}/${p.t} (${pct}%)`);
29
+ process.exit(0);
30
+ }
31
+ } catch { /* no progress file or parse error — continue to health check */ }
32
+
33
+ // No indexing in progress — show normal health status
34
+ if (!fs.existsSync(path.join(codeGraphDir, 'index.db'))) {
17
35
  process.exit(0);
18
36
  }
19
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
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.28",
37
- "@sdsrs/code-graph-linux-arm64": "0.5.28",
38
- "@sdsrs/code-graph-darwin-x64": "0.5.28",
39
- "@sdsrs/code-graph-darwin-arm64": "0.5.28",
40
- "@sdsrs/code-graph-win32-x64": "0.5.28"
36
+ "@sdsrs/code-graph-linux-x64": "0.5.29",
37
+ "@sdsrs/code-graph-linux-arm64": "0.5.29",
38
+ "@sdsrs/code-graph-darwin-x64": "0.5.29",
39
+ "@sdsrs/code-graph-darwin-arm64": "0.5.29",
40
+ "@sdsrs/code-graph-win32-x64": "0.5.29"
41
41
  }
42
42
  }