@rayadesu/dsh-billing 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -41,23 +41,24 @@ cordis.patch.yml DSH profile bundle 补丁层:挂载 llm-billing + ui-
41
41
  - **发布前校验**:`pnpm run verify`(每个包 `prepublishOnly` 自动运行)检查
42
42
  `lib/typert.host.js` 的 `TYPERT.package` 必须等于导出它的包名,且 lib 中不得残留
43
43
  其他包名的清单;失败即禁止发布。
44
- - **依赖以发布形态声明**:`@deepseek-ai/dsh-*` 依赖写 `^0.1.6-alpha.1`(对应官方 monorepo 当前发布基线,monorepo 内为
44
+ - **依赖以发布形态声明**:`@deepseek-ai/dsh-*` 依赖写 `^0.1.7-alpha.2`(对应官方 monorepo 当前发布基线,monorepo 内为
45
45
  `workspace:^`);本插件的三个包发布到 npm 的
46
46
  `@rayadesu` scope,直接 `dsh plugin add @rayadesu/...` 安装。
47
47
  - **补客户端包漏声明的运行时依赖**:`dsh-client-store`(`zustand`/`immer`)与
48
48
  `dsh-client-ui-primitives`(markdown 视图栈:`mdast-util-*`、`micromark-*`、`shiki`、
49
- `katex`、`diff`、`anser`、`clsx`)把它们只声明为上游 devDependencies,产物却直接 import;
50
- 发布 bundle 运行时由 dsh 安装提供,独立 workspace 的测试要自己解析,故在 `ui-billing`
51
- 的 devDependencies 里按上游同版本范围补齐。dsh 依赖线升级后若测试报 `Cannot find package`,
52
- 照此补即可。
53
- - **typert codec 跨基线桥接(`scripts/typert-compat.mjs`)**:npm 上最新的
54
- `@deepseek-ai/dsh-typert-generator@0.1.6-alpha.1` 把 strict codec 生成为
55
- `{ mode, typeSymbol, schema }`,而 dsh checkout(HEAD,含 `perf(typert): materialize
56
- generated schemas on first use`)改成 `{ mode, typeSymbol, create() }`,其 `dsh-typert-loader`
57
- 见不到 `create` 就拒绝注册(`... parameter codec has no create() factory`),宿主行随之
58
- 启动失败、Web 启动页报 `1 entry did not activate`。两个读取方都不拒绝自己不读的字段,
59
- 所以产物**两个字段都带**即可同时满足 checkout 与 npm alpha 线。该步骤挂在 `build:host`
60
- 末尾(tsdown 之后),幂等;`verify` 检查 strict codec 数 == `create: () =>` 数。
49
+ `katex`、`diff`、`anser`、`clsx`、`simple-icons`)、`dsh-client-web`
50
+ (`dsh-client-ui-dockkit`)把它们只声明为上游 devDependencies(或干脆不声明),产物却直接
51
+ import;发布 bundle 运行时由 dsh 安装提供,独立 workspace 的测试要自己解析,故在
52
+ `ui-billing` 的 devDependencies 里按上游同版本范围补齐。dsh 依赖线升级后若测试报
53
+ `Cannot find package`,照此补即可。
54
+ - **typert codec 的 create 工厂(`scripts/typert-compat.mjs`)**:DSH 的 `dsh-typert-loader`
55
+ 要求每个 strict codec 带 `create` 工厂,见不到就拒绝注册
56
+ (`... parameter codec has no create() factory`),宿主行随之启动失败、Web 启动页报
57
+ `1 entry did not activate`。自 0.1.7-alpha.2 起 generator 原生产出 `create: schema`,
58
+ 构建产物直接可用;`scripts/typert-compat.mjs` 降级为安全网(幂等,遇无 create 的 codec
59
+ 或未知形状即非零退出,防 generator 回退)。该步骤挂在 `build:host` 末尾(tsdown 之后);
60
+ `verify` 按 codec 块检查每个块都带 `create`(逐行计数会误伤清单里 `TYPERT.schemas`
61
+ 的 `create` 条目)。
61
62
  **改完与 typert 产物相关的代码务必走 `pnpm run build:host`,不要只跑 tsdown。**
