@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 (with local embedding model)
331
+ # Default build — FTS5-only (~10 MB binary, no embedding model)
332
332
  cargo build --release
333
333
 
334
- # Without embedding model (lighter build)
335
- cargo build --release --no-default-features
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:
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.18.2",
7
+ "version": "0.18.4",
8
8
  "keywords": [
9
9
  "code-graph",
10
10
  "ast",
@@ -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` 含影响面(替代 impact_analysis) |
52
+ | "看 X 的源码 / 签名" | `get_ast_node` / `show X` | `include_impact=true` 影响面 / `include_similar=true` 嵌入近邻 |
43
53
  | "项目结构总览" | `project_map` / `map` | 起手势用 `--compact` |
44
-
45
- ### 进阶 5(Claude Code 里走 CLI;MCP 名调用仅限脚本/SDK)
46
-
47
- **实测**:从 Claude Code 里直接调 `mcp__plugin_code-graph-mcp_code-graph__<tool>`
48
- 会得到 `No such tool available`——Claude Code 的 `ToolSearch` 只为 `tools/list`
49
- 里的工具生成 schema,hidden 5 list 之外就加载不到。**Claude Code 场景一律用
50
- 下表 CLI 列**。raw JSON-RPC (`tools/call`) 仍接受这 5 个名字(含向后兼容别名
51
- `find_http_route` `trace_http_chain`, `read_snippet` `get_ast_node`)。
52
-
53
- | 意图 | CLI(Claude Code 首选) | MCP 工具名(SDK/脚本) | 关键参数 |
54
- |------|--------------------------|------------------------|----------|
55
- | "改 X 会炸啥?" | `code-graph-mcp impact X` | `impact_analysis` | `symbol_name` (必), `file_path`, `change_type` ∈ {signature,behavior,remove}, `depth` |
56
- | HTTP 路由 → handler 链路 | `code-graph-mcp trace /api/x` | `trace_http_chain` | **`route_path`** ⚠ (不是 `route`), `depth` |
57
- | "X 文件依赖谁?" | `code-graph-mcp deps src/x.rs` | `dependency_graph` | `file_path` (必), `direction` ∈ {outgoing,incoming,both}, `depth`, `compact` |
58
- | "相似/重复函数"(需 embedding) | `code-graph-mcp similar X` | `find_similar_code` | `symbol_name` 或 `node_id` (必), `top_k`, `max_distance` |
59
- | "未使用的代码" | `code-graph-mcp dead-code [path]` | `find_dead_code` | `path`, `node_type`, `include_tests`, `min_lines`, `compact`, **`ignore_paths`** (prefix glob 数组;默认 `["claude-plugin/"]`,传 `[]` 关闭默认豁免) |
60
-
61
- **替代路径**:核心 7 里的 `get_ast_node include_impact=true` 覆盖 `impact_analysis`
62
- 的常用场景(风险等级 + 直接/传递调用者 + 受影响文件/路由),不必跳到 CLI。
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.2",
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.2",
39
- "@sdsrs/code-graph-linux-arm64": "0.18.2",
40
- "@sdsrs/code-graph-darwin-x64": "0.18.2",
41
- "@sdsrs/code-graph-darwin-arm64": "0.18.2",
42
- "@sdsrs/code-graph-win32-x64": "0.18.2"
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
  }