DeepSeek Harness 插件

dsh-plugin-undo

Conversation undo for DeepSeek Harness: /undo <n> rewinds the model-visible surface and the Web UI collapses the undone turns.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
wang-xudong/dsh-plugin-undo
最近更新
2026年8月16日
分类
界面增强
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/wang-xudong/dsh-plugin-undo
插件名:dsh-plugin-undo
作者:wang-xudong

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-plugin-undo

Conversation undo for DeepSeek Harness: undo the last n turns within the current session — no new session, no project file changes.

Why this plugin

Most conversation-rewind plugins use sessions.fork to copy a history prefix into a new session (the original session is kept or archived). This plugin undoes in place on the current session's surface, so:

  • No fork, no new session — the session id stays the same
  • No duplicate “original + new” sessions in the sidebar
  • You keep chatting in the same session, and the model context is exactly the retained history

Features

  • /undo or /undo 1 — undo the last completed turn
  • /undo 3 — undo the last 3 completed turns
  • /undo all — undo every turn currently visible to the model

After undo:

  • The model-visible history is replaced by the retained turns; undone turns leave the model context
  • The raw session log stays append-only and is never rewritten
  • The Web UI collapses the undone turns into a compact header
  • The current session continues; no fork, no new session

Effect

Undone turns collapse in the chat view as:

↩ 第 N 轮已撤销 · 点击展开

Click the header to expand or collapse that turn in place. The /undo command card itself is hidden; the folded headers are the only visible undo feedback.

How it works

1. The host derives the currently model-visible turns from turn/start / turn/end 2. It takes the last n turns and appends surfaceOp: { op: 'replace', start, end } over their surface range 3. The checkpoint is an empty assistant message outside any turn boundary; message derivation skips empty assistant content, so the model sees only the retained history — no undo marker, no turn numbers 4. The client half reads the successful /undo command nodes and folds the undone turns with DOM/CSS

Install

dsh plugin --profile <profile> add file:/path/to/dsh-plugin-undo

Restart the profile:

dsh --profile <profile>

No additional configuration is required.

Usage

Type in the session input:

/undo
/undo 1
/undo 3
/undo all

The command requires the session to be idle. Stop the running turn first if the UI reports it is busy.

Build & pack

Published entry points live in lib/; source lives in src/. Build and create the distributable tarball:

npm run build
npm pack

This produces dsh-plugin-undo-<version>.tgz, which can also be installed directly:

dsh plugin --profile <profile> add file:/path/to/dsh-plugin-undo-<version>.tgz

Project layout

dsh-plugin-undo/
├── README.md
├── README_zh.md
├── cordis.patch.yml
├── package.json
├── scripts/
│   └── build.mjs
├── src/          # source
│   ├── index.js  # host: /undo command and surface replacement
│   └── client.js # web: folds undone turns, hides the command card
└── lib/          # build output (generated by npm run build)

License

[MIT](./LICENSE)

Limitations

  • Only consecutive trailing turns can be undone; picking an arbitrary message in the middle is not supported
  • Only the model-visible conversation history is rewound; project files are never touched
  • The session must be idle when /undo runs