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

v0.1.0

Published

dsh plugin: render archived session transcripts into self-contained offline HTML reports (inline CSS, no dependencies).

Readme

dsh-plugin-html-report

🧩 dsh 插件家族(22 件):总目录 dsh-plugin-family | 明星插件:ide-hub 跨 IDE 统一管理 · task-forge 跨窗口无损交接 · quota 实时用量仪表

EN · Renders a session into one self-contained HTML file you can open, archive or forward: escaped content, per-turn stats, compressed tool lines (/report latest · /report <prefix> · /report all). · pure functions under test (injection escaping, self-containment / external-link check, session selection) · ran /report against real ~/.dsh/transcripts sidecars and inspected the output · untested: single messages above 100 KB in a browser.

DeepSeek Harness (dsh) 插件:把会话转录渲染成自包含 HTML 报告。读 transcript 的 JSONL 边车,产出单文件、内联样式、零外链的 HTML——发给任何人都能直接双击打开。

适合回答:"这次会话我要交给别人看,但不想让他装 dsh、开 Obsidian、或者读 JSONL。"

同系列:transcript(数据源)· transcript-search(检索)· obsidian-push(入库)。区别:本插件面向分享与浏览,Markdown 那两个面向归档与检索。

用法

  • /report:渲染最近活跃的那一个会话。
  • /report <sessionId 前缀>:渲染匹配前缀的会话(session- 前缀带不带都行)。
  • /report all:渲染全部会话,按最后活跃时间倒序。

输出示例:

已渲染 1 份报告:
C:\Users\<你>\.dsh\html-reports\4bc1bd00-916.html(15 条 / 12,645 字符)

文件名取 sessionId 去掉 session- 前缀后截 12 字符(这个截断规则是系列里踩过的坑:早期用 slice(0,8) 导致同前缀会话互相覆盖)。

产物形态

  • 单文件 <!doctype html>,样式全部内联,正文不引用任何外部 src=http… / href=http…;离线、内网、邮件附件场景都成立。
  • 用户/助手消息成"轮次卡片",工具调用压成一行 chip 且正文截断到 300 字符——转录里工具结果可能非常大,报告要的是可读性而不是全量转储。
  • 顶部一行统计:条数 / 用户 / 助手 / 工具 / 字符数 / 完整 sessionId。
  • 正文按 at 升序回放,与转录时间线一致。
  • 所有文本、标题、工具名一律 HTML 转义(含 # 与 "),会话里出现 <img onerror=...> 不会变成可执行标签。

配置

| 字段 | 默认 | 说明 | |---|---|---| | enabled | true | | | dataDir | ~/.dsh/transcripts | transcript 边车目录(只读) | | outDir | ~/.dsh/html-reports | 输出目录,不存在会自动创建 | | title | Session Report | 页面标题;留空则回退为 Session <id 前 8 位> |

只读取 transcript-YYYY-MM.jsonl 命名的文件;损坏行跳过并计数,永不改写源文件。没有转录数据时明确报错并提示先装 transcript,不会输出空页面糊人。

安装

三步,实测于 @deepseek-ai/[email protected](需 pnpm 在 PATH 上):

# ① 装进 profile:dsh plugin 把参数原样转发给 pnpm,git 包会自动跑 prepare 构建 lib/
dsh plugin --profile web add github:121212165/dsh-plugin-html-report

② 把本仓库根目录 cordis.patch.yml 的内容并进 $DSH_HOME/profiles/web/cordis.patch.yml。 该文件默认是 [],所以要么整份替换,要么把 insert 条目并进同一个数组;不要直接追加—— 追加会形成两个 YAML 文档,启动即报 failed to parse overlay ... end of the stream or a document separator is expected(本机实测踩过)。

③ 重启 dsh。配置层与 client 半都要重启才生效(客户端按 boot 时算出的内容 rev 下发,硬刷新浏览器没用)。

自检挂载:dsh --profile web --dump-config | grep dsh-plugin-html-report,应看到该条目。

验证状态

  • 纯函数(转义防注入、统计计数、自包含性与外链检查、工具行压缩、会话选择:缺省最新 / all 倒序 / 前缀匹配含 session- 变体 / 交错记录取最后时间)8 个 node --test 全绿。
  • 本机 live:对真实 ~/.dsh/transcripts 边车执行 /report,产出 HTML 结构与统计逐项目视通过。
  • 未验证:超大单条消息(>100KB 文本)在浏览器里的渲染表现;长文本仅工具行做截断,用户/助手全文照排。

借鉴来源与差异

| 借鉴来源 | 借鉴了什么 | 我们的差异 | |---|---|---| | simonw/claude-code-transcripts(1.7k★) | 「把会话转录发布成可分享页面」这个需求方向 | 它面向 Claude Code 单一格式;本插件读的是 dsh-plugin-transcript 的 JSONL 契约(跨工具),渲染为自包含单文件 HTML,独立实现 |