my-dsh/oh-my-dsh--packages-bundle-token-usage-dashboard ↗★ 2

@deepseek-ai/dsh-token-usage-dashboard

The Token consumption dashboard as a profile bundle: a patch layer inserting the host-side token-usage listener and its SQLite provider plus the browser dashboard panel over any web-surface profile 适合需在未挂载网页应用的主机配置档中补齐用量看板者;已挂载该应用则不应安装。

パッケージ
@deepseek-ai/dsh-token-usage-dashboard
互換性
未検証
Harness ピア範囲
workspace:^
Cordis ピア範囲
workspace:^
バージョン
0.1.2-alpha.1
ライセンス
MIT
最終更新
2026/09/10

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:my-dsh/oh-my-dsh#4851e4eaa6b8dee8c008e67068e489ec74c43faf&path:packages/bundle/token-usage-dashboard

ドキュメント

README 全文を読む ↗

@deepseek-ai/dsh-token-usage-dashboard

English | 中文

Summary

The Token consumption dashboard as a profile bundle: one install gives both ends of the feature — the host-side capture (SQLite provider + session listener) and the browser dashboard panel. @deepseek-ai/dsh-web-app already includes these same three rows, so this bundle exists to add the full dashboard to a web-surface profile that does not mount it. A profile that already mounts @deepseek-ai/dsh-web-app must not install this bundle.

Table of Contents


Use this package

Install into a profile

dsh plugin --profile  add @deepseek-ai/dsh-token-usage-dashboard
dsh plugin --profile  remove @deepseek-ai/dsh-token-usage-dashboard

The browser panel renders only inside a web surface, so the target profile must already provide the client runtime, connection, and shell.overlay layout. It composes over a web-surface profile and mounts on a dsh web boot. Requires pnpm on PATH and a dsh installation that provides the in-box dependencies the rows name.

What you get

Three rows: the SQLite provider behind tokenUsageStore, the session/event listener that appends per-request usage records, and the floating-button dashboard panel registered into shell.overlay.


Understand the implementation

Implementation internals — click to expand

The patch document (cordis.patch.yml) inserts four rows:

Row idPackageRole
token-usage-sqlite@deepseek-ai/dsh-token-usage/sqlite-providerSQLite provider for tokenUsageStore
token-usage@deepseek-ai/dsh-token-usageSession/event listener appending usage records
token-usage-remote@deepseek-ai/dsh-token-usage/serviceTypert Remote service exposing daily summaries
ui-token-usage@deepseek-ai/dsh-client-token-usageBrowser dashboard panel in shell.overlay

The listener injects tokenUsageStore, so it activates only after the provider mounts. The bundle's substance is the patch list and it carries no runtime API.


Model Experience

None, as the inserted listener only observes the session stream and persists provider-reported accounting.

KV Cache effect

None; neither inserted host row nor the client panel assembles a provider request.

Known Limitations and Deferred Work

  • A web surface is required — the browser panel registers into shell.overlay (owned by @deepseek-ai/dsh-client-ui-layout) and reads the tokenUsage wire domain, so this bundle composes over a web-surface profile and not a host-only or headless one.
  • Mutually exclusive with @deepseek-ai/dsh-web-app — that bundle already includes the same three rows, so installing both registers the tokenUsageStore service twice and fails the load.
  • Local timezone day bucketing — the aggregate groups records by calendar day in the host's local timezone, matching the panel's day picker, rather than UTC. A locale-configured bucketing mode is deferred until a deployment states a requirement.
  • No retention policy — the store never auto-expires data; growth is bounded by purge() calls.

Dev Note

Working context for maintainers — click to expand

Capture starts on the next boot and needs no configuration: every successful model call appends one record, and the bundled browser panel shows the daily (provider, model)-grouped totals from the wire tokenUsage domain. The store never auto-deletes; tokenUsage.purge(before?) drops rows before an epoch-millisecond cutoff for retention.