@rayadesu/dsh-billing 0.3.4 → 0.3.6

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
@@ -47,7 +47,7 @@ cordis.patch.yml DSH profile bundle 补丁层:挂载 llm-billing + ui-
47
47
  - **密钥不进仓库**:`DEEPSEEK_API_KEY` 等一律由用户环境或凭据 seam 提供,仓库不含真实值。
48
48
  - **README 双语**:每个 README 遵循 DSH 结构 `README.md`(EN) + `README.zh.md`(ZH) +
49
49
  `README.i18n.yaml`(记录两文件 git blob hash,改动后需更新)。
50
- - **版本对齐**:根 bundle 与两个包统一版本号(当前 0.3.4),`pnpm-lock.yaml` 随依赖变更更新。
50
+ - **版本对齐**:根 bundle 与两个包统一版本号(当前 0.3.6),`pnpm-lock.yaml` 随依赖变更更新。
51
51
  - **文本规范**:LF 换行、文件末尾一个换行(`.editorconfig`/`.gitattributes` 已声明)。
52
52
 
53
53
  ## 常用命令
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 WilliamLIiii
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WilliamLIiii
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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: 9c37927de206de645bc826b3d95b8d86dd636e1e
6
- README.zh.md: c48efb8c6d88452d959feec50670f428fd927cce
5
+ README.md: 841fb8d702f4cf47e0892be8a69485175d089082
6
+ README.zh.md: da8ff60723cf529527294d6fc6198d0428c4efba
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that shows your **DeepSeek account balance**, **this session's (this conversation's) billed spend**, and **today's total spend across all sessions** directly in the web session header; each completed turn also shows its **turn cost** in the message actions row, and the detail panel ends with a **today session-spend ranking**.
5
+ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that shows your **DeepSeek account balance**, **this session's (this conversation's) billed spend**, and **today's total spend across all sessions** directly in the web session header; each completed turn also shows its **turn cost** as a static amount at the end of the message actions row, and the detail panel ends with a **today session-spend ranking**.
6
6
 
7
7
  > The balance is the real `GET /user/balance` figure; the session, turn, and today spends price each message's billed tokens at the official peak/off-peak rates and are estimates, not billing promises.
8
8
 
@@ -10,7 +10,7 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin tha
10
10
 
11
11
  - **Session-header badge** — two lines: remaining balance (`剩余额度:¥X`) and this conversation's billed spend (`本轮对话花费:¥X`).
12
12
  - **Detail panel** — the remaining amount, this session's spend (`本会话花费`) with today's all-session spend beside it (`今日共花费`), one priced row per model (`缓存命中 ¥X · 未命中输入 ¥Y · 输出 ¥Z`), plus a manual refresh action and a spend disclaimer. The panel ends with a **today session-spend ranking**: sessions sorted by today's spend, highest first (names come from the log's Chinese titles and follow renames automatically; at most the top 10 rows, with a "…N more sessions" hint).
13
- - **Turn cost row** — each completed turn's closing message shows `本轮花费 ¥X` at the **front** of the actions row (before the copy control): the "本轮花费" word in the usage-card title tone and the amount in the summary tone, **always visible** (not hover-revealed like the clock text); turns without DeepSeek usage (zero cost) or failed loads stay hidden.
13
+ - **Turn cost amount** — each completed turn's closing message shows a plain static `¥X` at the **end** of the actions row, after the clock: non-interactive (no icon, no "cost" word, no card), its typography replicates the clock text (13px secondary tier, tertiary tone, nowrap), and it is **always visible** (not hover-revealed like the clock text — the row's own hover reveal shows both together); turns without DeepSeek usage (zero cost) or failed loads stay hidden.
14
14
  - **Failures and empty states** — a session or day without priced usage shows "no usage recorded" instead of a fabricated figure; a missing key, rejected credential, or transport error renders a muted "Balance unavailable" whose tooltip carries the Remote's own error message.
15
15
 
16
16
  ## Data update mechanics
@@ -21,7 +21,7 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin tha
21
21
 
22
22
  ## Preview
23
23
 
