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-diff-summary

v0.2.0

Published

Per-turn diff summary for file mutations: individual edit/write rows are suppressed, and after each completed turn a single card lists every mutated file once — repeated edits of the same file merge in call order — with click-path-to-open and click-row-to

Readme

dsh-diff-summary

文件改动的轮末汇总卡片:改代码的工具调用不再每次弹一张 diff 卡,每轮对话结束后在轮次尾部出一张汇总卡——同文件多次修改合并成一行,点文件名打开文件、点行内其它地方展开 diff。

效果

  • 单次卡片全压制:edit/write(以及任何以 diff 卡/generic-edit 卡呈现的改动工具)在对话流里不再渲染卡片。
  • 轮末一张汇总卡:每轮 turn 结束后,轮次尾部出现「本轮改动 · N 个文件 · +A −D」卡片:
    • 同文件合并:一个文件一行,该轮内对它的多次修改按调用顺序拼接展示,hunk 之间用 ⋯ 分隔;不再每改一次显示一次。
    • 行数统计:+N −D 按真实增删行统计(上下文行不计入),文件行与卡片头都有。
    • 新增/修改徽标:本轮首次写出的文件标「新增」,其余「修改」。
    • 失败不丢:失败的调用在对应文件的展开体里挂红色错误行,卡片头累计「N 次失败」。
  • 交互(与官方 ToolRow 一致的心智):文件名文字本身是唯一打开入口(点击 → 侧边栏打开文件),行内其它任何位置点击/回车 = 展开/折叠该文件 diff。

机制

两个槽位注册,纯 client 半区(host 是空 apply):

  1. 压制:tool.call.toolview 槽(keyed、开放 key 域)对 edit/write 以 priority -1 注册一个渲染 null 的组件——低优先者渲染,官方行被阴影;卸载即还原官方卡片。
  2. 汇总:conversation.chat.turnTail 槽(chain、只在 turn/end 后挂载)以 priority -1 注册——排在官方 deliverables「产物」行(priority 0)前面。chain 是首个 select 非 null 者胜出的独占选举,本插件 select 恒真、组件按 render intent(diff 卡 / generic edit 卡,含嵌套 subCalls)扫描本轮全部改动调用——覆盖域 ⊇ 官方产物累加器的判定域,所以「当选却无内容」恰好发生在官方也不会渲染的轮次,不会顶掉任何东西;同时把官方产物行整体升级成带 diff 的汇总卡。
  • 数据全部来自各调用自带的 callView/resultView diff 卡({path, oldText, newText},hunk 级片段):settled 用结果 hunks,新文件整写(结果 hunks 为空)回退 call-time diff 并判「新增」,running 用 call-time diff。不跑 git、不读文件、无 host 通信。
  • 快照读取走会话标准件:useSession 取 chat.locations.getTurn(turn) + chat.nodes,useSessions 取 cwd 做相对路径显示。
  • 行内 diff 用内存 LCS 计算(超大数据退化全量重写),无第三方依赖。

已知取舍

  • 轮次进行中(turn/end 之前)不显示任何改动反馈,汇总只在轮末出现——即需求本身「不要每改一次就显示一次」。
  • 压制后官方产物(deliverables)chips 行在改文件的轮次被本卡取代(信息是超集:同样的文件 + diff + 打开);正文里的文件 mention 链接由 deliverables 独立提供,不受影响。

安装(手动部署)

仓库已私有、npm 冻结,git 是唯一发布渠道。部署到 profile:

# 1. 拷贝到 profile 的 node_modules(开发期改代码统一走 cp,dsh plugin add 对同版本不重新解包)
cp -r dsh-diff-summary /root/.dsh/profiles/web/node_modules/

# 2. 在 /root/.dsh/profiles/web/cordis.patch.yml 的 web 行下注册:
#    - id: diff-summary
#      name: 'dsh-diff-summary'

# 3. 重启生效
systemctl restart dsh-web

若 node_modules 里不存在该包,需先在 profile 里 pnpm add <本地 tarball 或目录> 装一次建立依赖解析(本插件无第三方运行时依赖,仅 peer 使用平台自带包)。

卸载

dsh plugin --profile web remove dsh-diff-summary   # 或从 cordis.patch.yml 删行 + rm node_modules
systemctl restart dsh-web

开发

手写 ESM(无构建步骤):lib/index.js(空 host apply)+ lib/client.js(全部逻辑,window.__ModuleLoader__.load 闭包 + exports.apply/inject)。改完 cp 到 profile 再重启验证。

更新记录

  • 0.2.0:交互重做 + 轮末汇总。文件名文字是唯一打开入口、点行内其它地方展开;单次 edit/write 卡片全面压制,改为每轮结束后一张汇总卡;同文件多次修改合并(hunk 顺序拼接、⋯ 分隔);增删行数按真实 add/del 统计;取代官方 deliverables 产物行(priority -1 链选举)。
  • 0.1.0:初版。每次 edit/write 一张紧凑 diff 卡(折叠列文件 + 增删行数,点行展开)。