62
63
  - **workspace 关掉 pnpm 发布龄门槛**:`pnpm-workspace.yaml` 显式 `minimumReleaseAge: 0`。
63
64
  pnpm ≥11 默认 1 天门槛会把刚发布的 alpha 包挡在 lockfile 校验外,而校验阶段不认
@@ -65,7 +66,7 @@ cordis.patch.yml DSH profile bundle 补丁层:挂载 llm-billing + ui-
65
66
  - **密钥不进仓库**:`DEEPSEEK_API_KEY` 等一律由用户环境或凭据 seam 提供,仓库不含真实值。
66
67
  - **README 双语**:每个 README 遵循 DSH 结构 `README.md`(EN) + `README.zh.md`(ZH) +
67
68
  `README.i18n.yaml`(记录两文件 git blob hash,改动后需更新)。
68
- - **版本对齐**:根 bundle 与两个包统一版本号(当前 0.3.14),`pnpm-lock.yaml` 随依赖变更更新。
69
+ - **版本对齐**:根 bundle 与两个包统一版本号(当前 0.3.16),`pnpm-lock.yaml` 随依赖变更更新。
69
70
  - **提交与发布流程**:见 `.agents/skills/dsh-release/SKILL.md` —— 阶段 A(改代码 → 按档位校验/打包 →
70
71
  本地 pack 安装 → 交用户验证)**不提交**,改动留在工作区;用户说「发布」进入阶段 B 才 bump 版本、
71
72
  **按类型分别提交**、推送、发 npm 与 GitHub Release。
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # last confirmed-consistent state. Both languages carry equal authority; after
3
3
  # editing either side, bring the other along and re-record both hashes with:
4
4
  # git hash-object README.md README.zh.md
5
- README.md: 1e65c00d536d0c589976b3bbbe2c551afc54957b
6
- README.zh.md: b38c56782db1edd4ed3d5d3ab75a463f6996d16a
5
+ README.md: 2b5bde11041d108657cab40bd4afa04c8cf88195
6
+ README.zh.md: 2d5570b3700887ff928ba559a195c48d98217d61
package/README.md CHANGED
@@ -130,7 +130,7 @@ commands.
130
130
 
131
131
  The two plugin packages declare the DeepSeek Harness packages they build on
132
132
  (`@deepseek-ai/cordis`, `@deepseek-ai/dsh-credentials`, `@deepseek-ai/dsh-session`,
133
- and the client runtime packages) as `peerDependencies` at `^0.1.6-alpha.1`. A dsh
133
+ and the client runtime packages) as `peerDependencies` at `^0.1.7-alpha.2`. A dsh
134
134
  profile does not auto-install peers, so these are provided by the dsh
135
135
  installation itself through the `profiles/node_modules` fallback rather than
136
136
  fetched from the registry — no extra packages to install, and no registry token
@@ -139,12 +139,14 @@ needed on the installing machine.
139
139
  Two of those published client packages import runtime modules their manifests
140
140
  list only under `devDependencies` (`dsh-client-store` → `zustand`/`immer`;
141
141
  `dsh-client-ui-primitives` → the markdown view stack: `mdast-util-*`,
142
- `micromark-*`, `shiki`, `katex`, `diff`, `anser`, `clsx`). The shipped bundles
142
+ `micromark-*`, `shiki`, `katex`, `diff`, `anser`, `clsx`, `simple-icons`;
143
+ `dsh-client-web` → `dsh-client-ui-dockkit`, which its manifest does not declare
144
+ at all). The shipped bundles
143
145
  are external and load them from the dsh installation at runtime, but this
144
146
  standalone workspace resolves them itself, so `ui-billing` declares them as its
145
147
  own `devDependencies` for the browser-half specs.
146
148
 
147
- The plugin builds against the 0.1.6-alpha.1 published line and keeps both DSH
149
+ The plugin builds against the 0.1.7-alpha.2 published line and keeps both DSH
148
150
  runtime families readable: the live `Session` log surface
149
151
  (`Session.events` + `header.seedLength` at/before 0.1.1-rc.2,
150
152
  `snapshotEvents()` + `inheritedEventCount` since 0.1.2-alpha.4), and the
