DeepSeek Harness plugin

dsh-cost-kamimura

DSH 原生插件:按 DeepSeek 峰谷价格表实时计算当前对话花费,并显示在输入框旁

Jump to install

Source facts

Repository
kami-mura/dsh-cost
Latest update
Aug 15, 2026
Category
Usage & Billing
GitHub stars
2
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-20

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/kami-mura/dsh-cost
Plugin: dsh-cost-kamimura
Author: kami-mura

Check the source files

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

File explorer4 files
README.en.mdSource · read only
README language

dsh-cost-log

English | 简体中文

DSH native plugin: real-time current conversation cost based on DeepSeek pricing, displayed as a badge beside the input box (right side of the composer tool row, to the left of the model selector). Cost is computed by a durable Host session projection costLog, so paging, compaction, or history backfill never change the accumulated value. The browser only reads and renders the projection — no external requests.

<p align="center"> <img src="./docs/assets/cost-badge-preview.jpg" alt="dsh-cost-log cost badge beside the message composer" width="972"> </p>

Why dsh-cost-log?

It is more than tokens multiplied by one static rate: it is a cost projection designed around official DeepSeek models and DSH session semantics. Version 1.0.0 is the stable release; future maintenance is limited to DeepSeek pricing changes and DSH compatibility.

AdvantageWhat it means
Durable conversation totalsCost is computed in a Host-side durable session projection, not in the browser tab. Paging, context compaction, and history backfill do not change the accumulated value.
DeepSeek-specific pricingCache hits, cache misses, cache writes, and output are priced separately, with automatic selection by Flash / Pro, Beijing peak hours, CNY / USD, and legacy / new price tables.
No double counting or guessed ratesUsage for the same turn/step is de-duplicated by projection replacement rules. Unknown third-party models are marked as partially priced instead of receiving a potentially wrong fallback rate.
Privacy-first, zero extra deploymentNo API key access, account-balance lookup, external request, database, proxy, or additional daemon is required.
Cost stays in the workflowThe badge remains beside the composer so the conversation total is visible before and after sending. Details open on demand and follow the DSH locale and light / dark theme.

Features

  • Always-visible cost badge next to the input box; updates as token usage changes. Currency is configurable in DSH Settings > Plugins > Plugin configuration (CNY / USD, default CNY) and stored in the current browser.
  • Tooltip language follows the DSH system language (Chinese / English).
  • Hovering over the cost icon shows only: input tokens, output tokens, flash cost, pro cost.
  • All displayed costs are rounded to 2 decimal places; amounts below 0.01 are shown as <0.01.
  • CNY pricing since 2026-08-17:

- deepseek-v4-flash: off-peak 0.05 / 1.5 / 4.5, peak 0.10 / 3.0 / 9.0 (CNY per million tokens) - deepseek-v4-pro: off-peak 0.15 / 4.5 / 13.5, peak 0.30 / 9.0 / 27.0 (CNY per million tokens)

  • Official DeepSeek USD pricing:

- deepseek-v4-flash: off-peak $0.007 / $0.22 / $0.66, peak $0.014 / $0.44 / $1.32 (USD per million tokens) - deepseek-v4-pro: off-peak $0.022 / $0.66 / $1.98, peak $0.044 / $1.32 / $3.96 (USD per million tokens)

  • Peak hours use Beijing time: 9:00-12:00, 14:00-18:00; all other hours are off-peak, at half the peak rate.
  • Before the effective time, legacy pricing (both CNY and USD) is used automatically.
  • Pricing is limited to DSH's built-in deepseek-official provider with the exact model IDs deepseek-v4-flash and deepseek-v4-pro, displayed as DeepSeek-V4-Flash and DeepSeek-V4-Pro.
  • Unrecognized third-party models are never guessed: the badge shows / ¥0+ (or / $0+).
  • Styles use DSH WebUI design tokens (--dsw-alias-*) and follow light / dark themes.

Pricing sources: official DeepSeek CNY pricing and official DeepSeek USD pricing, last verified 2026-08-15.

Pricing basis

UsageBilling
Input (cache miss)inputTokens, billed as 1M input tokens (cache miss)
Input (cache hit)cacheReadTokens, billed as 1M input tokens (cache hit)
Cache writecacheWriteTokens; DeepSeek does not quote this separately, billed as cache miss
OutputoutputTokens, billed as 1M output tokens

> The amount is a reference estimate based on provider-reported token usage, not an official DeepSeek bill. Usage chunks and assistant/message for the same turn/step are de-duplicated by the projection replacement rules.

Pre-effective pricing

Before the new pricing takes effect, the current official rates are used:

// lib/index.js
const LEGACY_RATES = {
  flash: { inputHit: 0.02, inputMiss: 1, output: 2 },
  pro:   { inputHit: 0.025, inputMiss: 3, output: 6 },
}

const LEGACY_RATES_USD = {
  flash: { inputHit: 0.0028, inputMiss: 0.14, output: 0.28 },
  pro:   { inputHit: 0.003625, inputMiss: 0.435, output: 0.87 },
}

Architecture

Browser (Client)                               DSH Host
┌────────────────────────────┐   session   ┌──────────────────────────────┐
│ conversation.input.right    │  projection │ sessionProjections registry  │
│ cost badge beside input     │ ◄────────── │ costLog projection            │
│ useProjection('costLog')    │  durable    │  ├ request/header model       │
│ React + hand-written bundle │             │  ├ assistant/chunk usage     │
│ locale + localStorage       │             │  └ assistant/message usage   │
└────────────────────────────┘             │ cost by time x model x tier │
                                            │ outputs both CNY / USD       │
                                            └──────────────────────────────┘
  • Host ([lib/index.js](lib/index.js)): registers the sessionProjections key costLog and outputs both CNY and USD cost.
  • Client ([lib/client.js](lib/client.js)): hand-written CJS bundle (window.__ModuleLoader__.load), registered in the conversation.input.right slot, reads useProjection('costLog'), localizes tooltips via the locale service, and stores the selected currency in browser local storage.
  • No external HTTP calls, no cookies, no database, no local server, no build step.

Installation

From npm:

dsh plugin --profile web add dsh-cost-log

From GitHub:

dsh plugin --profile web add github:kami-mura/dsh-cost

Return to the terminal running DSH, press Ctrl+C to stop the old process, then start it again:

dsh web

Uninstall:

dsh plugin --profile web remove dsh-cost-log

> Requires DSH runtime capabilities: Host sessionProjections; Client slots, locale, the react platform module, and the conversation.input.right slot provided by ui-conversation.

Quick start

1. Install the plugin and restart DSH Web. 2. Open any conversation. 3. The cost badge appears on the right side of the input box; hover to see token usage, click to view the flash / pro cost breakdown.

To switch currency, open DSH Settings > Plugins > Plugin configuration and choose CNY or USD.

Files

FileDescription
lib/index.jsHost half (costLog session projection + peak/off-peak pricing + settings namespace)
lib/client.jsClient bundle (cost badge + Plugin configuration currency card)
cordis.patch.ymlBundle patch (mounts the Host half in the profile layer stack)
package.jsonPackage manifest (dsh.bundle.patch + dsh.client.platform: "web")
tests/pricing.test.mjsPricing, model validation, boundary, and projection folding tests
tests/client.test.mjsDSH client module registration regression test

Run tests:

node --test tests/*.test.mjs

Contributing

Version 1.0.0 is in stable maintenance. New features are out of scope; updates are limited to official DeepSeek pricing changes and DSH compatibility. Keep the English and Chinese README files in sync for user-visible changes.

License

[MIT](LICENSE)