dsh-bottom-info-bar 1.16.2 → 1.16.3
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 +14 -13
- package/README.zh-CN.md +14 -13
- package/docs/INSTALL.md +1 -1
- package/lib/client.js +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,9 +20,16 @@ A DeepSeek Harness plugin that replaces the stats row under the composer with on
|
|
|
20
20
|
| Spend | this session (including subagents), today, last 30 days, all time |
|
|
21
21
|
| Extras | main time, world time, custom text |
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The bar has two densities — click it to switch. **Full** keeps DSH's native stats row above the plugin row; **compact** folds everything into one line. Both follow DSH's light or dark theme, and the context ring always stays on the same line as the text before it.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Compact mode
|
|
26
|
+
|
|
27
|
+
Four real states — light and dark, balance and subscription quota:
|
|
28
|
+
|
|
29
|
+
| Light | Dark |
|
|
30
|
+
|---|---|
|
|
31
|
+
|  |  |
|
|
32
|
+
|  |  |
|
|
26
33
|
|
|
27
34
|
## Three billing modes
|
|
28
35
|
|
|
@@ -32,8 +39,6 @@ The bar follows the active session and picks the mode from the provider. The thr
|
|
|
32
39
|
|
|
33
40
|
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.
|
|
34
41
|
|
|
35
|
-

|
|
36
|
-
|
|
37
42
|
### Subscription quota
|
|
38
43
|
|
|
39
44
|
Shows the remaining quota per window (5-hour / weekly / monthly) and a countdown to the next reset — 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. Compact mode prefers the shortest available window (5-hour → weekly → monthly).
|
|
@@ -42,12 +47,6 @@ Shows the remaining quota per window (5-hour / weekly / monthly) and a countdown
|
|
|
42
47
|
|
|
43
48
|
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.
|
|
44
49
|
|
|
45
|
-
## Dark mode
|
|
46
|
-
|
|
47
|
-
Colors adapt to DSH's theme — there is no separate setting.
|
|
48
|
-
|
|
49
|
-

