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

v0.1.3

Published

Inline +N −M diff badges on edit/write tool rows and a per-turn file change summary card for DeepSeek Harness. PTC/code-dispatch fallback, no git required.

Readme

DSH Diff Stat

English | 中文

Awesome DSH Plugin dsh plugin npm npm downloads dsh platform License: MIT i18n

DeepSeek Harness Web 插件,将智能体的文件变更可视化:变更工具行内联 +N −M 徽标、轮末文件变更汇总卡、点击展开对齐后的完整 diff。原生 edit/write 调用、极简预设的 str_replace_editor、Code Dispatch(PTC)子调用全链路覆盖。不依赖 git,不依赖任何第三方插件。

功能

  • 一份构建,两代内核 — 同一产物同时适配 harness 0.1.1-rc.20.1.2-alpha.1(后者的 client-runtime 包、视图信封与服务名均已变更);diff hunk 在两版都读自工具持久化的 wire meta
  • 行内 +N −M 徽标 — 接管 editwritestr_replace_editor 的 stock 变更行(keyed 低优先阴影,卸载自动还原)。计数是真实变更行数——与 diff 渲染共用同一趟 LCS:运行中按参数预估,结算后取精确值
  • 对齐 diff 窗口 — 点击行展开限高滚动的 unified 视图。两侧先做行级 LCS 对齐:共同行渲染为变更处 ±3 行上下文,更远的未变更区间折叠为 ⋯;页脚统计与正文渲染完全同源
  • 轮末汇总卡 — 每轮消息流尾部折叠条「N files changed +X −Y」;逐文件行含类型图标、目录、±行数、审查、打开 ▾ 与撤销,同文件多次编辑按结算顺序合并累计
  • Code Dispatch(PTC)全链路 — dispatch 子调用在 wire 上没有 diff 视图:行内回退到参数推导 diff,轮末卡从 stock 会话工具树 join 出其文件,纯 Code-Mode 轮同样有汇总卡;subCallId 去重防止重放双计
  • 文件上下文增强 — 参数推导的裸片段在展开时获得至多 ±3 行真实文件上下文:增强器经 host 围栏 API 读取文件、定位片段的 after 形态并重建 hunk(尽力而为;无法定位的片段保持原样)
  • 撤销 — 一键把本轮文件恢复到轮前状态:hunk 链倒序唯一性回剥、本轮新建文件删除、文件漂移在写入前拒绝、原子提交
  • 内嵌查看与打开系 — 点「打开」在行下方展开限高文件预览;「▾」菜单保留系统打开、资源管理器定位、VS Code 与绝对/相对路径复制
  • 毛玻璃(可选) — 安装 deepseek-harness-background 后,本插件全部表面并入其共享玻璃配方;未安装时保持 stock 不透明外观——优雅降级、零依赖
  • 中英文 — 文案跟随 Web 界面语言(locale 服务)

截图

| 轮末汇总卡 | 接管行与对齐 diff | | --- | --- | | 轮末汇总卡:逐文件行与内嵌预览 | 接管编辑行:徽标与对齐 diff 窗口 |

左:轮末汇总卡,含逐文件审查 / 打开 / 撤销操作;右:行内 +N −M 徽标与其对齐 diff 窗口。均处于可选毛玻璃效果之下。

机制

  • 徽标与 diff:注册进 tool.call.toolview keyed 槽的 edit/write/str_replace_editor 键,priority −1 阴影 shipped 行;diff 数据按权威链 resultView → callView → 参数兜底提取,窗口截断丢掉 callView 时仍可从 resultView 渲染
  • 轮末汇总卡ConversationNodeDefinition 聚合器(turn/starttool/calltool/result(append)tool/code-dispatch)发布 Turn 数据,conversation.chat.turnTail 链认领渲染——结构遵循官方 ui-deliverables 模式。Code-Dispatch 文件从 stock 会话工具树 join:其 tool-call 节点已把每个 dispatch 按 rootCallId 折叠进根调用的 subCalls
  • 上下文增强:参数来源的 hunk 在构造时按对象身份标记;展开时增强器经围栏 API 读取文件(LRU 缓存)、定位片段的 after 形态并以共享行重建 hunk,无法定位的原样渲染
  • host 半(可选):同源前缀路由提供围栏 API——realpath 包含性解析前后双查、符号链接拒绝、UTF-8 回环校验、512 KiB 读取上限、原子写;host 半缺席时相关操作自动隐藏
  • 毛玻璃桥(可选):零依赖消费 background 插件的 window.__DSH_BACKGROUND_GLASS__ 注册表——常驻订阅其 ready 事件(覆盖两种到达顺序与热重载);桥不存在时普通界面原样保留

安装

# 从 npm 安装
dsh plugin --profile web add dsh-diff-stat

# 或从 GitHub 安装
dsh plugin --profile web add github:HaoyueQin/dsh-diff-stat

# 重启 dsh web 生效
dsh web

卸载:

dsh plugin --profile web remove dsh-diff-stat

开发

pnpm install        # devDependencies;prepare 会自动构建 lib/
pnpm build          # host 半 → lib/index.js + 浏览器半 → lib/client.js(一次 tsdown)
pnpm typecheck      # 双端 tsc
pnpm check:align    # 对齐引擎与数据模型断言(需 Node >= 23.6)

内核兼容性说明: 同一构建产物同时面向两个内核世代 —— 0.1.1-rc.20.1.2-alpha.1。编译期类型钉在 0.1.1-rc.2 的 devDependencies 上 (新版系的包未发布公网 npm);对新内核的兼容性依赖运行时形状校验 (narrowDiffs、快照探测),其消费的 wire 数据在两版逐字节一致。未来 内核若改名或删除这些 wire 字段,tsc 不会报错 —— 发版前请对新内核 实测验证。

License

MIT