dsh-plugin-message-rewrite
v0.1.0
Published
Edit historical prompts and regenerate responses in DeepSeek Harness
Maintainers
Readme
dsh-plugin-message-rewrite
DeepSeek Harness 网页端的历史消息编辑与回复重新生成功能。
功能
- 每条普通用户消息下方显示“编辑这条消息”。点击后原消息气泡直接变成文本框,不打开额外卡片或对话框。
- 编辑后点击“发送”,继续使用原会话和原会话 ID;被编辑消息及其后的旧回复会从当前消息表面直接替换掉。
- 每条已完成的 Agent 回复底部显示“重新生成”。点击后会在原会话中丢弃这一轮及其后的旧内容,并重新发送这一轮原来的用户指令。
- 支持任意已经加载的历史距离;向上滚动并加载更早记录后,同样可以编辑。
- 图片块保留原有持久化引用,只替换消息中的文字块。
- Agent 正在运行时禁用编辑和重新生成,避免改写与正在进行的轮次冲突。
安装
发布到 npm 后,可以使用 DeepSeek Harness 的标准插件命令:
pnpm dsh plugin --profile web add dsh-plugin-message-rewrite本地开发版本使用同一套 profile/bundle 安装机制。在包含本插件目录的父目录执行:
dsh plugin --profile web add ./dsh-plugin-message-rewrite若从 DeepSeek Harness 源码 checkout 运行 CLI,请在该 checkout 根目录执行,并在命令前加 pnpm:
pnpm dsh plugin --profile web add "C:\path\to\dsh-plugin-message-rewrite"插件包通过 package.json#dsh.client 声明 Web Client bundle,并通过 package.json#dsh.bundle 与 cordis.patch.yml 声明 Loader 配置层;不需要修改 Harness 源码。
从源码构建和验证
需要 Node.js 22.19 或更高版本、pnpm 11,以及一份已经构建的 DeepSeek Harness checkout。
$env:DSH_HARNESS_ROOT="C:\path\to\deepseek-harness"
pnpm install
pnpm build
pnpm pack --dry-run行为边界
- 插件不会创建分支或归档会话。它利用 Harness 的 surface replacement 在同一 append-only 审计日志中追加替换事件;旧尾部不再进入模型上下文、聊天界面或刷新后的会话视图。
- 被替换的原始事件仍作为底层审计记录存在,但在用户和模型使用的消息表面上已经被丢弃。
- “任意历史消息”指已经加载到浏览器的普通用户消息。若更早消息尚未显示,先滚动到顶部加载历史页。
License
MIT
