All notable changes to this project are documented here. The format follows Keep a Changelog and the project uses Semantic Versioning. 中文版见 CHANGELOG_ZH.md.
- Claude cost estimation — built-in Anthropic Claude official API standard rates (USD per 1M tokens, verified 2026-11-05 against https://platform.claude.com/docs/en/about-claude/pricing): Fable 5.1 / 5, Mythos 5.1 / 5, Opus 5.5 / 5 / 4.8 / 4.7 / 4.6 / 4.5 / 4.1 / 4, Sonnet 5.5 / 5 / 4.6 / 4.5 / 4, Haiku 4.5. Flat across peak/off-peak; CNY converted at the shared display FX rate (config/default, saved last successful rate or manual refresh). Claude Haiku 5.5 is intentionally not listed (prompt-length tiered pricing cannot be determined from per-round totals).
- Separate cache-write pricing —
BucketPricesgains an optionalcacheWriterate (5-minute TTL write price for Claude);pricing.jsonaccepts it too. When absent, cache writes are still billed at the cache-miss rate (DeepSeek behavior unchanged). - Model-id normalization —
normalizeModelIdlower-cases, strips theanthropic/prefix and rewrites dotted Claude versions (claude-opus-5.5→claude-opus-5-5); used by the host resolver,pricing.jsonkeys and the client snapshot lookup. - Unpriced rounds —
RoundCost/ChartCost/ resolver results gainunpriced. Session totals that include unpriced rounds are shown as≥(lower bound) with a panel note; the current-model price line is hidden instead of showing$0/1M; compaction cost is left blank instead of$0.
- Unlisted Claude models are no longer billed at the DeepSeek fallback rate — any model id containing
claude(including Bedrock ids such asanthropic.claude-…/us.anthropic.claude-…and display names) that has no price resolves to zero rates and is marked unpriced, instead of thedeepseek-flashfallback estimate that understated them by tens of times. DeepSeek models and a missing model name keep the flash fallback. This also changes the exportedpricingFor()/estimateCost(): for such models they now returnUNPRICED_PRICING/0(stillestimated: true). - Longest-key price matching — price-key lookup (
matchPricingKey, shared by builtin,pricing.jsonand the client snapshot) now picks the exact key, else the longest matching prefix regardless of insertion order, soclaude-opus-5-5-20261101resolves to Opus 5.5 rather than Opus 5. Claude keys only match the exact id or the id plus a dated snapshot suffix (-YYYYMMDD/-latest), so an unlisted newer version (e.g.claude-opus-5-6) is unpriced instead of borrowing a sibling's rate. Non-Claude keys keep the lenient prefix semantics.
- Host/client pricing parity — a user-file prefix override now wins over a builtin exact key on both paths; matching stays exact-then-longest within each source.
- Complete cost breakdown — cache-read cost is included in the panel's components and composition bar, with wrapping for narrow layouts.
- Shared FX valuation — all single-currency prices (including Claude, USD-only overrides and legacy CNY entries) retain their source currency and use one validated display rate. Native dual quotes stay unchanged. Refreshes revalue history, compactions, live estimates and badges; in-flight history is keyed by session and rate with stale-response guards. Restoring a saved rate no longer blocks configured-currency initialization.
- Pricing explanations — the panel shows the actual shared conversion policy, separate cache-write rate and builtin Claude's 5-minute TTL/standard-price limits instead of implying an unrelated live rate was used.
- Anomaly detection skips unpriced rounds, so their zero cost no longer drags the baseline down and causes later priced rounds to be flagged as spikes.
- The Claude PR author reported checks against the installed DSH 0.2.2-rc.1 app bundle (not an independent clean-profile install): the peer-range admission check passes (
includePrerelease), the missingdsh-client-ui-slotspackage is skipped bydsh.client.inject, both slots and their standard props are unchanged, and the fold handles 0.2.2-rc.1 session logs. DeepSeek model ids and list prices are unchanged (deepseek-flash= DeepSeek-V4.1-Flash-1017,deepseek-v4-pro= DeepSeek-V4-Pro-0813).
- Source validation: Node 20.19.5 / 22.17.0 / 24.22.2, 85 tests passed, zero skipped (including version/documentation consistency); package dry-run and extracted runtime/type checks passed. No dependency upgrades or peer-range changes.
- Isolated Chrome with a synthetic Host/session exercised the real components/hooks and plugin routes: configured rate 7.1 → refreshed rate 7.3, history/indicator/badge agreement, CNY/USD switching, saved-rate reload, complete cost breakdown and English 360px layout. This is not installed-DSH or clean-profile certification; no new 0.1.x/0.2.x clean-profile evidence is claimed.
- Install the explicit version once it is available on npm, restart
dsh web, and reload the browser. Existing config and pricing files remain compatible; USD-only overrides are now accepted. Single-currency converted historical amounts can change with the selected display rate; native dual-currency quotes remain unchanged. No session-log migration is required. - The version-record date is 2026-11-10 (Asia/Shanghai). Content is finalized for maintainer-controlled npm publication; a dated changelog alone does not prove npm availability. Publish from the final verified release commit, not the earlier implementation commit. If publication occurs on a different date, update both changelogs together.
- DSH 0.2.x compatibility (plugin admission gate) — DSH 0.2.1-rc.2 only loads a plugin when
package.jsondeclaresengines.dsh, or when everypeerDependenciesrange whose package name is@deepseek-ai/dsh/@deepseek-ai/dsh-*matches the running DSH runtime version. 1.1.7 declared all four DSH client peers with>=0.1.0-rc.6 <0.2.0, so startup was denied with the user-visible warningdsh-usage-chart@1.1.7 与 DSH 0.2.1-rc.2 不兼容(要求 @deepseek-ai/dsh-client-locale >=0.1.0-rc.6 <0.2.0, ...)…. The peer ranges now cover both client-SDK generations:@deepseek-ai/dsh-client-locale,@deepseek-ai/dsh-client-ui-conversation, and@deepseek-ai/dsh-client-ui-slotswidened from>=0.1.0-rc.6 <0.2.0to>=0.1.0-rc.6 <0.3.0-0. The-0upper bound matters because DSH compares ranges withincludePrerelease: it still admits 0.2.x prereleases (like 0.2.1-rc.2) but keeps future 0.3.0 prereleases out.- The retired
@deepseek-ai/dsh-client-runtimepeer is removed. DSH 0.2.x replaced it with thedsh-client-modulesmodule system (plusdsh-client-ui-renderer, thedsh-client-ui-sessionstandard kit, anddsh-client-store); its last published version was0.1.1-rc.2, so no 0.2.x-compatible release exists. - DSH 0.1.x stays supported on the code level: the 0.1.x paths (
provenance,assistant/chunk, anduser/message.source— a{ kind }object on both lines since dsh-llm 0.1.0-rc.2, with bare strings kept as a legacy fallback) are kept, and the APIs the plugin uses are the same on both lines. The 0.2.1-rc.2 side was verified against the installed app bundle and the published 0.2.1-rc.2 package typings: slotsconversation.composer.dockandconversation.chat.assistant-actionsstill exist and render; session-scope standard props still deliveruseSession/sessionId/useProjection(ui-session) anduseChat(ui-chat);useChatsnapshots still exposelegacy.nodes; thetokenUsage/contextPressure/contextBreakdownprojections keep their fields;ctx.locale.getLocale()/subscribeandctx.slots.inject/registerare unchanged; and the hostwebServer.register/sessions.get/snapshotEvents/credentials.resolveservices are unchanged. No live 0.1.x install was re-run afterdsh-client-runtimeleftdsh.client.inject.
- Assistant-node model identity on DSH 0.2.x — the assistant-node model identity now also reads the 0.2.x
providerMetadatafield. The DSH 0.1.xprovenancesource is still preferred when present, andrequestConfigremains the last-resort fallback, so model labels and per-message cost attribution no longer lose the model on 0.2.x. - Self-contained client type declarations — the emitted client
.d.tsfiles no longer import the retired@deepseek-ai/dsh-client-runtimepackage. Type-checking the plugin in a 0.2.x-only DSH tree can no longer fail on a dangling import of a package DSH no longer ships; 0.1.x trees keep working as before. - DSH 0.2.x session-log vocabulary — DSH 0.2.x dropped
assistant/chunkevents and folds streaming usage intoassistant/message(usage+stream). The host fold now follows the official token-meter accounting on these logs:- Message usage comes from
data.usage, falling back to the last usage record instream. - Failed or retried requests, which 0.2.x persists only as
assistant/attemptwith usage insidestream, are counted in totals and per-round costs, and each attempt is billed separately across retry boundaries. - TTFT is the first token-bearing stream record: structural
block-start/usage/finishrecords and empty fragments are skipped, while raw*-deltachunks and name-bearing tool-call fragments count even when their argument text is empty. - Output TPS divides output tokens by the summed streaming time of each
assistant/message/assistant/attempt, so tool execution and the wait between steps no longer drag it down; a turn whose output arrives as a single fragment reports no TPS. Logs without a stream timeline keep the 0.1.x anchors (first usage sample → turn end). user/message.sourceis a{ kind }object (0.1.x has used the same typed shape since dsh-llm 0.1.0-rc.2; only legacy logs may still carry a bare string, which the fold keeps accepting).useranduser-*map tohuman, goal/continuation and agent kinds keep their name, and other runtime injections such astool-jobsbecomeagent.<kind>, so the input-source label no longer shows them as human.
- Message usage comes from
- Synchronize the npm lockfile root peer ranges/metadata with
package.json, removing the retired runtime entries without upgrading the locked dependency versions. - Include the exact preview screenshot filenames referenced by both READMEs in the npm package, and update the bilingual documentation, architecture, roadmap, and release checklist. Add manifest regressions for lockfile-root consistency and preview inclusion.
- Verified against the official DSH 0.2.1-rc.2 release notes and the
llm-deepseekcatalog thatDeepSeek-V4.1-Flash-1017keeps the model iddeepseek-flash, so the v1.1.5 rate table already prices it (no pricing change needed). Admission deliberately stays on the peer-range fallback rather thanengines.dsh: DSH 0.2.x prefersengines.dshwhen present but honors the peer ranges otherwise, and the peers keep each client-SDK package version-gated.
- New manifest tests assert the widened peer ranges, that the retired
@deepseek-ai/dsh-client-runtimepeer/inject entry is gone, and that the built client bundle and published client type declarations no longer reference the retired package. New fold tests feed DSH 0.2.x-shaped logs (noassistant/chunk,assistant/message/assistant/attemptwithusage+stream, objectuser/message.source) and assert totals, stream-only usage, TTFT from token-bearing records (raw delta chunks, name-bearing tool-call fragments), TPS over streaming time across steps, failed-attempt and retry billing, and source normalization; the retired-runtime check now scans every published client.d.ts; a client test covers theprovenance→providerMetadata→requestConfigmodel fallback.npm run verifypasses (typecheck + build +node --test, all 57 tests). The compatibility surface was checked against the installed DSH 0.2.1-rc.2 app bundle and the published 0.2.1-rc.2 package typings, and a headless-browser smoke test of a DSH 0.2.1-rc.2 Web instance loaded the linked 1.1.8 build: the boot graph included the plugin, the dock indicator rendered live usage/cost against a real session (zh copy through thelocaleservice) and the expanded panel rendered session totals, context breakdown and the token projections, with no plugin console errors.
- DSH 0.1.2+ conversation nodes — PR #12: the dock indicator and assistant cost badges now read
legacy.nodesfrom the independentchatslot source (useChat). Older DSH versions still use the session snapshot'schat.legacy.nodesor top-levelnodes. Both hooks are called in a fixed order to preserve React hook state; the session fallback selects only the node list, avoiding rerenders from unrelated session updates. - Panel placement under themed docks — PR #14: the fixed usage panel converts viewport coordinates to its nearest CSS containing block when a dock or ancestor uses
transform,filter,backdrop-filter, containment, or related properties. The follow-up handles borders, the root element, and additionalwill-changevalues, while ignoringcontain: style, which does not establish the required containing block. - Session total across models and billing periods — PR #15: the indicator and panel sum the host's per-round CNY/USD costs instead of repricing all session tokens with one model and one current billing tier. This preserves each round's model and peak/off-peak start time. If history is unavailable or a round lacks cost, the client falls back to an estimate from the
/pricingsnapshot. - Merge regression and live-cost synchronization — commits
9753856andcc0963f: restored PR #12'suseChatconnection in the indicator after PR #15's merge had reverted it and leftChatNodesHookunimported. The indicator and panel now share one history result, model attribution, and session cost. When live token usage exceeds the fetched history, they display the sum of fetched rounds plus a marked estimate for only the new tokens, then refresh the host fold after 750 ms of quiet. A panel refresh updates the indicator too; failed history requests can be retried, and stale responses from another session cannot replace the selected session.
- Added regression coverage for chat-source priority and legacy fallback, stable selector use, per-round currency sums, stale-history deltas, and the dock indicator's actual component wiring and model/cost display.
npm run verifypasses all 46 tests. A local headless-browser probe also exercised the live-cost transition and matching panel total; a running DSH Web installation should still be smoke-tested before publishing.
- Host pricing file source lifecycle (
pricing.jsonoverride & change watcher) — PR #10:- Fixed premature disposal of
filePricingSourceduring plugin registration:ctx.effect(() => fileSource.dispose(), ...)calleddispose()synchronously while building the fiber and registeredundefinedas the cleanup handler, aborting initial asynchronous file loading and disabling the file change watcher. Resolved by returning a disposer function:ctx.effect(() => () => fileSource.dispose(), ...). - Updated test mocks in
tests/core.test.mjs,tests/pricing.test.mjs, andtests/rounds.test.mjsto properly track and execute Cordis effect disposers inafter(). - Added regression test covering the
/pricingroute with userpricing.jsonoverrides enabled at startup.
- Fixed premature disposal of
- DeepSeek official pricing update (2026-09-10) &
deepseek-flashsupport — PR #8:- New
deepseek-flashmodel pricing: Updated builtin pricing according to the official DeepSeek pricing table (verified 2026-09-10). The newdeepseek-flashrates are:- Off-peak (Beijing Mon–Fri non-peak & weekends): CNY 1.0 / 0.02 / 4.0 per 1M tokens (cache-miss input / cache-hit input / output); USD 0.15 / 0.003 / 0.6 per 1M tokens.
- Peak (Beijing Mon–Fri 09:00–12:00 & 14:00–18:00): CNY 2.0 / 0.04 / 8.0 per 1M tokens; USD 0.30 / 0.006 / 1.2 per 1M tokens.
- Backward compatibility for legacy model names:
deepseek-v4-flashanddeepseek-v4-flash-vision-expare mapped todeepseek-flashinBUILTIN_PRICINGso historical session logs continue resolving without falling back to unknown-model estimates. - Fallback pricing: Default unlisted model fallback (
FALLBACK_PRICING) now points to the newdeepseek-flashpricing. - Docs & test synchronization: Updated custom
pricing.jsonexample inREADME.mdandREADME_ZH.md(verifiedAt: 1788998400000), and aligned test cases acrosstests/core.test.mjs,tests/pricing.test.mjs, andtests/rounds.test.mjs(BUILTIN_VERIFIED_ATset to2026-09-10T00:00:00Z).
- New
dsh-session >= 0.1.2-rc.1compatibility (snapshotEvents()) — PR #7:dsh-sessionremoved its publiceventsproperty in0.1.2-rc.1(replaced by thesnapshotEvents()method); the/usageroute then threwTypeError: events is not iterable, whichdsh-host-webserverwrapped as a bare400empty response, and the per-round chart disappeared (the client fell back to the empty observed-rounds path). Reproduced live ondsh-session 0.1.2-rc.1:/usage?session=<loaded>returned an empty400while/usage?session=<unknown>returned the plugin404JSON and folding the same log offline succeeded — confirming the crash was only the new runtime API shape. The host now reads events via capability detection — preferssession.snapshotEvents()when the function is present and falls back to the legacysession.events ?? [](so a missing API can never crash the route again). The vendoredSessionEventLiketype adds thetimefield (Unix epoch ms) and aSessionHandleshape (optionalevents+ optionalsnapshotEvents) soSessionStoreService.get()/list()stay valid across both API generations. Verified against the upstreamdeepseek-harnesssource:Session.eventswas removed from0.1.2-alpha.4onward (official architecture note2026-08-21-session-log-read-intent); the installed0.1.0-rc.6still exposesevents, so the fallback path remains covered.- Test coverage for the new
snapshotEvents()access path: addedtests/rounds.test.mjs→/usage route prefers snapshotEvents() when the new API is present, mocking a session handle that exposes onlysnapshotEvents()(itsget events()throws, proving the route never reads the removed property), assertstimeis consumed (duration/peak billing) and thatsnapshotEvents()wins when both APIs are present.
- Compact 2-Column Hover Tooltip & Overflow Elimination:
- Height Reduction: Redesigned
.duc-chart-tooltipinto a compact 2-column grid (2×2 token breakdown + 2-column metadata pairs), reducing card height from ~280px to ~120px (>55% reduction). - Top-Aligned Positioning: Adjusted placement from
top: 20pxtotop: 2px(240px width), ensuring the hover card stays strictly within the 132px chart boundary and never expands container scroll height or triggers popover scrollbars.
- Height Reduction: Redesigned
- Compact Panel UI & Vertical Overflow Elimination:
- Height Reduction: Tightened
.duc-sectionvertical padding from12pxto8px, compacted.duc-cellpadding from8px 9pxto5px 8px, reduced bar heights and line-heights. Overall panel height shrinks from ~800px to ~560px (~170px reduction), allowing the full dashboard to fit comfortably in viewport without vertical scrolling. - Removed Redundant Legend: Eliminated the duplicate 4-color legend row in the "Session Usage" section (values are already labeled in the 4 grid cards above; chart legend remains intact in the per-round section).
- Lightweight Compaction Empty State: When no compaction has occurred, the placeholder row is omitted to save vertical space; compaction details are shown only when compactions exist.
- SVG Chart Height Optimization: Reduced
RoundBarsbaseline height from96pxto76px(canvas height reduced from166pxto132px), keeping all scroll arrows, duration lines, anomaly markers, and hover tooltips aligned and legible. - Robustness Defense: Added fallback defaults for missing
currencyparameter ('cny') and safe optional chaining onround.costinRoundBars.
- Height Reduction: Tightened
Milestone release: Context Explainability & Compaction Diagnostics. Turns "why context grows, which round got compacted, how many tokens were freed, and how much the summarize step cost" into an interpretable view (dock indicator + dedicated panel diagnostics section), alongside user/message input source attribution.
- Context & Compaction Diagnostics Section: added a dedicated diagnostics section in the panel showing System Prompt, Tools Schema, and Message History token counts and percentage breakdown, complete with a multi-segment color bar (system blue, tools amber, messages green) and an explicit heuristic-approximation note based on the official
contextBreakdownprojection. - Compaction Lifecycle Folding & Cost Accounting: host-side
foldCompactions(src/usage/compactions.ts) parsescompaction/start,compaction/summary,compaction/prune, andcompaction/endevents from session logs, tracking shadowed token count, shadowed range/seqs, round attribution, summarize model, and dual-currency summarize cost (peak/off-peak tier aware). - Compaction Timeline & Savings: the diagnostics section summarizes total freed tokens and total compaction occurrences, listing each compaction record (round, freed tokens, summarize cost).
- Context Occupancy Recommendations: actionable recommendations based on
contextPressureoccupancy (≥75% suggests starting a new session or trimming large file injections; ≥90% warns of imminent context exhaustion). - Segmented Dock Pressure Bar: consumes official
contextBreakdownprojection to render system (blue), tools (amber), and messages (green) multi-segment bars on the composer dock indicator with detailed tooltip percentages, smoothly falling back to single-color bar when breakdown is unavailable. - Per-Round User Source Attribution:
foldRoundscapturesuserSource(human,agent.inject,continuation) fromuser/messageevents and displays the attribution badge in the chart tooltip explainer card. - New Exports:
foldCompactionsfunction andCompactionRecordtype.
- Weekend off-peak tier rule:
isPeakHourandtierAtnow take day-of-week into account — peak hours strictly apply to Monday through Friday 09:00–12:00 and 14:00–18:00 (Beijing time / UTC+8); all hours on Saturday and Sunday are now correctly classified as off-peak (leisure/discount period). - Builtin pricing coverage: added
deepseek-v4-flash-vision-expto builtin pricing table (identical pricing to flash); updatedBUILTIN_VERIFIED_ATto2026-08-26.
Billing updated to the latest DeepSeek pricing (official pricing pages, fetched 2026-08-17): prices are now quoted in two currencies — CNY (Chinese page) and USD (English page) — per 1M tokens with peak / off-peak tiers — peak hours (Beijing time 09:00–12:00 and 14:00–18:00, i.e. UTC 01:00–04:00 and 06:00–10:00) are billed at 2× the off-peak rate.
- Peak/off-peak tiered billing: the builtin price table stores both
peakandoffPeakunit prices per model; each round's cost is billed with the tier of its start time (tierAtresolves Beijing time = UTC+8). Unknown timestamps fall back to the peak tier (conservative estimate). - Official dual-currency pricing: each tier carries both the official CNY quote and the official USD quote; costs are computed with the list price of the selected display currency — no FX conversion, consistent with the official bill. The CNY/USD toggle now drives the indicator, the panel, the chart cost view and the cost badge.
pricing.jsonnow accepts the dual-currency tiered shape{ "peak": { "cny": {…}, "usd": {…} }, "offPeak": {…} }; legacy shapes are still accepted (single-currency tiers or the flat shape are treated as CNY, with USD derived at the default rate 6.76).- New exports:
costSplitAt,tierAt,isPeakHour,formatCny, and theCostCurrency/PriceTier/PriceTierId/BucketPricestypes. - The cost note in the panel now shows both tiers: e.g. cache-miss input
1.5/3.0(off-peak/peak) in the selected currency. - Live billing-tier tag: the panel's session-usage header shows a red (peak) / green (off-peak) tag for the current billing period (Beijing time, auto-flips at hour boundaries), and each round's tooltip shows its own billing tier.
- Per-round cost always visible: in the cost chart view every bar shows its own cost value (not only the current round), and the observed-rounds fallback (no host history) now derives per-round cost client-side from the
/pricingsnapshot + per-turn model/start time, so the cost view works even without host history.
- Builtin list price updated to the official prices (flash: CNY off-peak 1.5 / 0.05 / 4.5, peak 3.0 / 0.10 / 9.0; USD off-peak 0.22 / 0.007 / 0.66, peak 0.44 / 0.014 / 1.32; pro: CNY off-peak 4.5 / 0.15 / 13.5, peak 9.0 / 0.30 / 27.0; USD off-peak 0.66 / 0.022 / 1.98, peak 1.32 / 0.044 / 3.96 — miss input / hit input / output);
BUILTIN_VERIFIED_ATupdated to 2026-08-17. - Cost computation is now currency-parameterized:
costSplit(usage, pricing, tier, currency)andcostSplitAt(usage, pricing, timeMs, currency)return a currency-neutralCostSplit(input/cacheRead/output/total) in the requested currency.formatMoney/formatPricePerMdrop the FX-rate parameter (amounts are already in the display currency);toDisplayAmountis removed.estimateCostkeeps returning{ cny, estimated }(official CNY prices). foldRoundsbills each round with the tier of itsturn/starttime (fallback:turn/end, then peak) and publishes bothcnyandusdcost splits in the/usagepayload, so the client can switch currencies without re-deriving.- The FX rate (
config.cnyPerUsd,/rate, "Refresh rate") is now informational only ("1 USD ≈ X CNY" note); costs never depend on it for official models.
- The old builtin table (single-currency USD, flat price) no longer matched the official tiered billing in either currency, so costs were stale; the whole pipeline now follows the current official pricing pages (CNY + USD).
First complete release — the in-session usage interpreter is feature-complete (per-round chart with full-history horizontal scroll + cost/timing/anomaly explainer + multi-currency costs with live rates + account balance).
- Per-round chart no longer truncates to the latest 12 rounds: all rounds render into a horizontally scrollable area with a fixed slim bar width (30px), so bars stay constant-width and never look crowded. It auto-scrolls to the latest round, and arrow buttons + edge fades appear when content overflows; the scrollbar is slimmed down.
- Per-bar value labels adapt to density: in scrollable (dense) mode only the current round keeps its top-of-bar value (details stay in the hover explainer card); otherwise overly long labels (e.g.
$0.0013,123.4K) are elided so neighbouring labels never overlap. - Chart minimum width adapts to the panel width: short histories fill/center without stretching bar widths; the tooltip follows the active bar across scrolling (content coordinate − scroll offset, clamped to the visible area).
- The tooltip could not be positioned correctly once the chart could scroll; it now tracks the bar precisely at any scroll position.
- Short histories could overflow on narrow panels; the adaptive minimum width removes the needless scroll.
- The balance no-key test now isolates
$DEEPSEEK_API_KEY, so the suite passes on hosts that have the key in the environment; added coverage for the env fallback itself.
- Cost display currency:
config.currency('usd' | 'cny') andconfig.cnyPerUsd(default 6.76); costs render in the chosen currency. - USD/CNY toggle in the cost section; the choice is remembered in the browser (localStorage).
- Rate-refresh button: fetches the latest USD→CNY rate through the new same-origin
/dsh-usage-chart/rateproxy (config.fxUrl) and re-estimates immediately. /dsh-usage-chart/metaroute serving display-currency config to the client.
- Per-model price notes follow the display currency and show the applied rate (e.g.
CNY(1 USD ≈ 6.76 CNY)).
- Resilient rate refresh: falls back to a built-in FX source (frankfurter.dev) when the default (open.er-api.com) is unreachable or blocked; the last successful rate is persisted, so offline refreshes keep the previous rate instead of the fixed default.
- Client slots register via
ctx.slots.inject(wait for declaration), fixingslot "…" is not declaredwhen loader order changes.
- Per-round cost explainability (v0.2, see
docs/ROADMAP.md): the host fold (RoundFold,src/usage/rounds.ts) now derives per-round duration (turn/start → turn/end), TTFT (start → first usage sample), output throughput (tokens/s), model attribution (request/context→request/header→ cross-round carry-forward), end reason, and a per-round cost split (input / cache-read / output × unit price). - Pricing governance:
src/pricing.tsis split into a pure math module (pricing/calc.ts, bundled by both halves) and a host-onlyPricingSourceseam (pricing/source.ts— builtin list with a verification date + user-overridepricing.jsonfile adapter with change watching) plus aPricingResolver(pricing/resolve.ts, priority file > builtin > fallback, unknown models explicitly marked). New/dsh-usage-chart/pricingroute exposes the resolved snapshot — the client's only price input (ADR 2); the old bundled pricing constants no longer drift from host resolution. /usageroute now returnsrounds(with cost/timing/model/endReason) instead of bareturns(foldTurnUsagekept as a v0.1-compatible wrapper).- RoundBars cost view: a third chart mode stacks bars by cost (bucket × unit
price); a duration polyline overlays bar tops; anomalously expensive rounds
(relative to the previous N rounds,
src/client/diagnose/anomaly.ts) get a warning marker with attributed reason chips; a per-round cache-hit mini tick sits under the baseline; the tooltip became an explainer card (tokens + cost + model + duration + TTFT + TPS + cache hit + end reason + anomaly chips). - Cost badge: a dismissible
≈ $0.00xxbadge per assistant message (conversation.chat.assistant-actionsslot, data from the host/usagehistory). - Dock context pressure bar: slim
contextPressurebar in the indicator (green → amber → red as occupancy rises). - Tests:
tests/rounds.test.mjs(fold timing/TTFT/TPS/model/cost + route),tests/pricing.test.mjs(resolver priority, file source with temp dir, unknown marking + route),tests/anomaly.test.mjs(spike flagging and attribution); 28 tests pass vianpm run verify. - Configuration: optional
config.pricingFileoverrides the default$DSH_HOME/data/dsh-usage-chart/pricing.json(falls back to~/.dsh/...).
- Cost estimates are now single-sourced: real-time indicator cost and panel cost both
consume the
/pricingsnapshot; the price source, verification date, and unknown-model marker are shown in the panel. - Panel cost resolution now prefers the host fold's authoritative model attribution (ADR 1) over snapshot provenance, which can be absent for older sessions — the price source previously showed a spurious "fallback estimate" in that case.
- Restart
dsh webafter upgrading to 0.2.0. The Host process caches plugin code in memory (no hot reload): the new/dsh-usage-chart/pricingroute and therounds-shaped/dsh-usage-chart/usageresponse are only served after a restart. Until then the indicator silently omits the cost segment and the panel shows "Price snapshot unavailable".
- Balance queries now resolve the DeepSeek API key through the DSH credentials service
(
ctx.get('credentials')), so a key configured in the web UI (Settings → Models) or in.credentials.yamlworks without an environment variable or plugin config.
- Install warning
missing peer react@^18.2.0(react is provided by the DSH web platform; the peer is now marked optional). - Docs: document uninstall/cleanup steps in the README.
- Composer usage indicator and expandable SVG dashboard.
- Session token, cache, context-pressure, model, and estimated-cost views.
- Per-turn usage chart with total/mix views, hover and keyboard tooltips, and a highlighted current-round band; host-side per-turn aggregation from the session log.
- Host-side DeepSeek balance proxy.
- Full zh/en localization: the indicator, dashboard, charts, and balance views follow
the DSH in-app Language setting through the
localeservice (dictionaries registered under thedsh-usage-chartnamespace; browser language only seeds the initial value). - Release metadata, bilingual documentation, CI, contribution/security policies, and
portable visual probe scripts (
scripts/*.mjs). - Privacy-safe README demo screenshot with fictional usage values and no account data.
- Light-mode readability: indicator, panel, and SVG charts now use DSH theme tokens
(
--dsw-alias-label-*/--dsw-alias-bg-*) and theme static palette colors, so text and chart segments stay legible in both light and dark appearances.
- Restrict Host JSON routes to same-origin GET requests.
- Require HTTPS for custom API endpoints, except loopback HTTP proxies.
- Validate token-usage samples before aggregation.