<div align="center">

# Rich File Review

**无需离开 DeepSeek Harness Web，即可在 better-sidebar 右侧面板中审查 Agent 刚刚修改的每个文件。**

> 🍴 **Fork 自 [dsh-file-review](https://github.com/left0ver/dsh-file-review)** —— 衷心感谢原作者 [@left0ver](https://github.com/left0ver)：本项目保留了"产出文件卡片、逐文件逐行 diff、撤销/恢复，以及基于变更型工具的干净推导（与 git 无关）"，全部来自原作者的出色设计。

![DeepSeek Harness 0.1.x](https://img.shields.io/badge/DeepSeek%20Harness-0.1.x-4f46e5)
![Web profile](https://img.shields.io/badge/profile-Web-0ea5e9)
![MIT License](https://img.shields.io/badge/license-MIT-22c55e)
![GitHub topics: dsh-plugin](https://img.shields.io/badge/dsh--plugin-dsh--plugin-00a6ed)

[English](README.md) · 简体中文

</div>

## 本 fork 的改动

`dsh-file-review` 用自己独立的一个 **review 抽屉**来展示逐行 diff——它会自己强行挤进 host 右侧的 grid 布局，从而跟 **dsh-better-sidebar** 的右侧栏撞在一起，造成**右侧两个面板叠放**。

本 fork **彻底移除独立抽屉**。点击产出文件后，改为在 **better-sidebar 右侧栏内部**打开一个 `rich-file-review:diff` 标签页（通过其公开的 `ctx.betterSidebar` 服务调用），因此右侧**始终只有一个面板**。非 git 无关的逐行 diff、`+N/-M` 行数汇总、以及撤销功能**都完整保留**——不依赖 git。

需要先安装 `dsh-better-sidebar` 插件，diff 面板才会在右侧栏内打开。

## 怎么用

<p align="center">
  <strong>💬 Chat &nbsp;→&nbsp; ✨ Generate &nbsp;→&nbsp; 📄 Click a changed file &nbsp;→&nbsp; 🔍 Review</strong>
</p>

## 功能
1. 每个回合结束时显示一张汇总卡片，列出 Agent 本次改动的所有文件，每个文件带 `+N` / `-M` 行数，并有总行数统计。
2. 点击某个文件（或"审查全部"），在 better-sidebar 右侧面板中打开逐行 diff。支持非 git 工作区（diff 直接来自变更型工具自身的 hunks，而非 `git diff`）。
3. 支持撤销 / 恢复该回合 Agent 的改动。

## 快速开始

### 0. 将 rich-file-review 添加到 pnpm 冷静期白名单
找到 `~/.dsh/profiles/web/pnpm-workspace.yaml`，加上

```yaml
minimumReleaseAgeExclude:
  - rich-file-review
```
这是因为较新版的 `pnpm` 有冷静期，默认情况下，新发布的包得过了冷静期之后才会被安装。因此要安装最新版本，需要将 `rich-file-review` 加入到名单中。

### 1. 安装所需面板（若尚未安装）

```sh
dsh plugin --profile web add dsh-better-sidebar
```

### 2. 从本 fork 安装插件

该包**尚未发布到 npm**，所以请从 GitHub fork 安装：

```sh
dsh plugin --profile web add github:richfugui001-netizen/dsh-file-review
```

> 若之前是本地路径安装也没问题——这是一个轻量包装，无原生编译步骤。

### 3. 启动 DSH Web

```sh
dsh web
```

### 4. 享受它

## 从源码安装

```sh
git clone https://github.com/richfugui001-netizen/dsh-file-review.git
cd dsh-file-review
pnpm install
pnpm run build
dsh plugin --profile web add ${PWD}
```

## 从 GitHub 仓库进行安装

```sh
dsh plugin --profile web add github:richfugui001-netizen/dsh-file-review
```

## 卸载插件

```sh
dsh plugin --profile web remove rich-file-review
```

## 许可证

[MIT](LICENSE)
