@sdsrs/code-graph 0.18.2 → 0.18.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.
package/README.md
CHANGED
|
@@ -328,13 +328,17 @@ Data is stored in `.code-graph/index.db` under the project root (auto-created, g
|
|
|
328
328
|
### Build
|
|
329
329
|
|
|
330
330
|
```bash
|
|
331
|
-
# Default build (
|
|
331
|
+
# Default build — FTS5-only (~10 MB binary, no embedding model)
|
|
332
332
|
cargo build --release
|
|
333
333
|
|
|
334
|
-
#
|
|
335
|
-
cargo build --release --
|
|
334
|
+
# With local embedding model (~150 MB binary; downloads ~120 MB model lazily on first semantic search)
|
|
335
|
+
cargo build --release --features embed-model
|
|
336
336
|
```
|
|
337
337
|
|
|
338
|
+
> Direct `cargo install` users get the FTS5-only build by default. npm/npx/plugin
|
|
339
|
+
> users get the full hybrid (FTS5 + vector) build automatically — release CI
|
|
340
|
+
> compiles with `--features embed-model` for shipped binaries.
|
|
341
|
+
|
|
338
342
|
### Configure (from source)
|
|
339
343
|
|
|
340
344
|
Add the compiled binary to your MCP settings:
|
|
@@ -21,6 +21,16 @@ type: reference
|
|
|
21
21
|
> 显式启用:`CODE_GRAPH_VERBOSE_HOOKS=1` —— Bash 调 `code-graph-mcp map --compact`
|
|
22
22
|
> 也是等价的按需替代。
|
|
23
23
|
> 向后兼容:`CODE_GRAPH_QUIET_HOOKS=0` 强制 noisy / `=1` 强制 quiet(优先级最高)。
|
|
24
|
+
>
|
|
25
|
+
> **v0.18.4 起**:原"进阶 5"(impact / similar / deps / dead-code / trace)已折叠
|
|
26
|
+
> 进核心 7 的 flag —— Claude Code 现在能直接通过 MCP 调用,不必落到 CLI:
|
|
27
|
+
> - `get_ast_node include_impact=true` / `include_similar=true`
|
|
28
|
+
> - `module_overview include_deps=true` / `include_dead=true`
|
|
29
|
+
> - `get_call_graph route_path="GET /api/x"`
|
|
30
|
+
>
|
|
31
|
+
> 旧名(`impact_analysis` 等)仍作为向后兼容 dispatcher 别名可调(raw JSON-RPC /
|
|
32
|
+
> SDK 脚本场景),但 Claude Code 内强烈建议用上面的新 flag 形式。CLI 子命令
|
|
33
|
+
> (`code-graph-mcp impact|similar|deps|dead-code|trace`)保持不变,给 Bash 工作流。
|
|
24
34
|
|
|
25
35
|
## 何时调用 MCP/CLI(替代多步 Grep/Read)
|
|
26
36
|
|
|
@@ -39,27 +49,29 @@ type: reference
|
|
|
39
49
|
| "找做 Z 的代码"(概念) | MCP `semantic_code_search`(RRF 混合);CLI `search`(纯 FTS5) | 不知道精确名;要向量召回走 MCP |
|
|
40
50
|
| "返回 T 类型的函数" | `ast_search --returns T` | 结构化筛选 |
|
|
41
51
|
| "X 在哪被引用?" | `find_references` / `refs X` | 含 callers/importers |
|
|
42
|
-
| "看 X 的源码 / 签名" | `get_ast_node` / `show X` | `include_impact=true`
|
|
52
|
+
| "看 X 的源码 / 签名" | `get_ast_node` / `show X` | `include_impact=true` 影响面 / `include_similar=true` 嵌入近邻 |
|
|
43
53
|
| "项目结构总览" | `project_map` / `map` | 起手势用 `--compact` |
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
| "X
|
|
58
|
-
|
|
|
59
|
-
| "
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
| "X 文件依赖谁?" / "Y 模块下的死代码" | `module_overview path=Y include_deps=true` / `include_dead=true` | 文件路径走 deps;目录/文件走 dead |
|
|
55
|
+
| HTTP 路由 → handler 链 | `get_call_graph route_path="GET /api/x"` | 取代 trace_http_chain |
|
|
56
|
+
|
|
57
|
+
### 旧名兼容 + CLI 速查(v0.18.4 fold 后)
|
|
58
|
+
|
|
59
|
+
v0.18.4 把原"进阶 5"折叠进核心 7 的 flag。**Claude Code 内**首选上表的新 flag 形式。
|
|
60
|
+
旧名(`impact_analysis` / `find_similar_code` / `dependency_graph` / `find_dead_code` /
|
|
61
|
+
`trace_http_chain` + alias `find_http_route`)作为 dispatcher 向后兼容**仍可调用**
|
|
62
|
+
(raw JSON-RPC / MCP SDK / 既有脚本不破),但 Claude Code 的 ToolSearch 仍然不为
|
|
63
|
+
hidden 5 加载 schema —— 实操中走新 flag。CLI 子命令保持原样:
|
|
64
|
+
|
|
65
|
+
| 意图 | CLI(Bash 工作流) | 等价 MCP 新形式 |
|
|
66
|
+
|------|--------------------|------------------|
|
|
67
|
+
| "改 X 会炸啥?" | `code-graph-mcp impact X` | `get_ast_node symbol_name=X include_impact=true` |
|
|
68
|
+
| HTTP 路由 → handler 链路 | `code-graph-mcp trace /api/x` | `get_call_graph route_path="GET /api/x"` |
|
|
69
|
+
| "X 文件依赖谁?" | `code-graph-mcp deps src/x.rs` | `module_overview path="src/x.rs" include_deps=true` |
|
|
70
|
+
| "相似/重复函数"(需 embedding) | `code-graph-mcp similar X` | `get_ast_node symbol_name=X include_similar=true` |
|
|
71
|
+
| "未使用的代码" | `code-graph-mcp dead-code [path]` | `module_overview path=<path> include_dead=true` |
|
|
72
|
+
|
|
73
|
+
**dead-code 的 `ignore_paths`**:CLI 默认豁免 `["claude-plugin/", "benches/"]`
|
|
74
|
+
(macro/shell 入口点);`--no-ignore` 关闭。MCP 端也接同名参数。
|
|
63
75
|
|
|
64
76
|
## 不要替代
|
|
65
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.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": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"node": ">=16"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@sdsrs/code-graph-linux-x64": "0.18.
|
|
39
|
-
"@sdsrs/code-graph-linux-arm64": "0.18.
|
|
40
|
-
"@sdsrs/code-graph-darwin-x64": "0.18.
|
|
41
|
-
"@sdsrs/code-graph-darwin-arm64": "0.18.
|
|
42
|
-
"@sdsrs/code-graph-win32-x64": "0.18.
|
|
38
|
+
"@sdsrs/code-graph-linux-x64": "0.18.4",
|
|
39
|
+
"@sdsrs/code-graph-linux-arm64": "0.18.4",
|
|
40
|
+
"@sdsrs/code-graph-darwin-x64": "0.18.4",
|
|
41
|
+
"@sdsrs/code-graph-darwin-arm64": "0.18.4",
|
|
42
|
+
"@sdsrs/code-graph-win32-x64": "0.18.4"
|
|
43
43
|
}
|
|
44
44
|
}
|