24
- A real session: the session-header badge, the detail panel (remaining amount, this session's spend next to today's all-session spend, per-model breakdown, and the today session-spend ranking), plus the turn-cost row in the message actions row:
24
+ A real session: the session-header badge, the detail panel (remaining amount, this session's spend next to today's all-session spend, per-model breakdown, and the today session-spend ranking), plus the turn-cost amount at the end of the message actions row:
25
25
 
26
26
  <img width="1200" alt="Billing plugin overview: session header badge, detail panel with per-model rows and today's session ranking, and the turn-cost row" src="preview-overview.png" />
27
27
 
@@ -29,9 +29,9 @@ Close-up of the detail panel — the `API 剩余金额` figure, `本会话花费
29
29
 
30
30
  <img width="640" alt="Detail panel close-up: API remaining amount, this session's spend next to today's all-session spend, per-model rows and today's session ranking" src="preview-detail.png" />
31
31
 
32
- Close-up of the turn-cost rowmoney-bag icon, `本轮花费` label and the `¥` amount, in front of the copy control:
32
+ Close-up of the turn-cost amountthe static `¥` amount at the end of the actions row, after the clock:
33
33
 
34
- <img width="640" alt="Turn-cost row close-up: money-bag icon, 本轮花费 label and ¥ amount before the copy control" src="preview-turn-cost.png" />
34
+ <img width="640" alt="Turn-cost amount close-up: the static ¥ amount at the end of the actions row, after the clock" src="preview-turn-cost.png" />
35
35
 
36
36
 
37
37
  ## Package layout
@@ -39,7 +39,7 @@ Close-up of the turn-cost row — money-bag icon, `本轮花费` label and the `
39
39
  | Package | Side | Role |
40
40
  | --- | --- | --- |
41
41
  | [`packages/llm-billing`](packages/llm-billing) — `@rayadesu/dsh-llm-billing` | Host | Owns the `/user/balance` transport and the peak/off-peak pricing table. Exposes the `billing` Remote (`getBalance`, `getSessionSpend`, `getTodaySpend`, `getTodaySessionsSpend`, `getTurnSpend`). |
42
- | [`packages/ui-billing`](packages/ui-billing) — `@rayadesu/dsh-client-ui-billing` | Browser | Mounts the `billing` Remote itself and contributes the session-header badge and detail panel, plus the turn-cost row in the message actions strip. |
42
+ | [`packages/ui-billing`](packages/ui-billing) — `@rayadesu/dsh-client-ui-billing` | Browser | Mounts the `billing` Remote itself and contributes the session-header badge and detail panel, plus the static turn-cost amount at the end of the message actions strip. |
43
43
 
44
44
  ## Prerequisites
45
45
 
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- 一个 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 插件,在 Web 会话头部直接显示你的 **DeepSeek 账户余额**、**当前会话(本轮对话)的花费**,以及**今日所有会话的共花费**;每条已完成的回合还会在消息操作行里显示**本轮花费**,详情面板底部带**今日各会话花费排行**。
5
+ 一个 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 插件,在 Web 会话头部直接显示你的 **DeepSeek 账户余额**、**当前会话(本轮对话)的花费**,以及**今日所有会话的共花费**;每条已完成的回合还会在消息操作行**行尾**以静态金额显示**本轮花费**,详情面板底部带**今日各会话花费排行**。
6
6
 
7
7
  > 余额是 `GET /user/balance` 的真实数字;会话花费、本轮花费与今日共花费是按官方峰/谷单价对每条消息的计费 token 逐条计价的结果,不是计费承诺。
8
8
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  - **会话头部徽标** —— 两行:剩余余额(`剩余额度:¥X`)+ 本轮对话的计费花费(`本轮对话花费:¥X`)。
12
12
  - **详情面板** —— 剩余金额、本会话花费(`本会话花费`)与其右侧的今日所有会话共花费(`今日共花费`),以及每个模型一行的花费分项(`缓存命中 ¥X · 未命中输入 ¥Y · 输出 ¥Z`),外加手动刷新按钮与花费说明;面板底部是**今日会话花费排行**:按今日花费从高到低排列的会话列表(会话名取日志中的中文标题,重命名后自动同步;最多显示前 10 条,其余以「…还有 N 个会话」提示)。