|
|
50
|
-
|
|
51
50
|
## Install
|
|
52
51
|
|
|
53
52
|
Requires DeepSeek Harness with the web interface (`dsh web`) and pnpm.
|
|
@@ -72,6 +71,8 @@ cd dsh-bottom-info-bar
|
|
|
72
71
|
./install.sh
|
|
73
72
|
```
|
|
74
73
|
|
|
74
|
+
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.
|
|
75
|
+
|
|
75
76
|
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:
|
|
76
77
|
|
|
77
78
|

|
|
@@ -103,7 +104,7 @@ Everything lives on the plugin page — **Plugins → bottom-info-bar**. Changes
|
|
|
103
104
|
|
|
104
105
|
**Custom text** — up to 64 characters, shown in the bar.
|
|
105
106
|
|
|
106
|
-

|
|
107
108
|
|
|
108
109
|
**Billing data** — export the ledger as CSV or JSON, or clear it after confirmation. Settings and sign-in information stay untouched.
|
|
109
110
|
|
|
@@ -117,7 +118,7 @@ The bar detects the provider from DSH's current model — no configuration. Set
|
|
|
117
118
|
|---|---|---|
|
|
118
119
|
| deepseek / deepseek-official | DeepSeek | `DEEPSEEK_API_KEY` |
|
|
119
120
|
| openai | OpenAI | `OPENAI_API_KEY` — estimated from your spending rate; there is no public balance API |
|
|
120
|
-
| moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY`
|
|
121
|
+
| moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY` |
|
|
121
122
|
| openrouter | OpenRouter | `OPENROUTER_API_KEY` |
|
|
122
123
|
| stepfun | StepFun | `STEPFUN_API_KEY` |
|
|
123
124
|
| xiaomi | Xiaomi MiMo | `XIAOMI_API_KEY` |
|
|
@@ -150,7 +151,7 @@ Every model response is recorded (usage × unit price) and aggregated four ways:
|
|
|
150
151
|
|
|
151
152
|
## Updating
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
The plugin checks npm for a newer version at startup and re-checks at most every 15 minutes. When one exists, a red **Update available** label appears in the bar: click it to copy the update command, run it in a terminal, then restart `dsh web`.
|
|
154
155
|
|
|
155
156
|
| Installed via | Command |
|
|
156
157
|
|---|---|
|
package/README.zh-CN.md
CHANGED
|
@@ -20,9 +20,16 @@ DeepSeek Harness 插件:把输入框下方那行统计栏换成一行信息栏
|
|
|
20
20
|
| 花费 | 本会话(含子代理)、今天、近 30 天、累计 |
|
|
21
21
|
| 其它 | 主时间、世界时间、自定义文字 |
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
信息栏有两种密度,点击即可切换:**完整**保留 DSH 原生统计行,插件信息另起一行;**简洁**把全部内容收成一行。两种密度都跟随 DSH 的深色/浅色主题,上下文圆环始终与前面的文字同一行,不会单独折行。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## 简洁模式
|
|
26
|
+
|
|
27
|
+
四种真实状态:浅色与深色、余额制与订阅额度制:
|
|
28
|
+
|
|
29
|
+
| 浅色 | 深色 |
|
|
30
|
+
|---|---|
|
|
31
|
+
|  |  |
|
|
32
|
+
|  |  |
|
|
26
33
|
|
|
27
34
|
## 三种计费模式
|
|
28
35
|
|
|
@@ -32,8 +39,6 @@ DeepSeek Harness 插件:把输入框下方那行统计栏换成一行信息栏
|
|
|
32
39
|
|
|
33
40
|
显示服务商官方接口返回的真实余额。信息栏打开、页面刷新或切换服务商时立即重查,之后每 60 秒轮询一次;刷新失败时保留上一次的数值。余额低于 20(按账户币种)时,金额与**低**标记转红。
|
|
34
41
|
|
|
35
|
-

|
|
36
|
-
|
|
37
42
|
### 订阅额度制
|
|
38
43
|
|
|
39
44
|
显示各窗口剩余额度(5 小时 / 周 / 月)与距下次重置的倒计时——两者始终取自同一个窗口,不会互相矛盾。窗口默认按**剩余**显示百分比,可在设置里切换为**已用**;低额度告警始终按剩余 ≤ 20% 判定。简洁模式优先显示时长最短的可用窗口(5 小时 → 周 → 月)。
|
|
@@ -42,12 +47,6 @@ DeepSeek Harness 插件:把输入框下方那行统计栏换成一行信息栏
|
|
|
42
47
|
|
|
43
48
|
显示官方账单接口返回的本月真实花费,例如 `Together | 本月 $12.34`、`AWS Bedrock | 本月 $45.60 · 预算 46%`。Cloudflare 还会在接口确实返回免费额度时,显示每日免费额度剩余与 UTC 零点重置倒计时。
|
|
44
49
|
|
|
45
|
-
## 深色模式
|
|
46
|
-
|
|
47
|
-
配色跟随 DSH 主题,无需单独设置。
|
|
48
|
-
|
|
49
|
-

|
|
50
|
-
|
|
51
50
|
## 安装
|
|
52
51
|
|
|
53
52
|
需要带 Web 界面的 DeepSeek Harness(`dsh web`)与 pnpm。
|
|
@@ -72,6 +71,8 @@ cd dsh-bottom-info-bar
|
|
|
72
71
|
./install.sh
|
|
73
72
|
```
|
|
74
73
|
|
|
74
|
+
如果你在「包移到仓库根」之前用本地代码装过,profile 里的路径末尾是 `/plugin`。这条路径依然有效——仓库里保留了 `plugin/` 软链指向仓库根,所以不必重装。万一它不生效(例如用 ZIP 下载仓库时,软链会变成普通文件),先卸载,再用上面的任一方式装一次。
|
|
75
|
+
|
|
75
76
|
然后**重启 `dsh web`** —— 插件在宿主启动时组合,刷新页面不够。重启后插件出现在插件列表并处于启用状态:
|
|
76
77
|
|
|
77
78
|

|
|
@@ -103,7 +104,7 @@ cd dsh-bottom-info-bar
|
|
|
103
104
|
|
|
104
105
|
**自定义文字** —— 最多 64 个字符,显示在信息栏中。
|
|
105
106
|
|
|
106
|
-

