dsh-price-monitor

DSH PLUGINUI 与外观

仓库 fishOfOUC/dsh-price-monitor

UI 与外观 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

dsh-price-monitor 是 DeepSeek Harness 的会话成本监控插件,以 dsh-better-sidebar 标签页形式按官方或自定义套餐费率,逐轮、逐次请求统计 token 花费。

一句话选型结论

按资料字段整理

dsh-price-monitor 是UI 与外观类的 DSH 可安装插件,验证等级 L5 · 运行验证通过,安全审查为低风险,列出 4 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类UI 与外观 收录类型可安装插件 验证等级L5 · 运行验证通过 安全审查低风险
验证等级 L5 L5 · 运行验证通过
GitHub 星标 0 复刻 0 · 未关闭 issue 0
最近更新 2026-09-11 创建于 2026-09-10
README 15.8 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:fishOfOUC/dsh-price-monitor
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.2.0-rc.2 等 8 个;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.2.0-rc.2 等 8 个版本版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

4 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-price-monitor:DeepSeek Harness 的会话成本计价标签页

  • 会话总花费与三类 token 拆分
  • 逐轮逐请求成本明细
  • 套餐费率对比卡片
  • 无法计价项如实标注

上游标签

cost-monitordeepseek-harnessdsh-better-sidebardsh-plugin

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询
— · 其它检查项
  • L4_0_SANDBOX 沙盒安装判定 方式:沙盒安装执行

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L5:安装和运行都在沙盒里跑通过,装完能直接用的概率高。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.2.0-rc.2 等 8 个),按版本装不容易报错。
  • 列出了 4 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在UI 与外观场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-price-monitor当前 L5 · 运行验证通过 低风险 0 0.2.0-rc.2 等 8 个 有
nuwa-skill 未做沙盒验证 未标注 3.8 万 未标注 有
awesome-dsh-plugin L4 · 沙盒安装通过 低风险 1.8 万 0.1.1-rc.2 有
deepseek-balance-whale-widget L4 · 沙盒安装通过 低风险 4,492 0.1.7-rc.2 等 2 个 有
dsh-better-sidebar L4 · 沙盒安装通过 低风险 4,112 0.1.7-rc.2 等 10 个 有
dsh-deep-whale L4 · 沙盒安装通过 低风险 2,470 未标注 有

仓库档案

UI 与外观
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方fishOfOUC仓库 dsh-price-monitor · 默认分支 main
分类UI 与外观skin
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 0收录时的数值,非实时
创建 / 更新2026-09-10 · 2026-09-11最后推送 2026-09-11
本站收录2026-09-10首次进入本站目录的时间

README 全文

15.8 KB
作者原文,中文版优先;只做安全转义,不改内容

description: "dsh-price-monitor: a dsh-better-sidebar tab that prices a DeepSeek Harness session's provider-reported token usage."
kind: "user-guide"


dsh-price-monitor

Session cost monitoring for DeepSeek Harness: a host-side session projection
folds the durable log into a per-attempt token ledger, and a
dsh-better-sidebar tab prices
that ledger with an official or hand-entered plan.

Requirements — read this first

This plugin has no user interface of its own. It renders entirely as a tab of
dsh-better-sidebar, which
must be installed and mounted first.
Without it:

  • there is no place for the cost view to appear — this package registers a
    single sidebar tab and a plan-settings panel, nothing else;
  • the client half refuses to activate, and says so
    (dsh-price-monitor requires Better Sidebar features: pluginSettings, stateSubscription),
    rather than loading a half-working panel.
Requirement Why
DeepSeek Harness with the web profile the plugin ships a Host half (a session projection and an HTTP route) and a browser half
dsh-better-sidebar ≥ 0.18.0, mounted and enabled the tab, the settings panel, the plan catalog's storage, and the projection read all come from its service API (ctx.betterSidebar, stateSubscription, pluginSettings) — see Install
A plan for the rates you want to see the selected plan prices the session; without one, every request is listed as unpriced rather than guessed

The host half (the token ledger) works without the sidebar, but nothing reads
it: the ledger has no UI besides that tab.

What it shows

  • Total cost for the current session at the selected plan's rates, with the
    exact three-bucket split (cache miss / cache hit / output) in both tokens and
    money, in the plan's own currency.
  • Per-turn list: every turn with its tokens and cost, expandable to each
    billed request — including requests that retried, switched model, or cannot be
    priced. One request is one model call, i.e. one harness step, and the loop
    numbers a turn's steps 1..N, so a row reads "request N". A retried request
    keeps that number and gains "retry N" rather than appearing as an extra step.
  • Plan card with the selected plan's rates and a same-tokens comparison
    across every saved plan.
  • Partial honesty: an attempt whose usage never arrived or failed
    validation, whose cache buckets cannot be separated, or that reported
    cache-write tokens the plan has no rate for is excluded from the money and
    listed with its reason. Token counts, being provider-reported facts, are still
    summed and shown: unknown cost never blanks a known count, and unknown is
    never shown as zero.

