@sdsrs/code-graph 0.5.48 → 0.7.0

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
@@ -4,10 +4,11 @@ A high-performance code knowledge graph server implementing the [Model Context P
4
4
 
5
5
  ## Features
6
6
 
7
- - **Multi-language parsing** — Tree-sitter AST extraction for TypeScript, JavaScript, Go, Python, Rust, Java, C, C++, HTML, CSS
7
+ - **Multi-language parsing** — Tree-sitter AST extraction for 16 languages: TypeScript, JavaScript, Go, Python, Rust, Java, C, C++, C#, Kotlin, Ruby, PHP, Swift, Dart, HTML, CSS
8
8
  - **Semantic code search** — Hybrid BM25 full-text + vector semantic search with Reciprocal Rank Fusion (RRF), powered by sqlite-vec
9
9
  - **Call graph traversal** — Recursive CTE queries to trace callers/callees with cycle detection
10
- - **HTTP route tracing** — Map route paths to backend handler functions (Express, Flask/FastAPI, Go)
10
+ - **HTTP route tracing** — Map route paths to backend handler functions (Express, Flask/FastAPI, Go, ASP.NET, Rails, Laravel, Vapor)
11
+ - **Dead code detection** — Find unreferenced symbols with smart Orphan/Exported-Unused classification
11
12
  - **Impact analysis** — Determine the blast radius of code changes by tracing all dependents
12
13
  - **Incremental indexing** — Merkle tree change detection with file system watcher for real-time updates. Smart event filtering skips metadata-only changes (chmod, xattr)
13
14
  - **Context compression** — Token-aware snippet extraction for LLM context windows (L0→full code, L1→summaries, L2→file groups, L3→directory overview). Compact JSON output saves 15-20% tokens
@@ -44,6 +45,18 @@ Single binary, embedded SQLite, bundled sqlite-vec extension, optional local emb
44
45
 
45
46
  Every design decision — from token-aware compression to node_id-based snippet expansion — is optimized for LLM context windows. Works out of the box with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
46
47
 
48
+ ## Performance
49
+
50
+ | Metric | Value |
51
+ |--------|-------|
52
+ | Indexing speed | **300+ files/second** (single-threaded, release build) |
53
+ | Incremental re-index | **<250ms** no-change detection via BLAKE3 Merkle tree |
54
+ | FTS search P50 / P99 | **<300us / <1ms** |
55
+ | Database overhead | **~3.5MB** per 800 nodes |
56
+ | Token savings | **5-20x fewer tokens** per code understanding task vs grep+read |
57
+
58
+ Run `code-graph-mcp benchmark` on your own project to measure.
59
+
47
60
  ## Efficiency: code-graph vs Traditional Tools
48
61
 
49
62
  Real-world benchmarks comparing code-graph-mcp tools against traditional approaches (Grep + Read + Glob) on a 33-file Rust project (~537 AST nodes).
@@ -88,13 +101,15 @@ Real-world benchmarks comparing code-graph-mcp tools against traditional approac
88
101
 
89
102
  ```
90
103
  src/
104
+ ├── domain.rs # Shared constants, relation types, env-var config
91
105
  ├── mcp/ # MCP protocol layer (JSON-RPC, tool registry, server)
92
- ├── parser/ # Tree-sitter parsing, relation extraction, language support
106
+ │ └── server/ # McpServer with IndexingState + CacheState sub-structs
107
+ ├── parser/ # Tree-sitter parsing, relation extraction, LanguageConfig dispatch
93
108
  ├── indexer/ # 3-phase pipeline, Merkle tree, file watcher
94
- ├── storage/ # SQLite schema, CRUD, FTS5 full-text search
109
+ ├── storage/ # SQLite schema (v6), CRUD, FTS5, migrations
95
110
  ├── graph/ # Recursive CTE call graph queries
96
111
  ├── search/ # RRF fusion search combining BM25 + vector
97
- ├── embedding/ # Candle embedding model (optional)
112
+ ├── embedding/ # Candle embedding model (optional, masked mean pooling)
98
113
  ├── sandbox/ # Context compressor with token estimation
99
114
  └── utils/ # Language detection, config
100
115
  ```
@@ -212,9 +227,12 @@ npm uninstall -g @sdsrs/code-graph
212
227
  | `trace_http_chain` | Full request flow: route → handler → downstream call chain |
213
228
  | `impact_analysis` | Analyze the blast radius of changing a symbol |
214
229
  | `module_overview` | High-level overview of a module's structure and exports |
215
- | `dependency_graph` | Visualize dependency relationships between modules |
216
- | `find_similar_code` | Find code snippets similar to a given pattern |
217
- | `get_ast_node` | Extract a specific code symbol with signature, body, and relations |
230
+ | `dependency_graph` | Visualize dependency relationships between modules. Supports `compact` mode |
231
+ | `find_similar_code` | Find semantically similar code via embeddings. Requires `symbol_name` or `node_id` |
232
+ | `get_ast_node` | Extract a specific code symbol with signature, body, and relations. Supports `compact` mode |
233
+ | `ast_search` | Search AST nodes by text and/or structural filters (type, return type, params) |
234
+ | `find_references` | Find all references to a symbol (callers, importers, inheritors). Supports `compact` mode |
235
+ | `find_dead_code` | Find unused code — orphan symbols and exported-but-unused public APIs |
218
236
 
219
237
  ## Plugin Slash Commands
220
238
 
@@ -228,9 +246,26 @@ Available when installed as a Claude Code plugin:
228
246
  | `/status` | Show code-graph index status and embedding progress |
229
247
  | `/rebuild` | Force a full code-graph index rebuild |
230
248
 
231
- ## Supported Languages
232
-
233
- TypeScript, JavaScript, Go, Python, Rust, Java, C, C++, HTML, CSS
249
+ ## Supported Languages (16)
250
+
251
+ | Language | Extensions | Relations Extracted |
252
+ |----------|-----------|-------------------|
253
+ | TypeScript | .ts, .tsx | calls, imports, exports, inherits, implements, routes_to |
254
+ | JavaScript | .js, .jsx, .mjs, .cjs | calls, imports, exports, inherits, routes_to |
255
+ | Go | .go | calls, imports, routes_to |
256
+ | Python | .py, .pyi | calls, imports, inherits, routes_to |
257
+ | Rust | .rs | calls, imports, inherits, implements |
258
+ | Java | .java | calls, imports, inherits, implements |
259
+ | C# | .cs | calls, imports, inherits, implements |
260
+ | Kotlin | .kt, .kts | calls, imports, inherits |
261
+ | Ruby | .rb | calls, imports, inherits |
262
+ | PHP | .php | calls, imports, inherits, implements |
263
+ | Swift | .swift | calls, imports, inherits |
264
+ | Dart | .dart | calls, imports, implements |
265
+ | C | .c, .h | calls, imports |
266
+ | C++ | .cpp, .cc, .cxx, .hpp | calls, imports, inherits |
267
+ | HTML | .html, .htm | structural parsing |
268
+ | CSS | .css | structural parsing |
234
269
 
235
270
  ## Storage
236
271
 
@@ -283,6 +318,9 @@ cargo test --no-default-features
283
318
 
284
319
  # Check compilation
285
320
  cargo check
321
+
322
+ # Run performance benchmarks (indexing, search, call graph)
323
+ cargo bench --no-default-features
286
324
  ```
287
325
 
288
326
  ## License
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.5.48",
7
+ "version": "0.7.0",
8
8
  "keywords": [
9
9
  "code-graph",
10
10
  "ast",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.5.48",
3
+ "version": "0.7.0",
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.48",
37
- "@sdsrs/code-graph-linux-arm64": "0.5.48",
38
- "@sdsrs/code-graph-darwin-x64": "0.5.48",
39
- "@sdsrs/code-graph-darwin-arm64": "0.5.48",
40
- "@sdsrs/code-graph-win32-x64": "0.5.48"
36
+ "@sdsrs/code-graph-linux-x64": "0.7.0",
37
+ "@sdsrs/code-graph-linux-arm64": "0.7.0",
38
+ "@sdsrs/code-graph-darwin-x64": "0.7.0",
39
+ "@sdsrs/code-graph-darwin-arm64": "0.7.0",
40
+ "@sdsrs/code-graph-win32-x64": "0.7.0"
41
41
  }
42
42
  }