@@ -201,18 +203,17 @@ it. If a typert manifest ever names a package other than its own
201
203
 
202
204
  The typert generator recognizes `Remote`/`TypertRemoteService` only from a
203
205
  workspace-registered protocol package, so `packages/typert-protocol` vendors
204
- the published `@deepseek-ai/dsh-typert-protocol@0.1.6-alpha.1` declarations; when
206
+ the published `@deepseek-ai/dsh-typert-protocol@0.1.7-alpha.2` declarations; when
205
207
  the dsh dependency line moves, refresh it from the installed package.
206
208
 
207
- The generated codecs also straddle a baseline skew. The newest *published*
208
- generator emits `{ mode, typeSymbol, schema }`, while the harness checkout the
209
- web app actually runs from is ahead of that publish (`perf(typert): materialize
210
- generated schemas on first use`) and reads `{ mode, typeSymbol, create() }`,
211
- refusing any codec whose `create` is not a function. `scripts/typert-compat.mjs`
212
- — run at the end of `build:host`, enforced by `verify` — adds the `create`
213
- factory beside the emitted `schema`, so a single artifact loads on both lines.
214
- Run `pnpm run build:host` (not bare `tsdown`) after touching anything that
215
- regenerates these artifacts.
209
+ The generated codecs must carry a `create` factory: the `dsh-typert-loader`
210
+ refuses any strict codec without one (`... parameter codec has no create()
211
+ factory`), which fails the host line's activation. Generator 0.1.7+ emits
212
+ `create` natively, so a current build passes through unchanged;
213
+ `scripts/typert-compat.mjs` — run at the end of `build:host`, enforced by
214
+ `verify` — stays as a safety net that exits non-zero if a codec ever ships
215
+ without its factory. Run `pnpm run build:host` (not bare `tsdown`) after
216
+ touching anything that regenerates these artifacts.
216
217
 
217
218
  Publishing (the bundle and both plugins share one version; `prepublishOnly`
218
219
  runs the `verify` gate automatically). Use `npm publish` from **inside each
@@ -254,7 +255,7 @@ Both packages ship sane defaults; everything below is optional.
254
255
  | --- | --- | --- |
255
256
  | `apiKeyEnv` | `DEEPSEEK_API_KEY` | Credential-reference (environment-variable) name resolved per call. |
256
257
  | `baseURL` | `$DEEPSEEK_BASE_URL` then `https://api.deepseek.com` | Endpoint base; `/user/balance` is appended. |
257
- | `models` | V4.1 Flash (`deepseek-flash`) + V4 Flash + V4 Pro + V4 Flash Vision Exp + MiMo-V2.5 series | Advisory display rows, in presentation order; they mirror DSH's `llm-deepseek` catalog. |
258
+ | `models` | V4.1 Flash (`deepseek-flash`) + V4 Flash + V4 Pro + V4 Flash Vision Exp + MiMo-V2.5/V2.6 series | Advisory display rows, in presentation order; they mirror DSH's `llm-deepseek` catalog. |
258
259
  | `billing.peakHours` | 09:00–12:00, 14:00–18:00 (Beijing, weekdays) | Peak-hour windows, applied weekdays (Mon–Fri) only; weekends and all other hours are off-peak. |
259
260
  | `billing.models` | Published V4 + MiMo rates | Per-model price rows (`cacheHitInput`, `cacheMissInput`, `output`, in CNY per 1M tokens) with an optional inclusive `effectiveFrom`; several rows sharing a model are its rate revisions. |
260
261
 
@@ -265,7 +266,7 @@ Both packages ship sane defaults; everything below is optional.
265
266
  - **Today's spend** aggregates every session's events on the current Beijing-time calendar day with the same pricing rules; **today's tokens** is the sum of those same priced rows' three billing buckets (cache-hit input / cache-miss input / output), rendered in DSH's compact notation with its ` tok` unit (`517 tok`, `12.2K tok`, `1.2M tok`); event dates are also assigned in Beijing time.
