my-dsh/oh-my-dsh--packages-bundle-token-usage-dashboard ↗★ 2
@deepseek-ai/dsh-token-usage-dashboard
以配置包形式为网页界面配置档添加令牌用量看板,含主机端采集与浏览器面板。 适合需在未挂载网页应用的主机配置档中补齐用量看板者;已挂载该应用则不应安装。
安装
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
- Understand the implementation
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
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 id | Package | Role |
|---|---|---|
token-usage-sqlite | @deepseek-ai/dsh-token-usage/sqlite-provider | SQLite provider for tokenUsageStore |
token-usage | @deepseek-ai/dsh-token-usage | Session/event listener appending usage records |
token-usage-remote | @deepseek-ai/dsh-token-usage/service | Typert Remote service exposing daily summaries |
ui-token-usage | @deepseek-ai/dsh-client-token-usage | Browser 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 thetokenUsagewire 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 thetokenUsageStoreservice 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.