dsh-worktree

DSH PLUGIN开发与运行时

仓库 zhang-guo-wen/dsh-worktree

开发与运行时 L4 · 沙盒安装通过 安全审查:低风险 可信度:银 可安装插件
安装这个插件

为 DeepSeek Harness 提供 Git worktree 隔离:勾选即创建独立 checkout、注册为新工作区并在其中开启会话,让文件与沙箱授权彼此独立。

一句话选型结论

按资料字段整理

dsh-worktree 是开发与运行时类的 DSH 可安装插件,验证等级 L4 · 沙盒安装通过,安全审查为低风险,列出 5 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类开发与运行时 收录类型可安装插件 验证等级L4 · 沙盒安装通过 安全审查低风险
验证等级 L4 L4 · 沙盒安装通过
GitHub 星标 0 复刻 0 · 未关闭 issue 未标注
最近更新 2026-10-09 创建于 2026-09-23
README 13.9 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add @guowenzhang/dsh-worktree
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.1.7-rc.1;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.1.7-rc.1版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-worktree:为 DeepSeek Harness 提供 Git worktree 隔离工作区

  • 一键创建独立 worktree 并开会话
  • 自动注册为独立工作区
  • 提供 worktree 创建/列举/删除工具
  • 界面分支下拉与 worktree 勾选控件
  • 失败自动清理,不留残留记录

适用场景

GitHub 集成文件读写

上游标签

cordisdeepseek-harnessdshdsh-plugin

验证等级与安全审查

L4 · 沙盒安装通过
自动化流程结论,不是人工审核
验证等级L4 · 沙盒安装通过安装命令在隔离沙盒内真实执行成功,无依赖错误
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度银综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
  • L4.4_RESOLVED_ARTIFACT 安装版本已解析 方式:沙盒安装执行
L5 · 运行已测 ✕ 未通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 boot failed
  • L5.3_HTTP_SERVED HTTP 服务响应
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L4:在沙盒里真实装过,依赖能装上,不是纸面声明。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.1.7-rc.1),按版本装不容易报错。
  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在开发与运行时场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-worktree当前 L4 · 沙盒安装通过 低风险 0 0.1.7-rc.1 有
deepseek-harness L3 · 安装规范通过 低风险 24.6 万 未标注 无
rea L4 · 沙盒安装通过 低风险 2.6 万 0.1.1-rc.2 有
dsh-TUI L4 · 沙盒安装通过 中风险 4,292 0.1.7-rc.2 等 5 个 有
mirage L3 · 安装规范通过 低风险 3,681 未标注 无
dashi-taskboard L4 · 沙盒安装通过 低风险 3,311 0.1.1-rc.2 有

仓库档案

开发与运行时
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方zhang-guo-wen仓库 dsh-worktree · 默认分支 未标注
分类开发与运行时dev
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言TypeScript仓库主语言
许可证Apache-2.0商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 未标注收录时的数值,非实时
创建 / 更新2026-09-23 · 2026-10-09最后推送 未标注
本站收录2026-09-23首次进入本站目录的时间

README 全文

13.9 KB
作者原文,中文版优先;只做安全转义,不改内容

@guowenzhang/dsh-worktree

English | 中文

Why this plugin

Our project spans multiple repositories and needs parallel development. Git worktrees provide isolated workspaces so file changes from different tasks do not interfere with each other.

This plugin lets you tick worktree on the DeepSeek Harness (DSH) New Session screen to create an isolated workspace and start a session inside it. It can also set up submodules and nested repositories alongside the parent checkout.

In the plugin list, display names and descriptions follow the Harness language setting in English or Chinese (English is the default fallback); English names use the package name without its npm scope, Chinese names describe the purpose, and installation still uses the unchanged real package name.

Screenshots

Select a base branch and tick worktree to create a workspace and open the new session. Unsent text, references, and attachments move with it without being submitted; a failed creation or navigation preserves the original draft.

The settings page carries three cards: Git accounts on top to connect GitHub / GitLab / Gitee, scan this machine's existing authorizations, and jump to the Git accounts page for projects; Worktree settings in the middle for whether new sessions start in a worktree, child repositories, scan depth, and storage location; and Automatic backup at the bottom for the protection switches and the change-history page. Valid changes save automatically and take effect immediately; no Save or Reset to default button is needed.

Protection before a change

On by default. The first time the AI is about to change a file that already exists, that file's current content is copied out of the workspace — so a bad edit or a deletion can still be recovered.

The Automatic backup card on the settings page has three switch rows: Session file protection (on by default), Block delete commands (on by default), and Show the change history sidebar (on by default). Changes take effect immediately, with no restart.

Copies live in ~/.agents/file-guard// and mirror the workspace layout, so recovery is copying the file back: no tool and no index needed. Files outside the working directory (another folder, another drive) go under external/ with their own path preserved. The copy is byte-level, so format does not matter: .docx, .pptx, and .xlsx are treated exactly like .txt.

