dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:RitvaManner/dsh-token-control
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Per-turn token and cost readout, DeepSeek CNY balance, and peak/off-peak countdown — a DeepSeek Harness plugin mounted above the composer.
What it shows · Layout · Install · Development · Security · Release notes
Host and Client are strictly separated; PricingStrategy, BalanceProvider, PeakPeriodProvider, and View are replaceable seams; the UI is fully pluggable.
Status: v0.2.0 — rendered and exercised on a desktop profile (real session numbers, live balance with and without an API key), 57 unit assertions passing. Design: docs/design-v1.md · Verification: docs/verify-v1.md.
≈, then replaced by the committed value.GET /user/balance when DEEPSEEK_API_KEY exists, otherwise the same wallet through DSH's own account service — so a profile signed in with the DeepSeek account needs no key. A failed refresh keeps the previous reading and marks it stale with its timestamp; with neither a key nor a signed-in account it says "未配置" rather than making a number up.src/definition/ contracts and pure data: ViewModel, wire protocol, peak math, price table, holiday policy
src/provider/ replaceable implementations (pricing, peak policy, API-key and account balance, calibration, null alerts)
src/consumer/ depends on definition only: ledger fold, ViewModel builder, hub, view config
src/host/ composition root; every registration goes through ctx.effect
src/client/ core.js (transport, store, ViewRegistry, React shell, settings page)
src/client/views/ one self-contained file per View
src/client/client.js GENERATED bundle: core.js with every View inlined
The direction is enforced by scripts/check.mjs and tests/architecture.test.mjs.
Each View is one file under src/client/views/ listed in views/index.json; adding a View is one new file, one manifest line, then pnpm build. The builder inlines every View into the Client bundle.
That build step exists because the Harness Client loader runs a package's ./client export as a classic script: it cannot import a sibling file, and loading one later is fragile — a dynamic <script> depends on page policy, and a page-global handshake depends on activation order (a second activation can clobber the first). Inlining at build time keeps "one file per View" while leaving no runtime moving parts.
# from npm (after publishing)
dsh plugin --profile <profile> add dsh-token-control
# from GitHub
dsh plugin --profile <profile> add github:RitvaManner/dsh-token-control
# from a local checkout (development)
dsh plugin --profile <profile> add .
Then open Settings → Token Monitor and choose where the readout mounts (default conversation.input.dock, the row above the composer).
node scripts/build-client.mjs # regenerate src/client/client.js after editing core.js or a View
pnpm dev # build, then create/reuse .dsh-dev, link, boot the dev profile
pnpm dev:reset # delete .dsh-dev and rebuild it
Everything lives inside the repository (.dsh-dev/); ~/.dsh is untouched.
ctx.credentials.resolve('DEEPSEEK_API_KEY') and appears solely in the outbound Authorization header.AccountBalanceProvider asks the Host for ctx.get('deepseekAccount') and receives the wallet amounts, not the platform grant DSH keeps in its credential store./api connection admission: a local process can read the snapshot (it carries the balance, never the key). This matches the existing community-plugin pattern; wrapping the handler in ctx.connection.admit is the hardening path.DS_CNY_2026_11.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。