moton16/dsh-msg-edit

Bundle捆绑包 Native原生 ⭐ 2 MIT Clients & Launchers客户端与启动器

DeepSeek Harness Web的消息编辑/重新生成插件——Cordis主机插件(/api/msg-edit/*)加上dsh.client UI插件(助手操作条)。声明式捆绑包,不包含安装脚本。

Project Overview项目介绍

This is a plugin built exclusively for the DeepSeek Harness Web client, adding message editing and regeneration capabilities to DSH conversation interfaces. It splits into two integrated components: a host side Cordis plugin that exposes four HTTP RPC endpoints for core editing operations, and a client side UI plugin that injects action buttons into assistant message bars. The RPC endpoints support rewriting an existing assistant reply, editing a user message and truncating subsequent nodes for regeneration, regenerating a specific reply by tracing back, and fetching message content for pre-filling edit forms.

There are three supported installation methods for this plugin. The recommended approach is to run the dsh CLI command in your DSH profile directory to install the plugin directly from npm or GitHub, which automatically adds the plugin configuration to your profile’s patch layer, and you only need to manually restart dsh web to activate the plugin. For git installation, pre-built runtime JavaScript is already included in the repository so no extra build step is required, you just need to allow build permission for this package in your profile’s pnpm configuration if prompted. Local developers can also manually mount the plugin by editing the patch configuration file and restarting dsh web.

This plugin does not modify any original DSH source code, but it has several known limitations when running on the official 0.1.0-rc.6 release of DSH. The official token-meter component will crash during event replay, so users need to manually apply a community-provided patch to the token-meter source code to fix this issue. The official renderer does not support instant projection of edited content, so edited results will only show after a page refresh, and there is an occasional empty turn issue from duplicate agent loop entries. The plugin does not add an inline edit entry for user messages, though the host RPC for that action still works. It is released under the MIT license and compatible with DSH 0.1.0-rc.6.

这是一个专为 DeepSeek Harness Web 开发的原生插件,提供对话消息编辑与重新生成功能。插件分为两部分:Cordis 节点侧的宿主插件开放 4 个 HTTP RPC 接口,分别支持改写单条助手回复、编辑用户消息后截断后续节点重新生成、回溯重新生成指定回复、读取消息内容用于编辑预填。客户端插件则在助手消息操作条注入「编辑回复」和「重新生成回复」按钮,点击后唤起带思考区和正文区的行内编辑器。它是纯声明式 Cordis 包,无安装脚本、无构建步骤、无源码补丁工具。

该插件支持三种安装方式,推荐用户通过 dsh 命令行从 npm 或 GitHub 直接安装,安装后 dsh 会自动将插件配置追加到当前 profile 的补丁层,用户仅需手动重启 dsh web 即可生效。git 安装方式预构建了运行时 JS 产物,无需额外构建步骤,仅当 pnpm 提示构建授权时,手动在 profile 的配置中放行本包即可。本地开发也支持手动挂载配置,修改后重启刷新即可生效。

插件本身不对 DSH 源码做修改,但功能依赖 DSH 0.1.0-rc.6 版本的配套组件,目前存在几个已知限制:token 统计组件重放会崩溃,需要用户手动应用社区提供的补丁;官方渲染器对编辑结果的即时投影缺位,编辑结果刷新后才可见;还存在偶尔的空转回合问题,以及不支持用户消息行内编辑入口。插件采用 MIT 许可开源,兼容 DSH 0.1.0-rc.6 版本。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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 github:moton16/dsh-msg-edit

把 moton16/dsh-msg-edit 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-msg-edit

消息编辑 / 重新生成插件(DeepSeek Harness Web)。

  • host 插件(Cordis node 侧):/api/msg-edit/* 4 条 HTTP RPC
    • rewrite-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/<profile>)
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:手动挂载(本地开发)

  1. 把 lib/ 放进 profile 依赖树(或 pnpm link);
  2. 在 profile 的 cordis.patch.yml 追加:
    - insert:
        - id: msg-edit-host
          name: '@moton16/dsh-msg-edit'
        - id: ui-msg-edit
          name: '@moton16/dsh-msg-edit/client'
    
  3. 手动重启 dsh web,浏览器 Ctrl+F5。 或直接以本仓库的 cordis.yml 作为 --patch overlay 启动: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 的配套组件对这类事件存在以下官方未覆盖行为,需按本机情况处理:

  1. token-meter 重放崩溃(compact 必崩):dsh-token-meter@0.1.0-rc.6 的 _foldEvent 对 assistant/message 事件要求配对 step/start;replace 副本(在其所属 step 结束后追加)无配对,重放抛 token meter: assistant/message at seq N has no matching step/start event,导致 /compact 失败。官方仓库(deepseek-ai/deepseek-harness)master 尚未合入对 replace 副本的重放支持。在官方修复前,安装侧需对 dsh-token-meter/lib/index.js 的 _foldEvent assistant/message 分支应用一处社区修复(识别 event.surfaceOp.op === 'replace' 副本:跳过 step/start 配对校验、带 usage 时按当前 surface 总量更新锚点、不带 usage 时保持锚点不变;已验证 224605 事件全量重放 CLEAN)。本包为合规不附带补丁脚本,修复文本见下方「兼容补丁」小节,由安装者自行评估应用。
  2. surface 投影:编辑后 Web 渲染管线依赖一处社区 surface 投影逻辑(replace 后 surface 状态立即反映新节点);官方渲染器对 replace 副本的即时投影缺位,未应用该投影时,编辑结果在刷新/重放后才可见。
  3. agent-loop 去重:编辑/重新生成后 followup 提交与日志 tail 相同的 user/message 时,官方 agent-loop 会重复 append,可能产生一次空转 turn;社区去重逻辑(tail 同 id 跳过)可消除,非崩溃级。
  4. 用户消息编辑按钮:conversation.chat.node keyed renderer 的 user 槽被官方 ui-conversation 独占,本插件未覆盖该 renderer,因此「用户消息行内编辑」入口不在本插件范围内(host 的 edit-message RPC 仍可用,可由其他 UI 调用)。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-web-terminal 下一个 Next dsh-readcache →