rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Arun1016/dsh-cost
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Account balance and cost statistics pill for DeepSeek Harness. It adds a pill at the right-hand end of the official stats row below the session composer, combining three readings: the billing period (peak / off-peak, colour-coded), the account balance, and the current session cost. Clicking the pill expands a per-session breakdown — cache-hit input, cache-miss input and output amounts, cost per model, the successful web search / web fetch call counts and their per-request fee (billed from 2026-11-01), and the token and web-call cost of the subagent sessions this session spawned (at any depth). The cost side needs no credentials; the balance side needs a DeepSeek API key.
Community plugin. Not affiliated with, endorsed by, or shipped by DeepSeek.


conversation.composer.dock with order: 2, after both official stats pills (activity = 0, usage = 1). The period reads Peak or Off-peak, and a red / green dot distinguishes them.origin: subagent header lineage, including subagents of subagents) has its token usage and web call fees folded into the existing fields — total, the three token buckets, the web rows and the per-model rows. A user fork is an independent conversation and never counts. Running subagents are read from memory; closed ones are read from their persisted logs through the session-query service and cached.09:00–12:00 and 14:00–18:00; everything else, weekends and statutory holidays bill off-peak all day (including a weekend that holiday adjustment turns into a workday). The built-in 2026 PRC holiday table can be replaced through Config.holidays.cost-stats namespace, Chinese and English, following the app locale./api/dsh-balance (once per session step plus a 60 s poll) and never contacts a third party.anchor-name and the panel position-anchor); outside-dismiss still reuses the shared useDismissOnOutsidePointer helper.>= 0.2.2-rc.1 (0.2.2 removed useAnchoredPosition from ui-primitives; this release moves the dialog to CSS anchor positioning).DEEPSEEK_API_KEY environment variable only when the credentials service itself is unavailable — if credentials exists but holds no such key, the environment variable is not consulted. When no key resolves (for example an install signed in with a DeepSeek account), the pill keeps showing the billing period and the session cost, and only the balance is absent.From the plugin market (search dsh-cost), or from a terminal:
dsh plugin --profile <profile> add dsh-cost-pill
You can also install from the GitHub source: dsh plugin --profile <profile> add github:Arun1016/dsh-cost.
Note: the bare npm name
dsh-costbelongs to an unrelated project; this plugin is published under the@arun_1016/scope, so the two cannot be confused.
- id: cost-stats
name: dsh-cost
config:
holidays: ['2026-01-01'] # statutory holidays bill off-peak all day
holidays is the only Config field. It defaults to the built-in 2026 PRC statutory-holiday table (State Council notice 国办发明电〔2025〕7号), as Beijing-local YYYY-MM-DD dates. A new year is a Config edit, not a code change.
Model prices are CNY per million tokens, and every figure below is a peak rate — off-peak is exactly half, per the official rule. Search and Fetch are billed per request instead, listed at the end of the table.
| Item | Rule |
|---|---|
| Flash (from 2026-09-10 12:00 Beijing) | peak 2 / 0.04 / 8 = uncached input / cache-hit input / output |
| Flash (before the price cut) | 3.0 / 0.1 / 9.0, same three buckets |
Pro (deepseek-v4-pro, before 2026-09-14 12:00 Beijing) |
9.0 / 0.3 / 27.0, same three buckets |
| Peak window | workdays 09:00–12:00 and 14:00–18:00 |
| Off-peak | everything else; weekends and statutory holidays all day, including a weekend that holiday adjustment turns into a workday |
| Clock used | the local clock of the machine running dsh — the official windows are Beijing time, so the reading is only exact on a Beijing-time host |
| pro→flash routing | billed as Flash from 2026-09-14 12:00 Beijing |
inputTokens |
uncached input; cache writes bill at the uncached rate |
| reasoning | subset of output, not billed separately |
| Search / Fetch calls | ¥5 per 1,000 successful requests (¥0.005 each), independent of the peak / off-peak window |
| Web billing start | 2026-11-01 00:00 Beijing; earlier successful calls cost nothing and display as "Free" |
| Successful call | Search returned a non-empty results array; Fetch returned page content; failures, empty searches and timeouts are free |
| Call counting | the session log's web_search / web_fetch tool calls; one multi-query web_search counts its distinct queries |
| Scope | the session's own events (excluding any fork-inherited prefix) plus the own events of every descendant subagent session it spawned |
| Subagent identification | header lineage carrying origin: subagent, at any depth; a user fork is an independent conversation and never counts |
| Subagent annotation | with subagents, the session-cost label reads "(incl. subagents)" and a small note names how many sessions are included; their cost is never a separate line, it is folded into the amounts above |
The Search / Fetch price and billing start come from the official price page and the web search & fetch guide (announced 2026-10-17).
https://api.deepseek.com/user/balance, authenticated with your key; it times out after 15 s./api/dsh-balance — once per session step, plus a 60 s poll. It never contacts a third-party endpoint itself.(估) in Chinese / (est) in English.web_search / web_fetch tool calls: the host does not load a detached session's log and keeps no per-query results, so detached sessions and the local fallback estimate omit this fee; a log trimmed by compaction undercounts too.web_search whose queries partly return nothing cannot be split after the results are merged, so every distinct query is billed (an overcount); a failed call bills nothing, but sibling requests that had already succeeded in the same batch cannot be counted (an undercount).¥0.00 hides the cost segment; and when the host route is missing or errors, the whole pill disappears silently, with no placeholder and no error message. After a failure it stops per-step polling and keeps only the 60 s poll.¥ prefix, regardless of the account currency the API reports. Balance uses 2 decimals; session costs use 2 decimals, or 4 below ¥0.01; web call fees use 3 decimals (the ¥0.005 unit — three calls read ¥0.015, not a two-decimal ¥0.01).deepseek-v4-flash and deepseek-v4-flash-vision-exp both display as deepseek-flash).200 response with no balance_infos field, and that empty result is cached for 30 s as well.Source lives in src/ (host half index.ts, client half client/). It is built with the official dsh monorepo toolchain: tsconfig.*.json and tsdown.config.ts reference the monorepo through relative paths (../../../tsconfig.base.json, ../../client/tsdown.client.ts), so building requires placing this package back into that tree — the repository cannot be built standalone.
The published package carries lib/ and cordis.patch.yml, plus package.json, both READMEs and LICENSE (npm always includes those).
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。