|
|
107
108
|
|
|
108
109
|
**账单数据** —— 导出 CSV / JSON,或确认后清除记录。设置与登录信息不受影响。
|
|
109
110
|
|
|
@@ -117,7 +118,7 @@ cd dsh-bottom-info-bar
|
|
|
117
118
|
|---|---|---|
|
|
118
119
|
| deepseek / deepseek-official | DeepSeek | `DEEPSEEK_API_KEY` |
|
|
119
120
|
| openai | OpenAI | `OPENAI_API_KEY` —— 按消耗速度估算;官方没有公开余额接口 |
|
|
120
|
-
| moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY
|
|
121
|
+
| moonshotai / moonshotai-cn / kimi-coding | Kimi | `MOONSHOT_API_KEY` |
|
|
121
122
|
| openrouter | OpenRouter | `OPENROUTER_API_KEY` |
|
|
122
123
|
| stepfun | StepFun | `STEPFUN_API_KEY` |
|
|
123
124
|
| xiaomi | 小米 MiMo | `XIAOMI_API_KEY` |
|
|
@@ -150,7 +151,7 @@ cd dsh-bottom-info-bar
|
|
|
150
151
|
|
|
151
152
|
## 更新
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
插件在 DSH 启动时检查一次 npm 上的新版本,之后最多每 15 分钟复查一次。有新版时,信息栏出现红色**新版本提醒**标签:点击即可复制更新命令,到终端执行后重启 `dsh web`。
|
|
154
155
|
|
|
155
156
|
| 安装方式 | 命令 |
|
|
156
157
|
|---|---|
|
package/docs/INSTALL.md
CHANGED
|
@@ -47,7 +47,7 @@ node scripts/build.mjs
|
|
|
47
47
|
dsh plugin --profile web add /path/to/dsh-bottom-info-bar
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
> 1.15.0 及更早的版本里,插件包放在仓库的 `plugin/`
|
|
50
|
+
> 1.15.0 及更早的版本里,插件包放在仓库的 `plugin/` 子目录,安装路径末尾写的是 `/plugin`。仓库里保留了 `plugin/` 软链指向仓库根,所以旧路径依然可用、不必重装;万一不生效(例如用 ZIP 下载仓库时软链会变成普通文件),先 `dsh plugin --profile web remove dsh-bottom-info-bar`,再用上面的命令装一次。
|
|
51
51
|
|
|
52
52
|
### 安装原理
|
|
53
53
|
|
package/lib/client.js
CHANGED
|
@@ -586,6 +586,18 @@ function assembleInfoBarRow(groups, trailingErrorGroups, createElement) {
|
|
|
586
586
|
return nodes;
|
|
587
587
|
}
|
|
588
588
|
|
|
589
|
+
// 上下文圆环的落位(2026-09-24 用户报「圆环被单独挤到下一行并居中」):
|
|
590
|
+
// 圆环原本作为主行的独立 flex 子项追加在末尾 —— 行满换行时它会独占一行,居中后非常难看。
|
|
591
|
+
// 改为与「最后一个内容节点」一起包进同一个 nowrap 尾巴(.bi-tail):要换行两者一起走,
|
|
592
|
+
// 圆环永远不会孤零零占一行;没有内容节点时(只显示圆环)保持原样。
|
|
593
|
+
function attachContextMeter(nodes, contextNode, createElement) {
|
|
594
|
+
if (!contextNode) return nodes.slice();
|
|
595
|
+
if (nodes.length === 0) return [contextNode];
|
|
596
|
+
const out = nodes.slice();
|
|
597
|
+
out[out.length - 1] = createElement('span', { key: 'tail', className: 'bi-tail' }, out[out.length - 1], contextNode);
|
|
598
|
+
return out;
|
|
599
|
+
}
|
|
600
|
+
|
|
589
601
|
// D6 用户拍板:全部字段隐藏 = 底栏彻底移除。此判定为纯函数供单测:
|
|
590
602
|
// 注册表内没有任何可见字段,或渲染结果(原生行/主行/错误组)全空 → 信息栏整体不渲染,
|
|
591
603
|
// 不留空行、占位高度或悬空分隔符;density 点击因无 DOM 而天然无副作用。
|
|
@@ -630,6 +642,8 @@ function installStyles() {
|
|
|
630
642
|
/* 整条信息栏始终作为一个居中的内容组;不会超过上方对话框的内容宽度。 */
|
|
631
643
|
.bi-root > .bi-row2 { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; width: 100%; }
|
|
632
644
|
.bi-native-row > span, .bi-row2 > span { white-space: nowrap; }
|
|
645
|
+
/* 圆环与最后一个内容节点同组:换行时一起走,绝不单独占一行(见 attachContextMeter) */
|
|
646
|
+
.bi-tail { display: inline-flex; align-items: center; flex: 0 0 auto; max-width: 100%; white-space: nowrap; }
|
|
633
647
|
/* 只有模型组可在窄宽度折行;服务商与模型详情仍成组,不会让圆点落在行尾。 */
|
|
634
648
|
.bi-row2 > .bi-model-group { white-space: normal; }
|
|
635
649
|
/* 组间 6px、模型内部圆点 4px:保留分组层级,同时避免 12px 信息栏被过大留白拉散。 */
|
|
@@ -681,7 +695,11 @@ function installStyles() {
|
|
|
681
695
|
.bi-ctx-track { fill: none; stroke: var(--dsw-alias-border-l3, rgba(128, 128, 128, 0.35)); stroke-width: 2px; }
|
|
682
696
|
.bi-ctx-fill { fill: none; stroke: currentColor; stroke-width: 2px; stroke-linecap: round; }
|
|
683
697
|
/* 构成明细面板:与原生 ContextMeter 面板同构(264px 宽 / 12px 内边距 / 12px 圆角 / 4px 构成条)。 */
|
|
684
|
-
|
|
698
|
+
/* 面板底色必须不透明(2026-09-24 用户报「面板透明、文字和底下的信息栏叠在一起看不清」):
|
|
699
|
+
宿主 --dsw-specific-menu 是带 alpha 的色(浅 #f8f9fa94 / 深 #30313680),且宿主菜单另有毛玻璃层,
|
|
700
|
+
本面板悬在信息栏文字之上,直接用它必然透字。改用不透明的层级底色(浅 #fff / 深 #353638,随主题走),
|
|
701
|
+
并保留宿主阴影;不引用任何可能带 alpha 的 token。 */
|
|
702
|
+
.bi-ctx-panel { z-index: 1100; box-sizing: border-box; width: min(264px, calc(100vw - 24px)); padding: 12px; border: 0.5px solid var(--dsw-alias-border-l4, rgba(128, 128, 128, 0.28)); border-radius: 12px; background: var(--dsw-alias-bg-layer-3, #fff); color: var(--dsw-alias-label-secondary, #5a6169); box-shadow: var(--dsw-elevation-prominent, 0 8px 24px rgba(0, 0, 0, 0.18)); font-size: 12px; line-height: 20px; cursor: default; position: fixed; }
|
|
685
703
|
.bi-ctx-panel-header { display: flex; align-items: center; gap: 6px; }
|
|
686
704
|
.bi-ctx-panel-headline { color: var(--dsw-alias-label-tertiary, #8a9099); }
|
|
687
705
|
.bi-ctx-panel-headline:empty { display: none; }
|
|
@@ -3490,7 +3508,7 @@ module.exports = {
|
|
|
3490
3508
|
context: contextInfo,
|
|
3491
3509
|
breakdown: breakdownProj,
|
|
3492
3510
|
});
|
|
3493
|
-
const row2 = React.createElement('div', { id: 'dsh-bottom-info-bar-primary', className: 'bi-row2' }, ...nodes, contextNode);
|
|
3511
|
+
const row2 = React.createElement('div', { id: 'dsh-bottom-info-bar-primary', className: 'bi-row2' }, ...attachContextMeter(nodes, contextNode, React.createElement));
|
|
3494
3512
|
|
|
3495
3513
|
let row1 = null;
|
|
3496
3514
|
if (statsProj) {
|