DeepSHPlugins
dsh-usage-guard 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-usage-guard

安全與運維JavaScriptMIT

用量統計面板:靜默按模型採集 token、活躍熱力圖、趨勢圖、費用估算與每日超限守衛。

1 Starshb-degithub 更新時間 2026-08-20
訪問 GitHub 倉庫
dsh-usage-guard 專案預覽

專案介紹

中文

用量統計面板:靜默按模型採集 token、活躍熱力圖、趨勢圖、費用估算與每日超限守衛。

English

Usage statistics panel: silent per-model token collection, activity heatmap, trend charts, cost estimation and daily-limit guard.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
hb-degithub
倉庫
hb-degithub/dsh-usage-guard
GitHub Stars
1
Forks
0
開發語言
JavaScript
許可證
MIT
最近推送
2026-08-20
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

54/ 100
維護活躍
85
文件與實用資訊
100
生態關注度
9
安裝便捷訊號
100
專案宣告訊號
100

近 22 天仍在更新;README 含完整安裝與使用說明;關注度尚低(1)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add dsh-usage-guard

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-usage-guard

English | 中文

Usage statistics panel for DeepSeek Harness (DSH) Web GUI — silent background collection, per-model analytics, cost estimation and a daily-limit guard.

Features

  • Silent collection — hooks session events, folds every assistant message's token usage into daily buckets per provider × model; survives restarts, backfills from session logs on first run
  • Dashboard in Settings → Usage: six stat cards (tokens, sessions, messages, active days, current streak, top model), a GitHub-style activity heatmap (continuous year view, weekday/month labels, hover detail card per day), a multi-series line/area trend chart (input / output / cache hit / cache write / cost, dual axes, 7d/30d switch) and a model-usage donut
  • Cost estimation — configurable per-model prices (input / output / cache read / cache write per 1M tokens); built-in DeepSeek list prices; models without a price are excluded from cost instead of guessed
  • Daily-limit guard — optional daily token / cost caps; warn mode shows a global banner, block mode aborts over-limit LLM requests before they hit the network
  • Bilingual (zh/en), follows the DSH theme tokens, zero external runtime dependencies

Install

From the DSH plugin market (Settings → 插件市场), or:

dsh plugin --profile web add dsh-usage-guard   # npm
dsh plugin --profile web add <github-url>      # or from GitHub

Restart dsh web, then open Settings → 使用统计.

Develop

pnpm install
pnpm build   # tsdown + wrap-client → dist/client.js (host loads host/, browser loads dist/)
pnpm test    # vitest, incl. an SSR smoke test that renders all charts from real data

License

MIT


中文

DeepSeek Harness(DSH)Web GUI 的用量统计面板——后台静默采集、按模型分析、费用估算、每日超限守卫。

功能

  • 静默采集——挂钩会话事件,把每条助手消息的 token 用量折叠进 天 × 提供商 × 模型 桶;重启不丢,首次运行自动从会话日志回填
  • 仪表盘(设置 → 使用统计):六张统计卡(tokens、会话数、消息数、活跃天数、连续天数、最常用模型)、GitHub 风格活跃热力图(连续年度视图、星期/月份标注、逐日悬浮详情卡)、多序列折线/面积趋势图(输入/输出/缓存命中/缓存创建/成本,双轴,7/30 天切换)、模型用量环形图
  • 费用估算——按模型配置价格(每 1M tokens 的 输入/输出/缓存读/缓存写);内置 DeepSeek 刊例价;未配置价格的模型不计费而不是瞎猜
  • 每日超限守卫——可选每日 token / 费用上限;warn 模式全局横幅提醒,block 模式在请求发出前直接拦截
  • 中英双语,跟随 DSH 主题令牌,零外部运行时依赖

安装

插件市场(设置 → 插件市场)一键安装,或:

dsh plugin --profile web add dsh-usage-guard   # npm
dsh plugin --profile web add <github 地址>      # 或从 GitHub

重启 dsh web,打开 设置 → 使用统计。

许可

MIT

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案