Architecture

host   priceMonitorUsage session projection   ← the only fact source
└─ one row per (turn, step, attempt): startedAt/settledAt, provider,
model, the four DSH token buckets, completeness
client price tab (dsh-better-sidebar)
├─ reads the projection through ctx.sessions.binding(id)
├─ prices it with decimal.js under pluginSettings['price-monitor']
└─ official refresh: POST /price-monitor/api/official-pricing

Three properties follow from that split, and each is covered by tests:

  1. Complete history — the ledger comes from the whole persisted log, not
    from the client's paged event window.
  2. No double counting — pricing never re-derives tokens; it consumes the
    exact provider-reported buckets. The fold mirrors the harness's own
    deriveTurnTokenUsage and is cross-checked against it for every complete
    turn.
  3. Re-pricing is free — plans live in the sidebar's settings, so switching
    a plan re-prices without touching the session log.

Token bucket semantics

DSH's TokenUsage buckets are disjoint: inputTokens is uncached input
only
, and DeepSeek's adapter subtracts cache hits out of prompt_tokens
before writing it. Pricing therefore multiplies each bucket by its own rate and
never computes prompt_tokens - cacheReadTokens. outputTokens already
includes reasoning tokens, so reasoning is never billed twice.

Pricing plans

Rates are per million tokens, stored as decimal strings; every product and sum
stays a Decimal until display.

Plan source Editable Created by
official no — duplicate it first an official refresh (the fetched era)
manual yes the settings panel, or the bundled history below

The bundled catalog is the flash model's published price history — one plan per
era, all in CNY, with the era in force selected:

Plan Rates per 1M tokens (off-peak, peak)
涨价前(8-17 前) ¥0.02 / ¥1 / ¥2, one flat price
涨价后(8-17 起) ¥0.05 / ¥1.5 / ¥4.5, peak ¥0.1 / ¥3 / ¥9
降价后(现行官方价) flash ¥0.02 / ¥1 / ¥4 and peak ¥0.04 / ¥2 / ¥8; pro ¥0.15 / ¥4.5 / ¥13.5 and peak ¥0.3 / ¥9 / ¥27

A refresh replaces the official plan with the era the page currently
describes: one plan carrying one rate table per model the page lists, so a
retired model billed at its successor's rates is expressed as a group naming
both ids.

Currency

Official pricing is CNY by default: both the bundled snapshot and the
refresh route read DeepSeek's Chinese pricing page, which prints the primary
published numbers in yuan. The English page prints the same rates as a rounded
USD conversion of them (1 USD ≈ 6.818 CNY on the 2026-09-10 snapshot: flash is
¥0.02 / ¥1 / ¥4 in Chinese against $0.003 / $0.15 / $0.6 in English), and
this plugin never converts between the two.

A plan therefore carries the currency its publisher printed — CNY for the
official plans, and whichever currency a manual plan was saved in — and an
amount always reads in the currency of the plan that produced it. $0.15 and
¥1 are never silently added together. The same rule governs the comparison
list: rows of different currencies still list their totals, but no percentage is
shown between them, because a ratio across currencies would be meaningless.

Add a manual plan in USD if you account in dollars, and copy an official plan
into a manual one to restate it in the other currency. A plan's modelIds never
affects an amount, so a USD plan prices any session just as a CNY one does.

Price phases

DeepSeek changes these rates over time, so the same session can be compared
across phases by saving one plan per phase and switching between them; the
comparison list then shows every phase's total for the very same tokens. Record
when each phase applied in its rate period (effectiveFrom / effectiveTo) —
that period is a label for the plan card and never gates pricing, so the
selected plan prices the whole session whatever dates its attempts fall on.

A superseded phase knows when it ended without knowing when it began, so either
end of the period may be filled in on its own.

How a session is priced

The selected plan is the whole pricing basis, and a plan is an era: the
rates one provider charged for a set of models over a window. Switching a plan
moves the hero total, the three-bucket breakdown, the per-turn rows, and the
comparison list together — the reason to switch is exactly "what would these
tokens cost under another era", and a session that switched models mid-way is
still priced model by model.

Within a plan, each attempt is priced by the group its own model belongs to:

  • a group that names the model prices it;
  • a model no group names (a renamed id, a model the era never listed, an attempt
    with no route recorded) is priced by the plan's first group, the era's
    headline rates, and the attempt row says priced as so the
    substitution is visible rather than silent.

