dsh-model-billing 0.1.2 → 0.3.0
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/CHANGELOG.md +117 -31
- package/README.md +43 -17
- package/client.js +2281 -1787
- package/host.js +1386 -935
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +68 -68
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,117 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [0.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
###
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.0] - 2026-11-02
|
|
4
|
+
|
|
5
|
+
### 新增
|
|
6
|
+
|
|
7
|
+
- 计入 DeepSeek Search/Fetch 按次费:当 DSH 使用 DeepSeek 自带的 `deepseek-official`、`deepseek-search-api` 或 `deepseek-fetch-api` 时,按 ¥5 / 1,000 次成功请求(2026-11-01 00:00 北京时间起)计费;DuckDuckGo、Tavily、普通 HTTP 抓取等免费 provider 不计费。
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- DeepSeek Search/Fetch per-request fees are now included when DSH runs on DeepSeek's own `deepseek-official`, `deepseek-search-api`, or `deepseek-fetch-api` providers: ¥5 per 1,000 successful requests from 2026-11-01 00:00 Beijing time. Free providers such as DuckDuckGo, Tavily, and plain HTTP fetch are not charged.
|
|
12
|
+
|
|
13
|
+
## [0.2.0] - 2026-10-28
|
|
14
|
+
|
|
15
|
+
### 新增
|
|
16
|
+
|
|
17
|
+
- 设置 → 模型与费用新增历史价格簿:可为已不在当前配置列表中的模型新增、编辑或删除三档价格。移除模型时会保留其价格,因此历史轮次仍能计算费用;没有显示名时回退显示原始模型 id。
|
|
18
|
+
- 价格来源标识与一键恢复:完整的自定义价格会覆盖 DeepSeek 内置价格表并标记为“自定义”;无需再次请求即可恢复官方峰谷价表。
|
|
19
|
+
- 费用面板新增未定价路由列表,并提供隐藏未定价提示的开关。
|
|
20
|
+
- 轮尾与输入框下方费用估算拆分为独立设置区,各自拥有总开关。
|
|
21
|
+
- 局域网与反向代理访问:除回环地址外,当请求的 Host 头与套接字实际监听地址一致时也信任该请求;伪造的 Host 仍会被拒绝。
|
|
22
|
+
- 键盘访问:费用面板为模态对话框,打开时获取焦点;模型选择器支持 ↑/↓/Home/End 与 roving tabindex。
|
|
23
|
+
- 新增回归测试:计价一致性、按到达时间判断峰谷、catalog 与 usage 缓存、并发保存、413 状态保留、历史价格簿、移除模型后的历史计费、可信地址校验。
|
|
24
|
+
|
|
25
|
+
### 变更
|
|
26
|
+
|
|
27
|
+
- 峰谷档位改为按 `request/header` 的到达时间判断,而不是完成时间。
|
|
28
|
+
- `totalTokens` 与三档用量不一致时,保留三档并将该次调用标记为 partial,而不是整条丢弃。
|
|
29
|
+
- catalog 与 usage 读取增加缓存;catalog 缓存可用 `?refresh=1` 绕过。
|
|
30
|
+
- 宿主要求为 DSH `^0.2.1-rc.3`。
|
|
31
|
+
|
|
32
|
+
### 修复
|
|
33
|
+
|
|
34
|
+
- 并发到达的保存会串行执行,避免互相覆盖;超大请求体在 `/save` 与 `/select` 上均保留 413 状态。
|
|
35
|
+
- 加载时清理残留的临时状态文件;由更高版本插件写入的状态改为只读,不再被覆盖。
|
|
36
|
+
- catalog 不可用时选择器不再接管,内置选择器保持可用。
|
|
37
|
+
- 显示设置以 Host 状态为唯一来源;旧版 localStorage 值会清理一次。
|
|
38
|
+
- 即使没有配置模型,设置页也保留保存按钮。
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Historical price book under Settings → Models & Cost: add, edit, or remove three-price entries for models that are no longer in the configured list. Removing a model keeps its price, so past turns keep their cost and fall back to the raw model id when no display name exists.
|
|
43
|
+
- Price-source labels and one-click restore: a complete custom price overrides the built-in DeepSeek table and is marked “Custom”; the official peak/off-peak table can be restored without another request.
|
|
44
|
+
- Unpriced-route list in the cost panel, plus a switch to hide unpriced notices.
|
|
45
|
+
- Separate settings sections for the turn tail and the composer cost estimate, each with its own master switch.
|
|
46
|
+
- LAN and reverse-proxy access: besides loopback, a request is trusted when its Host header matches the address the socket actually listens on. A forged Host is still rejected.
|
|
47
|
+
- Keyboard access: the cost panel is a modal dialog that takes focus on open; the picker supports ↑/↓/Home/End with a roving tabindex.
|
|
48
|
+
- Regression tests for pricing consistency, arrival-time peak/off-peak, catalog and usage caches, concurrent saves, 413 preservation, archive pricing, historical billing after model removal, and trusted authorities.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- Peak/off-peak is now chosen from the `request/header` arrival time instead of the completion time.
|
|
53
|
+
- A `totalTokens` that disagrees with the three usage buckets keeps the buckets and marks the attempt partial instead of dropping it.
|
|
54
|
+
- Catalog and usage reads are cached; catalog caching can be bypassed with `?refresh=1`.
|
|
55
|
+
- Requires DSH `^0.2.1-rc.3`.
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Saves that arrive together are serialized so one cannot overwrite the other; oversized bodies keep their 413 status on both `/save` and `/select`.
|
|
60
|
+
- Stale temporary state files are removed on load; state written by a newer plugin version is read-only instead of being overwritten.
|
|
61
|
+
- The picker no longer takes over when the catalog is unavailable, so the built-in picker remains usable.
|
|
62
|
+
- Display settings have a single source of truth in Host state; legacy localStorage values are cleared once.
|
|
63
|
+
- The settings save button is present even with no models configured.
|
|
64
|
+
|
|
65
|
+
## [0.1.2] - 2026-10-22
|
|
66
|
+
|
|
67
|
+
### 新增
|
|
68
|
+
|
|
69
|
+
- 设置 → 模型与费用新增轮尾显示设置:可选择模型、模型提供商、费用、token、缓存命中率与文字标签,并可调整字号、间距与字重。
|
|
70
|
+
- 新增“让其他选择器接管输入框模型选择器”开关;关闭后恢复 DSH 内置选择器。
|
|
71
|
+
- 在 `peerDependencies` 中声明支持的 DSH 宿主范围,便于 dsh-market 展示宿主兼容性。
|
|
72
|
+
|
|
73
|
+
### 变更
|
|
74
|
+
|
|
75
|
+
- 轮尾数值改用与周围聊天元数据一致的次级文字颜色,不再是亮白色。
|
|
76
|
+
- 轮尾字段改用间距分隔,不再使用中点;移除悬停说明。
|
|
77
|
+
- 费用详情面板的模型列加宽,可完整显示 `DeepSeek-V4.1-Flash`。
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- Turn-tail display settings under Settings → Models & Cost: choose models, model provider, cost, tokens, cache-hit rate, and text labels; adjust font size, spacing, and weight.
|
|
82
|
+
- A switch to let another picker take over the composer model selector; turning it off restores the built-in DSH picker.
|
|
83
|
+
- Declared the supported DSH host range in `peerDependencies` so dsh-market can show host compatibility.
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- Turn-tail values now use the same secondary text color as the surrounding chat metadata instead of bright white.
|
|
88
|
+
- Turn-tail fields are separated by spacing rather than middle dots, and the hover explanation has been removed.
|
|
89
|
+
- The model column in the cost details panel is wide enough to show `DeepSeek-V4.1-Flash` without truncation.
|
|
90
|
+
|
|
91
|
+
## [0.1.1] - 2026-10-21
|
|
92
|
+
|
|
93
|
+
### 新增
|
|
94
|
+
|
|
95
|
+
- 在每轮末尾、本轮费用旁显示该轮使用的模型。
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- Show the model or models used by each turn at the end of that turn, next to the per-turn cost.
|
|
100
|
+
|
|
101
|
+
## [0.1.0] - 2026-10-20
|
|
102
|
+
|
|
103
|
+
### 新增
|
|
104
|
+
|
|
105
|
+
- 输入框模型选择器支持自定义已配置模型的顺序。
|
|
106
|
+
- 每个模型可编辑三档每百万 token 价格:缓存命中输入、缓存未命中输入、输出。
|
|
107
|
+
- 为 `deepseek-flash` 与 `deepseek-v4-pro` 内置 DeepSeek 官方峰谷价,按每次用量事件的北京时间选择档位。
|
|
108
|
+
- 提供逐轮与会话费用估算:输入框下方摘要、轮尾金额,以及按轮次和模型分组的详情面板。
|
|
109
|
+
- 状态本地持久化到 `~/.dsh/model-billing.json`,使用原子写入。
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
- Custom ordering for configured models in the composer model picker.
|
|
114
|
+
- Three editable per-million-token prices per model: cache-hit input, cache-miss input, and output.
|
|
115
|
+
- Built-in official DeepSeek peak/off-peak prices for `deepseek-flash` and `deepseek-v4-pro`, selected from each usage event's Beijing time.
|
|
116
|
+
- Per-turn and session cost estimates with a composer summary, turn-tail amount, and a detail panel grouped by turn and model.
|
|
117
|
+
- Local persistence at `~/.dsh/model-billing.json` with atomic writes.
|
package/README.md
CHANGED
|
@@ -29,11 +29,13 @@
|
|
|
29
29
|
### 功能
|
|
30
30
|
|
|
31
31
|
- **自定义模型顺序**:在“设置 → 模型与费用”中用 ↑ / ↓ 调整已配置模型的顺序。模型选择器按这个顺序展示,跨提供方也保持你排的顺序,并用提供方名称分组。
|
|
32
|
-
- **三档 token
|
|
33
|
-
- **DeepSeek 官方价内置**:`deepseek-flash` 和 `deepseek-v4-pro`
|
|
32
|
+
- **三档 token 价格**:每个模型可填写每百万 tokens 的缓存命中输入、缓存未命中输入、输出价格。`0` 是有效价格,留空表示未设置。
|
|
33
|
+
- **DeepSeek 官方价内置**:`deepseek-flash` 和 `deepseek-v4-pro` 默认使用 DeepSeek 官网的峰谷价,并在设置页标明“官方价”;填入完整的三档自定义价即可覆盖官方价,标为“自定义”。
|
|
34
34
|
- **逐轮费用与使用模型**:每轮结束后在轮尾显示这一轮使用的模型,以及该轮费用和缓存命中率。
|
|
35
|
-
-
|
|
35
|
+
- **可配置轮尾**:在设置中总开关轮尾显示,并可分别开关使用模型、模型提供商、费用、token、缓存命中率、文字标签,调整字号、间距和字重;也可以关闭选择器接管,恢复 DSH 内置模型选择器。输入框下方的费用估算另有独立开关。
|
|
36
36
|
- **本会话费用**:输入框下方显示本会话累计估算、最近一轮费用和缓存命中率;展开后可查看按轮次和按模型的明细。
|
|
37
|
+
- **DeepSeek Search/Fetch 按次费**:当 DSH 的 Web 搜索或抓取使用 DeepSeek 自带 provider 时,按官方 ¥5 / 1,000 次成功请求计入合计,并在费用明细里单独列出搜索、抓取的计费次数。
|
|
38
|
+
- **历史价格与未定价路由**:设置页的“历史价格”区可以为已移出配置的模型补价、改价或删除,不必把模型加回列表;从模型列表删除模型不会删除它的价格,历史调用仍按保存的价格计算,查不到名称时显示原始模型 id。缺价时显示统一提示,可在设置里关闭这条提示。
|
|
37
39
|
- **DeepSeek 也计入金额**:每条 usage 按事件发生时的北京时间自动选择高峰或空闲价,与第三方模型一起进入统计。
|
|
38
40
|
|
|
39
41
|
### 估算口径
|
|
@@ -42,9 +44,10 @@
|
|
|
42
44
|
缓存命中输入 × 命中价
|
|
43
45
|
+(未缓存输入 + 缓存写入)× 未命中价
|
|
44
46
|
+ 输出 × 输出价
|
|
47
|
+
+ DeepSeek Search/Fetch 成功请求次数 × 单次价
|
|
45
48
|
```
|
|
46
49
|
|
|
47
|
-
价格单位是“元 / 百万 tokens
|
|
50
|
+
价格单位是“元 / 百万 tokens”;Search/Fetch 按次计费,单次价为 ¥0.005(¥5 / 1,000 次成功请求)。缓存写入按缓存未命中价计算,这是三档价格模型下的近似处理。金额来自会话日志中的 provider usage 与工具结果,实际账单以 provider 为准。
|
|
48
51
|
|
|
49
52
|
### DeepSeek 官方价
|
|
50
53
|
|
|
@@ -59,7 +62,7 @@
|
|
|
59
62
|
|
|
60
63
|
高峰时段为北京时间周一至周五 `9:00–12:00`、`14:00–18:00`(中国法定节假日除外);其余时间、周末和法定节假日全天为空闲时段。空闲价是高峰价的一半。
|
|
61
64
|
|
|
62
|
-
DeepSeek
|
|
65
|
+
DeepSeek 价格默认只读展示;如需按其他渠道或折扣价计费,可在设置页点“自定义价格”填入完整三档价格,保存后以自定义价为准并标为“自定义”;三项清空后保存即可恢复官方价。官网调价或节假日安排变化后,需要更新 `host.js` 中的 `DEEPSEEK_PRICES` 和 `DEEPSEEK_HOLIDAYS`;目前内置的是 2026 年节假日。
|
|
63
66
|
|
|
64
67
|
### 其他模型价格
|
|
65
68
|
|
|
@@ -69,7 +72,7 @@ DeepSeek 价格只读,不写入本地价格配置。官网调价或节假日
|
|
|
69
72
|
|
|
70
73
|
### 安装
|
|
71
74
|
|
|
72
|
-
需要 DSH `^0.2.
|
|
75
|
+
需要 DSH `^0.2.1-rc.3`。
|
|
73
76
|
|
|
74
77
|
**npm**
|
|
75
78
|
|
|
@@ -122,21 +125,26 @@ npm 包和 GitHub Release 使用相同版本号,两个渠道分别发布:
|
|
|
122
125
|
|
|
123
126
|
### 已知限制
|
|
124
127
|
|
|
125
|
-
-
|
|
128
|
+
- DeepSeek 官方峰谷价只对 `deepseek` 开头的官方 provider(如 `deepseek-account`)且模型名在官方价表内时生效;`openrouter`、`my-deepseek-relay` 这类第三方即使模型名含 `deepseek` 也按普通规则计费,可自行填价。
|
|
129
|
+
- 显示设置(轮尾开关、字号、间距、是否接管选择器等)只保存在 Host 的 `model-billing.json` 里,不再镜像到浏览器 localStorage,因此换设备或换浏览器不会不同步;旧版本写入的 localStorage 键会被自动清除。
|
|
130
|
+
- 除本机回环地址(`127.0.0.1` / `localhost` / `[::1]`)外,Host 头与该连接实际监听的地址(`socket.localAddress` + `localPort`)一致时也会放行,因此 `--host 0.0.0.0` 后用局域网 IP 访问可用;反向代理若改写了 Host,需要让它保留原 Host 或与实际监听地址一致,否则四个路由返回 403,此时模型选择器回退为 DSH 内置版本(费用与排序功能不可用),不会影响正常聊天。
|
|
131
|
+
- 模型选择器由本插件接管,依赖 `ctx.modelDirectories`。该服务不可用或 catalog 尚未加载完成时,插件不会强行覆盖内置选择器,价格和费用统计不受影响。
|
|
126
132
|
- `/model` 命令仍由 DSH 自带实现,顺序不保证与右下角选择器一致。
|
|
127
133
|
- 一轮里的多次模型尝试(重试、失败等)会分别计入;失败调用如果 provider 没有返回 usage,则无法计入。
|
|
128
134
|
- 只统计当前载入 Host 的会话;未打开的历史会话在进入后按需计算。
|
|
129
|
-
-
|
|
135
|
+
- provider 返回的 `totalTokens` 与三档明细不一致时,保留三档明细并把该轮标为“部分未定价/不完整”,不再整条丢弃,避免大幅少报。
|
|
136
|
+
- 当 DSH 的 Web 搜索或抓取使用 DeepSeek 自带的 `deepseek-official` / `deepseek-search-api` / `deepseek-fetch-api` 时,按 DeepSeek 官方价把 **Search/Fetch 按次费**(¥5 / 1,000 次成功请求,2026-11-01 00:00 北京时间起)计入合计;DuckDuckGo、Tavily、普通 HTTP 抓取等不收费的 provider 不会被计费。一次 `web_search` 含多个 query 时按一次成功工具调用计,可能低估其中多个 query 各自的按次费。
|
|
137
|
+
- 第三方价格是静态配置,不会自动跟随官网调价;内置节假日表目前只覆盖 2026 年,2027 年起需更新 `DEEPSEEK_HOLIDAYS`。
|
|
130
138
|
|
|
131
139
|
### 开发
|
|
132
140
|
|
|
133
141
|
```sh
|
|
134
142
|
node --check host.js
|
|
135
143
|
node --check client.js
|
|
136
|
-
node --test test
|
|
144
|
+
node --test test/*.test.mjs
|
|
137
145
|
```
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
插件没有运行时 npm 依赖。
|
|
140
148
|
|
|
141
149
|
### License
|
|
142
150
|
|
|
@@ -152,10 +160,12 @@ node --test test/host.test.mjs test/routes.test.mjs
|
|
|
152
160
|
|
|
153
161
|
- **Custom model order** in Settings → Models & Cost; the composer picker follows that order across providers and groups models by provider.
|
|
154
162
|
- **Three prices per model**: cache-hit input, cache-miss input, and output, in CNY per million tokens. `0` is a valid price; blank means unset.
|
|
155
|
-
- **Built-in official DeepSeek pricing** for `deepseek-flash` and `deepseek-v4-pro`, selected per usage event between peak and off-peak Beijing time.
|
|
163
|
+
- **Built-in official DeepSeek pricing** for `deepseek-flash` and `deepseek-v4-pro`, selected per usage event between peak and off-peak Beijing time. A complete set of custom prices overrides the table and is labelled "Custom".
|
|
156
164
|
- **Per-turn model and amount** at the end of each turn, together with the turn's cache-hit rate.
|
|
157
|
-
- **Configurable turn tail**:
|
|
165
|
+
- **Configurable turn tail**: a master switch for the turn tail, plus individual toggles for models, provider names, cost, tokens, cache-hit rate, and text labels; adjust font size, spacing, and weight; or disable the picker takeover to restore the built-in DSH picker. The composer cost estimate has its own switch.
|
|
158
166
|
- **Session summary** below the composer plus a detail panel grouped by turn and by model.
|
|
167
|
+
- **DeepSeek Search/Fetch per-request fees**: when DSH web search or fetch runs on DeepSeek's own providers, the official fee of ¥5 per 1,000 successful requests is included, with search and fetch billed counts shown separately in the detail panel.
|
|
168
|
+
- **Historical prices and unpriced routes**: the "Historical prices" section in Settings lets you add, edit, or remove prices for models no longer in your order without re-adding them. Removing a model from the list keeps its price, so historical calls still bill correctly; when the name is unknown, the raw model id is shown. Unpriced calls share one notice that can be switched off.
|
|
159
169
|
- **DeepSeek is billed too**, using the same three-price formula and the event's timestamp.
|
|
160
170
|
|
|
161
171
|
### Cost formula
|
|
@@ -164,15 +174,16 @@ node --test test/host.test.mjs test/routes.test.mjs
|
|
|
164
174
|
cache-hit input × hit price
|
|
165
175
|
+ (uncached input + cache write) × miss price
|
|
166
176
|
+ output × output price
|
|
177
|
+
+ DeepSeek Search/Fetch successful requests × per-request price
|
|
167
178
|
```
|
|
168
179
|
|
|
169
|
-
Prices are CNY per million tokens. Cache writes are approximated at the cache-miss price. Figures come from provider usage in the session log; the provider's invoice is authoritative.
|
|
180
|
+
Prices are CNY per million tokens; Search/Fetch is billed per request at ¥0.005 (¥5 per 1,000 successful requests). Cache writes are approximated at the cache-miss price. Figures come from provider usage and tool results in the session log; the provider's invoice is authoritative.
|
|
170
181
|
|
|
171
|
-
The plugin ships **no third-party price defaults**. Enter your provider's actual rates in Settings → Models & Cost. Models without a complete three-price set are marked as unpriced and contribute no amount. DeepSeek prices
|
|
182
|
+
The plugin ships **no third-party price defaults**. Enter your provider's actual rates in Settings → Models & Cost. Models without a complete three-price set are marked as unpriced and contribute no amount. DeepSeek prices come from the built-in official table; enter a complete custom set to override it, or clear all three fields to restore the official rates.
|
|
172
183
|
|
|
173
184
|
### Install
|
|
174
185
|
|
|
175
|
-
Requires DSH `^0.2.
|
|
186
|
+
Requires DSH `^0.2.1-rc.3`.
|
|
176
187
|
|
|
177
188
|
**npm**
|
|
178
189
|
|
|
@@ -216,11 +227,26 @@ Order and prices live in `~/.dsh/model-billing.json` (or `$DSH_HOME/model-billin
|
|
|
216
227
|
|
|
217
228
|
### Limitations
|
|
218
229
|
|
|
219
|
-
-
|
|
230
|
+
- Official DeepSeek peak/off-peak rates apply only to providers whose id starts with `deepseek` (such as `deepseek-account`) and to models present in the official table. A third-party route such as `openrouter` or `my-deepseek-relay` is billed by the normal rules even when the model name contains `deepseek`, and you can price it yourself.
|
|
231
|
+
- Display settings (turn-tail switches, font size, spacing, picker takeover) are stored only in the Host's `model-billing.json`; they are no longer mirrored into browser localStorage, so they do not sync across devices or browsers. Any key written by older builds is cleared automatically.
|
|
232
|
+
- Besides loopback (`127.0.0.1`, `localhost`, `[::1]`), a request is accepted when its Host header matches the address this socket actually listens on (`socket.localAddress` + `localPort`), so a LAN IP works with `--host 0.0.0.0`. A reverse proxy that rewrites Host must preserve it or match the listening address, otherwise the four routes return 403 and the picker falls back to the DSH built-in one; chat itself keeps working.
|
|
233
|
+
- The custom picker depends on `ctx.modelDirectories`; when that service is unavailable or the catalog has not loaded yet, the plugin leaves the built-in picker alone.
|
|
220
234
|
- The `/model` command is still implemented by DSH and may not follow the custom order.
|
|
221
235
|
- Multiple attempts within a turn are counted separately; failed calls without provider usage cannot be counted.
|
|
222
236
|
- Only sessions loaded by the current Host are counted.
|
|
223
|
-
-
|
|
237
|
+
- When a provider's `totalTokens` disagrees with its three buckets, the buckets are kept and the turn is marked partial instead of being dropped, which avoids large under-reporting.
|
|
238
|
+
- When DSH web search or fetch runs on DeepSeek's own `deepseek-official`, `deepseek-search-api`, or `deepseek-fetch-api` providers, the DeepSeek **Search/Fetch per-request fee** (¥5 per 1,000 successful requests, from 2026-11-01 00:00 Beijing time) is included. Free providers such as DuckDuckGo, Tavily, and plain HTTP fetch are never charged. A `web_search` call containing several queries is counted as one successful tool call, so the per-query part may be understated.
|
|
239
|
+
- Third-party prices are static and are not refreshed automatically. The bundled holiday table covers 2026 only; update `DEEPSEEK_HOLIDAYS` for 2027 onward.
|
|
240
|
+
|
|
241
|
+
### Development
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
node --check host.js
|
|
245
|
+
node --check client.js
|
|
246
|
+
node --test test/*.test.mjs
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The plugin has no runtime npm dependencies.
|
|
224
250
|
|
|
225
251
|
### License
|
|
226
252
|
|