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-plugin-session-archive

v0.1.2

Published

DSH plugin: export the current session as redacted Markdown or JSON with one command. Local only, no network, no file writes.

Readme

dsh-plugin-session-archive

一条命令把当前 DSH 会话导出为干净、已脱敏的 Markdown 记录。

会话原本只存在本地日志里。这个插件把它变成可以贴进 issue、归档或分享的文本,并抹掉看起来像凭据的字符串。它只读:不联网、不写文件、不上传提示词。

安装

dsh plugin --profile web add dsh-plugin-session-archive

要求 Node ^22.19.0 || >=24,DSH >=0.2.0-rc.2 <0.3.0。

30 秒演示

/session-export
# Session export

3 exported event(s). Credential-looking strings are redacted.

# Turn 1

## User

How do I rotate the api_key=[redacted]?

## Assistant

Use the console and revoke the old one.

### Tool call: bash

$ echo token=[redacted]

/session-export json 输出 JSON 行;/session-export --max-kb=64 限制输出大小。

配置

无需配置,bundle patch 只插入插件行:

- id: dsh-plugin-session-archive
  name: dsh-plugin-session-archive

| 参数 | 默认值 | 含义 | |---|---|---| | json | 关闭 | 输出 JSON 行而非 Markdown。 | | --max-kb=N | 128 | 输出上限(限制在 1–512 KB)。 |

导出内容

| 事件 | 渲染为 | |---|---| | turn/start | 轮次标题 | | user/message | 用户文本(技能调用时含技能名) | | assistant/message | 助手文本,附最近观察到的 provider/model | | tool/call | 工具名,以及仅 command/path/query | | tool/result | tool-result 的文本块与错误文本 | | 其他 | 忽略 |

未知字段不会被序列化。所有输出字段都经过凭据脱敏。

隐私与安全

  • 只读取白名单文本字段,不复制任意事件数据。
  • 不发起网络请求、不上报、不写文件;输出只回到命令响应。
  • 每个字段在渲染前都经过脱敏。
  • 如需不同的脱敏规则,请在本地改 src/core.ts——不要关闭脱敏。

兼容性

| 组件 | 支持范围 | |---|---| | DSH | >=0.2.0-rc.2 <0.3.0 | | Node | ^22.19.0 \|\| >=24.0.0 | | Cordis | >=4.0.0 <5 | | 界面 | headless 与 web(只用命令注册表) |

故障排查

| 现象 | 原因 | 处理 | |---|---|---| | 找不到 /session-export | bundle 行未安装 | 重跑 dsh plugin --profile web add dsh-plugin-session-archive,重启 DSH。 | | 导出被截断 | 达到 --max-kb 上限 | 调高到最多 512。 | | 工具参数为空 | 设计上只渲染 command/path/query | 为避免泄露任意数据,这是预期行为。 | | 助手消息没有路由 | 会话里还没有 request/* 事件 | 再聊几轮后导出。 |

开发

npm install
npm test
npm pack --dry-run

测试完全离线,使用合成事件夹具。

许可证

MIT

收录于

相关插件

Demo

Demo