rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:HekStudio2024/dsh-usage-kline
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A Harness Web UI plugin that renders DeepSeek usage as a trading terminal: a candlestick chart of spend and tokens per day, with the account balance beside it. The layout follows the stock-terminal reference: dark board, left watchlist, central K-line stage with volume, right-side rankings and a live tape, a model table below, and a status bar.
The bundle also declares a dshGo manifest, so the DSH-Go Android client draws
the numbers with its own widgets instead of loading a WebView island:
| Surface | What it shows |
|---|---|
composer.strip |
today's estimated spend, for example 今日 ¥0.2046; tapping it opens the panel |
panels (session.tab, features) |
a 7/14/30/60/90-day range picker; estimated spend and today's spend; tokens, requests and the cache hit rate; recharged and usable balance; a daily spend bar chart per range; 主力动向 (models ranked by spend with their share); 逐笔成交 (the newest priced calls); and the 对话用量排名 (lifetime spend per conversation) |
The range choice is kept per session in the Host half, because the bridge passes only a scope and never plugin state.
Composer taps are limited by the App: an open effect accepts only App page
ids, so tapping a conversation row cannot select that conversation. Rows
therefore show the conversation id tail instead of implying navigation.
The views are built by the Host half through ctx.dshGo from the same numbers
as the Web page, and never run plugin code inside the App. The bridge is
optional: on a Host without dshGo the injection callback never runs and only
the Web surface exists, so the same package serves both.
Set dshGo.minApp in package.json if a future surface needs a newer client.
usage-kline, opened through ctx.sidebarRightTabs.openTab('usage-kline').| Region | Content |
|---|---|
| Title bar | terminal name, live-sample counter, 7/14/30/60/90-day range, refresh, clock |
| 自选行情 (watchlist) | one row per model: code, name, sparkline, total spend and its day change; below it the 统计 rows for cached / uncached / output tokens and requests, which switch the tape's readout |
| Center stage | the selected model's 日K candles or today's 分时 calls, selectable by 金额 / Token; MA5 overlay, volume histogram, last-price tag, crosshair with price scales |
| 主力动向 (rankings) | models ranked by spend with proportional bars |
| 逐笔成交 (live tape) | the most recent calls, newest first |
| 个股列表 (table) | every model with code, spend, change, requests, tokens, share, and a mini K-line strip of today's calls |
| 本次对话用量 (turns) | turn-by-turn usage of the conversation on screen: turn number, time, tokens, cached hit, input and cost, with a footer total |
| 工作区对话用量排名 (ranking) | every conversation of a picked Workspace (or all of them) ranked by lifetime spend: rank, conversation ID, title and Workspace, amount, tokens, requests, share, and a jump button. A row's context menu offers 跳转至该对话, 删除该对话 and 复制对话 ID. Delete removes the row for good: the Session is also archived when the client can, and its id is stored in $DSH_HOME/usage-kline-removed.json so the checkpoint scan never lists it again |
| 用量对比 (sources) | every usage source this Harness can show, side by side: projection checkpoints, live requests, the page total, the account wallets, and the Platform usage page. Its footer prints the scan diagnostics (checkpoint directory, files found, files readable, or the scan error) |
| Status bar | live samples, sessions, peak/off-peak pricing, data health |
Right-click a conversation row for its menu; a left click also jumps straight to the conversation when the workspace navigation is available.
| Piece | Source |
|---|---|
| Per-Session token totals | the tokenUsage fold in session-projection-cache checkpoints under $DSH_HOME/storages/session_projcache/sessions, grouped per model by the Session's newest route |
| Calls made since a Session's last checkpoint | the llm/stream waterfall; Search/Fetch through ctx.web |
| Prices | official DeepSeek list price per 1M tokens (peak rate); off-peak is half, chosen per call by its time of day |
| Balance | ctx.deepseekAccount.getBalance |
The 用量对比 block compares one range of calls across all six views in one place; the column pair shows each source's token count and estimate next to the page total:
session-projcache/tokenUsage) — per-Session cumulative
totals, model from the Session's newest route. When that directory cannot be
read, the same totals are read through sessionQuery + sessionProjections,
so the conversation lists still populate; the footer prints which path ran.llm/stream) — calls made after each checkpoint.Prices used (CNY / USD per 1M tokens, peak): deepseek-flash cache hit
0.04 / 0.006, cache miss 2 / 0.3, output 8 / 1.2; deepseek-v4-pro 0.3 / 0.044,
9 / 1.32, 27 / 3.96. Peak hours are 01:00-04:00 and 06:00-10:00 UTC on weekdays.
Amounts are estimates from those rates, not the actual bill.
cordis.patch.yml)- id: usage-kline
config:
currency: CNY # CNY or USD
priceMode: auto # auto | peak | offpeak
includeSubagentSessions: true
liveRequestCount: 20000
scanConcurrency: 6
checkpointDir: '' # defaults to $DSH_HOME/storages/session_projcache/sessions
prices: # per-model overrides for the active currency
deepseek-flash: { cacheHit: 0.04, cacheMiss: 2, output: 8 }
sidebar.panellist (id usage-kline) — the workspace-strip row glyph.main (key usage-kline) — the page that row selects.sidebarRightTabs.register — the tab type usage-kline (id
@local/dsh-usage-kline/tab) for the workspace column.sidebar.right.pane.tab / sidebar.right.pane.tab.title — that tab's body.conversation.composer.dock — the chip under the input.Client halves reach every service through ctx.get(name); no other Context
property is touched, per the client runner's guard.
The Host half serves them under /dsh-usage-kline/api and admits any request
the Client connection admits:
GET /overview?days=30 — per-model candles for the range, today's per-call
series, totals, unpriced routes, range and lifetime conversation rows, and
the checkpoint-scan diagnosticsGET /turns?sessionId=… — turn-by-turn usage of one live SessionGET /accountGET /diag — the checkpoint directory the host actually scans and how many
files it could readGET /events (Server-Sent Events revision feed)CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。