266
267
  - **Turn cost** prices the events inside the turn's `turn/start`..`turn/end` range with the same rules (located by the closing message's session id + message id), folded in one pass for the whole session and served as a `messageId → cost` map.
267
268
  - **Today session ranking** aggregates today's spend per session with the same rules (a cross-day session counts only today's part), sorted descending; names come from the log's latest `session/title` event (the auto-generated Chinese title or a user rename). It ranks **conversations**: a subagent session (DSH stamps its header with `origin: 'subagent'` and a `delegationDepth`; a user fork carries neither) is merged into the row of the top-level session that delegated it, so one row is one conversation. Each row reports `total` (the conversation's whole day, subagents included) plus `ownTotal` (that session's own spend) — the panel's trailing share reads `ownTotal`, and the day's aggregate total is unchanged by the regrouping.
268
- - Models without a rate row are not priced (the built-in table covers the DSH `llm-deepseek` catalog — V4.1 Flash `deepseek-flash`, V4 Flash, V4 Pro, V4 Flash Vision Exp — plus the retired `deepseek-v4.1-flash-expires-on-0910` preview id and the MiMo-V2.5 series; every flash-series route shares the same pair). Each sample takes the rate revision in effect at its own timestamp: the base schedule is the DeepSeek pricing effective **August 17**; the **flash series** (V4.1 Flash, V4 Flash, V4 Flash Vision Exp, and the retired id) was re-priced effective **September 10, 12:00 Beijing time** to off-peak 0.02 / 1.0 / 4.0 CNY per 1M tokens with peak at twice those prices — samples from before that instant, the V4.1 Flash route's own earlier usage included, keep the superseded rates; the **V4 Pro** route is announced to switch to V4.1 Flash and its rates on **September 14, 12:00 Beijing time**; the MiMo-V2.5 series is untouched. The weekend-off-peak rule (weekends billed at off-peak prices all day) follows the adjustment effective **August 23**.
269
+ - Models without a rate row are not priced (the built-in table covers the DSH `llm-deepseek` catalog — V4.1 Flash `deepseek-flash`, V4 Flash, V4 Pro, V4 Flash Vision Exp — plus the retired `deepseek-v4.1-flash-expires-on-0910` preview id and the MiMo-V2.5/V2.6 series; every flash-series route shares the same pair). Each sample takes the rate revision in effect at its own timestamp: the base schedule is the DeepSeek pricing effective **August 17**; the **flash series** (V4.1 Flash, V4 Flash, V4 Flash Vision Exp, and the retired id) was re-priced effective **September 10, 12:00 Beijing time** to off-peak 0.02 / 1.0 / 4.0 CNY per 1M tokens with peak at twice those prices — samples from before that instant, the V4.1 Flash route's own earlier usage included, keep the superseded rates; the **V4 Pro** route is announced to switch to V4.1 Flash and its rates on **September 14, 12:00 Beijing time**; the MiMo series is untouched (MiMo-V2.6 — launched September 22, 2026 — kept V2.5's published rates and ships the same rows). The weekend-off-peak rule (weekends billed at off-peak prices all day) follows the adjustment effective **August 23**.
269
270
 
270
271
  - **The balance-series "today's consumption"** (the figure right after `API 剩余金额`) is pure account arithmetic and never enters the token pricing above: the first balance queried on the local calendar day − the current balance + the day's detected top-ups (an increase rounds **up to the next ¥10 step**, because the provider only tops up in round tens). It is the caliber of the `balanceinfo` program this plugin mirrors, and it is deliberately a separate figure from the priced 今日花费 — spend from another client, or from before this browser was opened, shows up only here; the two figures disagreeing is normal. The day record lives in this browser's `localStorage` (key `dsh.billing.balance-day.v1`), survives reloads and `dsh` restarts, rolls over on the **local** calendar day (the browser's day, not the host's Beijing day key), is sampled on mount, on session switch, on the manual refresh, and every 5 minutes while the page is visible, renders only once the day holds a sample, and is not shared between clients. Details in [`packages/ui-billing/README.md`](packages/ui-billing/README.md).
271
272
 
package/README.zh.md CHANGED
@@ -121,17 +121,18 @@ dsh plugin --profile web update --latest # 忽略声明的版本区间,把所
121
121
 
