y2zyyr/dsh-token-usage-sidebar
DeepSeek Harness 的持久化今日/昨日/总计令牌使用量侧边栏。
Project Overview项目介绍
This is a community-built native plugin for the DeepSeek Harness (DSH) web profile, designed to track provider-reported token usage data locally on your machine. It integrates directly into DSH by adding a persistent sidebar summary that shows today’s, yesterday’s, and total lifetime token usage, plus a dedicated native Token Usage settings page. The plugin is published to the npm registry as @y2zyyr/dsh-token-usage-sidebar, and can also be installed directly from its GitHub source repository via the DSH CLI. To install the plugin, run the DSH CLI command dsh plugin --profile web add @y2zyyr/dsh-token-usage-sidebar, then restart your DSH web instance to activate the plugin.
This plugin is intended for any DSH user that wants to keep track of their token consumption and associated API costs across all their LLM calls. During regular use, the sidebar displays a quick summary of usage across different time ranges, while the dedicated settings page offers far more detailed aggregated statistics. Users can filter usage data by custom time range (today, yesterday, last 7 days, all time), and dynamically filter results by provider and model pulled directly from existing usage records. The plugin tracks input tokens, output tokens, cache reads and writes, reasoning tokens, and total call counts, giving users full visibility into their spending.
The plugin requires a Node.js runtime that includes the built-in node:sqlite module, which it uses for persistent, scalable storage. Write latency stays flat regardless of how much historical usage data you accumulate, since each new invocation is stored as a small row-level upsert. Upgrading from the older v1.0.1 version to the newer SQLite-backed v1.1 automatically migrates and verifies all existing data, so no usage totals are lost or double-counted. The plugin is released under the open-source MIT license, and removing the plugin does not delete your locally stored usage data. It has been verified to work with DSH 0.1.0-rc.6, and no broader compatibility is officially claimed.
这是一款由社区开发的原生DeepSeek Harness(DSH)网页配置文件插件,作用是在本地记录大模型提供商返回的token用量数据。它在DSH网页界面添加了一个持久化的侧边栏摘要,展示今日、昨日和累计总token用量,同时还内置了一个专属的「Token用量」设置页面。用户可通过DSH命令行工具执行dsh plugin --profile web add @y2zyyr/dsh-token-usage-sidebar完成安装,安装后重启DSH即可激活。
这款插件面向所有使用DSH调用大模型服务、需要跟踪自身token消耗和使用成本的用户。日常使用中,侧边栏会固定展示不同时段的用量汇总,用户也可以进入设置页面查看更详细的统计数据,支持按今日、昨日、7天和全部时间筛选,还可以按提供商和模型动态过滤。统计内容包含输入、输出、缓存读写、推理token用量以及调用次数,能够充分满足用户对用量明细查询和成本管控的需求。
插件依赖Node.js内置的node:sqlite模块,使用SQLite数据库作为持久化存储,写入延迟稳定,不会随着历史记录增加而变慢。从v1.0升级到v1.1版本时,插件会自动完成旧数据迁移并校验一致性,不会丢失数据或重复统计。插件采用MIT许可证开源,移除插件时不会删除本地已存储的用量数据,用户可自行保留历史记录。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-token-usage-sidebar(y2zyyr/dsh-token-usage-sidebar)
仓库:https://github.com/y2zyyr/dsh-token-usage-sidebar
本站详情页:https://www.yhbd.top/plugins/y2zyyr-dsh-token-usage-sidebar/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-10-03 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add @y2zyyr/dsh-token-usage-sidebar
把 y2zyyr/dsh-token-usage-sidebar 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-token-usage-sidebar
English | 简体中文
A community DeepSeek Harness (DSH) plugin for Web and Desktop profiles that keeps provider-reported token usage locally. It provides both a persistent sidebar summary and a native Token Usage settings page.
Project website: dsh-token-usage-sidebar
TOKEN USAGE
Today …
Yesterday …
Total …
This is a community plugin, not an official DeepSeek plugin.
v1.1.9 corrects retry and fork accounting, strengthens historical recovery and ledger validation, and prevents stale browser results. See CHANGELOG.md and the accounting v2 migration notes.
Features
- Sidebar summary: Today, Yesterday, and lifetime Total.
- Native Settings → Token Usage page, placed after Agent Presets and before Plugin Market.
- Compact per-range metric cards for Total, Input, Output, Cache, Reasoning, and Calls.
- Detail range selector: Today, Yesterday, 7D, and All time, with the filters kept on one compact row in the DSH modal.
- Per-range totals for Input, Output, Cache Read, Cache Write, Reasoning, and call count.
- Dynamic provider/model filters: the choices come from the exact provider and model names present in the selected range; no provider directory or preset supplier list is hard-coded.
- Provider/model filters use the exact names reported by DSH; the plugin does not ask users to configure a second provider-name mapping.
- Compact provider/model table with expandable bucket details, plus a seven-local-day table that retains zero-value days.
- Persistent local accounting that survives DSH restarts.
- Scalable durable ledger (v1.1). The lifetime accounting store is backed by a
plugin-owned SQLite database (Node's built-in
node:sqlite, WAL journal) instead of a monolithic JSON root. A new invocation is one small row-level upsert, so write latency stays effectively flat no matter how many historical records accumulate. - Automatic verified migration. Legacy JSON records are imported and verified transactionally, retaining unrelated or newer SQLite records. The source is backed up before cutover; a failed migration restores the previous SQLite state.
- Each usage batch commits its records and aggregate updates before returning.
- Historical recovery from available authoritative session usage records, with honest scan/coverage reporting (a partial or failed scan never claims complete lifetime coverage).
- Replay-safe accounting: each provider attempt is counted once; explicit retries contribute their own reported usage, and forks exclude inherited events.
- Visible recovery, partial-history, and stale-data states; failures do not silently replace known totals with zero.
- Native placement in the DSH web sidebar.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
Aisland-SJL/dsh-usage
Witherwithwinter/DeepSeek-Balance-Whale-Widget-Bowl
jelly-000/dsh-balance-monitor
SoDaZilla-zzz/dsh-liquid-glass-balance-card
283Gawin/dsh-heatmap
AKI2253/Sidor_UI
162568316/dsh-tokenrhythm-bill