13
- - **本轮花费行** —— 每条已完成回合的收尾消息操作行**最前**(复制按钮之前)显示 `本轮花费 ¥X`:「本轮花费」一词用「本轮用量」卡片标题色、金额用卡片摘要色,**始终显示**(不随悬停隐藏,不同于时钟文本);回合没有 DeepSeek 用量(花费为 0)或加载失败时不显示。
13
+ - **本轮花费金额** —— 每条已完成回合的收尾消息操作行**行尾**(时钟之后)显示纯静态的 X`:不可点击、无图标、无「花费」字样、不弹卡片,字体样式逐项复刻时钟文本(13px 次级字号、tertiary 色、nowrap),并且**始终显示**(不随悬停隐藏,与时钟文本一致——整行的悬停显隐规则让两者同进退);回合没有 DeepSeek 用量(花费为 0)或加载失败时不显示。
14
14
  - **失败与空态** —— 会话或今日没有可计价消耗时显示「暂无消耗记录」而不是编造数字;未配置 key、凭据被拒或传输错误时显示弱化的「额度不可用」,其提示携带 Remote 自己的错误信息。
15
15
 
16
16
  ## 数据更新机制
@@ -21,7 +21,7 @@
21
21
 
22
22
  ## 显示样式
23
23
 
24
- 真实会话中的会话头部徽标与详情面板(剩余金额、本会话花费与今日共花费、按模型分项、今日会话花费排行),以及消息操作行里的本轮花费行:
24
+ 真实会话中的会话头部徽标与详情面板(剩余金额、本会话花费与今日共花费、按模型分项、今日会话花费排行),以及消息操作行行尾的本轮花费金额:
25
25
 
26
26
  <img width="1200" alt="计费插件总览:会话头部徽标、详情面板(按模型分项与今日会话花费排行)、消息操作行里的本轮花费行" src="preview-overview.png" />
27
27
 
@@ -29,9 +29,9 @@
29
29
 
30
30
  <img width="640" alt="详情面板特写:API 剩余金额、本会话花费与今日共花费、按模型分项与今日会话花费排行" src="preview-detail.png" />
31
31
 
32
- 本轮花费行特写 —— 钱袋图标、`本轮花费` 标签与 `¥` 金额,位于复制控件之前:
32
+ 本轮花费金额特写 —— 操作行行尾(时钟之后)的静态 `¥` 金额:
33
33
 
34
- <img width="640" alt="本轮花费行特写:钱袋图标、本轮花费标签与金额,位于复制控件之前" src="preview-turn-cost.png" />
34
+ <img width="640" alt="本轮花费金额特写:操作行行尾的静态金额,位于时钟之后" src="preview-turn-cost.png" />
35
35
 
36
36
 
37
37
  ## 包结构
@@ -39,7 +39,7 @@
39
39
  | 包 | 侧 | 作用 |
40
40
  | --- | --- | --- |
41
41
  | [`packages/llm-billing`](packages/llm-billing) —— `@rayadesu/dsh-llm-billing` | 主机端 | 负责 `/user/balance` 传输与峰/谷计价表。对外暴露 `billing` Remote(`getBalance`、`getSessionSpend`、`getTodaySpend`、`getTodaySessionsSpend`、`getTurnSpend`)。 |
42
- | [`packages/ui-billing`](packages/ui-billing) —— `@rayadesu/dsh-client-ui-billing` | 浏览器端 | 自己挂载 `billing` Remote,并贡献会话头部徽标与详情面板、消息操作行里的本轮花费行。 |
42
+ | [`packages/ui-billing`](packages/ui-billing) —— `@rayadesu/dsh-client-ui-billing` | 浏览器端 | 自己挂载 `billing` Remote,并贡献会话头部徽标与详情面板、消息操作行行尾的静态本轮花费金额。 |
43
43
 
44
44
  ## 前置条件
45
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayadesu/dsh-billing",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
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": {
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "peerDependencies": {
42
- "@rayadesu/dsh-client-ui-billing": "^0.3.4",
43
- "@rayadesu/dsh-llm-billing": "^0.3.4"
42
+ "@rayadesu/dsh-client-ui-billing": "^0.3.6",
43
+ "@rayadesu/dsh-llm-billing": "^0.3.6"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/cordis": "^4.0.1",
Binary file