KIDLi1412/dsh-token-heatmap
KIDLi1412★ 0JavaScript最后同步: 2026-08-16
DSH web plugin: GitHub-style daily token-usage heatmap on the new-session screen with a selectable calendar-year view, green/blue color schemes and a display switch, plus today / this-month / all-time totals.
README 摘要
dsh-token-heatmap DSH Web GUI 插件:在 新会话(hero)屏幕的输入框下方 显示一个 GitHub 风格的 token 用量热力图 —— 当前自然年(1月–12月) 每天的 token 用量,颜色深浅表示用量多少;同一行展示 今日 / 本月 / 累计 token 用量。 A DeepSeek Harness web plugin: a GitHub-style daily token-usage heatmap of the current calendar year (Jan–Dec) rendered below the composer input card on the new-session screen only , with today / this-month / all-time totals on the same line. 界面 / What you get 新会话屏幕输入框正下方出现一张统计卡( 只在新会话显示 ;已对话的会话不显示): - 📊 自然年热力图 :GitHub 风格,覆盖所选自然年 1月–12月(可切换年份, ‹ 年份 › 选择器在统计行右侧,最多到当前年),列为周(周一起),行为星期(左侧标注一 日全部 7 天);顶部月份标签按列跨度标注(左侧与格线对齐),今日之后的日期显示为空格。 - 🎨 六套配色 :绿色(经典 GitHub 风格)、蓝色、橙色、红色、紫色、青色,可在 设置 → 插件 → 插件配置 切换;颜色按 绝对阈值 分档(按天 token 数,非相对排名):0 / /storages/token-heatmap-config.json 。 安装 / Install 需要 web profile( @deepseek-ai/dsh = 0.1.0-rc.6 )与 pnpm 。 从 npm 安装: 从 GitHub 安装: 本地开发(手动,本地链接): 安装完成后 重启正在运行的 dsh web ,并在浏览器中硬刷新(Ctrl+Shift+R)。侧边栏无新增入口——统计卡直接出现在新会话输入框下方。卸载: 工作原理 / How it works - 服务端 ( lib/index.js + lib/usage.js + lib/config.js ):作为 profile bundle 挂载,增量折叠全部会话事件日志中的 token 用量样本( assistant/chunk 的 usage 与 assistant/message 的 usage ;同 (turn, step) 的重复样本按"替换"语义处理,归属后一天),按天、按模型聚合,缓存到 /storages/token-heatmap-cache.json ,并通过回环受限端点 GET /api/token-heatm…
在 GitHub 查看完整 README →