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-inline-message-edit

v0.1.1

Published

Inline user message edit & resend plugin for DeepSeek Harness (用户消息原位编辑与重发插件:气泡下方铅笔图标 + 圆角内联编辑框 + 分支回退重发 / 当前会话追发)

Readme

dsh-message-edit

DeepSeek Harness (DSH) 用户消息原位编辑与重发插件(Inline User Message Edit & Resend Plugin for DeepSeek Harness)。

在已发送的用户消息气泡下方**「复制」按钮旁原位提供「编辑(铅笔图标)」按钮**;点击后消息气泡原位切换为圆角内联编辑卡片(无边框多行自适应输入框 + 右下角白底「取消」/ 黑底「发送」胶囊按钮),支持修改文本后自动从上一轮末尾分叉回退重发(branch)或在当前会话直接追发(followup),并自动保留原消息图片附件。


✨ 核心特性 (Features)

  1. 原生插槽无损接管(Slot Shadowing)
    • 基于 DSH 客户端插槽(conversation.chat.node)的 priority: -10 优先级选举机制无损接管 user 与 steering 消息节点,完整复用宿主 conversation.chat.user.content 工厂插槽渲染图片附件、文件卡片、@file 引用与 dsh-selection-quote 引用块;禁用或卸载插件后自动无感回退至内置组件,零侵入 app.asar。
  2. 气泡下方复制按钮旁铅笔编辑图标
    • 在每条已发送用户消息气泡下方的操作栏(MessageIconActions)中,紧贴原生「复制」按钮右侧渲染 1:1 尺寸与悬停态的铅笔编辑图标(IconEditOutlineRegular),悬停提示「编辑并重新发送 / Edit & resend」。
  3. 原位圆角内联编辑卡片
    • 点击铅笔图标后,消息气泡原位切换为与原生用户气泡同色系(--dsw-specific-bubble)的大圆角(--dsw-radius-xl)内联编辑框:
      • 自适应多行 <textarea>:自动聚焦并将光标定位至末尾,随内容行数自动伸缩高度。
      • 右下角胶囊操作按钮:提供浅色胶囊按钮 「取消」(支持 Esc 快捷键一键恢复原气泡)与深色胶囊主按钮 「发送」(支持 Enter 或 ⌘/Ctrl+Enter 快捷键)。
  4. 双模式会话重发(分支回退重发 / 当前会话追发)+ 原图片附件保留
    • 分支回退重发(branch,默认推荐):
      • 编辑第 $N$ ($N > 1$) 轮用户消息时,自动定位上一已完成轮次的末尾事件序号 prevTurnEndSeq,调用 ctx.sessions.fork({ sessionId, atSeq: prevTurnEndSeq, increaseTitle: true }) 分叉出干净的新分支会话,自动切换焦点并发送修改后的消息。
      • 编辑第 $1$ 轮首条用户消息时,自动在相同工作区(cwd)创建全新会话、切换并发送修改后的消息。
    • 当前会话直接追发(followup):若当前会话正在生成则先安全中断,随后直接在当前会话发送修改后的消息。
    • 原消息图片附件自动携带(preserveAttachments):若被编辑的原用户消息带有图片附件,重发时自动读取原附件 Base64 数据并随新消息一并发送。

📸 实机运行截图 (Screenshots)

1. 气泡下方铅笔编辑图标与原位圆角内联编辑框全景

Inline Message Edit Overview

2. 对话流中原位展开圆角内联编辑卡片(取消 / 发送胶囊按钮)

Inline Message Editor Card

3. 插件可视化设置面板(支持切换重发模式、发送快捷键与附件保留)

Message Edit Settings Card


🏗️ 运行时架构与重发状态机 (Architecture & Resend Flow)

flowchart LR
  Click["点击用户气泡下方<br/>铅笔编辑按钮"] --> Editor["原位展开圆角内联编辑卡片<br/>修改文本 + 按 Enter / 点击发送"]
  Editor --> Mode{"检查配置项<br/>resendMode"}
  Mode -- "branch (默认)" --> TurnCheck{"是否存在上一轮<br/>prevTurnEndSeq?"}
  TurnCheck -- "Turn N > 1" --> Fork["sessions.fork(atSeq: prevTurnEndSeq)<br/>切换新分支会话并自动发送"]
  TurnCheck -- "Turn 1 (首轮)" --> Create["sessions.create({ cwd })<br/>同工作区新建会话并自动发送"]
  Mode -- "followup" --> Followup["当前会话直接发送<br/>beginSubmission + session.prompt"]

  style Click fill:#e3f2fd,stroke:#1565c0,color:#0d47a1
  style Editor fill:#e0f2f1,stroke:#00695c,color:#004d40
  style Mode fill:#fff8e1,stroke:#ff8f00,color:#e65100
  style TurnCheck fill:#fff8e1,stroke:#ff8f00,color:#e65100
  style Fork fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
  style Create fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
  style Followup fill:#fce4ec,stroke:#ad1457,color:#880e4f

📦 安装与使用 (Installation)

方式一:通过 DSH CLI 一键安装

dsh plugin add https://github.com/xt765/dsh-message-edit/releases/latest/download/dsh-message-edit.tgz --trust

方式二:通过 npm 安装

npm install @xt765/dsh-message-edit
# 或无作用域别名包:
npm install dsh-inline-message-edit

方式三:在 DeepSeek Harness Profile 中配置启用

在 Profile 的 package.json 中添加 "dsh-message-edit" 依赖与 dsh.profile.bundles 项,并在 cordis.patch.yml 中声明:

- id: message-edit
  name: dsh-message-edit
  config:
    enabled: true
    resendMode: branch
    sendShortcut: enter
    preserveAttachments: true

⚙️ 配置项说明 (Configuration)

| 配置项 | 类型 | 默认值 | 说明 | | :--- | :--- | :--- | :--- | | enabled | boolean | true | 是否在已发送用户消息气泡下方(复制按钮旁)显示铅笔编辑按钮 | | resendMode | 'branch' \| 'followup' | 'branch' | 重新发送会话处理方式:branch 为从上一轮末尾分叉新会话重发(首轮新建同工作区会话);followup 为当前会话直接追发 | | sendShortcut | 'enter' \| 'mod-enter' | 'enter' | 内联编辑框发送快捷键:enter 为 Enter 发送 / Shift+Enter 换行;mod-enter 为 ⌘/Ctrl+Enter 发送 | | preserveAttachments | boolean | true | 重发时是否自动保留并携带被编辑消息原本包含的图片附件 |


🧪 运行单元测试 (Testing)

npm test

📄 开源协议 (License)

MIT © xt765