@sdsrs/code-graph 0.116.0 → 0.118.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 +38 -15
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/scripts/adopt.js +210 -50
- package/claude-plugin/scripts/auto-update.js +147 -11
- package/claude-plugin/scripts/doctor.js +158 -12
- package/claude-plugin/scripts/hook-emit.js +80 -11
- package/claude-plugin/scripts/lifecycle.js +193 -28
- package/claude-plugin/scripts/pr-impact-comment.js +33 -1
- package/claude-plugin/scripts/pre-edit-guide.js +16 -8
- package/claude-plugin/scripts/proc-opts.js +15 -0
- package/claude-plugin/scripts/session-init.js +73 -2
- package/claude-plugin/scripts/statusline-chain.js +17 -1
- package/claude-plugin/scripts/statusline-composite.js +3 -0
- package/claude-plugin/scripts/statusline.js +3 -0
- package/claude-plugin/templates/code-graph-snapshot.yml +8 -3
- package/claude-plugin/templates/plugin_code_graph_mcp.md +15 -7
- package/package.json +7 -7
|
@@ -22,15 +22,20 @@ jobs:
|
|
|
22
22
|
permissions:
|
|
23
23
|
contents: write
|
|
24
24
|
steps:
|
|
25
|
-
-
|
|
25
|
+
# SHA-pinned, not `@v4`: a floating major tag is mutable, so anyone who can
|
|
26
|
+
# move it runs their code in a job that holds `contents: write` on your
|
|
27
|
+
# repo. These are the same commits code-graph-mcp's own workflows pin.
|
|
28
|
+
# Update by copying a new SHA from the action's release page, not by
|
|
29
|
+
# switching back to a tag.
|
|
30
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
26
31
|
with:
|
|
27
32
|
fetch-depth: 0
|
|
28
|
-
- uses: actions/setup-node@
|
|
33
|
+
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
|
29
34
|
with:
|
|
30
35
|
node-version: '20'
|
|
31
36
|
- name: Build snapshot
|
|
32
37
|
run: |
|
|
33
|
-
npx -y -p @sdsrs/code-graph@0.
|
|
38
|
+
npx -y -p @sdsrs/code-graph@0.118.0 code-graph-mcp snapshot create --out snapshot.db
|
|
34
39
|
zstd -9 snapshot.db -o snapshot.db.zst
|
|
35
40
|
mv snapshot.db.zst "code-graph-snapshot-${GITHUB_SHA:0:7}.db.zst"
|
|
36
41
|
- name: Upload to release
|
|
@@ -35,8 +35,12 @@ type: reference
|
|
|
35
35
|
> - `module_overview include_deps=true` / `include_dead=true`
|
|
36
36
|
> - `get_call_graph route_path="GET /api/x"`
|
|
37
37
|
>
|
|
38
|
-
>
|
|
39
|
-
>
|
|
38
|
+
> `impact_analysis` **已删除**——dispatcher 里没有这个 arm,按名调用返回
|
|
39
|
+
> `Unknown tool`。改用 `get_ast_node include_impact=true`,或 CLI `impact`。
|
|
40
|
+
> 其余旧名(`read_snippet` / `dependency_graph` / `find_similar_code` /
|
|
41
|
+
> `find_dead_code` / `trace_http_chain` + alias `find_http_route`)仍是向后兼容
|
|
42
|
+
> dispatcher 别名(raw JSON-RPC / SDK 脚本场景),但 Claude Code 内一律用上面的
|
|
43
|
+
> 新 flag 形式。CLI 子命令
|
|
40
44
|
> (`code-graph-mcp impact|similar|deps|dead-code|trace`)保持不变,给 Bash 工作流。
|
|
41
45
|
|
|
42
46
|
## 何时调用 MCP/CLI(替代多步 Grep/Read)
|
|
@@ -73,10 +77,14 @@ type: reference
|
|
|
73
77
|
### 旧名兼容 + CLI 速查(v0.18.4 fold 后)
|
|
74
78
|
|
|
75
79
|
v0.18.4 把原"进阶 5"折叠进核心 7 的 flag。**Claude Code 内**首选上表的新 flag 形式。
|
|
76
|
-
|
|
77
|
-
`
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
|
|
81
|
+
可按名调用的只有这 7 个:`project_map` / `semantic_code_search` / `get_call_graph` /
|
|
82
|
+
`get_ast_node` / `module_overview` / `ast_search` / `find_references`。
|
|
83
|
+
`impact_analysis` **不在其列,已从 dispatcher 删除**——按名调用返回 `Unknown tool`。
|
|
84
|
+
隐藏旧名 `read_snippet` / `dependency_graph` / `find_similar_code` / `find_dead_code` /
|
|
85
|
+
`trace_http_chain`(+ alias `find_http_route`)仍有 dispatcher arm,raw JSON-RPC / MCP
|
|
86
|
+
SDK / 既有脚本不破;但它们不在 `tools/list`,Claude Code 的 ToolSearch 不为其加载
|
|
87
|
+
schema —— 实操中一律走新 flag。CLI 子命令保持原样:
|
|
80
88
|
|
|
81
89
|
| 意图 | CLI(Bash 工作流) | 等价 MCP 新形式 |
|
|
82
90
|
|------|--------------------|------------------|
|
|
@@ -121,7 +129,7 @@ code-graph-mcp overview src/mcp/ # 模块总览
|
|
|
121
129
|
code-graph-mcp callgraph SYMBOL # 调用图
|
|
122
130
|
code-graph-mcp impact SYMBOL # 影响面(--change-type ∈ signature|behavior|remove,默认 behavior)
|
|
123
131
|
code-graph-mcp show SYMBOL # 节点详情
|
|
124
|
-
code-graph-mcp refs SYMBOL --relation calls # --relation ∈ calls|imports|inherits|implements|references|all
|
|
132
|
+
code-graph-mcp refs SYMBOL --relation calls # --relation ∈ calls|imports|inherits|implements|references|exports|routes_to|all
|
|
125
133
|
code-graph-mcp refs SYMBOL --min-confidence extracted # ∈ extracted|inferred|ambiguous;extracted=只看精确边(callgraph/impact/trace 同款)
|
|
126
134
|
code-graph-mcp centrality # 架构咽喉(betweenness 桥节点;补 map 的 caller_count)
|
|
127
135
|
code-graph-mcp cycles # 循环导入依赖(文件级 import 环 / SCC)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.118.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": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "cargo build --release --no-default-features && node scripts/copy-binary.js",
|
|
32
|
-
"prepare": "
|
|
32
|
+
"prepare": "node scripts/setup-git-hooks.js"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=16"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@sdsrs/code-graph-linux-x64": "0.
|
|
39
|
-
"@sdsrs/code-graph-linux-arm64": "0.
|
|
40
|
-
"@sdsrs/code-graph-darwin-x64": "0.
|
|
41
|
-
"@sdsrs/code-graph-darwin-arm64": "0.
|
|
42
|
-
"@sdsrs/code-graph-win32-x64": "0.
|
|
38
|
+
"@sdsrs/code-graph-linux-x64": "0.118.0",
|
|
39
|
+
"@sdsrs/code-graph-linux-arm64": "0.118.0",
|
|
40
|
+
"@sdsrs/code-graph-darwin-x64": "0.118.0",
|
|
41
|
+
"@sdsrs/code-graph-darwin-arm64": "0.118.0",
|
|
42
|
+
"@sdsrs/code-graph-win32-x64": "0.118.0"
|
|
43
43
|
}
|
|
44
44
|
}
|