DDDMUC/dsh-delete-turn
Per-message delete for DeepSeek Harness: remove a user message, one reply step, or a whole assistant reply from the derived model context via the official surface-replace contract, and hide it from the visible transcript without rewriting the append-only log.
Project Overview项目介绍
dsh-delete-turn is a DeepSeek Harness (DSH) native plugin that adds per-message deletion on top of the host's append-only session log, since the only official tool for shedding old context is whole-range /compact. It is installed via dsh plugin --profile web add dsh-delete-turn (or a local link: path for development), and after install or update the user must fully restart the DSH process and hard-refresh the browser; loading can be verified with dsh --profile web --dump-config, which prints a # == dsh-delete-turn section. The plugin attaches delete actions to user rows, reasoning and tool cards, injected-context lines, failed turns, and to the official conversation.chat.assistant-actions slot on assistant replies.
In practice the user hovers a message row, clicks a trash icon at the row's tail (the assistant reply's button sits next to copy/fork in the official action strip), confirms a dialog that spells out exactly what will be hidden, and then watches the target row collapse while the model context is rebuilt on the next request without that content. The original session log bytes are never overwritten: the host half appends an official surfaceOp: { op: 'replace', startSeq, endSeq } event with sourceEventSeqs referencing the shadowed seqs, and the browser half then folds those seqs away using data-chat-flow-* anchors and the standard useChat snapshot, so the hidden ledger survives reloads, restarts, and tab switches because it is replayed from the log itself on every session open.
The host half carries zero runtime dependencies and resolves every service through the cordis context, falling back to a live session snapshot when sessionQuery is absent. Verified against DSH 0.1.6-alpha.2 and 0.1.7-alpha.2 on the web profile under both WebKit and Chromium, with both session formats v3 and v4 supported and the v4 migration to plugin:dsh-delete-turn source tags recognised. Limitations are explicit: there is no un-delete, the system-prompt head is protected, running turns refuse the action, and the assistant action strip deletes an entire reply attempt, so single steps must be removed via the reasoning or tool card. Released under MIT.
dsh-delete-turn 是面向 DeepSeek Harness(DSH)的官方生态原生插件,专注于在客户端提供「消息级删除」能力。它通过 dsh plugin --profile web add dsh-delete-turn 命令安装到宿主,安装或更新后必须完全重启 DSH 进程,浏览器端需要硬刷新页面,并通过 dsh --profile web --dump-config 输出中的 # == dsh-delete-turn 段落验证加载。插件在用户消息行、思考卡、工具卡、注入上下文行、失败回合行通过 DOM 增强补上删除入口,并在官方助手回复的 conversation.chat.assistant-actions 槽位挂载按钮。
典型工作流是:悬停任意消息行点击尾部垃圾桶按钮,弹出确认弹窗并显示影响范围,点击「删除」后目标行折叠退场,下一轮请求重建模型上下文时该内容不再出现。它适用于需要从 append-only 会话日志中精确剔除说错话、发错提示词或模型答偏内容的用户,同时保证原始会话字节不被改写。助手操作条删除整条回复,思考卡 / 工具卡只删对应步骤,二者通过 data-chat-flow-* 锚点和官方 useChat 快照定位。
宿主半区零运行时依赖,全部服务经 cordis ctx 解析,会话格式 v3 / v4 兼容,已实测 DSH 0.1.6-alpha.2 与 0.1.7-alpha.2。被遮蔽内容不可撤销,过程行不单独提供入口,系统提示词头受保护。许可证为 MIT。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-delete-turn(DDDMUC/dsh-delete-turn)
仓库:https://github.com/DDDMUC/dsh-delete-turn
本站详情页:https://www.yhbd.top/plugins/dddmuc-dsh-delete-turn/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-30 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-delete-turn
把 DDDMUC/dsh-delete-turn 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-delete-turn
DeepSeek Harness 消息删除插件 —— 把一条消息从模型上下文里真正拿掉,同时从当前转录里隐藏它。 助手回复挂在官方 conversation.chat.assistant-actions 槽位;用户消息、注入上下文与工具调用卡由 DOM 增强补上入口。确认后经官方 surface-replace 契约追加替换事件:模型后续看到的历史里不再有这条内容,而原始会话日志一个字节都不改写。
中文
▲ 悬停消息行时出现的删除按钮(复制按钮右侧)
为什么需要它
DSH 的会话日志是 append-only 的:说错话、发错提示词、模型答偏了,这些内容会一直留在模型上下文里,污染后续每一轮。官方只提供了「压缩」(/compact)这种整段摘要机制,没有单条消息级别的删除。
这个插件把删除放回消息本身:
- 用户消息 → 删这一条;
- 思考卡 / 工具调用卡 → 删这一步(该步的
assistant/message与它请求的tool/result一起走,工具配对永不悬空); - 助手回复(官方操作条)→ 删这条回复连同它的思考、工具调用与注入上下文(你的提问保留);
- 注入上下文行、失败回合行 → 同样有删除入口。
特性
- 模型上下文级删除 —— 追加一条官方
surfaceOp: { op: 'replace', startSeq, endSeq }替换事件,被遮蔽的内容不再进入deriveMessages();与宿主/compact同一套官方契约 - 转录级隐藏 —— 客户端按
data-chat-flow-*锚点与官方useChat快照定位行,删除后折叠退场;刷新、重启 DSH、换标签页后依旧隐藏 - 日志即台账 —— 隐藏依据直接从日志里的替换事件重建(替换事件的消息 source 标记为本插件),不依赖 localStorage、不需要预检,也不会和其它插件(如压缩)的替换混淆
- 原生视觉 —— 复用官方 primitives 的 Modal / Button 与主题 token,明暗主题自动适配;图标与全部文案为原创
- 中英双语 —— 弹窗、提示、错误原因随系统语言即时切换
- 安全边界 —— 只接受回环地址且 Host 为本机的请求;目标必须是当前 surface 节点、不能碰系统提示词头、回合进行中拒绝、已被删除的目标拒绝并给出机器原因码
截图
▲ 删除前确认:说明影响范围,原始日志不改写
▲ 删除后:该行从转录中消失,后续内容自然上移
安装
# npm 安装(web profile)
dsh plugin --profile web add dsh-delete-turn
# 本地工作区(开发)
dsh plugin --profile web add link:/path/to/dsh-delete-turn
安装后需要完全重启 DSH 进程(宿主侧插件树只在启动时读取)。浏览器端 bundle 由宿主按请求动态 serve,重启后硬刷新页面即可生效。核实是否加载:
dsh --profile web --dump-config # 应出现 "# == dsh-delete-turn" 段落
使用
- 悬停任意消息行,点击行尾的垃圾桶按钮;助手回复的按钮在官方操作条(复制 / 分叉旁边)。
- 确认弹窗会说明这次删除的影响范围,点「删除」。
- 目标行折叠退场;模型上下文在下一轮请求重建时不再包含它。
工作原理
UI(官方槽按钮 / DOM 增强按钮)
→ 确认弹窗
→ POST /dsh-delete-turn/delete { sessionId, mode, seq? / messageId? / turn? }
宿主:
sessionQuery.readSession() 读完整日志(live 优先)
自实现 surface fold → 当前 surface 节点 + 历史替换遮蔽集
校验(当前节点 / 区间干净 / 回合已闭合 / 不碰系统头)
session.append('user/message', 短标记占位, {
surfaceOp: { op: 'replace', startSeq, endSeq },
sourceEventSeqs: [被遮蔽的全部 seq],
})
等待官方 session/flush 持久化检查点
→ 返回 { hidden: [{ seq, mode }] }
客户端:
useChat 快照把 data-chat-flow-key 映射到节点,按 hidden 集合折叠行
GET /dsh-delete-turn/state 在每次打开会话时重建 hidden 集合
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
hellodigua/dsh-share
PhysicalAI-0/dsh-paperforge
nexu-io/open-design
EthanYoQ/Invoice-Downloader
ZSeven-W/dsh-ios
sunchaokun/PPT-Design-Skill