122
122
  两个插件包把它们依赖的 DeepSeek Harness 包(`@deepseek-ai/cordis`、
123
123
  `@deepseek-ai/dsh-credentials`、`@deepseek-ai/dsh-session` 以及客户端运行时包)
124
- 声明为 `peerDependencies`(`^0.1.6-alpha.1`)。dsh profile 默认不自动安装 peer,所以
124
+ 声明为 `peerDependencies`(`^0.1.7-alpha.2`)。dsh profile 默认不自动安装 peer,所以
125
125
  这些由 dsh 安装本身通过 `profiles/node_modules` 回退提供,而不是从 registry 拉取——
126
126
  无需额外安装,安装机也不需要 registry token。
127
127
 
128
128
  这些已发布的客户端包里有两个会把只写在 `devDependencies` 里的运行时模块直接 import 进
129
129
  产物(`dsh-client-store` → `zustand`/`immer`;`dsh-client-ui-primitives` → markdown 视图栈
130
- `mdast-util-*`、`micromark-*`、`shiki`、`katex`、`diff`、`anser`、`clsx`)。发布的 bundle
130
+ `mdast-util-*`、`micromark-*`、`shiki`、`katex`、`diff`、`anser`、`clsx`、`simple-icons`;
131
+ `dsh-client-web` → 清单里完全没声明的 `dsh-client-ui-dockkit`)。发布的 bundle
131
132
  把这些留作外部依赖、运行时由 dsh 安装提供,但本仓库是独立 workspace、要自己解析,所以
132
133
  `ui-billing` 把它们声明为自己的 `devDependencies` 供浏览器半测使用。
133
134
 
