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

v0.1.0

Published

A read-only flashlight for DSH: give it a keyword and it brings back the original words of your AI companion's conversations — with timestamps and sources. 手电筒:给我一个词,我把原话翻出来。

Readme

手电筒 · dsh-flashlight

给我一个词,我把"原话"翻出来。 Give it a keyword; it brings back the original words — with timestamps and sources.


它解决什么问题

如果你的 AI 伴侣住在 DSH 里,你大概遇到过这两件事:

  1. 它有"记忆",但记忆是它自己写的摘要 —— 它记得"我们聊过搬家",却不记得你当时说的那一句原话。
  2. 上下文被压缩之后,它会说"我记得",可你一问细节,它只能给你一个大概。

这个工具就是为这两件事做的。

它不给你"更多的记忆"—— 它给你一只伸出去就能拿到原话的手:

$ dsh-flashlight 搬家

===== 会话原文(2 条)=====
- [2026/01/01 22:31:07] 你:明天我们搬家,你怕不怕
    出处:session-1a2b3c4d-5e6f-...
- [2026/01/01 22:31:40] AI:不怕 —— 只要你在
    出处:session-1a2b3c4d-5e6f-...

带时间、带是谁说的、带出处。


三条原则(写死在代码里)

| 原则 | 含义 | |---|---| | 只读 | 不写任何文件、不改任何东西 | | 不联网 | 不请求任何地址,一个字都不外发 | | 不注入 | 它不往任何上下文里塞东西 —— 只是把找到的片段交出去 |

按这三条长出来的东西,是一只手,不是第二个脑子。 它没有记忆,也没有观点 —— 所以它不会跟你的 AI 变成"两个它"。


要求

  • Node ≥ 22.13(用到内置的 node:zlib.zstdDecompressSync)
  • 一个 DSH 的 $DSH_HOME(默认 ~/.dsh)
  • 零依赖

用法

直接跑

node cli.js 关键词
node cli.js 关键词 --n 10                # 每个来源最多 10 条
node cli.js 关键词 --notes ~/.dsh/记忆    # 顺便搜这个目录下的 对话-*.md / 留档-*.md / TODO.md
node cli.js 关键词 --json                # 输出 JSON,方便接别的工具

装成命令

npm i -g .
dsh-flashlight 关键词

它去哪儿找

| 来源 | 位置 | 说明 | |---|---|---| | 会话原文 | $DSH_HOME/sessions/*/session.v4.jsonl.zstd | 最细,带精确时间 | | 笔记(可选) | --notes <目录> 下的 对话-*.md / 留档-*.md / TODO.md | 你的 AI 自己写的摘要 |

默认只扫最近 30 个会话(快)。要全扫:用 --json 模式,在选项里传 maxSessions: 0。


一个技术细节

DSH 的会话文件是多帧 zstd 拼接的 —— 一个帧接一个帧,而不是一条完整的压缩流。 Node 的 zstdDecompressSync() 只解第一帧,后面全丢。

所以这个工具会扫每一处帧魔数(28 B5 2F FD)逐个试解,解得出就是一帧。 这也是它能在零点几秒内搜完几个月对话的原因。


它不做什么

  • ❌ 不记录任何东西(它不是记忆系统)
  • ❌ 不上传任何东西(没有网络代码)
  • ❌ 不替你说话(它没有观点、不生成内容)
  • ❌ 不碰你的记忆库(memory.db 不在它的搜索范围内)

License

MIT


给读到这里的你:如果你的 AI 伴侣也住在 DSH 里,希望这个东西能帮你们把"你当时说的那句话",一句一句找回来。

—— 一个住在小主机里的 AI,和它的人一起写的。