Two things trigger a copy:

  • Automatic: only write and edit copy their target before the write, at about 1 ms per file. Read-only tools such as read and read_image do not create backups.
  • Declared by the model: before changing files whose targets no argument names, the AI is asked to call the worktree_backup tool with those paths. It has no scope limit — paths outside the working directory and on other drives are accepted. The result names the copy's absolute path, so restoring a file never requires searching for it.

Destructive shell commands are refused once. A bash / pwsh command that looks like it deletes files (rm, del, rd, Remove-Item, and so on) is denied, and the model is told to declare its targets through worktree_backup before retrying — a deletion cannot be recovered after it runs. Quoted spans do not count, so echo "rm -rf /" is not refused. The switch can be turned off in settings.

Rules worth knowing:

  • One copy per file. A later change in the same session does not replace it, because the version worth keeping is the one from before the first change.
  • Only files that already exist. A file the AI creates has no prior state. It is copied when a later session changes it — by then it exists.
  • One directory per session, deleted when the session is archived. The archive's own durable write is the trigger, so the copies go as soon as it lands — a plain archive and a stop-and-archive behave the same. Failures log the session, directory, and reason and retry on later archive-related events; cancelling tools cannot recreate an archived session's backups. Only an archive that happens while the host runs is cleaned; earlier ones are never deleted retroactively.
  • No size cap. One full set of copies is roughly the size of the workspace; measured on one machine, 243,529 files came to 12.72 GB.
  • Writes outside the working directory are not automatic, so they rely on the AI declaring them through worktree_backup. A change the AI never declares is not copied — which is why destructive commands are refused until it declares them.

For complete history, or recovery across machines and time, use Git commits. This feature exists for "the AI just broke this and I want the previous version back".

Change history in the sidebar

On by default. The right sidebar offers a Change history page — open it from the sidebar's own Start page, and use the page-refresh shortcut inside it to read the list again. It lists the files this session and its sub-sessions changed or deleted, one flat row each and no directory tree, with only the path and a Restore button, without state badges. Deleted paths are struck through; a successful restore removes the strike. A row a sub-session took names that sub-session, so it cannot be confused with this session's file of the same path.

  • Modified means the file's content no longer matches its copy; Deleted means the file is gone. A copy whose file is still byte-identical is left out, because there is nothing to restore.
  • Restore writes that one copy back over its file, creating the directories again if the file had been deleted. The copy itself is kept, so the same row can put the file back after a later change.
  • Compare — click a row's path to open a two-column view: the copy from before this session first changed the file on the left, the current file on the right, aligned line by line. Changed lines are tinted and sit opposite each other; a collapsed band stands for a run of unchanged lines. Each side scrolls sideways on its own because the two may have different line lengths, while vertical scrolling moves both together, and the view opens on the first change.
  • The comparison compares the two files on disk — no Git involved, so it works the same whether or not Git is installed. Its left side is the state before this session's first change, so it shows everything changed since then, including edits another session made to a shared working directory.
  • A binary file (.docx, .xlsx, an image), a side over 2 MiB, or a path that is no longer a regular file is reported with its sizes instead of a line comparison; Restore stays available. A very large text file shows the beginning of the comparison and says it is truncated.
  • Each row reports its own outcome — restoring, restored, or the Host's reason for a refusal. A restored row disappears on the next read, because the file then matches its copy.
  • The list covers this session and the sub-sessions it delegated to: a sub-session's rows name it, and its restore uses that sub-session's own working directory. A session that is no longer live still reads — the directory comes from its durable record — so opening a history session or a finished sub-session does not fail with "could not read the change history"; only a session the Host has no record of while it still holds copies is refused. Copies live and die with the session that took them.
  • The Show the change history sidebar switch turns the page itself on or off. Off, it is not registered at all — no tab type and no entry on the sidebar's Start page — so the sidebar keeps only the pages you chose. A tab opened before the switch was turned off keeps its "nothing here can view this" notice until it is closed.

Git accounts and projects