134
- 插件按 0.1.6-alpha.1 发布线构建,同时兼容读取两代 DSH 运行时:live `Session` 日志面
135
+ 插件按 0.1.7-alpha.2 发布线构建,同时兼容读取两代 DSH 运行时:live `Session` 日志面
135
136
  (0.1.1-rc.2 及以前为 `Session.events` + `header.seedLength`,0.1.2-alpha.4 起为
136
137
  `snapshotEvents()` + `inheritedEventCount`),以及持久化服务面(0.1.1-rc.2 及以前为
137
138
  `inspect`/`listSnapshots`,0.1.2-alpha.5 的 handle 化改造后为
@@ -180,16 +181,14 @@ host 面会从源码重新生成 `lib/typert.host.js` 与 `lib/typert.remote-cli
180
181
  的 name 不一致,`verify` 会在发布前直接失败。
181
182
 
182
183
  typert 生成器只认工作区内已注册协议包里的 `Remote`/`TypertRemoteService` 声明,所以
183
- `packages/typert-protocol` 内嵌了 npm 上 `@deepseek-ai/dsh-typert-protocol@0.1.6-alpha.1` 的
184
+ `packages/typert-protocol` 内嵌了 npm 上 `@deepseek-ai/dsh-typert-protocol@0.1.7-alpha.2` 的
184
185
  声明文件;dsh 依赖线升级时,从安装包重新刷新它。
185
186
 
186
- 生成出来的 codec 还横跨了一次基线错位:npm 上最新的**发布版**生成器输出
187
- `{ mode, typeSymbol, schema }`,而 Web 实际运行的那份 harness checkout 领先于该次发布
188
- (`perf(typert): materialize generated schemas on first use`),读的是
189
- `{ mode, typeSymbol, create() }`,`create` 不是函数就拒绝注册。`scripts/typert-compat.mjs`
190
- 挂在 `build:host` 末尾、并由 `verify` 把关,在生成的 `schema` 旁补上 `create` 工厂,
191
- 让同一份产物在两条线上都能加载。**动到会重新生成这些产物的代码后,请跑
192
- `pnpm run build:host`,不要只跑 tsdown。**
187
+ 生成的每个 strict codec 必须带 `create` 工厂:`dsh-typert-loader` 对没有 `create` 的
188
+ codec 直接拒绝注册(`... parameter codec has no create() factory`),宿主行随之启动
189
+ 失败。0.1.7 起生成器原生产出 `create`,当前构建直接可用;`scripts/typert-compat.mjs`
190
+ 挂在 `build:host` 末尾、并由 `verify` 把关,降级为安全网——一旦再有 codec 缺工厂就非零
191
+ 退出。**动到会重新生成这些产物的代码后,请跑 `pnpm run build:host`,不要只跑 tsdown。**
193
192
 
194
193
  发布(bundle 与两个插件包统一版本号;`prepublishOnly` 会自动跑 `verify` 门禁)。
195
194
  要用 `npm publish` 且**必须在各包目录内执行**——`pnpm publish` 会失败(token 读取方式问题),
@@ -226,7 +225,7 @@ npm publish # @rayadesu/dsh-billing bundle(仓库根)
226
225
  | --- | --- | --- |
227
226
  | `apiKeyEnv` | `DEEPSEEK_API_KEY` | 每次调用时解析的凭据引用(环境变量)名。 |
228
227
  | `baseURL` | `$DEEPSEEK_BASE_URL`,其次 `https://api.deepseek.com` | 端点基础地址;会追加 `/user/balance`。 |
229
- | `models` | V4.1 Flash(`deepseek-flash`)+ V4 Flash + V4 Pro + V4 Flash Vision Exp + MiMo-V2.5 系列 | 展示用的模型行,按展示顺序;与 DSH `llm-deepseek` 目录对齐。 |
228
+ | `models` | V4.1 Flash(`deepseek-flash`)+ V4 Flash + V4 Pro + V4 Flash Vision Exp + MiMo-V2.5/V2.6 系列 | 展示用的模型行,按展示顺序;与 DSH `llm-deepseek` 目录对齐。 |
230
229
  | `billing.peakHours` | 09:00–12:00、14:00–18:00(北京,仅工作日) | 高峰时段窗口,仅周一至周五适用;周末与其余时段均为低谷。 |
231
230
  | `billing.models` | 官方 V4 + MiMo 费率 | 每个模型的单价行(`cacheHitInput`、`cacheMissInput`、`output`,单位:元/百万 token),可带生效时刻 `effectiveFrom`(含该时刻);同一模型的多行即其费率版本。 |
232
231
 
@@ -237,7 +236,7 @@ npm publish # @rayadesu/dsh-billing bundle(仓库根)
237
236
  - **今日花费**按同一个计价规则汇总当天(北京时间自然日)所有会话的事件,**今日 Token** 是同一批计价行的三个计费桶(缓存读取 / 未缓存输入 / 输出)之和,按 DSH 的紧凑记数法加 ` tok` 单位渲染(`517 tok`、`12.2K tok`、`1.2M tok`);事件归属的日期同样按北京时间计算。
238
237
  - **本轮花费**按同一规则计价该回合 `turn/start`..`turn/end` 区间内的事件(定位到收尾消息的会话 id + 消息 id),整会话一趟折出 `messageId → 金额` 映射后下发。
239
238
  - **今日会话花费排行**按同一规则按会话汇总今日花费(跨天会话只统计今天的部分),从高到低排序;会话名取日志中最后一条 `session/title` 事件(自动生成的中文标题或用户重命名的新标题)。排行排的是**对话**:子代理会话(DSH 在其 header 上盖 `origin: 'subagent'` 与 `delegationDepth`;用户手动分叉两者都没有)会并入委派它的顶层会话那一行,所以一行就是一个对话。每行给出 `total`(这次对话的整日花费,含子代理)与 `ownTotal`(该会话自己的花费);面板里紧跟的今日份金额读的是 `ownTotal`,而归组不改变整日合计。
240
- - 没有费率行的模型不计入(内置价目表覆盖 DSH `llm-deepseek` 目录——V4.1 Flash `deepseek-flash`、V4 Flash、V4 Pro、V4 Flash Vision Exp——外加已退役的 `deepseek-v4.1-flash-expires-on-0910` 预览 id 与 MiMo-V2.5 系列;flash 系列各路由同价)。每份样本取**自身时刻生效的费率版本**:基础价目为 DeepSeek **8 月 17 日实行**的费率;**flash 系列**(V4.1 Flash、V4 Flash、V4 Flash Vision Exp 及退役 id)自 **9 月 10 日 12:00(北京时间)** 起降为谷时 0.02 / 1.0 / 4.0 元每百万 token、峰时为其两倍——该时刻之前的样本(含 V4.1 Flash 路由自身的早先用量的)沿用被取代的旧价;**V4 Pro** 路由公告于 **9 月 14 日 12:00(北京时间)** 改由 V4.1 Flash 服务并按其实施费率计费;MiMo-V2.5 系列不受影响。**周末按低谷价计费**的规则按 **8 月 23 日**生效的调整执行。
239
+ - 没有费率行的模型不计入(内置价目表覆盖 DSH `llm-deepseek` 目录——V4.1 Flash `deepseek-flash`、V4 Flash、V4 Pro、V4 Flash Vision Exp——外加已退役的 `deepseek-v4.1-flash-expires-on-0910` 预览 id 与 MiMo-V2.5/V2.6 系列;flash 系列各路由同价)。每份样本取**自身时刻生效的费率版本**:基础价目为 DeepSeek **8 月 17 日实行**的费率;**flash 系列**(V4.1 Flash、V4 Flash、V4 Flash Vision Exp 及退役 id)自 **9 月 10 日 12:00(北京时间)** 起降为谷时 0.02 / 1.0 / 4.0 元每百万 token、峰时为其两倍——该时刻之前的样本(含 V4.1 Flash 路由自身的早先用量的)沿用被取代的旧价;**V4 Pro** 路由公告于 **9 月 14 日 12:00(北京时间)** 改由 V4.1 Flash 服务并按其实施费率计费;MiMo 系列不受影响(MiMo-V2.6 于 2026 年 9 月 22 日发布,沿用 V2.5 公布的费率,共用同一组行)。**周末按低谷价计费**的规则按 **8 月 23 日**生效的调整执行。
241
240
 
242
241
  - **余额口径的「今日消费」**(`API 剩余金额` 后紧跟的那个数字)是纯账户加减,不参与上面的 token 计价:当天(本地自然日)第一次查询到的余额 − 当前余额 + 当天识别出的充值(余额上涨按 **10 元步进向上取整**,因为厂商只按整十充值)。这条口径与本插件对标的 `balanceinfo` 程序一致,并且**刻意与计价的「今日花费」分成两个数**——别的客户端花的钱、或本浏览器打开前花的钱,只体现在这里;两个数字不一致是正常的。当日记录写在本浏览器的 `localStorage`(键 `dsh.billing.balance-day.v1`),跨页面刷新与 `dsh` 重启保留,按**本地自然日**翻篇(浏览器所在的日,不是宿主的北京日键);采样发生在挂载、切换会话、手动刷新与页面可见时的 5 分钟轮询,只有当天已经有过一次采样才显示,且不在客户端之间共享。细则见 [`packages/ui-billing/README.zh.md`](packages/ui-billing/README.zh.md)。
243
242
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayadesu/dsh-billing",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "DeepSeek Harness billing plugin: account balance and this session's billed spend with a session-header badge.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,13 +40,13 @@
40
40
  "access": "public"
41
41
  },
42
42
  "peerDependencies": {
43
- "@rayadesu/dsh-client-ui-billing": "^0.3.14",
44
- "@rayadesu/dsh-llm-billing": "^0.3.14"
43
+ "@rayadesu/dsh-client-ui-billing": "^0.3.16",
44
+ "@rayadesu/dsh-llm-billing": "^0.3.16"
45
45
  },
46
46
  "devDependencies": {
47
- "@deepseek-ai/cordis": "^4.0.2",
48
- "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
49
- "@deepseek-ai/dsh-typert-generator": "^0.1.6-alpha.1",
47
+ "@deepseek-ai/cordis": "^4.0.4",
48
+ "@deepseek-ai/dsh-invariants": "^0.1.7-alpha.2",
49
+ "@deepseek-ai/dsh-typert-generator": "^0.1.7-alpha.2",
50
50
  "@eslint/js": "^10.0.1",
51
51
  "@types/node": "^22.20.0",
52
52
  "eslint": "^10.9.1",