Nothing about a provider gates an amount either: a request that ran on another
gateway is priced the same way. Only the token facts can leave an attempt out of
the money.

Only the token facts can leave an attempt out of the money: usage that never
arrived or failed validation, cache buckets that cannot be separated, and
cache-write tokens a plan has no rate for. Their tokens are still counted, and
the hero switches to "known cost" with the reason tally, so an unknown amount
never becomes a zero.

A plan's declared rate period (effectiveFrom / effectiveTo) is a label for
the plan card — when those rates applied — and never a gate: the selected plan
prices the whole session whatever dates its attempts fall on. The bundled
snapshot omits a start deliberately, because a fetch observes today's rates
rather than learning when they began.

Peak/off-peak uses each attempt's UTC start time: Monday–Friday, 01:00–04:00 and
06:00–10:00 UTC are peak (left-closed, right-open), and a plan without a peak
band prices everything at its single rate. The bundled snapshot is dated
2026-09-10 and shows its source link in the UI; it prices the two models the
page lists — the flash model and the pro model — with one flash price covering
the ids that model has been listed or reported under (deepseek-flash,
deepseek-v4-flash, deepseek-v4-flash-vision-exp).

Stored settings carry a schemaVersion. A readable version 1 blob — which also
held a calculation mode and a model-alias map — is upgraded in place, keeping
the user's plans and selection; both fields are gone because neither can change
an amount under a single pricing basis.

Official price refresh

