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-comments

v0.1.4

Published

GPT 式 inline 注释:在 DSH 对话中选中助手文本,就地加批注(无语音)。交互:选中文字→+添加注释→编辑器→保存后高亮+编号气泡+N 条注胶囊。

Readme

dsh-inline-comments

DSH Web 的 GPT 式行内批注插件:在对话里选中助手回复的任意文本,就地加批注;发送时批注随正文一并交给模型,模型下一轮逐条回应。

批注演示

功能

  • 选中助手文本 → 浮出「+ 添加注释」按钮 → 点开编辑器写批注。
  • 编辑器内:回车 = 保存(默认),Shift+回车 = 换行。
  • 保存后:被批注文本高亮 + 右上角编号气泡;输入框上方出现「N 条注」胶囊。
  • 胶囊悬停查看详情、可删除单条;点「×」清空全部(并收回占位字符)。
  • 发送时:批注区([i] 原文:… / 批注:…)置于正文之前,中间以 --- 分割线隔开,模型下一轮逐条回答。
  • 发送后即清理(批注是「一次性」的,随发送消费)。
  • 支持中文 / 英文(跟随 DSH 语言设置),自动适配亮色 / 暗色主题。
  • 并入官方文本工具条(0.2.x):选中文字后,与官方「引用」同一排出现「+ 添加注释」;没有这条工具条时(0.1.x、或选区不在可交互文本区)自动回退成浮动按钮。
  • 定位可靠:记录选中文字前后的上下文,同一句话出现两次也能贴到正确的那一处;原文被改动导致找不到时,胶囊与详情会明确标出「原文已变」(批注内容不丢)。
  • 多窗口 / 多端安全合并:宿主侧按批注 id 合并(不是整表覆盖),web 版与桌面版共用同一份存储时互不覆盖;删除与清空带时间戳,陈旧窗口不会把删掉的批注"复活"。
  • 跨刷新持久化:批注镜像到宿主侧单一 JSON 文件(默认 ~/.dsh/dsh-inline-comments.json,可用 storagePath 配置覆盖),刷新后自动恢复;发送后自动清理,不留残留。浏览器 localStorage 仅作同页快速镜像。

使用

  1. 在助手回复里用鼠标选中一段文字。
  2. 点浮出的「+ 添加注释」。
  3. 输入批注,回车保存。
  4. (可选)再选别的文字继续加;胶囊里可管理 / 删除。
  5. 直接回车(或点发送)——正文会带上批注,模型逐条回应。

安装

dsh plugin --profile web add dsh-inline-comments

架构

  • lib/client.js(浏览器):全部功能——高亮 / 气泡 / 胶囊 / 编辑器、批注状态(localStorage + 宿主 JSON 文件)、发送前把摘要拼进草稿。
  • lib/index.js(宿主进程):注册 /_dsh/inline-comments/storage 路由,把批注持久化到单一 JSON 文件(load / save / clear,仅 loopback、原子写、发送后清理)。
  • cordis.patch.yml:把插件行插入 web profile 的 roster。

开发

  • 客户端热更:编辑 lib/client.js 后 dsh-client-hmr 自动重载(必要时刷新页面)。
  • 宿主改动需重启 dsh web。
  • 测试:npm install && npm test(自测脚本在 tests/,覆盖客户端 jsdom、刷新重挂载、多窗口合并、宿主路由、宿主文件往返、客户端 fetch 集成)。

目录

lib/client.js       客户端半部(全部功能)
lib/index.js        宿主半部(存储路由 + JSON 文件持久化)
cordis.patch.yml    web profile 的 bundle patch
package.json        包元信息
tests/              自测脚本(npm test)
market-entry.yml    上架条目(awesome-dsh-plugin)
LICENSE             MIT

兼容性

面向最新版 DSH 开发,不追求兼容所有旧版本;但接口一律走低耦合通道,并把"取不到接口"变成看得见的日志,而不是静默失效(静默失效的典型症状:批注加得上、却发不出去)。

  • 测试基准:桌面版(/Applications/DeepSeek Harness.app,当前 0.2.1-rc.3)—— 它比 Homebrew 的 CLI 发行版更新,插件的新接口风险会先在它这里暴露。
  • 已实测:0.2.1-rc.3 / 0.2.0-rc.2(桌面版,0.2.x 走 conversation.input.overlay 槽位桥接)、0.1.7-rc.2、0.1.5-rc.1(web profile)。
  • 低耦合接口:只用 DOM 契约([data-conversation-scroll]、[data-composer-input]、[data-conversation-session])、官方槽位(0.2.x 的 conversation.input.overlay、[data-text-interaction-surface])与宿主 webServer 的 HTTP 路由;不使用 typert 生成式远程接口,也不读内部 store 结构。
  • 回退:同一能力尽量留两条路 —— 当前会话 ID(DOM 属性优先 → sessions store 兜底);发送注入(shell API 优先 → 点发送按钮时由插件接管 → 桥不可用时保留批注并告警)。
  • 自测:npm test(155 项)覆盖客户端 jsdom、刷新重挂载、宿主路由与文件往返、多窗口合并与删除防复活、旧存储格式迁移、上下文定位与失锚标记、单次遍历的重绘性能、会话 ID 的优先级与回退、以及"能力缺失必须告警且不丢批注"。
  • 升级 DSH 之后:先跑 npm test,再手测一遍(选中 → 批注 → 发送);若控制台出现 [dsh-inline-comments] 开头的告警,告警里点名的那条接口就是这次被移动的,按它适配即可。

反馈

问题反馈与功能建议请提交至 GitHub Issues。

许可

MIT