dsh-bottom-info-bar 1.20.0 → 1.20.2

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/README.md CHANGED
@@ -11,189 +11,33 @@ A DeepSeek Harness plugin that replaces the stats row under the composer with on
11
11
 
12
12
  ## What it shows
13
13
 
14
- | Group | Fields |
15
- |---|---|
16
- | Provider | the exact provider and model, mirroring DSH's model switcher |
17
- | Native stats (kept) | turns and steps, model time, tool time, cache hit rate, input/output tokens, context usage |
18
- | Money | real balance, subscription quota windows, or this month's cloud bill |
19
- | Pricing | peak and off-peak prices, the current period, a countdown to the next price change |
20
- | Spend | this session (including subagents), today, last 30 days, all time |
21
- | Extras | main time, world time, custom text |
14
+ The bar follows the active session and picks one of three readings per provider (mutually exclusive, nothing to switch by hand): **balance** shows the real balance from the provider's own API, **subscription quota** shows each quota window's remaining allowance with its reset countdown, and **cloud billing** shows this month's real spend from the official billing API. On top of that come four spend tallies — this session, today, last 30 days, all time — plus extras such as time and custom text.
22
15
 
23
- The bar has two densities — click it to switch, and they differ in exactly one way: **Full** keeps DSH's native stats row above the main row, **Compact** collapses it. Both show every enabled plugin field and notice — a field's own switch is the only thing that decides whether it appears. Both follow DSH's light or dark theme.
24
-
25
- ## Compact mode
26
-
27
- Compact mode collapses the native stats row only; the main row keeps showing your enabled plugin fields. Four real states — light and dark, balance and subscription quota.
28
-
29
- **Light · balance**
30
-
31
- ![Balance mode, light theme](assets/bar-compact-light-balance.webp)
32
-
33
- **Dark · balance**
34
-
35
- ![Balance mode, dark theme](assets/bar-compact-dark-balance.webp)
36
-
37
- **Light · subscription quota**
38
-
39
- ![Subscription quota, light theme](assets/bar-compact-light-subscription.webp)
40
-
41
- **Dark · subscription quota**
42
-
43
- ![Subscription quota, dark theme](assets/bar-compact-dark-subscription.webp)
44
-
45
- ## Three billing modes
46
-
47
- The bar follows the active session and picks the mode from the provider. The three modes are mutually exclusive — there is no manual switch.
48
-
49
- ### Balance
50
-
51
- Shows the real balance from the provider's own API. It refetches when the bar opens, the page refreshes or the provider changes, then polls every 60 seconds; a failed refresh keeps the last known figure on screen. Below 20 (in the account's currency) the amount and a **Low** label turn red.
52
-
53
- ### Subscription quota
54
-
55
- Every available quota window (5-hour / weekly / monthly) and its countdown to the next reset are shown together — both always come from the same window, so they can never disagree. Windows show **remaining** percent by default and can be switched to **used** in settings; the low-quota warning always follows the remaining ≤ 20% rule. Turn off any window you do not want; Compact mode will not hide it for you.
56
-
57
- ### Cloud billing
58
-
59
- Shows this month's real spend from the provider's official billing API, for example `Together | This month $12.34` or `AWS Bedrock | This month $45.60 · Budget 46%`. Cloudflare also shows the daily free-quota remainder with a UTC-midnight reset countdown when the API actually reports a free allowance.
16
+ Click the bar to switch between **Full** and **Compact**. They differ in exactly one way: Full keeps DSH's native stats row, Compact collapses it. Whether a field appears is decided by that field's own switch alone, so the main row reads identically in both.
60
17
 
61
18
  ## Install
62
19
 
63
- Requires DeepSeek Harness with the web interface (`dsh web`) and pnpm.
64
-
65
- **From npm** (recommended — installs the released version):
66
-
67
20
  ```bash
68
21
  dsh plugin --profile web add dsh-bottom-info-bar
69
22
  ```
70
23
 
