DeepSeek Harness 插件

phungthien269/dsh-token-stats

Star 数 ★ 0 分类 用量与计费 收录于 2026-09-03

DSH Web GUI 的 Token 用量仪表盘 — 今日/本周/本月/累计汇总、按模型明细和堆叠柱状图,界面支持中/英/越/日。

安装

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:phungthien269/dsh-token-stats

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWEDERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yamlallowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

Token usage dashboard for the DeepSeek Harness web GUI — displayed directly inside the app. No extra collection: it reads the 365-day local ledger the built-in Wallet plugin already records (every AI call: model, provider, day, input/output/cache tokens, cost when priced).

English · Tiếng Việt · 中文

Features

Token Statistics dashboard

  • Sidebar entry "Token Statistics" — opens a full-width dashboard in the center column (same interaction model as the Task Board plugin); works in both the expanded sidebar and the compact rail.
  • Four summary cards — Today / This week / This month / All time (tokens + cost when pricing data exists).
  • Stacked bar chart — pure SVG, one color per model, daily (30 days) / weekly (12 ISO weeks) / monthly (12 months), hover tooltips per model, K/M-scaled axis.
  • Per-model table — input, output, cache read, total, share bar; sorted by total.
  • 4-language UI — English (primary), Tiếng Việt, 中文, 日本語. Language picker in the dashboard header; the choice is remembered.
  • Auto-refresh — refetches every 30 s while the dashboard is open, plus a manual refresh button.
  • Zero dependencies, no build step — host half is plain ESM Node; client half is a single pre-bundled CJS module.

Install

dsh plugin --profile web add dsh-token-stats

Restart dsh web (or use the Market's one-click restart), then look for Token Statistics in the left sidebar.

Requires dsh ≥ 0.1.1-rc.2 (the sidebar DOM it integrates with). Read-only: the plugin never writes to the Wallet ledger.

How it works

  • Host half registers GET /api/token-stats/summary: all-time totals from ~/.dsh/storages/wallet.json sessions, and day/week/month series from its history.events (timezone-aware, mtime-cached).
  • Client half mounts the sidebar entry (self-healing DOM injection) and the dashboard React view; charts are hand-rolled SVG — no chart library.

Data notes

  • All-time totals come from the Wallet session ledger; the day/week/month series come from the Wallet event ledger (capped at 20,000 events / 365 days by the Wallet plugin). Models without pricing show tokens only.

Tiếng Việt

Dashboard thống kê token cho web GUI của DeepSeek Harness — hiển thị trực tiếp trong ứng dụng. Đọc sổ ghi 365 ngày có sẵn của plugin Wallet (mỗi lần gọi AI: model, ngày, token input/output/cache, chi phí khi có). Thẻ tổng quan Hôm nay / Tuần này / Tháng này / Tổng tất cả; biểu đồ cột xếp lớp theo model; bảng chi tiết từng model. Giao diện đa ngôn ngữ: Tiếng Việt, English, 中文, 日本語 — đổi ngay trong dashboard. Cài đặt: dsh plugin --profile web add dsh-token-stats, khởi động lại dsh web, mở mục "Thống kê Token" ở thanh bên.

中文

DeepSeek Harness Web GUI 的 Token 用量仪表盘 — 直接显示在界面内。读取内置 Wallet 插件的 365 天本地账本(每次 AI 调用:模型、日期、输入/输出/缓存 token、可用时的费用)。今日 / 本周 / 本月 / 累计四张汇总卡片;按模型堆叠的柱状图;模型明细表。界面支持越南语 / 英语 / 中文 / 日语,可在仪表盘内切换。安装:dsh plugin --profile web add dsh-token-stats,重启 dsh web,在侧边栏打开 "Token 统计"。

Submit to the Plugin Market

See docs/market-submission.md — publish to npm, then PR one entry into the awesome-dsh-plugin catalog (the Market picks it up automatically, usually within a day).

License

MIT — see LICENSE.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。