npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-plugin-message-edit

v1.2.1

Published

ChatGPT-style message editing for DeepSeek Harness: edit a past prompt to rewind and branch the conversation, switch versions with a counter under the bubble, and browse branches in a tree.

Readme

dsh-plugin-message-edit

English | 简体中文

npm CI license dsh stars

编辑一条已经发出的消息,对话会从那一刻 真正回溯并分叉——和 ChatGPT、Claude、DeepSeek 的做法一致。旧版本不会被覆盖:气泡下方出现 ‹ 2/4 › 计数,「版本」标签页则画出整棵树。

演示

版本树分支展示

无论对话如何深层分叉、编辑多少次,「版本」标签页均会呈现清晰的轮次级分支图,当前会话所在路径实时高亮,点击任意节点即可平滑跳转:

版本树

功能

  • 编辑并分叉:修改过去的提问并发送,新分支会带着该轮 之前 的完整上下文重新生成。这是真正的回溯,而不是从末尾继续的 fork。
  • 版本计数:一条消息存在多个版本时,下方出现 ‹ n/m ›,左右箭头在各版本间即时切换。
  • 版本树:新增「版本」标签页,以图的方式展示所有分支,可平移、缩放、拖动。当前所在分支高亮,点击任意节点即可跳转。
  • 零延迟与即时切换:客户端家族级 SWR 缓存与乐观预加载,点击箭头或树节点切换版本 0ms 响应,无指示器闪烁或加载白屏。
  • 高性能内存缓存:宿主端内存解析缓存,消除重复磁盘 I/O 与日志重析,即便是深度分叉的庞大家族树也能毫秒级响应。
  • 自动中止旧分支:分叉时自动停止同家族中仍在流式生成的回复,避免浪费 Token 与计算资源。
  • 重试:不修改内容,直接重跑该轮(Claude 布局)。
  • 复制:把消息文本复制到剪贴板。
  • 持久可靠:每个分支都是真实会话,版本关系写入持久事件,重启后依旧完整。新分支自动归入父会话的工作区。

界面风格

这三家界面的差别在于 操作按钮放在哪里、有哪些,因此预设只改变这一点,颜色始终沿用 DSH 原生配色。在 设置 → 消息树 中选择,面板内有实时预览。

| 预设 | 气泡下方的按钮 | 显示方式 | 编辑框按钮 | | --- | --- | --- | --- | | ChatGPT | 编辑、复制 | 悬停时显示 | 取消 / 发送 在框 内部 | | DeepSeek | 编辑、复制 | 始终显示——与 DSH 一致 | 取消 / 发送 在框 内部 | | Claude | 重试、编辑、复制 | 悬停时显示 | 取消 / 保存 在框 下方 |

只有 Claude 在用户消息上提供重试,与真实界面一致。没有分享按钮——DSH 本身没有,就不自行发明。

安装

dsh plugin --profile web add dsh-plugin-message-edit

安装后请重启 DSH:宿主端随服务器加载。界面跟随 DSH 显示语言(中文 / English)。

工作原理

DSH 的会话是仅追加的事件日志,本身不支持会话内分支,因此回溯需要另行实现:

  • 宿主端提供 /message-tree 接口。编辑消息时,会 以目标轮次之前的全部事件为种子创建一个新会话,写入持久的 message-tree/version 标记说明改动内容,并把编辑后的提问送入。
  • 之后读取这些标记,还原出整棵版本树、‹ n/m › 计数,以及当前处于哪个分支。
  • 标记事件带有信封上的 ignorable 标志。插件自定义的事件类型不在宿主的事件词表内,缺少该标志时读取端会拒绝解释整份日志,会话将直接打不开。
  • 只遮蔽普通的 user 消息节点(优先级 -1);思考、工具调用与引导消息仍由宿主渲染。

宿主端的分支逻辑源自 dsh-message-edit(MIT © Moeblack),在其基础上重做为 ChatGPT 式回溯语义、同级分支展开,以及上述界面预设。

两者名字相近,这里说明一下:这是另一个独立插件。它的路由、cordis id 与持久事件类型都保留了 message-tree 这一套命名,正是为了两个插件可以同时安装而互不冲突。

文档

更多技术细节与开发指南,请参阅:

兼容性

版本 1.2.1(当前源码):修复 DSH 0.2 客户端加载,编辑、重试及版本切换改用 uiWorkspace.openSession 导航。

版本 1.2.0:在官方 dsh 0.2.0-rc.2 上通过 workspaceRegistry.unarchiveSession 取消版本归档。

版本 1.1.0:修复编辑/重试的 seed 边界,发布分支前清空继承的待发送输入,按会话身份识别版本标记,保留推理强度,并通过会话观察接口恢复持久分支。

声明兼容范围为 >=0.2.0-rc.2 <0.3.0-0;官方 dsh 0.2.0-rc.2 满足该范围。旧版 DSH 请保留上一插件版本。验证记录。

已发布版本可从 npm 安装。测试当前源码时,先运行 npm ci 和 npm pack,再运行 dsh plugin --profile desktop add ./dsh-plugin-message-edit-1.2.1.tgz。发布完整性检查见 发布流程。

1.1.0 已在 DSH 0.1.5-rc.2 的隔离 Web 环境验证:插件加载、图片显示、编辑与重试、深层分支,以及持久会话的恢复读取。模型回复使用本地测试实现,未调用远程模型服务。

兼容层保留了旧版 events / seedLength 接口支持,并由自动测试覆盖。本版本对应官方 dsh 0.2.0-rc.2。更新插件后请重启 DSH。

可与 dsh-plugin-smooth-stream、dsh-plugin-rollout-scout 共存。

许可

MIT © SpookySandwich。宿主端部分逻辑源自 dsh-message-edit(MIT © Moeblack)。