DeepSeek Harness plugin

dsh-ui-shadow-token

DSH web chat token badge: shadows the assistant-step renderer at slot priority -1 to show each message's input/output token usage

Jump to install

Source facts

Repository
haoliangwu/dsh-ui-shadow-token
Latest update
Aug 20, 2026
Category
Usage & Billing
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-21

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/haoliangwu/dsh-ui-shadow-token
Plugin: dsh-ui-shadow-token
Author: haoliangwu

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

<h1 align="center">dsh-ui-shadow-token</h1>

<p align="center">DSH web chat token badge — shows each assistant message's input/output token usage in a small pill at the message's top-right corner.</p>

<p align="center"><img src="docs/token-badge.png" alt="Token usage badge on assistant messages" width="640"></p>

A web client plugin for DeepSeek Harness. It shadows the keyed conversation.chat.node slot's assistant-step entry at slot priority -1, so every assistant message renders the stock content plus a ⚡ in {input} / out {output} badge in its top-right corner.

The badge reads the finalized message's usage payload (input/output/cache/reasoning tokens) with the same defensive narrowing the in-repo turn-metrics uses; while a message is still streaming and has no settled usage, the badge stays hidden. The stock assistant rendering — markdown, reasoning, tool rows, images — is untouched; only the pill is added.

Install

dsh plugin --profile web add github:haoliangwu/dsh-ui-shadow-token

Built lib/ is committed, so the git install is one line — no prepare script, no allowBuilds permission. Restart dsh --profile web after install (bundle layer stacks compose at boot).

Why slot priority -1

The conversation.chat.node slot is keyed by the node's kind: entryKey = routedNode.kind. The default assistant-step entry registers at priority 0. Keyed slot occupancy throws on same-key same-priority duplicates (fail loud), while a lower absolute priority shadows the default — the ledger sorts ascending and the lowest renders. Our entry registers the same key at priority: -1:

  • every assistant-step render resolves to this plugin's component;
  • the default renderer stays in the ledger as an inert fallback (upstream upgrades keep working; the default simply never renders);
  • any other kind (user, tool, turn-tail, …) is untouched — the default turn-tail footer (Ran for …, TTFT …, tok/s) still renders under the badge.

This is the client-slot alternative to disabled: true + re-registration: the slot declaration, seat dispatcher, and business-node state machines all stay in ui-conversation; the plugin only contributes one keyed renderer.

How it works

  • The badge is pure client rendering. The node half is an empty apply; all behavior lives in ./client, registered as a dsh.client web platform package. No host service, no RPC channel, no model-visible input, no session-log events.
  • Usage is read defensively from the node data. AssistantMessageNode.usage is typed unknown and carries a TokenUsage at runtime (inputTokens / outputTokens / cacheReadTokens / cacheWriteTokens / reasoningTokens). The component narrows it the same way the in-repo turn-metrics.ts does, so a future shape change degrades to a hidden badge, never a crash.
  • The badge text comes from a locale namespace. shadow-token (zh / en) interpolates {input} / {output} placeholders; the locale seat is provided automatically by the registration (PropsLocale mechanism).
  • The bundle id equals the row name. client-modules keys browser registration by the client row's name; the tsdown bundle id and cordis.patch.yml row name are both dsh-ui-shadow-token, or the browser shell throws "loaded without registering".

Build from source

pnpm install
pnpm build         # emits lib/index.js, lib/invariant.js, lib/client.js + sourcemaps
pnpm typecheck     # tsc --noEmit (types resolve via tsconfig paths to the local dsh profile)

lib/ is committed to the repo so git installs work without a build step. After changing source, run pnpm build and commit the updated lib/.

License

MIT