dsh-code-review-graph 0.0.0-stage → 0.1.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/LICENSE +22 -0
- package/NOTICE +12 -0
- package/README.en.md +117 -0
- package/README.md +110 -2
- package/capabilities.json +1790 -0
- package/cordis.patch.yml +3 -0
- package/dist/backend.js +215 -0
- package/dist/backend.js.map +7 -0
- package/dist/client.js +70 -0
- package/dist/client.js.map +7 -0
- package/dist/html.js +17 -0
- package/dist/html.js.map +7 -0
- package/dist/index.js +511 -0
- package/dist/index.js.map +7 -0
- package/dist/refactor.js +68 -0
- package/dist/refactor.js.map +7 -0
- package/dist/safety.js +52 -0
- package/dist/safety.js.map +7 -0
- package/dist/setup.js +78 -0
- package/dist/setup.js.map +7 -0
- package/dist/workflows.js +30 -0
- package/dist/workflows.js.map +7 -0
- package/docs/capabilities.md +103 -0
- package/docs/validation.md +113 -0
- package/engine.json +8 -0
- package/package.json +37 -4
- package/skills/build-graph/SKILL.md +26 -0
- package/skills/debug-issue/SKILL.md +23 -0
- package/skills/explore-codebase/SKILL.md +24 -0
- package/skills/refactor-safely/SKILL.md +24 -0
- package/skills/review-changes/SKILL.md +27 -0
- package/skills/review-delta/SKILL.md +25 -0
- package/skills/review-pr/SKILL.md +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tirth Kanani
|
|
4
|
+
Copyright (c) 2026 sumingwang233
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
This adapter reuses Code Review Graph 2.3.9 by Tirth Kanani:
|
|
2
|
+
https://github.com/tirth8205/code-review-graph
|
|
3
|
+
Copyright (c) 2026 Tirth Kanani. MIT licensed.
|
|
4
|
+
|
|
5
|
+
The bundled seven skill documents originate in Code Review Graph. The
|
|
6
|
+
capability snapshot and five workflow prompts mirror its MCP interface.
|
|
7
|
+
The interactive graph and its bundled D3 renderer are generated by the
|
|
8
|
+
separately installed CRG engine; upstream license notices are retained.
|
|
9
|
+
|
|
10
|
+
DeepSeek Harness is a separate MIT-licensed project:
|
|
11
|
+
https://github.com/deepseek-ai/deepseek-harness
|
|
12
|
+
This community adapter is not an official DeepSeek or CRG release.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# dsh-code-review-graph
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) · [Capability map](docs/capabilities.md) · [Validation](docs/validation.md)
|
|
4
|
+
|
|
5
|
+
Native DeepSeek Harness tools and a Web/Desktop graph sidebar, powered by
|
|
6
|
+
[Code Review Graph](https://github.com/tirth8205/code-review-graph) **2.3.9**.
|
|
7
|
+
Preserves all 30 tools, five prompt workflows and seven skills. The first release
|
|
8
|
+
target is **0.1.0**; check GitHub/npm for the actual published release status.
|
|
9
|
+
|
|
10
|
+
Supports Windows, Linux and macOS, with exact DSH baselines **0.1.5-rc.2** and
|
|
11
|
+
**0.2.0-rc.2**. Alpha compatibility is outside the contract.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
After public release:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
dsh plugin --profile web add dsh-code-review-graph@0.1.0
|
|
19
|
+
npx dsh-code-review-graph@0.1.0 prepare
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use `headless` or another ordinary profile for the command-line entrance. Desktop
|
|
23
|
+
profiles belong to the application: install through that release's native plugin
|
|
24
|
+
manager. See the [official DSH publishing guide](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.0-rc.2/docs/user/develop/basic/publish.md).
|
|
25
|
+
|
|
26
|
+
`prepare` explicitly creates an isolated Python engine under
|
|
27
|
+
`$DSH_HOME/code-review-graph/engine` (default `~/.dsh/code-review-graph/engine`),
|
|
28
|
+
preferring uv or real Python 3.10+. Windows Store aliases are rejected; an explicit
|
|
29
|
+
`--python /path/to/python` is supported. Ordinary startup never installs packages,
|
|
30
|
+
downloads embedding models or automatically enables a cloud provider. Search
|
|
31
|
+
falls back to the engine's FTS/keyword search without optional embeddings.
|
|
32
|
+
|
|
33
|
+
The default engine source is an exact public contribution-fork commit recorded
|
|
34
|
+
in [engine.json](engine.json), needed until the read-only edit-plan API ships in
|
|
35
|
+
an official upstream release. For local development:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm ci
|
|
39
|
+
npm run typecheck
|
|
40
|
+
npm run build
|
|
41
|
+
npm pack
|
|
42
|
+
dsh plugin --profile web add ./dsh-code-review-graph-0.1.0.tgz
|
|
43
|
+
node dist/setup.js prepare ../code-review-graph
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Workflows and graph
|
|
47
|
+
|
|
48
|
+
Start a session in a local Git/SVN repository. Call `crg_workflow` with `context`,
|
|
49
|
+
`review`, `refactor`, `export`, `advanced`, or `all`. Restrictions are Agent-local
|
|
50
|
+
and affect only this plugin's tools. Original tools use the
|
|
51
|
+
`mcp__code_review_graph__` prefix. `crg_prompt` loads any of the original five
|
|
52
|
+
workflows and reveals the corresponding tools; skills use `crg-<original-name>`.
|
|
53
|
+
|
|
54
|
+
First use builds the graph; subsequent file changes are indexed incrementally.
|
|
55
|
+
Active Agents in the same canonical repository share workers and watchers. The
|
|
56
|
+
last owner releases them. A cancelled or timed-out call stops that repository's
|
|
57
|
+
shared worker; another concurrent call may also be interrupted. Later calls
|
|
58
|
+
reconnect. Failures and partial parsing warnings are retained in results.
|
|
59
|
+
|
|
60
|
+
Call `crg_visualize`, open **Code graph / 代码图谱** in the right sidebar, then
|
|
61
|
+
refresh. The original renderer retains search, filters, zoom, dragging,
|
|
62
|
+
aggregation, paths and downloads. Supported options include `mode`,
|
|
63
|
+
file/symbol/changed-code/flow seeds, `path_from`/`path_to`, depth and node limits.
|
|
64
|
+
Export formats: HTML, JSON, GraphML, Cypher, Obsidian and SVG (optional engine
|
|
65
|
+
`[eval]` dependency set). Headless calls return local artifact paths. To prepare
|
|
66
|
+
optional dependencies, use the exact source from `engine.json` as the `prepare`
|
|
67
|
+
argument, changing the distribution name to `code-review-graph[eval]` for SVG or
|
|
68
|
+
`code-review-graph[embeddings]` for local vectors. Models must already be available
|
|
69
|
+
locally; daily operation keeps Hugging Face/Transformers offline.
|
|
70
|
+
|
|
71
|
+
Assets use DSH's existing workspace file reader, adapting only the two released
|
|
72
|
+
reader interfaces. Local assets are inlined into an iframe with scripts and
|
|
73
|
+
downloads enabled, without same-origin or network privilege. No fixed-port
|
|
74
|
+
server is started and no graph-database directory is exposed.
|
|
75
|
+
|
|
76
|
+
## Permissions and refactors
|
|
77
|
+
|
|
78
|
+
Model inputs cannot supply `repo_root`. Execution uses the session's canonical
|
|
79
|
+
repository, checks traversal/symlink boundaries, and only allows cross-repository
|
|
80
|
+
search over the current root plus user-configured `authorizedRepos`. Other roots
|
|
81
|
+
must first be built in their own sessions.
|
|
82
|
+
|
|
83
|
+
Non-preview `apply_refactor_tool` requests a complete read-only core edit plan,
|
|
84
|
+
checks original byte hashes and native file intents, then commits through
|
|
85
|
+
`ctx.fs.writeText` with session policy. Each file write is atomic, preserving
|
|
86
|
+
UTF-8, BOM and newlines. A failure stops subsequent writes and returns
|
|
87
|
+
`partial_failure`, committed paths and the complete `recovery_patch`. Recovery
|
|
88
|
+
must check its hashes before overwriting any later user changes.
|
|
89
|
+
|
|
90
|
+
Cloud embedding providers require explicit `embeddingProviders` authorization
|
|
91
|
+
and an `embeddingEnv` list naming the environment variables the engine may
|
|
92
|
+
receive. The default only permits `local`. Never put credentials in config files.
|
|
93
|
+
|
|
94
|
+
## Validation and removal
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npm run prepare:tests
|
|
98
|
+
npm test
|
|
99
|
+
npm run test:integration
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Set child-process `CRG_COMMAND` to a prepared real engine, and choose a supported
|
|
103
|
+
`DSH_VERSION`. Transcripts record deterministic calls in real released DSH
|
|
104
|
+
Session/AgentRegistry/ToolRuntime packages, with a real CRG backend and **no
|
|
105
|
+
model inference**. See validation records for results and limits; upstream
|
|
106
|
+
reviewers decide whether the evidence meets their contribution requirements.
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
dsh plugin --profile web remove dsh-code-review-graph
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The native manager removes only this bundle and dependency, retaining user
|
|
113
|
+
settings, other plugins, the prepared engine and repository graph data. Desktop
|
|
114
|
+
uses its native manager for removal.
|
|
115
|
+
|
|
116
|
+
MIT licensed; upstream Tirth Kanani copyright retained.
|
|
117
|
+
Platform request: [CRG #1100](https://github.com/tirth8205/code-review-graph/issues/1100).
|
package/README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-code-review-graph
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](README.en.md) · [能力对照](docs/capabilities.md) · [验证记录](docs/validation.md)
|
|
4
|
+
|
|
5
|
+
面向 DeepSeek Harness 的原生代码图谱插件。复用 [Code Review Graph](https://github.com/tirth8205/code-review-graph)
|
|
6
|
+
2.3.9 引擎,提供全部 30 个工具、5 个工作流 prompt、7 个技能,以及 Web/桌面侧栏交互图谱。
|
|
7
|
+
首版目标为 **0.1.0**;发布状态以 GitHub 和 npm 的实际公开版本为准。
|
|
8
|
+
|
|
9
|
+
支持 Windows、Linux、macOS;兼容基线固定为 DSH **0.1.5-rc.2、0.2.0-rc.2**。
|
|
10
|
+
Web 和命令行通过官方 CLI 安装,桌面版通过对应版本的原生插件管理器安装。Alpha 版本不在兼容承诺内。
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
公开发布后:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
dsh plugin --profile web add dsh-code-review-graph@0.1.0
|
|
18
|
+
npx dsh-code-review-graph@0.1.0 prepare
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
命令行入口将 `web` 替换为 `headless` 或你使用的普通 profile。
|
|
22
|
+
桌面版在插件管理器中安装 `dsh-code-review-graph@0.1.0`;桌面 profile 由应用持有,外部 CLI 不直接修改。
|
|
23
|
+
参考 [DSH 官方打包指南](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.0-rc.2/docs/user/develop/basic/publish.md)。
|
|
24
|
+
|
|
25
|
+
`prepare` 是主动触发的一次性依赖准备:优先复用 uv 或真实 Python 3.10+,在
|
|
26
|
+
`$DSH_HOME/code-review-graph/engine`(默认 `~/.dsh/code-review-graph/engine`)安装隔离引擎。
|
|
27
|
+
Windows Store 的 Python 占位程序不算可用运行时,可用 `--python /path/to/python` 明确指定。
|
|
28
|
+
正常启动和图谱调用不自动安装依赖、不下载嵌入模型、不默认使用云端服务。
|
|
29
|
+
没有本地嵌入依赖时,语义搜索使用引擎自带的 FTS/关键词降级。
|
|
30
|
+
|
|
31
|
+
源码开发安装:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm ci
|
|
35
|
+
npm run typecheck
|
|
36
|
+
npm run build
|
|
37
|
+
npm pack
|
|
38
|
+
dsh plugin --profile web add ./dsh-code-review-graph-0.1.0.tgz
|
|
39
|
+
node dist/setup.js prepare ../code-review-graph
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
首版默认 Python 依赖固定在 [engine.json](engine.json) 记录的贡献 fork 精确提交,
|
|
43
|
+
因为只读编辑计划接口尚未由上游发行。上游正式发布接口后再改为官方依赖。
|
|
44
|
+
|
|
45
|
+
## 使用
|
|
46
|
+
|
|
47
|
+
会话工作目录必须是本地 Git 或 SVN 仓库。先调用 `crg_workflow` 选择:
|
|
48
|
+
|
|
49
|
+
| 工作流 | 用途 |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `context` | 精准上下文、搜索和建图 |
|
|
52
|
+
| `review` | 变化、影响范围、调用链及审查 |
|
|
53
|
+
| `refactor` | 安全重构、死代码、大函数 |
|
|
54
|
+
| `export` | Wiki 和导出 |
|
|
55
|
+
| `advanced` | 社区、架构、跨仓库、遍历和嵌入 |
|
|
56
|
+
| `all` | 展开全部 30 个工具 |
|
|
57
|
+
|
|
58
|
+
限制只作用于当前 Agent 的本插件工具,其他插件不受影响。
|
|
59
|
+
原工具名使用 `mcp__code_review_graph__` 前缀。`crg_prompt` 加载原有五个工作流并展开对应工具;
|
|
60
|
+
七个技能注册为 `crg-<原技能名>`。
|
|
61
|
+
|
|
62
|
+
首次图谱调用自动建图,之后增量监听。相同仓库的活跃 Agent 共享后端及监听进程;
|
|
63
|
+
最后一个 Agent 释放后清理进程。取消或超时会停止该仓库的共享后端;后续调用重新建立连接,
|
|
64
|
+
因此同仓库的并发调用也可能收到中断结果。失败和解析警告保留在结果中。
|
|
65
|
+
|
|
66
|
+
调用 `crg_visualize` 后打开右侧 **Code graph / 代码图谱** 页面,并点击刷新。
|
|
67
|
+
原渲染器的搜索、过滤、缩放、拖动、聚合、调用路径和下载保持可用。
|
|
68
|
+
支持 `mode`、文件/符号/变更/执行流种子、`path_from`/`path_to` 和深度;
|
|
69
|
+
`format` 可选 `html`、`json`、`graphml`、`cypher`、`obsidian`、`svg`。
|
|
70
|
+
命令行返回可打开的本地文件路径;SVG 需要引擎的 `[eval]` 可选依赖。
|
|
71
|
+
准备可选功能时,将 `engine.json` 中的确切源作为 `prepare` 参数,SVG 将包名改为
|
|
72
|
+
`code-review-graph[eval]`,本地向量则改为 `code-review-graph[embeddings]`。
|
|
73
|
+
模型文件需预先在本地准备;日常运行保持 Hugging Face/Transformers 离线。
|
|
74
|
+
|
|
75
|
+
图谱资产通过 DSH 已有工作区文件读取接口取得,兼容两版接口差异。
|
|
76
|
+
本地资源内联到限制权限的 iframe;不启动固定端口服务器、不公开数据库目录。
|
|
77
|
+
|
|
78
|
+
## 权限和重构
|
|
79
|
+
|
|
80
|
+
模型不能指定 `repo_root`,执行器使用会话的规范化仓库路径,拒绝目录越界和逃逸符号链接。
|
|
81
|
+
`authorizedRepos` 默认为空;跨仓库查询只读取当前仓库及用户在 Host 配置中明确加入的仓库。
|
|
82
|
+
其他仓库需要先在自己的会话中建图。
|
|
83
|
+
|
|
84
|
+
`apply_refactor_tool` 的非预览操作先取得完整只读编辑计划,再通过 DSH 文件意图、会话策略和
|
|
85
|
+
`ctx.fs` 提交。写入前校验原始字节 SHA-256,拒绝过期计划。逐文件原子写入,保留 UTF-8、BOM 和换行;
|
|
86
|
+
中途失败会返回 `partial_failure`、已提交文件和完整 `recovery_patch`,不继续写入。
|
|
87
|
+
恢复前仍需检查补丁中的哈希,避免覆盖用户后续修改。
|
|
88
|
+
|
|
89
|
+
云端嵌入必须由用户在插件配置中显式加入 `embeddingProviders`,并通过 `embeddingEnv`
|
|
90
|
+
指定允许传给引擎的环境变量名称;默认只允许 `local`。不要将密钥写入配置文件。
|
|
91
|
+
|
|
92
|
+
## 验证和卸载
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
npm run prepare:tests
|
|
96
|
+
npm test
|
|
97
|
+
npm run test:integration
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
集成测试需用子进程环境 `CRG_COMMAND` 指向真实引擎;`DSH_VERSION` 选择两版之一。
|
|
101
|
+
记录真实发行版 DSH 会话的确定性工具调用,**未运行真实模型**。完整证据和测试边界见验证记录。
|
|
102
|
+
上游是否接受该证据由评审判断。
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
dsh plugin --profile web remove dsh-code-review-graph
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
卸载由 DSH 官方机制仅移除本插件依赖及 bundle,保留用户设置、其他插件、隔离引擎和仓库图谱。
|
|
109
|
+
桌面版使用原生管理器卸载。
|
|
110
|
+
|
|
111
|
+
MIT 许可,保留 Tirth Kanani 的上游版权。平台请求:[CRG #1100](https://github.com/tirth8205/code-review-graph/issues/1100)。
|