dshbase

插件目录 / Developer / dsh-plugin-undo

dsh-plugin-undo

未验证 wang-xudong

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
语言
2026-08-16最近推送
跨平台平台

功能简介

DSH 会话撤回插件:在当前会话内原地撤销最后 n 轮对话,不 fork、不新建会话 | Undo the last n turns in-place in the current DSH session

我们的评价
未验证 — 尚未实测

DSH 会话撤回插件:在当前会话内原地撤销最后 n 轮对话,不 fork、不新建会话 | Undo the last n turns in-place in the current DSH session 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

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

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

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-undo」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:wang-xudong/dsh-plugin-undo

Headless(CLI)profile:

dsh plugin --profile headless add github:wang-xudong/dsh-plugin-undo

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →