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

v0.4.1

Published

DSH conversation tidy tools: fold a turn to show only the final result (button top-left of the conversation), a right-edge node rail with lazy message previews, and a bottom-left total-token badge aligned to the stats line with context-pressure warning co

Readme

dsh-tidy

DSH(DeepSeek Harness)对话整理插件(轻量,中英文双语)。三个功能默认开启,可在 设置 → 通用 →「对话整理」 中分别开关:

  • 消息折叠:对话区左上角按钮切换「简洁 / 完整」——折叠时每个回合只保留最后一条回答,隐藏思考与工具调用;选择持久化在 localStorage(默认完整)
  • 导航条:对话区右缘短横杠对应每条提问,悬停显示消息摘要、点击跳转、自动高亮,启动时自动加载全部历史
  • 总 Token 徽章:对话区左下角只显示会话总 token(与折叠按钮左对齐、与底部统计行底对齐);上下文占用 ≥60% 变发送按钮同款色、≥80% 变红并提示"上下文快满了"

安全设计

纯浏览器端 DOM 驱动,零核心改动:

  • 绝不向 React 管理的 [data-chat-flow] 子树插入任何节点:折叠只改既有元素的 style.display;按钮/导航条/徽章挂在 document.body 浮动层。
  • observer 收窄:body 只观察 childList,仅 [data-chat-flow] 容器观察子树;所有回调 rAF 节流,watchdog 每秒一次完整调度(覆盖对话视图晚挂载的启动顺序);折叠扫描 ≥150ms 节流。
  • 匹配真实 DOM 契约(对照官方源码):flowItem 内递归找 [data-chat-call-id] / [data-variant="think"],排除 [data-subcalls] 内子调用;user / turn-tail 是回合边界(保持可见);导航锚点用气泡结构检测([class*="bubble"])排除 pending steering 与回合尾行。
  • 卸载完全还原(恢复所有 display、移除按钮/导航条/徽章、断开观察器)。
  • 设置开关:设置 → 通用 →「对话整理」(与「语言」「外观」「任务提醒」同级的折叠条目,展开后是三个开关行)——消息折叠 / 导航条 / 总 Token 徽章,状态存 localStorage,切换即时启停对应功能(无需刷新)。
  • 国际化:所有用户可见文本注册进官方 locale 服务(dsh-tidy 命名空间,中英双语);切换语言后设置页/导航标签即时重渲染,折叠按钮/导航条提示/徽章文本立即刷新,无需刷新页面。

安装

dsh plugin --profile web add dsh-tidy    # npm 发布版
# 或聚合包:dsh plugin --profile web add [email protected]
# 或 GitHub 调试:dsh plugin --profile web add github:Highjobop/dsh-gadgets#path=dsh-tidy

兼容性说明

  • 自动加载历史依赖「加载更早」按钮(button 文本或 .Md3f7G_older 类名回退)——DSH 构建更新后若失效会静默跳过(导航条仍可用,只是不自动加载)。
  • 总 Token 徽章读 session.history 返回的 projections.values.tokenUsage/sessionStats(依赖部署挂载 session-projection 注册表,DSH 默认挂载);当前会话 id 读 client sessions 服务的选中项,拿不到时退回最近更新会话。
  • 其余选择器均为官方 data 属性(data-chat-flow / data-chat-call-id / data-variant="think" / data-time-hover-root / data-composer-seat / data-conversation-scroll),跨版本稳定。

结构

dsh-tidy/
├── package.json     # dsh.client 声明
├── lib/index.js     # host 半边(空激活载体)
├── lib/client.js    # 浏览器半边:折叠控制器 + 导航条 + 自动加载 + 总 Token 徽章
└── cordis.patch.yml # bundle 组合补丁