dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness plugin: live peak-hours status and estimated USD spend for the current session, under the composer.
A DeepSeek Harness plugin that adds one ambient line under the composer:
● Off-peak · ≈ $0.338 · bal $7.27

It answers three questions about the session you are in:
Hovering the line opens a panel with the cost attribution: the billing window and the time until it flips, the account balance and both wallets, and a per-category table showing what each kind of content cost when it first entered the context versus what it costs on every later call that re-sends it.
The screenshot above is unedited: the line sits beside the shipped turn/step counter and token meter, and reads ● Off-peak · ≈ $0.338 · bal $7.27 for a session at 9 turns and 264 steps with a 99.6% cache hit rate.
| Slot | conversation.composer.dock (below the composer card, beside the shipped activity and context-usage entries) |
| Scope | Per session |
| Updates | Spend follows every settled model call; the status label re-evaluates against the clock every 30 s; the balance refreshes every 60 s |
| Locales | English and Chinese, following the app's language setting |
Next to the session estimate the line also shows your DeepSeek account balance:
● Off-peak · ≈ $0.18 · bal ¥7.26
It is read from the Host's account Remote (ctx.remote.account.getBalance) every 60 seconds and whenever the window regains focus — the same call the Settings → Account page makes — and both wallet kinds are summed: the recharge wallet plus any bonus/grant wallet, which is why it can differ from a single number on a top-up page. The panel always lists both.
The account face is a Typert Remote namespace rather than a plain service, so the plugin captures it through a scoped ctx.inject(['remote.account'], …) and still falls back to ctx.remote.account on the root context. That keeps it independent of load order: the cost line renders immediately, and the balance appears as soon as the transport is reachable.
The balance is optional in every direction: a signed-out account, an API-key-only setup, a failed read, or a build without the account transport all simply drop it, leaving the cost line intact. Nothing is cached to disk.
Hovering the line opens a themed panel (fixed-positioned above the composer, closes on leave or Escape) with the attribution:
Content In context First time Re-sent
Tool results 40k $0.021 $0.0047
Web results 18k $0.0014 $0.0110
Assistant replies 12k $0.0048 $0.00
Your messages 4.2k $0.0003 $0.0028
Model thinking 6k $0.0024 $0.00
Tool schemas 8.8k $0.0013 $0.00
System prompt 1.4k $0.0002 $0.00
Model output $0.028
Session total $0.423
Each row answers two different questions:
So "what did the web search data cost in this session?" is one row: the first fetch at the miss rate plus every re-send at the hit rate. A search result that arrives once and stays in the conversation is billed as input exactly once and as cache for the rest of the session — which is why 18k tokens of web data cost about a cent rather than 18 × the input rate.
Every call reports real billed usage. The fold keeps a running estimate of the context by category and splits each call's prompt:
Per-call totals are the provider's own numbers, so category costs add up to the real bill and only the split between categories is an estimate (four characters per token). Output is listed separately because it is not context. Replaced or compacted content is subtracted as it leaves the context, so the "In context" column tracks the live surface rather than a running sum.
The package is a Harness bundle: it declares dsh.bundle.patch and a dsh.client half, so installing it in a profile mounts both the Host projection and the Web entry.
Install the package spec github:ogidimitrov/dsh-peak-cost as a bundle — from the Plugins page of the app, or from an agent session through the plugin manager's install_bundle action with that spec as the target.
The plugin needs a Harness build that provides the session projection registry, the conversation.composer.dock slot, and the client locale service — that is, the current DeepSeek Harness desktop/web app. It has no npm dependencies and no build step.
To remove it, uninstall the bundle from the same Plugins page.
Money is not inferred on the client from a token total. The Host half folds the durable session log and registers one session projection, peakCost, whose wire view carries the cumulative spend. The Client renders that value; it never re-folds events, so the figure survives paging, reloads, and compaction.
Each assistant/message in the log is priced on its own:
deepseek-flash and deepseek-v4-pro stays correct;Because the fold is a pure function of committed events, replay and fork produce the same figure.
Harness sends the whole conversation on every model call, so a long session burns a large prompt each time — and nearly all of it is a cache hit, billed at the hit rate rather than the input rate. That discount is the whole reason one session can move millions of prompt tokens for cents.
A real session from this plugin, mid-conversation, off-peak on deepseek-flash:
| tokens | rate (off-peak) | cost | |
|---|---|---|---|
| cache-miss input | 184,312 | $0.15 / 1M | $0.028 |
| cache-hit input | 21,805,952 | $0.003 / 1M | $0.065 |
| output | 102,878 | $0.60 / 1M | $0.062 |
| total | $0.155 |
The same 22M prompt tokens billed without prompt caching would be $3.36 at the miss rate; the per-row First time / Re-sent split in the panel shows the same discount for the session you are looking at.
The figure is a list-price equivalent, computed from the session log; it never reads your wallet. Three things make a wallet diverge from it:
assistant/message, so they cost money this estimate cannot see.Use the platform's usage page for the authoritative charge; this line is for watching a session's shape while it runs.
Defaults follow DeepSeek's published pricing (USD per 1M tokens):
| Model | Cache hit | Cache miss | Output |
|---|---|---|---|
deepseek-flash | 0.006 | 0.30 | 1.20 |
deepseek-v4-pro | 0.044 | 1.32 | 3.96 |
Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday, excluding Chinese public holidays. Every other hour, all weekend, and Chinese public holidays are off-peak. Off-peak prices are half of the table above.
Both the rates and the calendar are constants at the top of index.js:
MODEL_RATES — add or change a model card when DeepSeek changes prices;PEAK_WINDOWS, PEAK_WEEKDAYS_ONLY — the billing calendar;PEAK_HOLIDAYS — Chinese public holidays as UTC YYYY-MM-DD. Empty by default: on a holiday the indicator reports "peak" while billing is actually off-peak, until you add the dates.Legacy aliases (deepseek-v4-flash, and the older -chat / -reasoner names) bill at the flash card.
assistant/message — session-title generation, some compaction work — are not in the log and are not counted. Failed attempts that report usage without a settled message are likewise skipped.npm test # node --test: fold semantics, window edges, wire schema, client rendering
The suite needs nothing beyond Node 22+:
test/fold.test.mjs drives the Host fold directly — peak edges, weekends, cache buckets, model routing, unknown routes, stream fallback, checkpoint safety;test/client.test.mjs loads the client module with a stubbed module loader and React, then renders the dock entry against projection values shaped like the wire view.Bundle layout:
index.js Host half: the `peakCost` session projection
client.js Client half: the composer-dock entry and locale dictionaries
cordis.patch.yml Loader row inserted by the bundle
locale/{en,zh}.json Plugin Manager title and description
icon.svg Plugin artwork
MIT — see LICENSE.