y2zyyr/dsh-token-usage-sidebar 预览 preview

y2zyyr/dsh-token-usage-sidebar

Plugin插件 Native原生 ⭐ 3 MIT Usage & Cost用量与计费UI & Themes界面与主题

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许可证开源,移除插件时不会删除本地已存储的用量数据,用户可自行保留历史记录。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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

npm version

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 →

← 上一个 Prev dsh-alpha 下一个 Next dsh-billing →