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

v0.1.1

Published

dsh 插件:本地蒸馏器——扫描全部历史会话,挖出「用户纠错 → agent 改对」片段,脱敏后蒸馏成微调数据对(JSONL)、技能草稿与 AGENTS.md 规则补丁,带人工审核队列

Readme

dsh-distillery — 本地蒸馏器

把全部历史会话当原材料的本地蒸馏插件:专挖「用户纠错 → agent 改对」的片段, 脱敏后蒸馏成三种可复用资产,全部经人工审核队列把关。云端 agent 永远做不了这件事—— 原材料锁在你自己的磁盘上。

它做什么

历史会话(~/.dsh/sessions/**/*.jsonl.zstd,只读)
   ↓  时间线重建(人类消息 / 助手回应 / 中断标记)
   ↓  纠错检测(中英词库 + 成功信号,纯规则可解释,零 LLM 调用、零网络)
   ↓  隐私脱敏(未脱敏内容绝不落盘)
   ↓  人工审核队列(设置页「蒸馏器」面板)
   ├─ ① 微调数据对   SFT chat JSONL(recovery 四消息轨迹 / correction 两消息)+ DPO(chosen=修正 / rejected=错误输出)
   ├─ ② 技能草稿     同主题纠错聚类 → SKILL.md 草稿(人工润色后启用)
   └─ ③ 规则补丁     AGENTS.md 规则条目草稿(可一键追加进 ~/.dsh/AGENTS.md,带标记块与逐条去重)

成功判定:纠错消息之后助手必须给出有实质内容的修复输出;下一条用户消息再次纠错 → 连续失败(扣分过滤);确认「好了/可以了/works now」→ 加分;会话就此结束无新抱怨 → 中性加分。每条带置信度与可解释的命中理由。

隐私脱敏(17 类内置规则,逐条计数随条目落盘):私钥块、JWT、sk-/ghp_/AKIA/xox 密钥、 Bearer 令牌、URL 凭据、secret 赋值、邮箱、手机号、身份证、公网 IP(回环/内网默认保留)、 哈希、用户路径用户名遮蔽……支持配置追加自定义正则。扫描状态文件与队列里只有脱敏后内容。

使用

  • 面板:设置页「蒸馏器」(order 63)→ 开始扫描 → 逐条预览(此前要求 / 被纠正的输出 / 用户纠正 / 修正后,均带脱敏徽章)→ 通过/驳回 → 导出。
  • agent 工具:distillery_scan / distillery_status / distillery_list / distillery_decide / distillery_export。
  • 规则补丁落盘:批准规则条目后点「追加到 AGENTS.md」,或 POST /distillery/api/rules/append-global。 追加区带 dsh-distillery:begin/end 标记,删除这对标记即可整体移除;重复追加按条目 id 自动去重。

配置

| 键 | 默认 | 说明 | | --- | --- | --- | | minConfidence | 0.55 | 最低置信度;调低(如 0.4)召回更多边缘片段 | | maxEvidenceChars | 1200 | 每个证据字段截断长度 | | minClusterSize | 2 | 同类纠错至少几次才生成技能/规则草稿 | | pairFormat | recovery | SFT 导出格式:recovery / correction | | extraRedactPatterns | [] | 追加自定义脱敏正则(JS 语法字符串) | | redactLocalIps | false | 是否连回环/内网 IP 也脱敏 |

数据位置

  • 队列与扫描状态:~/.dsh/distillery/queue.json(原子写;损坏自动改名保留现场)
  • 导出文件:~/.dsh/distillery/exports/(SFT/DPO JSONL、SKILL.md、规则补丁 md)
  • 未脱敏原文只存在于内存中的检测阶段,任何落盘内容都先过脱敏引擎。

开发

cd 插件目录
DSH_CHECKOUT=/d/App/dsh/deepseek-harness npm run typecheck && npm test && npm run build

测试 40/40(合成语料,不碰真实会话内容)。E2E 探针(对运行中的 web 实例):

node scripts/verify-distillery.mjs --base http://127.0.0.1:3080 --token <启动token>
# token 在 ~/.dsh/update-center/dsh-web.stdout.log;探针只输出计数与路径,不打印会话内容

边界与诚实声明

  • 检测/聚类/草稿生成全是确定性规则:技能与规则草稿是模板化生成的(引用真实脱敏片段), 面板与文件里都明确标注「需人工润色」,不是 LLM 撰写的成品。
  • 插件消息(kind=plugin)不参与检测;子 agent 会话可能带来少量噪音,靠置信度阈值过滤。
  • 重新扫描按会话指纹(mtime:size)增量跳过;队列按条目 id 去重,更新时保留人工审核状态。
  • 技能/规则草稿按全量 pair 重算:消失的 pending 草稿自动移除,已审核草稿保留不回撤。