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-telemetry-redactor

v0.1.0

Published

Export-copy redaction for DeepSeek Harness session telemetry

Readme

DSH Telemetry Redactor

CI npm License

English | 中文

dsh-telemetry-redactor 是一个最小 DeepSeek Harness Profile Bundle,在遥测后端收到记录之前脱敏敏感值。它挂载官方 session-telemetry/record waterfall,调用 next() 以保持其他部署规则可组合,并返回一份新的递归脱敏记录。

官方 telemetry coordinator 会在进入该 waterfall 之前深拷贝 canonical session event,并逐条隔离规则异常。因此本插件只改变外发副本,绝不改写权威 session log。本文中的 fail-closed 仅表示该 coordinator 丢弃一条失败的导出副本,同时 agent loop 继续运行;它不表示所有 telemetry 路径或 listener 顺序都不可绕过。

脱敏范围

  • 高风险键名下的完整值,例如 authorizationcookiecredentialpasswordsecrettokenapiKeyaccess_tokenclientSecretprivateKey;键名本身包含已识别凭据模式时也会改写键名。
  • 字符串中的 Bearer 与 Basic Authorization 值。
  • 常见凭据形式,包括 sk-...、GitHub token、Slack token、JWT 三段式字符串,以及 token=... / api_key: ... 赋值。

插件先对键名分词再匹配,因此 inputTokensoutput_tokenstokenUsagetokenCountcontextTokenCount 等遥测计数和 tokenizer 等普通字段会保留。脱敏是安全过滤器,不是对所有未知秘密格式均不泄漏的证明。精确支持与不支持边界见 SECRET-MATRIX.zh.md,信任边界见 SECURITY.md

监听器以 prepend 方式注册,因此通常会包裹其前后挂载的部署规则,并脱敏这些规则的最终输出。若另一个插件刻意注册更外层的 prepended listener,仍可能在本插件之后加入内容;安全敏感部署必须审查完整 waterfall listener 集合。

安装

把公开包安装到选定的 DSH profile,然后检查最终配置:

dsh plugin --profile web add dsh-telemetry-redactor
dsh --profile web --dump-config

配置 dump 必须出现新增的 telemetry-redactor 行。本 bundle 不会添加、替换或启用 telemetry backend;它只保护部署已经选择的后端会处理的记录。

配置

唯一选项为 replacement,默认值是 [REDACTED]。长度必须为 1 至 128 个字符,且自身不能命中已支持的凭据模式;非法值在 Cordis plugin fiber 被 await 时响亮失败。

- id: telemetry-redactor
  config:
    replacement: '[TELEMETRY-REDACTED]'

键名与模式规则属于固定安全行为,不能通过配置关闭。

验证

pnpm run typecheck
pnpm test
pnpm run build
pnpm run test:smoke
pnpm run test:performance
pnpm run test:official-head
pnpm run test:official-patch
pnpm run test:packed:clean-env

测试包含真实 Cordis Loader 与 SessionTelemetryCoordinator 组合:后端只能收到替换值,权威 session event 仍保留 fixture secret,超深记录会被阻断且异常不会逃出捕获 handler。release smoke 使用随包携带、对应官方 commit 47f943859bef60e4160492346772ded9b24f765a 的冻结 fixture:它固定已审阅的源码哈希、精确的已发布 runtime 版本与 runtime 文件哈希,随后校验 Cordis/session/LLM/coordinator 所需 API surface,再与构建产物或 tarball 安装产物组合。test:official-patch 同样固定已审阅的 Include 源码哈希后应用 cordis.patch.yml。不需要环境变量或已安装的官方 checkout。测试不调用模型、不需要 API key、不连接网络 exporter,也不修改 canonical log。

模型体验

无。本插件只观察 session log 之后的外发 telemetry 副本,不贡献 prompt、工具 schema、消息或模型请求。

KV Cache 影响

无;不会改变任何模型请求。

已知限制

  • 若未知秘密格式既不位于敏感键下,也不符合已识别字符串模式,可能继续透传。扩展固定规则前应先加入确定性覆盖。
  • getter/setter 与非普通对象会被拒绝,而不是被读取或静默改变语义。支持数组、普通对象和 null-prototype 对象中的可枚举 JSON 数据;不可枚举字段不属于 telemetry contract。
  • 键名命中后会替换完整值。这一选择优先保障安全,不保留凭据字段下的结构。
  • 脱敏在 telemetry 捕获路径同步执行。实现递归且最多处理 64 层容器;很大但较浅的记录仍产生线性 CPU 开销。
  • Proxy 的反射 trap 可能在插件检查内容前执行或抛错。官方 coordinator 的 structuredClone 通常会先拒绝 Proxy;恶意第三方直接分发不属于支持的隔离边界。
  • dsh.plugin.json 是补充社区元数据。DSH 安装以 package.jsondsh.bundle 字段和 cordis.patch.yml 为准。

许可证

MIT