71
- **From the GitHub repository** — [github.com/songoao25/dsh-bottom-info-bar](https://github.com/songoao25/dsh-bottom-info-bar) (tracks the default branch; `lib/` is committed, so no build runs on install):
72
-
73
- ```bash
74
- dsh plugin --profile web add https://github.com/songoao25/dsh-bottom-info-bar
75
- ```
76
-
77
- **With the local one-click script** (clone, build and install in one step):
78
-
79
- ```bash
80
- git clone https://github.com/songoao25/dsh-bottom-info-bar.git
81
- cd dsh-bottom-info-bar
82
- ./install.sh
83
- ```
84
-
85
- If you installed from a checkout before the package moved to the repository root, your profile points at `<repo>/plugin`. That path still resolves — the repository keeps `plugin/` as symlinks to the package root — so nothing needs reinstalling. If it does not resolve (a ZIP download, for instance, delivers those symlinks as plain files), remove the plugin and install again with one of the commands above.
86
-
87
- Then **restart `dsh web`** — plugins are composed when the host starts, so a page refresh is not enough. The plugin shows up in the Plugins list, enabled:
88
-
89
- ![Plugins list with Bottom Info Bar installed](assets/plugins-list.webp)
90
-
91
- More detail and troubleshooting: [docs/INSTALL.md](docs/INSTALL.md).
24
+ Then **restart `dsh web`** — plugins are composed when the host starts, so a page refresh is not enough. Other install methods and troubleshooting: [docs/INSTALL.md](docs/INSTALL.md).
92
25
 
93
26
  ## Settings
94
27
 
95
- Everything lives on the plugin page — **Plugins → bottom-info-bar**. Changes save as you make them.
96
-
97
- ![Plugin settings overview](assets/settings-overview.webp)
98
-
99
- **Information display** — choose **Compact** or **Full** and the choice is saved. They differ in exactly one place: Full also keeps DSH's native stats row, Compact collapses it. No field choice is affected, so switching back and forth never loses your setup.
100
-
101
- **Fields and colors** — one switch and one color per field, in three groups. Turn a field off and the bar drops it — **identically in Compact and Full**. All three groups start collapsed; click a group to open it (typing in the search box opens all three).
102
-
103
- - **Native information** — the fields DSH's own stats row already showed. They live in the native row, which only Full mode keeps.
104
- - **Plugin information** — everything this bar adds: provider and model, subscriptions, spend, balance, pricing and quota, the adopted context ring included. Shown in both modes.
105
- - **Notices** — update and failure badges, plus the "could not refresh" style warnings. Shown in both modes; each one has its own switch, and a one-off notice simply appears whenever there is really something to say, regardless of density.
106
-
107
- The context ring sits at the right end of the main row, which exists in both modes — so it stays visible either way.
108
-
109
- ![Native information fields](assets/settings-native.webp)
110
- ![Plugin information fields](assets/settings-plugin.webp)
111
-
112
- **Subscription window percentage** — show quota windows as **remaining** (default) or **used**. The low-quota warning always follows remaining ≤ 20%.
113
-
114
- ![Subscription window percentage set to remaining](assets/settings-quota.webp)
115
- ![Subscription window percentage set to used](assets/settings-quota-used.webp)
116
-
117
- **Time and date** — main and world time zones, plus which of year / month / day / hour / minute / second to display.
118
-
119
- ![Time and date settings](assets/settings-time.webp)
120
-
121
- **Custom text** — up to 64 characters, shown in the bar.
122
-
123
- ![Custom text settings](assets/settings-custom.webp)
124
-
125
- **Billing data** — export the ledger as CSV or JSON, or clear it after confirmation. Settings and sign-in information stay untouched.
126
-
127
- ## Supported providers
128
-
129
- The bar detects the provider from DSH's current model — no configuration. Set the key in DSH under **Settings → Models**.
130
-
131
- ### Balance
132
-
133
- | Provider | Display name | Credential / source |
134
- |---|---|---|
135
- | deepseek / deepseek-official | DeepSeek | `DEEPSEEK_API_KEY` |
136
- | openai | OpenAI | `OPENAI_API_KEY` — estimated from your spending rate; there is no public balance API |
137
- | moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY` |
138
- | openrouter | OpenRouter | `OPENROUTER_API_KEY` |
139
- | stepfun | StepFun | `STEPFUN_API_KEY` |
140
- | xiaomi | Xiaomi MiMo | `XIAOMI_API_KEY` |
141
-
142
- ### Subscription quota
143
-
144
- | Provider | Display name | Credential / source |
145
- |---|---|---|
146
- | codex / chatgpt / openai-codex | ChatGPT / Codex | `~/.codex/auth.json` (read-only, decoded locally) |
147
- | opencode-go / opencode | OpenCode Go | `OPENCODE_GO_API_KEY` or the opencode CLI login |
148
- | zai / zai-coding-cn | Zhipu | `ZAI_CODING_CN_API_KEY` (fallback `ZAI_API_KEY`) |
149
- | xiaomi-token-plan-cn / -sgp / -ams | Xiaomi MiMo | `XIAOMI_TOKEN_PLAN_CN/SGP/AMS_API_KEY` (fallback `XIAOMI_API_KEY`) |
150
- | command / command-code | Command Code | `COMMAND_CODE_API_KEY` or `CMD_API_KEY`, or `~/.commandcode/auth.json` |
151
- | minimax / minimax-cn | MiniMax | `MINIMAX_API_KEY` (Global) / `MINIMAX_CN_API_KEY` (CN) — must be a **Subscription Key** |
152
-
153
- ### Cloud billing
154
-
155
- | Provider | Display name | Credential / source |
156
- |---|---|---|
157
- | together | Together | `TOGETHER_API_KEY` — official Usage API, this month's spend |
158
- | fireworks | Fireworks | `FIREWORKS_API_KEY` — official Billing API, this period's spend |
159
- | amazon-bedrock | AWS Bedrock | `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` — Cost Explorer + Budgets |
160
- | cloudflare-ai-gateway / cloudflare-workers-ai | Cloudflare | `CLOUDFLARE_API_KEY` + `CLOUDFLARE_ACCOUNT_ID` (token needs Billing read) |
161
-
162
- Anything else shows a **Not supported** hint instead of borrowing another provider's numbers.
163
-
164
- ## Spend tracking
165
-
166
- Every model response is recorded (usage × unit price) and aggregated four ways: **this session** (including subagents), **today**, **last 30 days** and **all time**. The price is locked the moment a response completes, so later price-table updates never rewrite history. A model with no known price keeps its token counts but is excluded from money totals — no amount is ever invented. Records are written to disk before they count, so a restart loses nothing; if a write fails, the bar says **Spend not saved**.
167
-
168
- ## Updating
169
-
170
- The plugin checks npm shortly after each DSH start. Pick how it should act in **Version and updates** on the plugin settings page:
171
-
172
- - **Automatic** (default): download, verify and replace the plugin's own files, then all you do is restart DSH once.
173
- - **Manual**: it only checks and tells you; nothing is downloaded until you press **Check now**. That button only appears in manual mode.
174
-
175
- The check happens at startup only — a new version needs a restart to take effect anyway, and the restart itself triggers the next check. So the settings page shows **last checked**, and you never have to guess whether it is doing anything.
176
-
177
- Every file is verified before it lands, and a failure rolls the whole batch back, so a bad download never breaks the copy you are running. If the new version misbehaves, **Roll back to the previous version** appears in the same section along with the reason; once you are satisfied it stops taking up space. Only this plugin's own files are touched — never the dependency tree or the profile manifest.
28
+ Everything lives on the plugin page (**Plugins → bottom-info-bar**) and saves as you change it, in three groups, all collapsed by default: **native information** (DSH's own stats row, Full mode only), **plugin information** (everything this bar adds, both modes), and **notices** (one-off update and failure reminders, shown only when there is really something to say).
178
29
 
179
- When something needs you, the bar shows two short badges: **Restart to apply** (a new version is on disk) and **Update failed** (the last update did not go through). Each one has its own switch under **Notices** and takes no space otherwise. On failure the settings page explains it in plain words, and the raw error is kept in `~/.dsh/dsh-bottom-info-bar/update-log.jsonl` for troubleshooting.
30
+ ![Plugin information grouped by billing mode](assets/settings-plugin.webp)
180
31
 
181
- Updating itself only runs when the plugin is loaded from a profile (npm, GitHub address and the install script all qualify). A source checkout or a `link:` install is treated as read-only and left alone — update those by hand:
32
+ Plugin information is further grouped by billing mode — read only the block that matches your provider; each block's heading says which items carry data for it. Time zones, custom text, quota percentage direction and billing data are separate sections:
182
33
 
183
- | Installed via | Command |
184
- |---|---|
185
- | npm | `dsh plugin --profile <profile> add dsh-bottom-info-bar@latest` |
186
- | GitHub address | `dsh plugin --profile <profile> add <the same address>` |
187
- | local checkout or install script | `git -C <repo> fetch origin && git -C <repo> checkout main && git -C <repo> merge --ff-only origin/main && node <repo>/scripts/build.mjs` |
34
+ ![Time and date: time zones only](assets/settings-time.webp)
188
35
 
189
- The first upgrade to v1.19.0 still needs the table above, because the updater itself only arrives with that version. Later releases need nothing from you.
36
+ API keys go in DSH under **Settings → Models**; subscriptions (Codex, OpenCode, Xiaomi Token Plan, Command Code, MiniMax) read the local sign-in, and MiniMax requires a Subscription Key. Anything off the list gets a not-supported hint instead of borrowed numbers.
190
37
 
191
- ## Privacy and security
38
+ ## Spend and updates
192
39
 
193
- - **Read-only credentials.** API keys stay in DSH; `~/.codex/auth.json` and `~/.commandcode/auth.json` are read locally and never written back. This plugin does not bind or refresh accounts.
194
- - **No conversation content.** The ledger stores tokens, model, provider, currency and cost — never prompts, messages or keys.
195
- - **Local only.** Data lives in `~/.dsh/dsh-bottom-info-bar/` (directory `0700`, files `0600`). Nothing leaves your machine except the provider API requests the bar itself makes.
196
- - **Uninstalling keeps your data.** Export or clear it from the plugin page (Billing data) if you want a clean slate.
40
+ Every model response records one entry (usage × unit price, locked the moment the response completes) and survives restarts. The plugin checks npm once per DSH start: **automatic updates** (default) download in the background and take effect after you restart, **manual updates** only notify; a bad release can be rolled back from settings. The ledger stores tokens and amounts, never conversation content; data stays in `~/.dsh/dsh-bottom-info-bar/` and survives uninstall — export or clear it from Billing data if you want a clean slate.
197
41
 
198
42
  ## Development
199
43
 
package/README.zh-CN.md CHANGED
@@ -11,189 +11,33 @@ DeepSeek Harness 插件:把输入框下方那行统计栏换成一行信息栏
11
11
 
12
12
  ## 它显示什么
13
13
 
14
- | 分组 | 内容 |
15
- |---|---|
16
- | 服务商 | 当前会话的服务商与具体模型,跟随 DSH 模型切换器 |
17
- | 原生统计(保留) | 轮次与步数、模型耗时、工具耗时、缓存命中率、输入/输出 token、上下文占用 |
18
- | 金额 | 真实余额、订阅额度窗口,或本月云账单 |
19
- | 定价 | 高峰价与空闲价、当前时段、下次价格切换倒计时 |
20
- | 花费 | 本会话(含子代理)、今天、近 30 天、累计 |
21
- | 其它 | 主时间、世界时间、自定义文字 |
14
+ 信息栏跟随当前会话,按服务商自动选择三种口径之一(互斥,不用手动切):**余额制**显示官方接口的真实余额,**订阅制**显示各额度窗口剩余额度与重置倒计时,**云账单制**显示官方账单接口的本月真实花费。之外还有本会话/今天/近 30 天/累计四档花费,以及时间、自定义文字等通用项。
22
15
 
23
- 信息栏有两种显示方式,点击即可切换,区别只有一处:**完整**在主行之上保留 DSH 原生统计行,**简洁**把它收起。两种方式都显示已启用的全部插件信息与提醒——看哪个字段,只由该字段自己的开关决定。两种方式都跟随 DSH 的深色/浅色主题。
24
-
25
- ## 简洁模式
26
-
27
- 简洁模式只收起原生统计行,主行照常显示已启用的插件信息。四种真实状态:浅色与深色、余额制与订阅额度制。
28
-
29
- **浅色 · 余额制**
30
-
31
- ![余额制·浅色](assets/bar-compact-light-balance.zh-CN.webp)
32
-
33
- **深色 · 余额制**
34
-
35
- ![余额制·深色](assets/bar-compact-dark-balance.zh-CN.webp)
36
-
37
- **浅色 · 订阅额度制**
38
-
39
- ![订阅额度制·浅色](assets/bar-compact-light-subscription.zh-CN.webp)
40
-
41
- **深色 · 订阅额度制**
42
-
43
- ![订阅额度制·深色](assets/bar-compact-dark-subscription.zh-CN.webp)
44
-
45
- ## 三种计费模式
46
-
47
- 信息栏跟随当前会话,按服务商自动选择模式。三种模式互斥,无需手动切换。
48
-
49
- ### 余额制
50
-
51
- 显示服务商官方接口返回的真实余额。信息栏打开、页面刷新或切换服务商时立即重查,之后每 60 秒轮询一次;刷新失败时保留上一次的数值。余额低于 20(按账户币种)时,金额与**低**标记转红。
52
-
53
- ### 订阅额度制
54
-
55
- 完整模式显示各窗口剩余额度(5 小时 / 周 / 月)与距下次重置的倒计时——两者始终取自同一个窗口,不会互相矛盾。窗口默认按**剩余**显示百分比,可在设置里切换为**已用**;低额度告警始终按剩余 ≤ 20% 判定。不想要的窗口在设置里单独关掉即可,简洁模式不会替你隐藏它们。
56
-
57
- ### 云账单制
58
-
59
- 显示官方账单接口返回的本月真实花费,例如 `Together | 本月 $12.34`、`AWS Bedrock | 本月 $45.60 · 预算 46%`。Cloudflare 还会在接口确实返回免费额度时,显示每日免费额度剩余与 UTC 零点重置倒计时。
16
+ 点一下信息栏可以在**完整**与**简洁**之间切换,区别只有一处:完整保留 DSH 原生统计行,简洁把它收起。看哪个字段,只由该字段自己的开关决定,两种模式显示的主行逐字相同。
60
17
 
61
18
  ## 安装
62
19
 
63
- 需要带 Web 界面的 DeepSeek Harness(`dsh web`)与 pnpm。
64
-
65
- **npm 安装**(推荐,装的是已发布版本):
66
-
67
20
  ```bash
68
21
  dsh plugin --profile web add dsh-bottom-info-bar
69
22
  ```
70
23
 
71
- **从 GitHub 仓库安装** —— [github.com/songoao25/dsh-bottom-info-bar](https://github.com/songoao25/dsh-bottom-info-bar)(跟随默认分支;`lib/` 已入库,安装时不跑构建):
72
-
73
- ```bash
74
- dsh plugin --profile web add https://github.com/songoao25/dsh-bottom-info-bar
75
- ```
76
-
77
- **本地一键脚本**(clone、构建、安装一步完成):
78
-
79
- ```bash
80
- git clone https://github.com/songoao25/dsh-bottom-info-bar.git
81
- cd dsh-bottom-info-bar
82
- ./install.sh
83
- ```
84
-
85
- 如果你在「包移到仓库根」之前用本地代码装过,profile 里的路径末尾是 `/plugin`。这条路径依然有效——仓库里保留了 `plugin/` 软链指向仓库根,所以不必重装。万一它不生效(例如用 ZIP 下载仓库时,软链会变成普通文件),先卸载,再用上面的任一方式装一次。
86
-
87
- 然后**重启 `dsh web`** —— 插件在宿主启动时组合,刷新页面不够。重启后插件出现在插件列表并处于启用状态:
88
-
89
- ![插件列表:底部信息栏已安装](assets/plugins-list.zh-CN.webp)
90
-
91
- 详细步骤与故障排查见 [docs/INSTALL.md](docs/INSTALL.md)。
24
+ 然后**重启 `dsh web`**(插件在宿主启动时组合,只刷新页面不够)。其他装法与排障见 [docs/INSTALL.md](docs/INSTALL.md)。
92
25
 
93
26
  ## 设置
94
27
 
95
- 配置都在插件页(**插件 → bottom-info-bar**),改完自动保存。
96
-
97
- ![插件设置页总览](assets/settings-overview.zh-CN.webp)
98
-
99
- **信息显示方式** —— 选择**简洁**或**完整**,选择会自动保存。两者只差一处:完整模式额外保留 DSH 原生统计行,简洁模式把它收起。字段开关不受影响,切来切去不会丢配置。
100
-
101
- **字段与配色** —— 每个字段一个开关、一个颜色,分三组。关掉哪个字段,信息栏就不再显示它——**简洁与完整完全一致**。三组默认都收起,想看哪组点哪组(在搜索框里打字会把三组一起展开)。
102
-
103
- - **原生信息** —— DSH 原生统计栏本来就有的字段,归在原生行里;只有完整模式才看得到这一行。
104
- - **插件信息** —— 信息栏新增的全部内容:服务商与模型、订阅、花费、余额、定价与额度,以及接管过来的上下文圆环。简洁与完整都显示。
105
- - **提醒信息** —— 更新与失败短标记,以及「刷新失败」这类一次性提醒。两种模式都显示,每条单独开关;只要当下真的有事要提醒就出现,与模式无关。
106
-
107
- 上下文圆环固定在主行最右端,而主行在两种模式下都在,所以它始终可见。
108
-
109
- ![原生信息字段](assets/settings-native.zh-CN.webp)
110
- ![插件信息字段](assets/settings-plugin.zh-CN.webp)
111
-
112
- **订阅窗口百分比方向** —— 按**剩余**(默认)或**已用**显示额度窗口。低额度告警始终按剩余 ≤ 20% 判定。
113
-
114
- ![订阅窗口百分比方向:剩余](assets/settings-quota.zh-CN.webp)
115
- ![订阅窗口百分比方向:已用](assets/settings-quota-used.zh-CN.webp)
116
-
117
- **时间与日期** —— 主时间与世界时间的时区,以及年 / 月 / 日 / 时 / 分 / 秒的显示格式。
118
-
119
- ![时间与日期设置](assets/settings-time.zh-CN.webp)
120
-
121
- **自定义文字** —— 最多 64 个字符,显示在信息栏中。
122
-
123
- ![自定义文字设置](assets/settings-custom.zh-CN.webp)
124
-
125
- **账单数据** —— 导出 CSV / JSON,或确认后清除记录。设置与登录信息不受影响。
126
-
127
- ## 支持的服务商
128
-
129
- 信息栏从 DSH 当前模型识别服务商,零配置;密钥在 DSH 的**设置 → 模型**里填写。
130
-
131
- ### 余额制
132
-
133
- | 服务商 | 显示名 | 凭据 / 数据来源 |
134
- |---|---|---|
135
- | deepseek / deepseek-official | DeepSeek | `DEEPSEEK_API_KEY` |
136
- | openai | OpenAI | `OPENAI_API_KEY` —— 按消耗速度估算;官方没有公开余额接口 |
137
- | moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY` |
138
- | openrouter | OpenRouter | `OPENROUTER_API_KEY` |
139
- | stepfun | StepFun | `STEPFUN_API_KEY` |
140
- | xiaomi | 小米 MiMo | `XIAOMI_API_KEY` |
141
-
142
- ### 订阅额度制
143
-
144
- | 服务商 | 显示名 | 凭据 / 数据来源 |
145
- |---|---|---|
146
- | codex / chatgpt / openai-codex | ChatGPT / Codex | `~/.codex/auth.json`(只读,本机解析) |
147
- | opencode-go / opencode | OpenCode Go | `OPENCODE_GO_API_KEY` 或 opencode CLI 登录 |
148
- | zai / zai-coding-cn | 智谱 | `ZAI_CODING_CN_API_KEY`(回退 `ZAI_API_KEY`) |
149
- | xiaomi-token-plan-cn / -sgp / -ams | 小米 MiMo | `XIAOMI_TOKEN_PLAN_CN/SGP/AMS_API_KEY`(回退 `XIAOMI_API_KEY`) |
150
- | command / command-code | Command Code | `COMMAND_CODE_API_KEY` 或 `CMD_API_KEY`,或 `~/.commandcode/auth.json` |
151
- | minimax / minimax-cn | MiniMax | `MINIMAX_API_KEY`(Global)/ `MINIMAX_CN_API_KEY`(国内)—— 必须是 **Subscription Key** |
152
-
153
- ### 云账单制
154
-
155
- | 服务商 | 显示名 | 凭据 / 数据来源 |
156
- |---|---|---|
157
- | together | Together | `TOGETHER_API_KEY` —— 官方 Usage API,本月花费 |
158
- | fireworks | Fireworks | `FIREWORKS_API_KEY` —— 官方 Billing API,本周期花费 |
159
- | amazon-bedrock | AWS Bedrock | `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` —— Cost Explorer + Budgets |
160
- | cloudflare-ai-gateway / cloudflare-workers-ai | Cloudflare | `CLOUDFLARE_API_KEY` + `CLOUDFLARE_ACCOUNT_ID`(令牌需 Billing 读权限) |
161
-
162
- 不在列表中的服务商显示**未适配**提示,绝不借用别的服务商的数据。
163
-
164
- ## 花费记账
165
-
166
- 每次模型响应都会记录一条(用量 × 单价),并按四个口径聚合:**本会话**(含子代理)、**今天**、**近 30 天**、**累计**。单价在响应完成的那一刻锁定,之后的价目表更新不会改写历史金额。价目表里没有的模型保留 token 用量但不计入金额,绝不编造金额。记录先落盘再计入,重启不丢;写入失败时信息栏显示**账单未保存**。
167
-
168
- ## 更新
169
-
170
- 插件在每次 DSH 启动后不久检查一次 npm 上有没有新版本。更新方式在插件设置页的**版本与更新**里二选一:
171
-
172
- - **全自动更新**(默认):发现新版本就自动下载、校验、替换好,你只需要重启一次 DSH 就生效。
173
- - **手动更新**:只提示、不下载,你点「检查更新」时才执行。这个按钮只在选手动时出现。
174
-
175
- 检查只发生在启动那一次(装好也本来就要重启才生效,而重启本身就会触发下一次检查),所以设置页里会写明**上次检查**是什么时候,你不用猜它有没有在干活。
176
-
177
- 替换前先校验文件完整性,任何一步没过就整批回滚,不会把正在用的版本弄坏。万一新版有问题,设置页会出现「回滚到上一版」并说明原因;确认没问题之后它就不占位了。整个过程只改插件自己的文件,不碰依赖树,也不改 profile 的清单。
28
+ 都在插件页(**插件 → bottom-info-bar**),改完自动保存,一共三组,每组默认收起:**原生信息**(DSH 原生统计行,只在完整模式出现)、**插件信息**(本插件新增的全部内容,两种模式都显示)、**提醒信息**(更新与失败这类一次性提醒,真有事才出现)。
178
29
 
179
- 需要你动手时,信息栏会出现两枚短标记:**重启生效**(新版已装好,等重启)和**更新失败**(上次更新没成功)。两枚标记各自可以在「提醒信息」里关掉,平时不占位。更新失败时设置页会用一句人话讲清原因,原始报错留在 `~/.dsh/dsh-bottom-info-bar/update-log.jsonl` 里备查。
30
+ ![插件信息:按计费方式分块](assets/settings-plugin.zh-CN.webp)
180
31
 
181
- 自更新只在插件被正常装进 profile 时启用(npm、GitHub 地址、一键脚本三种安装方式都算)。如果你用的是本仓库的源码副本或 `link:` 安装,插件会把它当成只读副本、不去改动,这时按下面的方式手动更新:
32
+ 「插件信息」里再按计费方式分块——你用哪种服务,就只看哪一块,哪几项有数据的说明写在块标题旁。时区、自定义文字、订阅窗口方向、账单数据是独立设置区:
182
33
 
183
- | 安装方式 | 命令 |
184
- |---|---|
185
- | npm | `dsh plugin --profile <profile> add dsh-bottom-info-bar@latest` |
186
- | GitHub 地址 | `dsh plugin --profile <profile> add <同一个地址>` |
187
- | 本地代码或一键脚本 | `git -C <仓库> fetch origin && git -C <仓库> checkout main && git -C <仓库> merge --ff-only origin/main && node <仓库>/scripts/build.mjs` |
34
+ ![时间与日期:只设时区](assets/settings-time.zh-CN.webp)
188
35
 
189
- 首次升级到 v1.19.0(或更早版本升上来)时,自更新这套流程还没装在你机器上,所以那一次仍要按上表手动更新;之后的版本就不用再管了。
36
+ 密钥填在 DSH 的**设置 → 模型**;订阅类(Codex、OpenCode、小米 Token Plan、Command Code、MiniMax)读本机登录,MiniMax 必须用 Subscription Key。列表里没有的服务商只会显示未适配提示,绝不借用别家的数据。
190
37
 
191
- ## 隐私与安全
38
+ ## 花费与更新
192
39
 
193
- - **只读凭据。** API Key 始终留在 DSH 里;`~/.codex/auth.json` 与 `~/.commandcode/auth.json` 只在本机读取,绝不写回。本插件不负责绑定或续期账号。
194
- - **不保存对话内容。** 账本只记录 token、模型、服务商、币种与花费——没有提示词、消息或密钥。
195
- - **只存本地。** 数据在 `~/.dsh/dsh-bottom-info-bar/`(目录 `0700`、文件 `0600`)。除了信息栏自身发起的服务商接口请求,没有任何数据离开本机。
196
- - **卸载不删数据。** 想彻底清零,在插件页的「账单数据」里导出或清除。
40
+ 每次模型响应记一条(用量 × 单价,单价在响应完成时锁定),重启不丢。插件每次随 DSH 启动检查一次新版本:**全自动更新**(默认)下载好等你重启生效,**手动更新**只提示不下载;新版有问题可以在设置页回滚到上一版。账本只记 token 与金额,不记对话内容;数据只存本机 `~/.dsh/dsh-bottom-info-bar/`,卸载不删——要清零去设置页的账单数据里导出或清除。
197
41
 
198
42
  ## 开发
199
43
 
package/docs/INSTALL.md CHANGED
@@ -77,7 +77,7 @@ dsh --profile web --dump-config | grep -A2 dsh-bottom-info-bar
77
77
 
78
78
  信息栏会自动检测当前模型所属模式:**订阅制**(Codex / OpenCode Go)显示三窗口额度,**余额制**(DeepSeek 等)显示余额。订阅额度数据源:
79
79
 
80
- - **Codex / ChatGPT**:信息栏**只读** `~/.codex/auth.json` 中的登录令牌,解析真实套餐与到期信息;token 仅在本机内存中使用,不落盘、不记录、不续期、不写回。令牌的**绑定 / 续期**由独立插件 [**dsh-chatgpt-subscription**](https://github.com/songoao25)(独立仓库)负责——安装并绑定后,本信息栏即可显示订阅信息;令牌缺失时信息栏显示「未绑定」引导,相关字段缺失时只保留服务商和模型。
80
+ - **Codex / ChatGPT**:信息栏**只读** `~/.codex/auth.json` 中的登录令牌,解析真实套餐与到期信息;token 仅在本机内存中使用,不落盘、不记录、不续期、不写回。令牌的**绑定 / 续期**由独立插件 [**dsh-chatgpt-sub**](https://github.com/songoao25)(独立仓库)负责——安装并绑定后,本信息栏即可显示订阅信息;令牌缺失时信息栏显示「未绑定」引导,相关字段缺失时只保留服务商和模型。
81
81
  - **OpenCode Go**:在 **设置 → 模型** 配置 `OPENCODE_GO_API_KEY`(或先用 opencode CLI 登录其订阅,写入 `~/.local/share/opencode/auth.json` 的 `opencode-go` 条目)。未配置时信息栏显示"未配置 OpenCode Go"引导,不报错。
82
82
 
83
83
  ## 更新版本