DeepSeek Harness plugin

dsh-file-edit

Workspace file browser with agent-change review (accept/reject + undo), full user editing (undo/redo, save, auto-save), diff view and rendered markdown (static host+client plugin)

Jump to install

Source facts

Repository
justarook1e/dsh-file-edit
Latest update
Aug 21, 2026
Category
Workflow & Automation
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/justarook1e/dsh-file-edit
Plugin: dsh-file-edit
Author: justarook1e

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-file-edit

> 本项目全部代码由 DeepSeek-V4-Pro 与 DeepSeek-V4-Flash 生成。

> ⚠️ 测试版声明:本插件目前处于测试阶段(含实验性的文件编辑、撤销/重做与自动保存功能),可能存在未知缺陷。请谨慎使用,重要文件与重要会话数据请提前备份。

> 适配 DSH 版本:本插件在 DSH(deepseek-harness)0.1.1-rc.2 上开发与实测;其他版本未验证。

DSH WebUI 工作区文件插件,核心功能有两块:

1. 工作区文件浏览与编辑:文件树浏览、多标签打开、语法高亮、Markdown 渲染,并可在浏览器里直接编辑文件内容; 2. Diff 视图:对发生变化的文件展示行级 diff,可逐块或整文件接受/拒绝,拒绝后可撤销。

功能

  • 工作区侧边栏(替换原生浏览器):项目文件夹两层展开——会话历史(点开会话 / 新建会话;按最近活动时间倒序排列、每行右侧显示「2 min / 1 hr / 1 day」式相对时间标签;最多同时显示 5 个会话,其余经「展开其余 N 个会话 / 收起」一行展开与收起,与原生侧边栏同款控制;悬浮会话行时右侧时间标签渐变为「⋮」三点菜单——删除(不可恢复,二次确认)与置顶/取消置顶,置顶的会话固定在列表最上方、多个置顶按最后活动时间排序并持久化;「会话历史」栏头悬浮出现管理按钮,进入管理后会话左侧出现勾选框,可勾选后批量删除(删除前确认,未勾选时勾选框会橙黄警示闪烁两下),取消即恢复)与项目文件树(双击/单击打开、手动 ⟳ 刷新、文件集合变化自动刷新;文件夹在上、文件在下,各自按字母排序)。
  • Git 版本控制着色(VCS Annotations):项目文件树基于 Git 状态显示彩色字母徽标——M 已修改(黄)/ U 未跟踪(绿)/ A 已新增(绿)/ D 已删除(红)/ R 已重命名(蓝),文件夹聚合显示其内部最强的状态;被 .gitignore 排除的文件与文件夹显示为灰色,且不参与 8000 条目扫描预算(仍照常进入 DIFF 审阅)。徽标即时刷新:agent 改文件、插件拒绝/撤销拒绝、本地保存后立即重查;agent 执行 git add/commit/checkout/reset/... 等命令也即时刷新;外部终端/编辑器造成的变更(含外部 git commit)在「项目文件」展开期间每 20 秒自动重查一次(展开区块时也会立即重查),故徽标最多落后 20 秒。
  • 顶栏「文件」标签:与「对话/轨迹」并排;内容区是浏览器式标签条(切换 / ✕ 关闭 / ✕ 全部 / 拖拽排序 / 未保存编辑的白色圆点)。
  • 修改文件列表(输入框上方):会话中经 agent 工具通道(write/edit/shell/pwsh)产生的修改/新增/删除,带 +/− 统计、逐文件接受/拒绝、全部接受/拒绝、撤销上次拒绝。
  • 内联 Diff:红/绿行级 diff、24 语言语法高亮、块级/文件级接受与拒绝、跳转控件、大文件只读预览、二进制还原。
  • Sticky Scroll(粘性滚动):代码视图滚动时,当前作用域的定义行(类/函数/结构体/接口/标题等,覆盖全部 24 种语法高亮语言)固定在头部,显示嵌套作用域链(如 类 › 方法);点击链上任意一级即跳转定位到该定义行。
  • 基线制审阅:接受 = 当前内容成为新基线;拒绝 = 把基线写回磁盘(新增文件拒绝 = 删除文件);拒绝可撤销(单层)。
  • 完整的文件编辑:文件视图内直接输入/删除、Enter 换行(行首 Backspace / 行尾 Delete 合并行)、Ctrl+C/V 复制粘贴(跨行复制/多行粘贴)、Tab / Shift+Tab 缩进与反缩进、↑↓ 跨行移动插入点、Esc 还原当前行。
  • 独立撤销/重做:Ctrl+Z / Ctrl+Y / Ctrl+Shift+Z 使用插件自己的撤销栈(与网页其他区域完全隔离),只撤销用户的编辑、绝不撤销 AI 的 DIFF;撤销后新编辑会按 Word 惯例抛弃重做分支;AI 修改/删除文件、拒绝/撤销拒绝还原文件时自动重置该文件的编辑记录。
  • 编辑记录持久化:按(工作区, 文件路径)存于浏览器 localStorage——关闭并重开标签、切换 SESSION、重启 DSH 服务后都能继续撤销/重做。
  • 保存时点:Ctrl+S 主动保存;切换会话 / 关闭文件标签时弹窗确认(保存 / 不保存 / 取消);AI 编辑文件后自动保存(用户编辑与 AI 修改冲突的部分保留 AI 版本并提示);保存后标签上的白点消失。
  • 文件内编辑语义:用户编辑折入基线、不打扰 agent 的待审 hunks(hunk 区域内的用户编辑仍计入该 hunk);空文件可直接输入首行。
  • Markdown 渲染视图.md/.markdown 无待审修改时直接渲染(GFM 表格、围栏代码高亮、无行数上限)。
  • 即时更新:agent 改/增/删文件后约 1.5s 内主动出现在界面(SSE/长轮询唤醒),无需手动刷新。
  • 精准 DIFF 检查(v1.18):agent 使用 write/edit(带明确文件路径)或可解析出文件路径的 shell/pwsh 命令(如 Set-Content -Path ...Remove-Item ...git checkout -- ...)时,只对被操作的文件做检查与归属,不再每次触发都全量扫描工作区;无法从命令文本定位目标文件(通配符、变量、目录级操作、git reset --hard 等)时回退为全量扫描。全量扫描仅保留在首扫、无法定位文件时的回退、以及每 20 秒的兜底轮询三种情况。
  • 大规模审阅性能(v1.18):状态保存改为防抖合并(连续接受/拒绝共享一次落盘,响应先于序列化返回)、已审阅文件不再重复持久化 cur 内容(状态文件体积约减半)、修改列表统计按文件版本缓存——文件数量很大时,单文件接受/全部接受不再卡顿。

