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-message-review-plugin

v1.0.2

Published

DSH client plugin — review messages you sent: a top-right button opens your user-message list with click-to-jump and per-item copy

Readme

DSH Message Review Plugin

为 DeepSeek Harness (DSH) Web GUI 提供消息回看功能的插件。在会话右上角注入一个按钮,点开即列出你在当前会话发过的全部消息:

| 功能 | 说明 | |------|------| | 📋 消息列表 | 点击会话右上角按钮,弹出面板列出你发送过的每一条用户消息(含回合中途追加的 steering 消息) | | 🎯 点击跳转 | 点击任意一条消息,对话滚动到该消息并高亮闪烁提示 | | ⧉ 一键复制 | 列表每一项自带复制按钮,复制完整原文;成功显示 ✓ | | 🔍 面板搜索 | 输入关键字即时过滤消息(Enter 跳到第一条命中) | | ↻ 手动刷新 | 会话有新消息后可一键重新收集 | | 🎨 原生样式 | 使用 DSH 设计系统 CSS 变量与图标按钮规格,自动适配明暗主题 | | ⚡ 装了即用 | 声明 dsh.bundle.patch,dsh plugin add 时由 DSH 自动加入 profile 层并激活——无需手动编辑任何配置文件 | | 📦 npm 分发 | CI 自动构建、发布、创建 GitHub Release |

快速开始

npm 安装(推荐)

dsh plugin --profile web add dsh-message-review-plugin

插件包内自带 cordis.patch.yml(insert 注册项)并在 package.json 声明 dsh.bundle.patch。dsh plugin add 完成依赖安装后,DSH 自动把插件加入 profile 的 bundles 层堆栈。

如果遇到 ERR_PNPM_ADDING_TO_ROOT(profile 目录是 pnpm workspace root),补一个 -w 标志:

dsh plugin --profile web add -w dsh-message-review-plugin

然后重启:

dsh web

打开或刷新 DSH Web GUI(http://127.0.0.1:3080),进入任一会话,即可在右上角看到消息列表按钮。

升级已安装的版本

dsh plugin --profile web update dsh-message-review-plugin
dsh web   # 重启生效

详细步骤与故障排除见 install.md。

使用 API

浏览器端(控制台或独立脚本)可用全局对象 DSHMessageReviewPlugin(dist 独立包)或 loader 导出配置参数:

DSHMessageReviewPlugin.configure({
  buttonLabel: '消息列表',        // 按钮 tooltip / aria-label
  panelTitle: '用户消息',          // 面板标题
  searchPlaceholder: '搜索消息…',  // 搜索框占位文本
  emptyText: '当前会话还没有你发送的消息',
  includeSteering: true,           // 是否收录回合中途的追加(steering)消息
  maxPreviewLength: 120,           // 列表预览截断长度
  observerDebounce: 200,           // DOM 重扫描防抖(ms)
});

DSHMessageReviewPlugin.activate();
DSHMessageReviewPlugin.deactivate();

原理

插件是纯浏览器端 DOM 插件:宿主侧入口(lib/index.js)是一个空的 Cordis 载体(apply 空函数),让 Loader 能挂载本包;浏览器侧 bundle 通过 package.json 的 dsh.client 声明被发现,由 DSH 的 client-modules 机制在页面加载时执行。

运行时使用 MutationObserver 监听 DOM:

  • 按钮注入:定位当前会话的 <header>(div[data-phase] > header)右侧工具区(titleRow 内的 headerUtilities / headerActions),注入 28px 图标按钮;头部被 React 重渲染或切换会话后自动补挂。
  • 消息收集:从 [data-conversation-scroll] 滚动端口内收集 [data-chat-flow-kind="user"](可选含 "steering"),气泡文本取自 userRow > bubble。
  • 跳转:按行的 data-chat-flow-key 定位原行,scrollIntoView 平滑滚动并给气泡加一次高亮闪烁动画;目标行已被分页移出渲染窗口时自动刷新列表。
  • 复制:优先 navigator.clipboard.writeText,失败回退隐藏 textarea + execCommand('copy')。

面板为 fixed 浮层:Esc / 点击外部 / 关闭按钮均可关闭;窗口缩放时自动重定位。

提示:超长会话中较早的消息可能不在当前渲染分页内。先向上翻页加载历史,再打开面板即可完整列出。

项目结构

dsh-message-review/
├── package.json              # npm 包配置,含 dsh.bundle.patch 与 dsh.client 声明
├── cordis.patch.yml          # 包自带的 loader 注册 patch(insert 本插件)
├── tsconfig.json             # TypeScript 配置
├── src/
│   ├── index.ts              # 服务端入口(桩)
│   ├── client.ts             # 客户端插件 TypeScript 源码
│   └── types.ts              # 类型定义
├── lib/
│   ├── index.js              # 编译后的服务端入口(纯载体)
│   └── client.js             # DSH __ModuleLoader__ 格式的客户端插件
├── dist/
│   └── dsh-message-review-plugin.js  # 独立脚本(可直接 <script> 加载)
├── scripts/
│   ├── build-plugin.js       # 构建脚本(tsc 产物 → ModuleLoader 包装)
│   ├── clean.js              # 清理构建产物
│   └── smoke-test.js         # jsdom 冒烟测试
├── example/index.html        # 浏览器手动演示页
└── .github/workflows/
    └── publish.yml           # tag 推送 → 构建 → npm 发布 → GitHub Release

开发

npm install
npm run build     # 清理 + tsc + 打包
npm test          # jsdom 冒烟测试(按钮注入 / 收集 / 过滤 / 跳转)
npx serve example # 打开演示页手动体验

发布流程

npm version patch        # 或 minor / major
git push origin main --tags

推送 v* tag 后 CI 自动完成构建、npm 发布和 GitHub Release。

许可

MIT