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

@jianyiagi/dsh-plugin-ui-boost

v0.3.1

Published

DSH Web UI enhancements: Markdown editor with workspace file tree, per-key token usage analytics, chat export, composer counter — toggleable in General settings

Readme

@jianyiagi/dsh-plugin-ui-boost

DSH Web UI 增强插件:五个功能,其中三个可在 设置 → 通用 → 界面增强 中独立开关(默认开启)。

功能

| 功能 | 位置 | 说明 | | --- | --- | --- | | 导出对话 | 会话头部工具区 | 将当前会话(用户/助手消息)折叠为 Markdown 并下载,文件名 标题-日期.md | | Token 累计消耗 | 会话头部工具区 | 遍历会话节点的 usage 累加累计 token;悬停查看输入/缓存命中/输出明细 | | 输入框字数统计 | 输入框停靠区 | 实时统计草稿字符数(码点计),超过 4000 字变色提示 | | MD 编辑器 | 侧边栏底部 📝 | 在工作区内浏览/新建/编辑/预览 .md 文件;右键删除文件/目录(二次确认);可拖入桌面 .md 导入;对话产物区的 .md 文件点击直接用编辑器打开 | | Token 用量统计 | 设置 → 通用 → Token 用量统计 | 按 API Key 统计累计 token(输入/输出/缓存命中/命中率/请求数),每小时/每天/近 7 天/近 30 天视图 + SVG 柱状图 |

MD 编辑器使用

  1. 打开:点击侧边栏底部的 📝 MD 编辑器 按钮(侧边栏收起时只显示图标)。
  2. 浏览:左侧文件树列出当前工作区根的 .md 文件;目录可点入、.. 返回上级;多个工作区时顶部下拉切换。
  3. 打开:点文件列表项;也可在对话消息的产物区直接点 .md 文件芯片(自动用编辑器打开,不再走系统打开)。
  4. 拖入:把桌面上的 .md 文件拖进编辑器窗口,松开即导入到当前目录并打开(重名会提示)。
  5. 编辑:工具栏切换 分屏 / 编辑 / 预览;预览为零依赖渲染(标题/粗斜体/代码块/引用/列表/链接等)。
  6. 新建:点「新建」→ 工具栏内联输入文件名(如 notes.md,须以 .md/.markdown 结尾)→ 回车确认。
  7. 保存:点「保存」;有未保存修改时标题带 *,关闭会确认。文件只允许落在工作区根目录内(含子目录),工作区外的路径读写会被拒绝。

Token 用量统计

  • 数据从插件启用后开始记录(重启不丢,按小时桶存于 $DSH_HOME/storages/ui-boost-token-meter.json,保留 90 天)。
  • 归因:按 provider 配置的 API key 名(settings 中 llm-pi-ai.providers.*.apiKeyEnv,如 STEPFUN_API_KEY)归因;未配置的 provider 归到 provider:<id>不存储 key 明文
  • 指标:输入 = 计费输入(uncachedInputTokens + cacheWriteTokens,或总输入减缓存命中);输出 = outputTokens;缓存命中率 = cacheRead / (输入 + cacheRead)

结构

  • lib/index.js — 宿主端:静态注入 webServer,注册 /ui-boost/* 路由(MD 读写/新建/导入 + token 汇总查询);订阅 session/event 采集 usage 并按小时桶持久化。
  • lib/client.js — 浏览器端:window.__ModuleLoader__.load 模块,实现全部 UI(导出按钮、token 徽标、字数统计、设置开关、MD 编辑器、Token 统计卡片、对话内 .md 点击拦截、拖拽导入)。
  • cordis.patch.yml — profile patch:插入 ui-boost 插件行。

设置存储

功能开关持久化在浏览器 localStoragedsh-plugin-ui-boost.prefs 键(通过 @deepseek-ai/dsh-client-runtimecreateSnapshotStore + persist 实现),热更新,无需重启。

安装 / 更新

方式一:本地路径(开发者,改代码即生效)

node <dsh-app>\lib\bin.js plugin --profile=web add E:\Plugin\dsh-plugin-ui-boost

方式二:离线 tgz 分发(推荐)

打包(在插件目录):

cd E:\Plugin\dsh-plugin-ui-boost
npm pack        # 生成 dsh-plugin-ui-boost-0.2.0.tgz

安装(把 tgz 发给对方,对方执行):

node <dsh-app>\lib\bin.js plugin --profile=web add C:\path\to\dsh-plugin-ui-boost-0.2.0.tgz

方式三:npm 安装(已发布)

node <dsh-app>\lib\bin.js plugin --profile=web add @jianyiagi/dsh-plugin-ui-boost

注意:tgz / npm 安装是复制安装(非 link)——之后改源码不会自动生效,需重新打包并 remove + add。每次升级版本号(package.jsonversion)再打包。

移除:node <dsh-app>\lib\bin.js plugin --profile=web remove @jianyiagi/dsh-plugin-ui-boost

运行时所需的 react@deepseek-ai/dsh-client-runtime 等模块由 DSH web 宿主提供 (已在 package.jsonpeerDependencies 中声明),本插件不携带第三方运行时依赖。

已知边界

  • 导出的 Markdown 只含当前已加载窗口内的消息(长会话需先向上滚动加载完整历史)
  • token 统计来自会话节点上 provider 上报的 usage(uncachedInputTokens + cacheWriteTokens 计入输入、 outputTokens 计入输出、cacheReadTokens 单独列为缓存命中),未上报 usage 的节点不计入; 若会话历史加载失败,节点为空,token 徽标不显示
  • MD 编辑器只读写工作区根内的 .md/.markdown 文件(.md 之外的文件不会出现在列表)
  • 宿主端代码变更需重启 dsh web 生效;浏览器端变更刷新页面即可