@sdsrs/code-graph 0.5.18 → 0.5.20

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/README.md CHANGED
@@ -109,7 +109,7 @@ Install as a Claude Code plugin for the best experience — includes slash comma
109
109
  /plugin marketplace add sdsrss/code-graph-mcp
110
110
 
111
111
  # Step 2: Install the plugin
112
- /plugin install code-graph@sdsrss-code-graph
112
+ /plugin install code-graph-mcp
113
113
  ```
114
114
 
115
115
  What you get:
@@ -176,13 +176,13 @@ code-graph-mcp
176
176
 
177
177
  ```bash
178
178
  # Uninstall the plugin
179
- /plugin uninstall code-graph@sdsrss-code-graph
179
+ /plugin uninstall code-graph-mcp
180
180
 
181
181
  # (Optional) Remove the marketplace
182
- /plugin marketplace remove sdsrss-code-graph
182
+ /plugin marketplace remove code-graph-mcp
183
183
 
184
184
  # (Optional) Clean up all config and cache data
185
- node ~/.claude/plugins/cache/sdsrss/code-graph/*/scripts/lifecycle.js uninstall
185
+ node ~/.claude/plugins/cache/code-graph-mcp/code-graph-mcp/*/scripts/lifecycle.js uninstall
186
186
  ```
187
187
 
188
188
  ### Claude Code MCP Server
@@ -205,19 +205,15 @@ npm uninstall -g @sdsrs/code-graph
205
205
 
206
206
  | Tool | Description |
207
207
  |------|-------------|
208
+ | `project_map` | Full project architecture: modules, dependencies, entry points, hot functions |
208
209
  | `semantic_code_search` | Hybrid BM25 + vector + graph search for AST nodes |
209
210
  | `get_call_graph` | Trace upstream/downstream call chains for a function |
210
- | `find_http_route` | Map route path to backend handler function |
211
211
  | `trace_http_chain` | Full request flow: route → handler → downstream call chain |
212
212
  | `impact_analysis` | Analyze the blast radius of changing a symbol |
213
213
  | `module_overview` | High-level overview of a module's structure and exports |
214
214
  | `dependency_graph` | Visualize dependency relationships between modules |
215
215
  | `find_similar_code` | Find code snippets similar to a given pattern |
216
- | `get_ast_node` | Extract a specific code symbol from a file |
217
- | `read_snippet` | Read original code snippet by node ID with context |
218
- | `start_watch` / `stop_watch` | Start/stop file system watcher for incremental indexing |
219
- | `get_index_status` | Query index status and health |
220
- | `rebuild_index` | Force full index rebuild |
216
+ | `get_ast_node` | Extract a specific code symbol with signature, body, and relations |
221
217
 
222
218
  ## Plugin Slash Commands
223
219
 
@@ -228,6 +224,8 @@ Available when installed as a Claude Code plugin:
228
224
  | `/understand <module>` | Deep dive into a module or file's architecture and relationships |
229
225
  | `/trace <route>` | Trace a full HTTP request flow from route to data layer |
230
226
  | `/impact <symbol>` | Analyze the impact scope of changing a symbol before modifying it |
227
+ | `/status` | Show code-graph index status and embedding progress |
228
+ | `/rebuild` | Force a full code-graph index rebuild |
231
229
 
232
230
  ## Supported Languages
233
231
 
@@ -1,9 +1,9 @@
1
1
  {
2
- "name": "code-graph",
2
+ "name": "code-graph-mcp",
3
3
  "description": "AST knowledge graph for intelligent code navigation — auto-indexes your codebase and provides semantic search, call graph traversal, HTTP route tracing, and impact analysis via MCP tools",
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.5.18",
7
+ "version": "0.5.19",
8
8
  "keywords": ["code-graph", "ast", "navigation", "mcp", "knowledge-graph"]
9
9
  }
@@ -125,7 +125,7 @@ async function downloadAndInstall(latest) {
125
125
  // 3. Copy plugin files to cache (cross-platform)
126
126
  const pluginSrc = path.join(tmpDir, 'claude-plugin');
127
127
  const pluginDst = path.join(
128
- os.homedir(), '.claude', 'plugins', 'cache', MARKETPLACE_NAME, 'code-graph', latest.version
128
+ os.homedir(), '.claude', 'plugins', 'cache', MARKETPLACE_NAME, 'code-graph-mcp', latest.version
129
129
  );
130
130
 
131
131
  if (fs.existsSync(pluginSrc)) {
@@ -4,9 +4,12 @@ const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
6
 
7
- const PLUGIN_ID = 'code-graph@sdsrss-code-graph';
8
- const OLD_PLUGIN_ID = 'code-graph@sdsrss'; // Legacy ID — kept for migration cleanup
9
- const MARKETPLACE_NAME = 'sdsrss-code-graph';
7
+ const PLUGIN_ID = 'code-graph-mcp@code-graph-mcp';
8
+ const OLD_PLUGIN_IDS = [
9
+ 'code-graph@sdsrss', // v1 legacy ID
10
+ 'code-graph@sdsrss-code-graph', // v2 legacy ID (pre-rename)
11
+ ];
12
+ const MARKETPLACE_NAME = 'code-graph-mcp';
10
13
  const CACHE_DIR = path.join(os.homedir(), '.cache', 'code-graph');
11
14
  const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || path.resolve(__dirname, '..');
12
15
  const MANIFEST_FILE = path.join(CACHE_DIR, 'install-manifest.json');
@@ -97,34 +100,53 @@ function checkScopeConflict() {
97
100
  if (!installed || !installed.plugins) return null;
98
101
  for (const [key, entries] of Object.entries(installed.plugins)) {
99
102
  if (key === PLUGIN_ID) continue;
100
- if (key.startsWith('code-graph@')) {
103
+ // Detect any old code-graph plugin IDs still installed
104
+ if (key.startsWith('code-graph@') || key.startsWith('code-graph-mcp@')) {
101
105
  return { existingId: key, scope: entries[0] && entries[0].scope, entries };
102
106
  }
103
107
  }
104
108
  return null;
105
109
  }
106
110
 
107
- // --- Migration: clean up old PLUGIN_ID remnants ---
111
+ // --- Migration: clean up old plugin ID remnants ---
108
112
 
109
- function migrateOldPluginId(settings) {
113
+ function migrateOldPluginIds(settings) {
110
114
  let changed = false;
111
115
 
112
- // Clean old ID from enabledPlugins
113
- if (settings.enabledPlugins && OLD_PLUGIN_ID in settings.enabledPlugins) {
114
- delete settings.enabledPlugins[OLD_PLUGIN_ID];
115
- changed = true;
116
+ for (const oldId of OLD_PLUGIN_IDS) {
117
+ // Clean old ID from enabledPlugins
118
+ if (settings.enabledPlugins && oldId in settings.enabledPlugins) {
119
+ delete settings.enabledPlugins[oldId];
120
+ changed = true;
121
+ }
122
+
123
+ // Clean old ID from installed_plugins.json
124
+ const installed = readJson(INSTALLED_PLUGINS_PATH);
125
+ if (installed && installed.plugins && oldId in installed.plugins) {
126
+ delete installed.plugins[oldId];
127
+ writeJsonAtomic(INSTALLED_PLUGINS_PATH, installed);
128
+ }
116
129
  }
117
130
 
118
- // Clean old ID from installed_plugins.json
119
- const installed = readJson(INSTALLED_PLUGINS_PATH);
120
- if (installed && installed.plugins && OLD_PLUGIN_ID in installed.plugins) {
121
- delete installed.plugins[OLD_PLUGIN_ID];
122
- writeJsonAtomic(INSTALLED_PLUGINS_PATH, installed);
131
+ // Clean old marketplace names from extraKnownMarketplaces
132
+ if (settings.extraKnownMarketplaces) {
133
+ for (const oldName of ['sdsrss-code-graph']) {
134
+ if (oldName in settings.extraKnownMarketplaces) {
135
+ delete settings.extraKnownMarketplaces[oldName];
136
+ changed = true;
137
+ }
138
+ }
123
139
  }
124
140
 
125
- // Clean old cache path (was using 'sdsrss' instead of 'sdsrss-code-graph')
126
- const oldCacheDir = path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss', 'code-graph');
127
- try { fs.rmSync(oldCacheDir, { recursive: true, force: true }); } catch { /* ok */ }
141
+ // Clean old cache paths
142
+ const oldCacheDirs = [
143
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss', 'code-graph'),
144
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss-code-graph', 'code-graph'),
145
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss-code-graph'),
146
+ ];
147
+ for (const dir of oldCacheDirs) {
148
+ try { fs.rmSync(dir, { recursive: true, force: true }); } catch { /* ok */ }
149
+ }
128
150
 
129
151
  return changed;
130
152
  }
@@ -137,8 +159,8 @@ function install() {
137
159
  const settings = readJson(SETTINGS_PATH) || {};
138
160
  let settingsChanged = false;
139
161
 
140
- // 0. Migrate from old PLUGIN_ID
141
- if (migrateOldPluginId(settings)) {
162
+ // 0. Migrate from old plugin IDs
163
+ if (migrateOldPluginIds(settings)) {
142
164
  settingsChanged = true;
143
165
  }
144
166
 
@@ -203,9 +225,9 @@ function uninstall() {
203
225
  // else: other providers still using composite — leave it
204
226
  }
205
227
 
206
- // 2. Remove both old and new IDs from enabledPlugins
228
+ // 2. Remove all known IDs from enabledPlugins
207
229
  if (settings.enabledPlugins) {
208
- for (const id of [PLUGIN_ID, OLD_PLUGIN_ID]) {
230
+ for (const id of [PLUGIN_ID, ...OLD_PLUGIN_IDS]) {
209
231
  if (id in settings.enabledPlugins) {
210
232
  delete settings.enabledPlugins[id];
211
233
  settingsChanged = true;
@@ -219,11 +241,11 @@ function uninstall() {
219
241
  }
220
242
  }
221
243
 
222
- // 4. Remove both old and new IDs from installed_plugins.json
244
+ // 4. Remove all known IDs from installed_plugins.json
223
245
  const installedPlugins = readJson(INSTALLED_PLUGINS_PATH);
224
246
  if (installedPlugins && installedPlugins.plugins) {
225
247
  let ipChanged = false;
226
- for (const id of [PLUGIN_ID, OLD_PLUGIN_ID]) {
248
+ for (const id of [PLUGIN_ID, ...OLD_PLUGIN_IDS]) {
227
249
  if (id in installedPlugins.plugins) {
228
250
  delete installedPlugins.plugins[id];
229
251
  ipChanged = true;
@@ -235,10 +257,11 @@ function uninstall() {
235
257
  // 5. Remove cache directory
236
258
  try { fs.rmSync(CACHE_DIR, { recursive: true, force: true }); } catch { /* ok */ }
237
259
 
238
- // 6. Remove plugin files from cache (both old and new paths)
260
+ // 6. Remove plugin files from cache (all known paths, including parent dirs)
239
261
  const pluginCacheDirs = [
240
- path.join(os.homedir(), '.claude', 'plugins', 'cache', MARKETPLACE_NAME, 'code-graph'),
241
- path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss', 'code-graph'), // legacy
262
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', MARKETPLACE_NAME),
263
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss-code-graph'),
264
+ path.join(os.homedir(), '.claude', 'plugins', 'cache', 'sdsrss', 'code-graph'),
242
265
  ];
243
266
  for (const dir of pluginCacheDirs) {
244
267
  try { fs.rmSync(dir, { recursive: true, force: true }); } catch { /* ok */ }
@@ -256,8 +279,8 @@ function update() {
256
279
  const settings = readJson(SETTINGS_PATH) || {};
257
280
  let settingsChanged = false;
258
281
 
259
- // 0. Migrate from old PLUGIN_ID
260
- if (migrateOldPluginId(settings)) {
282
+ // 0. Migrate from old plugin IDs
283
+ if (migrateOldPluginIds(settings)) {
261
284
  settingsChanged = true;
262
285
  }
263
286
 
@@ -297,7 +320,7 @@ module.exports = {
297
320
  readManifest, readJson, writeJsonAtomic,
298
321
  readRegistry, writeRegistry,
299
322
  getPluginVersion,
300
- PLUGIN_ID, OLD_PLUGIN_ID, MARKETPLACE_NAME, CACHE_DIR, REGISTRY_FILE,
323
+ PLUGIN_ID, OLD_PLUGIN_IDS, MARKETPLACE_NAME, CACHE_DIR, REGISTRY_FILE,
301
324
  };
302
325
 
303
326
  // CLI: node lifecycle.js <install|uninstall|update>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
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.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"
36
+ "@sdsrs/code-graph-linux-x64": "0.5.20",
37
+ "@sdsrs/code-graph-linux-arm64": "0.5.20",
38
+ "@sdsrs/code-graph-darwin-x64": "0.5.20",
39
+ "@sdsrs/code-graph-darwin-arm64": "0.5.20",
40
+ "@sdsrs/code-graph-win32-x64": "0.5.20"
41
41
  }
42
42
  }