一条命令安装(推荐)

需要本机已装 DSH(~/.dsh/profiles/web 存在)且能访问 GitHub。PowerShell 中执行:

irm https://raw.githubusercontent.com/justarook1e/dsh-file-edit/main/install.ps1 | iex

完成后:重启 DSH(加载宿主插件与挂载项),然后 Ctrl+F5 刷新页面(加载客户端 bundle)。

> 备选(clone 方式,凭据走 Git Credential Manager): > git clone https://github.com/justarook1e/dsh-file-edit.git "$env:TEMP\dsh-file-edit"; & "$env:TEMP\dsh-file-edit\install.ps1"

手动安装

1. 把本仓库的 package.jsonhost/client/ 复制到 ~/.dsh/profiles/web/node_modules/dsh-file-edit/; 2. 在 ~/.dsh/profiles/web/cordis.patch.yml 末尾追加:

``yaml - insert: - id: dsh-file-edit name: dsh-file-edit ``

3. 重启 DSH + Ctrl+F5 刷新页面。

install.ps1 做的正是这两步(幂等,可重复执行;-Uninstall 反向移除)。

更新

再次运行安装脚本即可(幂等,覆盖已安装的包):

irm https://raw.githubusercontent.com/justarook1e/dsh-file-edit/main/install.ps1 | iex

或(clone 方式):cd "$env:TEMP\dsh-file-edit"; git pull; & .\install.ps1

卸载

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/justarook1e/dsh-file-edit/main/install.ps1))) -Uninstall

或(clone 方式):& "$env:TEMP\dsh-file-edit\install.ps1" -Uninstall

或手动删除 node_modules/dsh-file-edit/ 与 patch 里的 insert 块。重启后生效。

仓库结构

dsh-file-edit/
├── package.json          # dsh.client: {platform:'web'} + exports["./client"]
├── host/index.mjs        # 宿主插件:扫描/基线/diff/接受拒绝/RPC(POST /dsh-file-edit/api)
├── client/dist/client.js # 浏览器 bundle(__ModuleLoader__.load + factory)
└── install.ps1           # 一键安装/卸载脚本

运行期数据

  • 每会话审阅状态(基线、待决定项、撤销记录)存在 ~/.dsh/dsh-file-edit-state/,由插件自动创建与维护;重启后自动恢复。
  • 用户编辑历史(撤销/重做栈)存在浏览器 localStorage(key 前缀 dsh-fe-edit-v1:),按(工作区根, 相对路径)组织,与 DSH 服务端状态相互独立。
  • 从旧名 dsh-files 升级时,宿主首次启动会把旧的 ~/.dsh/dsh-files-state/ 自动迁移过来,待审状态不丢。

已知限制

  • 替换了原生 WorkspaceBrowser:没有搜索、分组/排序菜单、重命名/删除/归档对话框(保留了添加工作区、打开/新建会话)。
  • 跳过目录:.git node_modules .venv venv __pycache__ .next .dsh .idea .vscode .cache .turbo .pytest_cache .mypy_cache .ruff_cache .eslintcache .DS_Store;树上限 8000 条目 / 16 层。.gitignore 排除的文件/目录(git ls-files --others --ignored --exclude-standard 判定)不占用 8000 条目预算,但仍照常进入扫描与 DIFF 审阅(修改/新增/删除照常出现在修改列表),文件树中灰显、可照常展开浏览;! 否定规则由 git 自身语义保证;非 git 工作区行为不变。注意:工作区存在大量被忽略文件时(如内嵌 Python 运行时),扫描覆盖全部条目,状态文件与树负载会相应变大。
  • 大文件不做行级 diff:>512KB 或 >8000 行标为 large(≤512KB 的文本可只读预览前 4000 行);二进制 ≤4MB 可拒绝还原。
  • shell/pwsh 命令不透明,执行期间的变更会保守地全部归入审阅(无法区分同窗口内的手动操作)。
  • 基线随插件重启重建(待审状态本身持久化)。

许可证

本项目以 MIT License 发布(见 [LICENSE](LICENSE))。

客户端 bundle(client/dist/client.js)内嵌了 markdown-it v15.0.0 的浏览器 UMD 构建,其中包含 linkify-it、mdurl、uc.micro。这些依赖同样以 MIT 发布,其版权声明与完整许可证文本见 [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md)。