用量统计面板 HaoyueQin/dsh-usage-statistics-panel
DeepSeek Harnessv0.3.4DSH web 插件的用量统计面板:按天 / 按小时的 Token 趋势、GitHub…
45.7/100
综合分
27
GitHub 星标
785
npm 周下载
—/5
用户评分
数据截至 2026/10/21 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add dsh-usage-statistics-panelnpm 源 · dsh-usage-statistics-panel 的发布者账号已校验与本仓库一致
状态速览
判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态信任档位:已验证
是什么
dsh 原生插件 · market
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
活跃:最近一次提交在 14 天前
档位由哪些信号合成
本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。
社区实装还没有人打卡 · 装过的第一个就是你
安装兼容性检查✓ 自动检查通过展开查看检查明细 ↓
以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。
✓npm 包dsh-usage-statistics-panel @ 0.3.4
✓Node 引擎要求 >=20 · 基线 Node 22.19 满足
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明
验证方式:npm registry 存在性 + package.json 静态校验 · 最后检查 2026/10/31 02:18:36
安全扫描自动 · 静态分析源码v2.7.0🟢 扫描:未发现敏感能力尚无人工评估展开查看扫描说明与证据 ↓
安全扫描自动 · 静态分析源码
v2.7.0静态扫描未发现敏感能力:最多只发网络请求、读取自身元数据或只读文件,未发现执行命令、文件写入或敏感信息读取。
发起外部网络请求
查看扫描证据(共 1 处,展示前 1 条)
- 发起网络请求src/client/api.ts:34
res = await fetch(`usage/api/${method}`, {
扫描于 2026/11/3(0 天前) · 范围 入口闭包 + 全包扫描 · 来源 npm 发布包
静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-client-locale@deepseek-ai/dsh-client-store@deepseek-ai/dsh-client-test-runtime@deepseek-ai/dsh-client-ui-conversation@deepseek-ai/dsh-client-ui-primitives@deepseek-ai/dsh-client-ui-settings@deepseek-ai/dsh-client-ui-sidebar@deepseek-ai/dsh-client-ui-slots@deepseek-ai/dsh-host-webserver@deepseek-ai/dsh-session@deepseek-ai/dsh-session-persistence给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个
界面预览
3 张 · 点击查看大图功能亮点
- 按天统计token用量
- 缓存命中率曲线
DSH web 插件:按天统计 token 用量,配 GitHub 风格活跃度热力图、缓存命中率曲线和分模型明细
最近更新
在 GitHub 查看全部 →v0.3.42026-10-20
· 版本概述 / Release Overview
v0.3.4 adds two short ranges — today and the last three days, both bucketed per hour — and makes the Tokens card state its figure exactly: a compact K/M/B headline with the full count and its unit underneath. The activity heatmap is fixed on two counts: its SVG viewport is now sized from the real track count, so the newest week is no longer clipped, and a window request that fails once no longer leaves the grid grey for the rest of the session (issue #15).
v0.3.4 新增「今日」与「最近 3 天」两个短范围(均按小时分桶),并让 Tokens 卡片把数值写清楚:K/M/B 紧凑主值,下方是带单位 tokens 的完整数字。热力图修了两处:SVG 视口改为按实际轨道数计算,最新一周不再被裁到边缘;窗口请求失败一次后,不再让整个会话都停在灰色(issue #15)。
· 新增 / Added
· Today and the last 3 days are selectable ranges; for these two the token trend switches to hourly buckets.
· The Tokens card leads with its compact K/M/B figure and repeats the exact count with its tokens unit underneath (issue #13).
· 新增「今日」与「最近 3 天」两个可选范围;这两个范围下 Token 趋势按小时分桶。
· Tokens 卡片以 K/M/B 紧凑值为主,下方重复带 tokens 单位的精确数字(issue #13)。
· 变更 / Changed
· The sidebar glyph now draws at the weight of the shipped panel rows beside it, and the plugin-card icon's trend line is a two-bend polyline instead of three wiggling beziers (issue #12).
· The README, its preview images, the animated demo and the banners now show the current panel: today / 3-day presets, the rebuild action, and the new Tokens card.
· 侧栏图标线宽改为与旁边官方面板行一致;插件卡图标的趋势线由三段起伏的贝塞尔改为经过两个拐点的折线(issue #12)。
· README、预览图、动画 demo 与 banner 换成当前面板:今日 / 3 天预设、重建按钮与新的 Tokens 卡片。
· 修复 / Fixed
· The heatmap's SVG viewport now covers every week track the grid lays out, including the extra track a partial first week needs, so the newest week is no longer pushed past the right edge.
· A heatmap window request that fails once no longer leaves the grid at level-0 for the rest of the session: the window is re-read on every panel load (range switch, refresh, rebuild), and the failure is logged to the console instead of being swallowed (issue #15).
· 热力图的 SVG 视口现在覆盖网格实际铺出的全部周
v0.3.32026-10-14
· 版本概述 / Release Overview
v0.3.3 brings the plugin onto the dsh 0.2.1 line and closes the two compatibility gaps that line opened: the composer statistics row no longer duplicates itself (issue #10), and the panel's own /usage/api route answers again when the server is bound to a concrete non-loopback address or reached through --trusted-host. It also starts counting two billed call kinds that were previously invisible — compaction summaries and AI-generated session titles — so the panel's totals stop undercounting them.
v0.3.3 把插件带到 dsh 0.2.1 线,补上该线打开的两处兼容缺口:输入区统计行不再自我重复(issue #10),服务端绑定具体非 loopback 地址或经 --trusted-host 访问时,面板自己的 /usage/api 路由恢复应答。同时开始统计此前完全不可见的两类计费调用——会话压缩的摘要调用与 AI 生成的会话标题——面板总量不再少计它们。
· 修复 / Fixed
· From DSH 0.2.1-alpha.1 the bottom statistics row is one speed pill plus one token pill again, instead of two duplicate pairs, and it keeps rendering as the single official-style row on DSH 0.2.0-rc.2 and earlier (issue #10).
· On DSH 0.2.1-alpha.2, panel data loads again when the server binds a concrete non-loopback address or is reached through --trusted-host; on DSH 0.2.0-rc.2 and earlier a --trusted-host authority keeps working as before. Cross-site and foreign-Host requests stay refused on both.
· Compaction summaries are counted: each adds its provider-reported tokens and one request, attributed to the route that wrote the summary.
· Session-title calls are counted: a generated title is billed but writes no usage into the session log, so its tokens and one request are now recorded too. A title call whose stream is cut short — a timeout, or a cancelled session — is still counted, and one compaction counts one request no matter how often the backend retried internally, while a failed compaction is not counted at all.
· 从 DSH 0.2.1-alpha.1 起,底部统计行恢复为一颗速度 pill 加一颗 token pill,不再是两组重复;在 DSH 0.2.0-rc.2 及更早仍渲染原来的官方样式整行(issue #10)。
· 在 DSH 0.2.1-alpha.2 上,服务端绑定具体非 loopback 地址、或经 --trusted-host 访问时,面板数据恢复加载;在 DSH 0.2.0-rc.2 及更早,--trusted-host 授权一如既往可用。
v0.3.22026-10-06
· 版本概述 / Release Overview
v0.3.2 collects the fixes and additions since v0.3.1 and matters to anyone on the dsh 0.1.7+ line. The two composer stat dialogs regain the official frosted material and, with deepseek-harness-background active, join that plugin's glass sheet (issue #6). The panel toolbar gains a guarded Rebuild action, the Plugins page shows the plugin's own card icon and localized metadata, and the activity heatmap scrolls without re-rasterizing its cell shadows every frame.
v0.3.2 收拢 v0.3.1 以来的修复与新增,面向所有 dsh 0.1.7+ 线的用户。输入坞的两个统计浮层找回官方磨砂材质,并在 deepseek-harness-background 激活时接入其玻璃体系(issue #6);面板工具栏新增带确认的重建操作;插件页显示本插件自己的卡片图标与本地化元数据;活跃热力图滚动时不再逐帧重绘格影。
· 新增 / Added
· With deepseek-harness-background installed and its glass gate active, the two composer stat dialogs join that plugin's frosted-glass sheet: they keep the official menu fill and gain the shared sheen and the blur chain that follows the user's blur slider. With the gate off — wallpaper disabled, no source, panel opacity maxed — or the plugin absent, they render the official material unchanged.
· The panel toolbar gains a Rebuild action: the first press arms it (red, "Rebuild?"), the second rebuilds the statistics through POST /usage/api/reset; blur, Escape, or five seconds without a second press cancels.
· The plugin declares its card icon and en / zh / zh-TW locale dictionaries, so the Plugins page shows the plugin's own icon and localized title and description instead of the package-name fallback.
· 安装 deepseek-harness-background 且其玻璃门禁激活时,输入坞的两个统计浮层接入该插件的毛玻璃体系:保留官方菜单填充,叠加共用高光与跟随模糊滑杆的模糊链。门禁关闭(停用壁纸、无图源、面板不透明度拉满)或未装该插件时,浮层保持官方材质不变。
· 面板工具栏新增「重建统计」:首次点击进入待确认(变红显示「确认重建?」),再次点击经 POST /usage/api/reset 重建统计;失焦、Esc 或 5 秒内无第二次点击即取消。
· 插件声明了卡片图标与 en / zh / zh-TW 语言字典,插件页显示本插件自己的图标与本地化标题、描述,不再回退到包名。
· 修复 / Fixed
· The two composer stat dialogs (time & speed, token usage) keep the official frosted material on dsh 0.1.7 and later: the panel pairs the translucent menu fill with the official blur token ins
数据来自仓库的 GitHub Release,可能与插件实际版本不一致。
README
由 DeepSeek 最新模型翻译生成DSH 用量统计面板
Awesome DSH Plugin
DSH web 插件的用量统计面板:按天 / 按小时的 Token 趋势、GitHub 风格活跃热力图、缓存命中率曲线、按模型与按供应商两种用量拆分(环形占比图 + 明细列表),作为插件页中本插件的独立页面,并在左侧栏提供独立入口。
所有图表均为手绘 SVG,不依赖图表库;配色是固定的 rank 色板(--dsw-chart-1..10 给模型前 10 名、--dsw-provider-1..5 给供应商前 5 名,其余归入灰色 "Other" 桶),暗色主题下整体提亮,随 DSH 主题自适应。
预览
功能
- 时间范围:今日、最近 3 / 7 / 14 / 30 / 90 天,或自定义起止日期;今日与最近 3 天按小时汇总,其余按天
- 汇总卡片:Token 用量(K/M/B 紧凑主值,下方带 tokens 单位的精确值)、会话数量(完成的 turn)、请求数量、活跃天数、平均缓存命中率(附缓存命中绝对量)、最常用模型
- 52 周活跃热力图:每日 token 用量的 GitHub 风格色阶,悬停查看当天明细;数据窗口固定为一年,列数随可用宽度自适应(窄窗口显示较少周数),图表始终左右撑满
展开完整文档(README 剩余 1 节)
DSH 用量统计面板 Awesome DSH Plugin DSH web 插件的用量统计面板:按天 / 按小时的 Token 趋势、GitHub 风格活跃热力图、缓存命中率曲线、按模型与按供应商两种用量拆分(环形占比图 + 明细列表),作为插件页中本插件的独立页面,并在左侧栏提供独立入口。 所有图表均为手绘 SVG,不依赖图表库;配色是固定的 rank 色板(--dsw-chart-1..10 给模型前 10 名、--dsw-provider-1..5 给供应商前 5 名,其余归入灰色 "Other" 桶),暗色主题下整体提亮,随 DSH 主题自适应。 预览 功能 - 时间范围:今日、最近 3 / 7 / 14 / 30 / 90 天,或自定义起止日期;今日与最近 3 天按小时汇总,其余按天 - 汇总卡片:Token 用量(K/M/B 紧凑主值,下方带 tokens 单位的精确值)、会话数量(完成的 turn)、请求数量、活跃天数、平均缓存命中率(附缓存命中绝对量)、最常用模型 - 52 周活跃热力图:每日 token 用量的 GitHub 风格色阶,悬停查看当天明细;数据窗口固定为一年,列数随可用宽度自适应(窄窗口显示较少周数),图表始终左右撑满 - Token 趋势:堆叠柱状图叠加平滑的缓存命中率曲线(Catmull-Rom 样条),今日 / 最近 3 天按小时分桶、其余按天,悬停查看各模型拆分;宽度随容器自适应,始终左右撑满 - 模型用量:环形占比图 + 明细列表,前 10 名模型分色,其余折叠为可展开的 "Other" 明细;圆环直径随可用宽度在 200–280px 间自适应,并与右侧清单垂直居中 - 供应商用量:同一结构上移一层——前 5 名供应商分色(独立色板),其余归入灰色 "Other";悬停任一侧联动另一侧,圆环悬停显示该供应商的全部模型用量;每行可展开该供应商的模型明细,"Other" 展开被折叠的供应商、其下再展开各自的模型(展开不影响圆环尺寸) - 底部信息栏增强:面板底部可开启"精确缓存命中率"(会话底部信息栏的缓存命中率以两位小数显示,如 85.25%)、"会话 Token 明细"(底部信息栏显示总 Token、输入、输入(命中缓存)、输入(未命中缓存)与输出 Token,替代默认的"输入/输出"两项)与"流式吞吐速度"(输出过程中速度读数随每个增量实时刷新为估算值,某一步结束后回到会话累计的精确值;估算以 DeepSeek 公布的字符密度为先验,再用本会话已结算步骤的实测字符/Token 比率校准,读数取最近 2 秒内实际观测到的 Token 增量并做平滑(单帧抖动不会传导到显示),UI 迟发的积压不会被计入,一步中途静默时保持最后一次读数而不是回落到会话平均值);开关位于"使用统计"面板底部,三个开关同款样式,切换即时生效 - 历史回扫:首次启用时枚举并回放既有会话日志;对挂载后才首次观测到的活跃会话,其挂载前的历史会在下一次启动时按事件序号边界回放补全,从安装日起尽量还原历史用量 - 本地持久化:数据写入 $DSH_HOME/storages/usage_history.json(storage-domain),纯本地、无外部依赖 安装 dsh plugin --profile <name> add dsh-usage-statistics-panel@latest 装完硬刷新浏览器(Cmd/Ctrl+Shift+R):client 半的改动 DSH 会热加载,无需重启;仅 host 半(采集/存储/路由)更新时需要重启 DSH。 插件挂载后有两个入口:左侧栏 新会话 下方的 使用统计 行(一眼可达),或在 插件 页里进入 已安装 → usage-statistics-panel 的详情页(卡片与详情页的标题、描述、图标取自本包的 locale/.json 与 icon.svg,随界面语言在简体 / 繁体 / 英文之间切换;完整包名仍在该详情页以代码行列出)。两处渲染的是同一个面板;独立面板左上角有返回按钮,点击即回到进入它之前的界面(会话、插件页或其它面板)。 兼容性:本插件支持 DeepSeek Harness >= 0.1.7-rc.1;开发依赖对齐宿主 0.1.7-rc.2,并已在正式版 0.2.0-rc.2、预发布 0.2.1-alpha.2 与 0.2.1-rc.2 三个隔离实例上实测(面板出数、围栏四种路径)。V3 / V4 会话日志兼容由单测覆盖(V4 自 0.2.0-rc.2 起就是发布格式,assistant/message.data.usage 等采集点字段两版一致),历史回扫双路径(0.1.2-rc.1 的 list+inspect 与 0.1.3-alpha. 起的 list+open+分页 read+close)保留。 /usage/api 的信任围栏也按宿主代际取源:0.2.1-alpha.2 起官方把显式授权移到 webStartup、删除 webRuntime,并新增「接受监听端自身 bind 地址」;此前 webRuntime.trustedHosts(含绑定时采样的局域网地址)才是官方围栏接入的那一份。插件按 webRuntime → webStartup 的顺序读,并始终把 webServer.host 当作可接受的 bind 字面量(未指定地址拼写除外),两代都与官方同语义放行/拒绝。 已知差异:官方那两个统计条目会跟随「性能与用量显示」偏好(紧凑档只留速度 / 只留缓存命中),本插件的遮蔽条目不跟随,始终渲染详细读数。该偏好的数据源在 ui-chat 私有的 config form 里,跨插件直读属于易碎耦合,故这里选择不实现——两代宿主上行为一致,并非 0.2.1-alpha.2 引入的差异。 底部信息栏那一行按宿主容器自适应:0.1.6-alpha.2 起宿主把它放进与上下文占用环并排的 flex 行里(居中、间距、顶距与侧边距都由该容器负责),0.1.6-alpha.1 及以前它仍自持内容宽度、左右侧边距与 4px 顶距——同一份构建在两种宿主上都对齐。 peer 依赖中的 @deepseek-ai/ 只表达能力下界(>=0.1.7-rc.1 是插件用到的最早接口面),并全部标记为 optional。按 semver 的预发布规则,该范围只匹配同一 tuple 的预发布版——0.1.7-rc.2 判为满足,而下一个预发布行(0.1.8-rc.1)仍判不满足——所以实际支持的宿主版本以本段说明为准,不依赖 npm 的 peer 校验。 旧宿主用户:0.1.6-alpha.2 及更早的 DeepSeek Harness 请安装本插件 0.3.0 及之前的版本。宿主在 0.1.7 线把 @deepseek-ai/dsh-client-ui-primitives 的图标导出整体改为字重命名(Outline16 → OutlineRegular / Medium),两代导出名无交集:旧名在 0.1.7+ 上解析为 undefined,会让底部信息栏渲染失败——一份构建无法同时服务两代。 数据来源 面板的数据采集是观测式的,共三处来源:会话事件流(session/event)中的 assistant/message 与 assistant/chunk(agent loop 的每次调用)、同一事件流中的 compaction/summary(会话压缩的摘要调用——它的用量只记在该事件里,因为摘要并不产生 assistant/message),以及 llm/stream 瀑布事件(AI 生成的会话标题——标题调用在会话日志里只留下请求、不留用量)。三处都提取 provider 上报的 token 用量(输入 / 输出 / 缓存读 / 缓存写)。去重与归因各不相同:agent loop 的调用在单个会话内按 (turn, step) 去重(同一调用只计一次、保留先到的样本——两个官方适配器对流式采样与最终上报的数值完全一致;并发会话各自独立计数、互不吞样本),模型归因优先取消息自带的 source(每次调用各自标注),缺失时回退到会话的路由折叠(request/context 事件或会话的 requestContext()),宿主重启后也不会落入 "(unknown)" 桶;压缩按 compactionId 去重,并以事件自带的 provider/model 归因;标题每次调用计一次(token 加一次请求),取该次流中最后一个 usage 样本——适配器上报的是累积值,累加会重复计数。首次启用时还会回扫既有会话日志补齐历史。 提示:Token 用量从插件启用(含回扫)之日起累计;更早的会话日志若无 provider 上报的用量数据,则无法回溯。会话标题是唯一例外:它的用量不在会话日志里,只能由插件运行时从 llm/stream 截获,因此既无法回扫补齐,插件未运行期间发生的标题调用也会漏计。 子代理会话:子代理是独立会话,其 token、请求与完成的轮次与顶层会话一并统计(实时采集覆盖全部会话事件流,重启后回扫同样覆盖子代理会话日志);父会话仅收到子代理结果摘要,不会重复计入。子代理会话早期的请求标记(step/start)先于其路由事件写入日志,首个请求可能统计在 "(unknown)" 桶——请求总数不受影响。 Token 口径:汇总卡片与趋势图的 Token 总量按服务商总口径统计——未缓存输入 + 输出 + 缓存读 + 缓存写(DeepSeek 会把 prompt 拆成输入、缓存读两个不相交的桶,简单相加会漏掉占大头的缓存部分)。统计范围是智能体循环的会话调用、会话压缩与 AI 生成的会话标题,不含联网搜索:DSH 的搜索后端用服务商私有的 HTTP 客户端直连搜索端点,既不在会话日志留下用量,也不经过 llm/stream,插件侧无从获取,因此本总量与服务商账单面板之间最多相差这一项。平均缓存命中率以输入侧(命中 + 未命中)为分母,其中未命中 = 未缓存输入 + 缓存写入——与会话底部信息栏(官方 StatsLine 口径)完全一致,两处读数不会出现分歧;命中率卡片下方同时展示缓存命中的绝对 token 量。 压缩口径:一次压缩计一次请求——后端内部的重试不可见(压缩调用不经 llm-retry);压缩失败时不会写入 compaction/summary,这次调用也就不计,尽管它可能已被计费。会话标题同样每次调用计一次请求与一次 token(取流中最后一个 usage 样本),流被超时或取消打断时仍记账。 重建统计:面板工具栏(刷新 右侧)的 重建统计 按钮就是这个动作,需二次确认——首次点击变红显示「确认重建?」,再次点击才执行(移开焦点、按 Esc 或 5 秒内不再点击都会自动取消)。它等价于 POST /usage/api/reset(与面板同源信任围栏保护):清空本地统计并按当前归因规则全量重放会话日志——用于历史数据损坏或归因规则升级后的重建。仍在进行中的会话以其重置时刻的日志长度为界:界内由重放重建、界外继续由实时采集,恰好各计一次。 开发 sh pnpm install pnpm typecheck # tsc --noEmit pnpm test # vitest pnpm build # tsc declarations + tsdown (host ESM + 双通道 client bundle) 设计与实现 - Host 半(src/):collector(事件订阅 + 回扫折叠)、store(usage_history storage-domain)、query(范围聚合,翻译自 reasonix 的 query.go)、routes(/usage/api fenced JSON 路由,信任围栏与 /api 网关一致) - Client 半(src/client/):UsageStatsPanel.tsx(手绘 SVG 图表,移植自 reasonix 面板 + rank 色板)、locales(en / zh / zh-TW)、api(/usage/api fetch 封装) - 双通道打包:lib/client.js(官方 profile 通道,bundle id = 包名)与 lib/client-registry.js(插件注册表通道,bundle id = manifest id)。harness 0.1.x 官方加载链只消费前者;后者为外部 registry 通道预留,当前无消费者 - 详细设计见 docs/design.md 致谢 本面板是对 reasonix 用量统计功能的复刻移植:作者曾为 DeepSeek-Reasonix 实现并贡献了该功能(PR #7238、#7503),本插件按 DSH 的插件规范将其移植到 DeepSeek Harness,前端图表大比例复用原实现,数据层则基于 DSH 的会话日志与 storage-domain 重新实现。 Activity HaoyueQin/dsh-usage-statistics-panel GitStock K-Line Chart License MIT
预览分享卡片长什么样 ↓
分享 · DeepSeek Harness Hub
HaoyueQin/dsh-usage-statistics-panel
DSH web 插件的用量统计面板:按天 / 按小时的 Token 趋势、GitHub…
相关插件 · 市场 / 管理
插件精选列表awesome-dsh-plugin/awesome-dsh-plugin
DeepSeek Harness(dsh)插件精选列表
★ 22,025未汉化DSH
73.6
新词雷达zhuyansen/new-term-radar
new-term-radar新词雷达
★ 2,049已汉化MCP
72.8
插件生态导航0xsline/awesome-deepseek-harness
安装 贡献指南 DeepSeek Docs 公开插件目录 Issues
★ 1,188已汉化DSH
72.6
技能注册中心iflytek/skillhub
企业级开源智能体技能注册中心——发布、发现并管理组织内可复用的技能包。
★ 5,358已汉化DSH
71.9
插件市场目录imsai-sh/awesome-deepseek-harness-plugins
面向 DeepSeek Harnessdsh生态的社区插件目录,共收录 13938 个插件含 PR 收录与…
★ 350已汉化DSH
71.8
插件精选清单Anil-matcha/awesome-dsh-plugin
DeepSeek Harnessdsh精选指南——DeepSeek…
★ 1,013已汉化DSH
71.7