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-redteam-report

v0.2.4

Published

DSH 红队报告:按工作区隔离,切换时自动采集文件与会话并生成可导出的报告

Readme

红队报告 · DSH 插件

dsh-redteam-report 0.2.1:报告跟随当前工作区,切换工作区后自动采集文件、会话与证据,调用宿主模型生成报告,可编辑并导出 Markdown、HTML 或 Word。

安装

统一设置页由 dsh-redteam-memory >= 0.4.0 提供,两个插件都需要加入 DSH profile:

dsh plugin --profile web add [email protected]
dsh plugin --profile web add [email protected]
# 完成后重启现有 dsh web

本包带有 dsh.bundle.patch,无需手动修改组合。npm 的 peer dependency 安装不能替代 dsh plugin add 的 profile 挂载步骤。

如果此前使用过会话内临时加载器,请不要与正式包重复加载。重启会清除临时插件;已保存数据保留。

工作区自动报告

  • 通过 GUI 当前会话与工作区成员关系识别工作区;没有有效选择时不回退到第一个工作区。
  • 工作区切换稳定约 1.2 秒后自动采集。即使报告面板没有打开,观察器仍然工作。
  • 每个工作区拥有独立报告库、配置和生成状态。界面及工具都显式绑定工作区,不会把上一工作区的异步结果写入新工作区。
  • 一次只执行一个生成任务。快速切换只保留页面最后一个待处理工作区;已经开始的任务仍写回原工作区。
  • 五分钟冷却避免重复尝试;冷却后若送入模型的证据与配置未变化,复用已有报告。需要重新撰写时可手动点击生成。
  • 自动生成会调用你配置的模型服务并产生相应费用。可在统一设置页关闭当前工作区的自动生成。

生成时采集:

  1. 当前工作区的可读取文本、源码与结构化文件及文件清单。
  2. 当前工作区的内存会话和持久化会话,按配置限量摘录。
  3. 当前工作区的攻击矩阵文件;缺失时明确标记,不混入其他工作区的全局矩阵。
  4. 红队记忆检索到的通用参考知识;参考知识不是目标存在漏洞的证明。

**不是无边界扫描。**默认跳过隐藏文件、符号链接、私钥/凭据、依赖与构建缓存、二进制及已生成报告目录;限制清单、目录深度、文件数量和摘录预算。PDF/Word 当前只列清单,不解析正文。跳过、截断和未验证内容会注明。

密钥与授权头使用启发式脱敏,不能保证移除所有未标记秘密。采集内容会进入宿主配置的模型服务;敏感工作区请先关闭自动生成,再按需要选择资料。详见 WORKSPACE-REPORTS.md。

统一设置

入口:设置 → 红队设置。

  • 记忆与向量存储:由记忆插件提供 Milvus、向量模型、重排、MinIO 和本地库配置。
  • 报告设置:当前工作区的自动生成开关、撰写模型、证据预算、攻击矩阵路径、导出目录及额外要求。

报告面板不再单独放置「设置」标签。两块设置各自保存,不会相互覆盖。

模型留空时使用宿主的默认模型配置;这不保证跟随每个会话的模型 override。需要固定撰写模型时请填写 provider/model。

面板和工具

报告面板保留「报告 / 证据 / 日志」:

  • 报告列表、Markdown 编辑、HTML 预览、保存与删除。
  • 一键生成,或由工作区切换自动启动。
  • 导出 Markdown、HTML、Word;结果显示实际磁盘路径。
  • 「试算证据」查看文件清单、采集统计和送入模型的 digest。
  • 将报告导入记忆库,供后续任务检索。

| 工具 | 用途 | |---|---| | report_generate | 采集指定工作区并撰写,等待完成 | | report_list | 只列出指定工作区的报告 | | report_export | 导出当前工作区报告,拒绝其他工作区的报告 ID | | redteam_report_status | 查看工作区报告状态和自动队列;wait=true 等待现有任务 |

工具的 workspaceId 可省略,此时使用调用会话所属工作区;无法确定时返回错误,不猜测。

数据与升级

工作区报告库为插件文件系统默认可写位置下的 .redteam-report-ws-<工作区指纹>.json,实际路径在面板中显示。工作区库路径固定,不能通过设置指向另一个工作区的报告库。

旧版 .redteam-report.json 保留不动。新工作区继承旧库的默认配置,但旧报告没有可信的工作区归属,因此不自动迁移,也不会在界面上反复提示。

Word 是自实现的 ZIP/OOXML 输出,不需要 Office 服务。没有内嵌字体、页眉页脚等高级排版,需要时可在 Word 中二次编辑。

开发

npm run build:lib
npm run check:lib
npm test

正式入口:lib/host.js 与 lib/client.js,由 tools/build-lib.mjs 生成。

  • src/host.js、src/client.js:复用的旧报告引擎和 UI 模板,不再直接作为正式入口。
  • src/workspace-runtime.js:隔离存储、采集和串行调度。
  • src/workspace-evidence.js:文件安全边界、摘录与脱敏。
  • src/workspace-client.js:工作区观察器、显式 RPC 与统一设置。
  • src/workspace-install.js:正式 Host 工具和 RPC 注册。
  • src/docx.js:HTML/Word 纯函数。

旧引擎测试明确使用 legacy fixture;正式发布产物另有 published-smoke 检查,避免只通过 mock 就声称静态包可用。