Introduction

The extension method of DSH is “Everything is a plugin”. The plugin directory here is an independent site/page with no official affiliation to DeepSeek / Hyperscience and should not be interpreted as an official app store.

When developing agents, token consumption is usually scattered across various project sessions. If you only want to quickly check “how many tokens were used on this machine today” or “which day of the week has higher usage this week”, simply flipping through session logs is not convenient. Below is an introduction to a DSH web GUI plugin: @apodemakeles/dsh-token-dashboard.

What is it

@apodemakeles/dsh-token-dashboard is a DSH web GUI token-consumption heatmap plugin. It provides a daily / weekly total-token usage panel based on session-log usage events.

The basic facts are as follows:

  • Plugin Name: @apodemakeles/dsh-token-dashboard
  • Maintainer: apodemakeles
  • License: MIT
  • Current Version: v0.2.0
  • Distribution Status: GitHub distribution is live; npm package is not currently published
  • Node Requirements: node >=22.5.0

Core Features

The plugin registers a Token entry in the DSH web GUI sidebar. Clicking it opens a dedicated panel containing a weekly grid and a daily view, used to view token usage for all projects on this machine.

Data Projection

The plugin’s data pipeline consists of two parts:

  • Host half: Listens to live session/events, flushes through the DSH durability barrier, and sends minimal usage deltas to the persistent Worker.
  • Worker half: Responsible for SQLite data projection and exposing a consistent snapshot endpoint to the outside.

When the panel opens or refreshes, it calls the snapshot route:

GET /api/token-dashboard/snapshot

A snapshot is obtained every time the panel opens / refreshes / or the page changes.

Total tokens are calculated using the following formula:

inputTokens + outputTokens + cacheReadTokens

CLI Maintenance Commands

The plugin provides local maintenance commands:

dsh-token-dashboard status|verify|rebuild|backups|restore|cleanup

Installation and Activation

The installation steps are as follows:

  1. Install from GitHub:
dsh plugin --profile web add github:apodemakeles/dsh-token-dashboard
  1. Restart DSH web:
restart dsh web
  1. Open any project session, then click the Token entry in the sidebar.

Data and First Launch

The projection database is located at:

$DSH_HOME/data/token-dashboard/usage-v1.sqlite

The default DSH_HOME is:

~/.dsh

On the first launch, the plugin initializes the database in the background. The panel will display the phase / progress until it enters ready.

The projection scope is machine-local: it reads sessions stored on this machine. ~/.dsh/sessions is the authority, and SQLite is a rebuildable projection.

The panel will only call the snapshot route and will not trigger the following operations:

listSnapshots
inspect
readFrom
flush
backfill

Development Installation

If building from source, first clone the repository:

git clone https://github.com/apodemakeles/dsh-token-dashboard.git
cd dsh-token-dashboard

Then install dependencies and build:

pnpm install && pnpm build

Finally, install via local link:

dsh plugin --profile web add link:$(pwd)

Changes at the Host / Worker level require restarting DSH; client HMR does not override the persistent Worker.

Use Cases and Notes

Suitable for these scenarios:

  • Using the DSH web GUI and wanting to view daily / weekly token usage on the local machine.
  • Wanting to project usage facts to a local SQLite database instead of scanning logs every time the panel is opened.
  • Needing to view the total token count after merging inputTokens, outputTokens, and cacheReadTokens.

Notes:

  • The plugin runs with the permissions of the current DSH process. You should check the source code and the MIT license before installing.
  • The npm package is not currently published; use the GitHub installation method.
  • Projection data is local machine data and is not equivalent to cross-machine aggregation.
  • SQLite is in an experimental state (node:sqlite) under Node 24. The plugin will check for the capability at startup and will not globally suppress warnings.
  • In the package declaration, dsh.client.platform is set to web and injects the following runtime dependencies:
@deepseek-ai/dsh-client-runtime
@deepseek-ai/dsh-client-ui-slots
@deepseek-ai/dsh-client-locale

dsh.bundle.patch points to:

./cordis.patch.yml

Conclusion

This plugin organizes token usage from local DSH sessions into a daily / weekly heatmap, suitable for developers who need to quickly determine “how many tokens were spent today / this week”.

Reference Links:

  • Directory Page: https://www.skillhub.cn/plugins/apodemakeles/dsh-token-dashboard
  • GitHub: https://github.com/apodemakeles/dsh-token-dashboard