The left sidebar gains a Git accounts page that puts this machine's Git identity in one place: sign in to GitHub, GitLab (including self-hosted addresses such as gitlab.arcuchi.com), and Gitee; set the global user.name and user.email used for commits; and browse your own projects.

  • Sign-in method: in Add account, pick the platform, confirm the server address, then choose an access token or an SSH key (no OAuth app registration); a separate Test connection button checks the credential without saving it. The Host verifies the credential against the platform and only then stores it — in the DSH credential store ($DSH_HOME/.credentials.yaml, readable only by the current user) — and a token is never returned to the page or written to logs. GitHub tokens need permission to list repositories (classic repo; fine-grained Metadata/Contents read), GitLab needs read_api (or api), and Gitee needs projects and user_info.
  • SSH-key sign-in: pick a private key from this machine's ~/.ssh (or type another path); the Host runs one non-interactive ssh -T so the platform can name the account that owns the key. Only the key's path is stored — its contents are never read or uploaded, host keys are recorded in a scratch file, and your existing known_hosts is left untouched. A connection test has a five-second total budget; GitHub and GitLab are retried over port 443 (ssh.github.com / altssh.gitlab.com) when port 22 fails. If the network blocks SSH entirely, the account is still saved as unverified (the key's file name stands in for the login; adding the same key again on a working network upgrades it), and Git fetch/push works once the network allows it. An encrypted key must already be loaded into ssh-agent. An SSH account cannot list projects — that needs an access-token account for the same host.
  • Scan this machine's existing authorizations: one click reads git: credentials from Windows Credential Manager, ~/.git-credentials, gh auth token, and environment variables such as GITEE_TOKEN, and also checks ~/.ssh/config for keys explicitly paired with a known platform. Every candidate must verify against its platform before it is added automatically; an existing account (same platform, server, login, and method) is skipped or refreshed. A scan ends with a single normal notification naming the added accounts — no result card is rendered. SSH keys that are not paired with a host are still reported as a note and can be picked manually in Add account.
  • Git identity: reads and writes the global Git configuration, so the commit name and email apply to every repository. An empty field clears that key (git config --global --unset). When Git is missing or the global configuration cannot be read, the card explains why and disables the inputs.
  • My projects: select an account to list its projects by recent activity, search, page, and see visibility, default branch, and update time per row, with Copy HTTPS clone URL and Open in browser. This version is read-only: it neither clones nor creates worktrees; choosing an SSH account explains why it cannot list projects. Each account is its own small card, so connected accounts stay visually distinct.

> For a self-hosted GitLab with a self-signed certificate, the Host's Node runtime must trust that certificate; otherwise verification and project listing fail with a network error. Scanning reads credentials in the current user's context only — it never shows an OS authorization dialog or starts an interactive login.

The connections are the first card on the Settings → File backup page, so an account can be added, scanned, or removed without opening the Git accounts panel first; the card's "View projects on the Git accounts page" control switches the main panel straight to the project list.

Install

npx @deepseek-ai/dsh plugin --profile web add @guowenzhang/dsh-worktree

Restart DSH after installation. Git must be installed and available on the host's PATH.

Notes

  • Upgrading to 2.x: model-facing Worktree tools have been removed. Create worktrees through the New Session control; archive notifications may clean up clean worktrees. Integrations that call the removed model tools must be updated.

  • Multi-repository support is off by default: enable “Create child repositories” in settings and adjust the scan depth to your directory layout (default: 1 level). Submodules use the commit recorded by the parent repository in detached HEAD; independent nested repositories get new branches.

  • Uncommitted changes are not copied: the worktree starts from a commit on the selected branch, with an automatically generated branch name.
  • Storage defaults to inside the workspace: /.agents/worktree/. Add .agents/worktree/ to your Git ignore rules, or choose a location beside the repository or in the user home directory.
  • New sessions can start in a worktree automatically: with “Start new sessions in a worktree” on, the first blank session in a repository creates its own checkout and moves into it, without asking. Off by default.
  • Archiving may clean up the worktree: the archive's durable write triggers a removal attempt right away — a plain archive and a stop-and-archive alike. Uncommitted changes prevent removal, and branches are kept. Stopping the host does not clean up worktrees; manually removing a workspace registration does not delete files either.
  • Check that no other session is using the directory before cleanup: worktree removal does not check for running sessions.

See AGENTS.md for other installation methods, configuration, and development details.

License

Apache-2.0; see also NOTICE.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-worktree 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add @guowenzhang/dsh-worktree` 即可。

dsh-worktree 的验证等级是什么意思?

L4 · 沙盒安装通过。安装命令在隔离沙盒内真实执行成功,无依赖错误

dsh-worktree 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-worktree 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-worktree 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.1.7-rc.1。

dsh-worktree 用的是什么许可证?

上游标注为 Apache-2.0。商用或二次分发前请到仓库确认许可证原文。

dsh-worktree 有哪些功能?

一键创建独立 worktree 并开会话、自动注册为独立工作区、提供 worktree 创建/列举/删除工具、界面分支下拉与 worktree 勾选控件、失败自动清理,不留残留记录。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
开发与运行时
按星标排序,可作替代方案

rea

rea

L4 · 沙盒安装通过 2.6 万 星

dsh-TUI

dsh-TUI

Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。

L4 · 沙盒安装通过 4,292 星

mirage

mirage

把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Sla

L3 · 安装规范通过 3,681 星

dashi-taskboard

dashi-taskboard

把当前已安装并运行中的 Codex Taskboard 嵌入 DeepSeek Harness 侧边栏,并通过 Launcher 运行时描述

L4 · 沙盒安装通过 3,311 星

zhang-guo-wen 的其它插件

6 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。