@moton16/dsh-msg-edit
Message edit / regenerate for DSH Web: inline edit of assistant replies (text + reasoning), regenerate replies, and user-message edit — a Cordis host plugin serving /api/msg-edit/* plus a dsh.client UI plugin contributing to the assistant action strip.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:moton16/dsh-msg-edit说明文档
阅读完整 README ↗dsh-msg-edit
消息编辑 / 重新生成插件(DeepSeek Harness Web)。
- host 插件(Cordis node 侧):
/api/msg-edit/*4 条 HTTP RPCrewrite-message— 改写单条助手回复(正文/思考),不截断后续edit-message— 编辑用户消息,截断其后所有节点并重新生成regenerate— 重新生成某条回复(回溯到归属的真实用户消息)get-message— 读取助手回复当前文本(编辑预填)
- client 插件(
dsh.client声明式):助手消息操作条注入「编辑这条回复」「重新生成回复」,编辑弹出行内编辑器(思考+正文),保存走rewrite-message。
纯声明式 Cordis bundle:dsh.bundle.patch 指向 cordis.patch.yml,无安装脚本、无构建步骤、无源码补丁工具。
安装
方式 A:dsh plugin(推荐)
# 在 profile 目录内($DSH_HOME/profiles/
)
dsh plugin --profile web add @moton16/dsh-msg-edit
dsh 会从 npm 安装包,读到 dsh.bundle.patch 后自动把两行插件追加进 profile 的 patch 层。手动重启 dsh web 生效(本插件不代重启)。
方式 B:git 安装
dsh plugin --profile web add github:moton16/dsh-msg-edit
仓库内已提交预构建 lib/(运行时 JS),无需 prepare/postinstall;若 pnpm 提示构建授权,按提示在 profile 的 pnpm-workspace.yaml 中 allowBuilds 放行本包即可(源码可信才放行)。
方式 C:手动挂载(本地开发)
- 把
lib/放进 profile 依赖树(或pnpm link); - 在 profile 的
cordis.patch.yml追加:- insert: - id: msg-edit-host name: '@moton16/dsh-msg-edit' - id: ui-msg-edit name: '@moton16/dsh-msg-edit/client' - 手动重启 dsh web,浏览器 Ctrl+F5。
或直接以本仓库的
cordis.yml作为--patchoverlay 启动:dsh web --profile web --patch ./cordis.yml。
验证
- host:
POST /api/msg-edit/{get-message,rewrite-message,edit-message,regenerate}返回 HTTP 200 +{ok:false,error:{code:'bad-request',...}}(空参)即路由生效。 - client:助手消息悬停出现铅笔(编辑这条回复)与循环(重新生成回复)按钮;点击编辑弹出「思考/正文」行内编辑器。
- 本地复验记录:
docs/VERIFICATION.md(插件路由 4/4、UI 按钮渲染、截图证据)。
已知限制(如实披露,dsh.so 审核要求)
插件本体零源码修改;但「编辑/重新生成」在事件溯源日志上追加 surface-replace 副本事件,dsh 0.1.0-rc.6 的配套组件对这类事件存在以下官方未覆盖行为,需按本机情况处理:
- token-meter 重放崩溃(compact 必崩): 的 对 assistant/message 事件要求配对 step/start;replace 副本(在其所属 step 结束后追加)无配对,重放抛 ,导致 失败。官方仓库(deepseek-ai/deepseek-harness)master 尚未合入对 replace 副本的重放支持。,安装侧需对 的 assistant/message 分支应用一处社区修复(识别 副本:跳过 step/start 配对校验、带 usage 时按当前 surface 总量更新锚点、不带 usage 时保持锚点不变;已验证 224605 事件全量重放 CLEAN)。本包为合规不附带补丁脚本,修复文本见下方「兼容补丁」小节,由安装者自行评估应用。