The client never fetches the upstream page. It POSTs to the plugin's host
route, which:

  1. requires the browser-trust fence (Host header must be loopback or a
    configured trusted authority; cross-site and mismatched Origin are
    refused) and POST only;
  2. fetches one hard-coded URL
    (https://api-docs.deepseek.com/zh-cn/quick_start/pricing/) — a client
    payload cannot change the target, redirects must stay HTTPS on that one host,
    and the body is capped at 256 KiB and must be HTML;
  3. parses the page strictly: the model header, the three priced categories
    across both bands, the peak = 2 × off-peak relation, and the peak-window
    footnote (the page states it in Beijing time; the schedule stores the
    equivalent UTC windows). Any structural change fails the whole import
    (HTTP 502) and the caller keeps the last good catalog;
  4. returns a per-field diff. The user confirms in the tab before anything is
    written, and applying appends new immutable official versions (fresh ids) —
    previous versions stay for historical comparison.

Install

Install and mount dsh-better-sidebar first — this plugin's tab appears in
that sidebar's + menu, and its plan settings appear in that sidebar's
Side card settings page. Then install this plugin:

# 1. the sidebar this plugin renders inside (skip if you already have it)
dsh plugin --profile web add dsh-better-sidebar

# 2. this plugin
dsh plugin --profile web add dsh-price-monitor

Both commands append a bundle to the profile and restart-time mount; restart
DSH after installing (the Host halves changed), then open the sidebar's +
menu and pick Session cost.

Development install (from this checkout)

cd dsh-price-monitor
pnpm install
pnpm run build          # tsc emits lib/types, tsdown emits lib/index.js + lib/client.js

Then point the profile's sidebar plugin at the built package:

# ~/.dsh/profiles/web/package.json
"dependencies": {
"dsh-price-monitor": "link:E:/Code/my_code/dsh_price_monitor/dsh-price-monitor"
}
cd ~/.dsh/profiles/web && pnpm install

The package's own cordis.patch.yml (dsh.bundle.patch) mounts the host half
once the bundle is in dsh.profile.bundles; for a link: install add the
bundle name there as well:

"dsh": { "profile": { "bundles": [ "...", "dsh-price-monitor" ] } }

Then restart DSH and hard-refresh the browser. The tab appears in the
sidebar's + menu as Session cost; its gear opens the plan settings.

Restart the host after any rebuild, including client-only edits: the client
artifact is served from /plugins//client.js with a revision derived
from its bytes, and a link:ed package outside the loader's watched workspace
is not re-read while the host runs — a rebuilt lib/client.js keeps being
served from the host's in-memory copy until it restarts.

Published install

dsh plugin --profile web add dsh-price-monitor

The same sidebar-first rule applies: with no mounted dsh-better-sidebar the
client half throws at activation instead of silently doing nothing, so check
that the sidebar itself is working before filing a bug here.

Privacy and network behavior

  • Reading the ledger and pricing it are entirely local; nothing is uploaded.
  • The only outbound request is the official-pricing refresh, which the user
    triggers explicitly and which fetches one public documentation page.
  • Plan settings live in the sidebar's own preferences document
    (pluginSettings['price-monitor'].catalog), i.e. alongside the user's other
    sidebar settings; the plugin writes nothing into session logs.

Configuration

No cordis.yml configuration: the plan catalog is user data, edited in the
settings panel. The bundled official snapshot is the offline default.

Development notes

  • pnpm run typecheck, pnpm run test, pnpm run build.
  • lib/ is committed, so a git install (dsh plugin add github:/dsh-price-monitor)
    needs no build step. Rerun pnpm run build and commit lib/ together with any
    source change.
  • The client half is a ModuleLoader closure factory (format: 'cjs' wrapped in
    window.__ModuleLoader__.load), because the harness evaluates it as a classic
    script at /plugins/dsh-price-monitor/client.js; only the harness's browser
    module table may stay external, so zod and decimal.js are inlined.
  • Styles are injected as one ` element fromsrc/client/styles.tsrather than a*.module.cssimport: tsdown does not compile CSS modules without an extra plugin, and every class carries adpm-` prefix so one
    global sheet cannot collide. Colors come only from DSH theme tokens.
  • The tab writes its catalog through the sidebar's own settings route with the
    same whole-pluginSettings patch its client sends, serialized through one
    promise chain so two quick edits cannot interleave.

Tests

File Covers
tests/usage-ledger.spec.ts the fold: attempt lifecycle, retries, validation, contradictions, a usage sample that never reported a cache-write bucket, reference stability, cold/live parity, and cross-checks against the harness's deriveTurnTokenUsage
tests/pricing-engine.spec.ts peak boundaries, the selected era as the sole basis with a table per model group, the headline-group fallback for an unlisted model, switching plans repricing every layer, token facts under partial pricing, decimal exactness, schema rejection, and the generation-1/2 upgrades
tests/official-pricing.spec.ts both saved page fixtures (three-column and the renamed two-model layout) parse exactly; changed amounts, categories, headers, malformed ids, or footnote windows fail
tests/trust-fence.spec.ts loopback/trusted hosts pass; cross-site, opaque, and mismatched origins fail
tests/client.spec.tsx activation and the feature gate, catalog reads (including the v1 upgrade), the hero total equal to the sum of the turn rows, and a plan switch repricing hero, breakdown, and rows
tests/client-interaction.spec.tsx expanding a turn numbers each request by its step and marks a retry; clicking a plan writes the catalog and reprices the rendered tab; the plan form edits one rate table per model group; a failed write surfaces
tests/built-artifacts.spec.ts the built entry points exist and behave; the client bundle is a valid loader factory; the route over real HTTP refuses GET/cross-site/foreign redirects and returns a candidate plus diff

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-price-monitor 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:fishOfOUC/dsh-price-monitor` 即可。

dsh-price-monitor 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-price-monitor 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-price-monitor 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-price-monitor 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2、0.2.0-rc.1、0.1.7-rc.2、0.1.7-alpha.2、0.1.6-alpha.2、0.1.6-alpha.1、0.1.5-rc.2、0.1.5-rc.1。

dsh-price-monitor 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-price-monitor 有哪些功能?

会话总花费与三类 token 拆分、逐轮逐请求成本明细、套餐费率对比卡片、无法计价项如实标注。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

UI 与外观
按星标排序,可作替代方案

nuwa-skill

nuwa-skill

女娲 DSH plugin 只需输入一个名字,就自动调研、提炼并验证任何人的心智模型、决策启发式与表达 DNA,生成可直接调用的思维视角 S

未标注验证等级 3.8 万 星

awesome-dsh-plugin

awesome-dsh-plugin

A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harnes

L4 · 沙盒安装通过 1.8 万 星

deepseek-balance-whale-widget

DeepSeek-Balance-Whale-Widget

DSH 界面右下角的常驻小鲸鱼余额挂件,实时显示 DeepSeek 账户余额、今日已用与每轮对话消耗,支持拖拽吸附、Q 弹动画与音效,开箱即

L4 · 沙盒安装通过 4,492 星

dsh-better-sidebar

DSH-better-sidebar

面向 DeepSeek Harness 的服务化侧边栏工作台插件,把文件编辑、终端、Git 变更、子代理任务与侧边对话整合进右侧栏与底部面板

L4 · 沙盒安装通过 4,112 星

dsh-deep-whale

dsh-deep-whale

DSH Web 鲸鱼娘皮肤系列(深海女仆工坊 maid-atelier)。

L4 · 沙盒安装通过 2,470 星

deepseek-design

deepseek-design

可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。

L4 · 沙盒安装通过 1,438 星

fishOfOUC 的其它插件

2 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。