dsh-desktop-statusbar 3.0.1 → 3.0.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 北浮森屿
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 北浮森屿
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.en.md CHANGED
@@ -1,145 +1,145 @@
1
- <h1 align="center">dsh-desktop-statusbar</h1>
2
-
3
- <p align="center">
4
- <a href="https://github.com/raphael-y7/dsh-desktop-statusbar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/raphael-y7/dsh-desktop-statusbar?style=flat&logo=github&color=f5f5f5"></a>
5
- <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm downloads" src="https://img.shields.io/npm/dt/dsh-desktop-statusbar?style=flat&logo=npm&label=downloads&color=e74c3c"></a>
6
- <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?style=flat&color=9B59B6"></a>
7
- <a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.5-%234d6bfe?style=flat"></a>
8
- <a href="https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/"><img alt="dshmarket" src="https://img.shields.io/badge/dshmarket-listed-%23e6b800?style=flat"></a>
9
- <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300897B?style=flat"></a>
10
- <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-%23e67e22?style=flat"></a>
11
- <br>
12
- <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%230099cc?style=flat"></a>
13
- <img alt="language" src="https://img.shields.io/badge/javascript-100%25-%23ec407a?style=flat">
14
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%2327ae60?style=flat"></a>
15
- </p>
16
-
17
- <p align="center"><a href="README.md">中文</a> | English</p>
18
-
19
- Replaces the stats line under the message input in the DSH desktop app with a configurable status bar: fields, ordering, per-model prices and currency are all configurable, with live cost estimates using DeepSeek's official peak/off-peak rates.
20
-
21
- ![Status bar](docs/statusbar.en.png)
22
-
23
- ## Features
24
-
25
- - **9 optional fields plus the context ring**: context occupancy (the ring at the head of the bar), peak / off-peak check, turns & steps, cache hit rate, output speed, TTFT, run time, this turn cost, session cost, balance
26
- - **Click a field for details**:
27
-
28
- | Field | Content |
29
- | --- | --- |
30
- | Context ring (bar head) | System prompt / tool definitions / messages |
31
- | Peak / off-peak check | Usage heat map: day / week / month / year |
32
- | Turns & steps | Context compactions / skills injected / tool calls |
33
- | Combined hit | This turn / highest / lowest cache hit rate |
34
- | TPS | This turn / fastest / slowest speed |
35
- | TTFT | This turn / fastest / slowest first-token delay |
36
- | Run time | Wait time / model time / tool calls |
37
- | This turn cost | Token breakdown for this turn |
38
- | Session cost | Cumulative token breakdown for this session |
39
- | Balance | Top-up balance / granted balance / quota left |
40
-
41
- - **Session data drill-down**: context compactions mark the node they happened at, skills injected counts the skills injected in this session, and tool calls list every tool the session used with its call count; click the title to go back up
42
- - **Version check and update**: DSH checks for the latest version on startup, shows a hint next to the "Status bar" nav item when one is available, and offers a one-click update button in settings
43
- - **GitHub support**: your support is the biggest motivation for the developer to keep going! Click the button to open the GitHub project page and help with a star — thanks, everyone!
44
- - **Cost estimation**: priced with the official peak/off-peak rules; each call is computed from the moment it happened and the model it used
45
- - **Price book**: your own prices, an optional peak/off-peak split, and a CNY / USD currency switch
46
- - **Also**: one-click holiday calendar update, balance refreshed every minute, bilingual UI
47
-
48
- ## Install
49
-
50
- In the DSH desktop app, open **Plugins → Add plugin** and install by package name:
51
-
52
- ```
53
- dsh-desktop-statusbar
54
- ```
55
-
56
- Where the npm registry is not reachable, the same dialog offers the China mainland mirror as the install source. A GitHub repository URL is also accepted:
57
-
58
- ```
59
- https://github.com/raphael-y7/dsh-desktop-statusbar
60
- ```
61
-
62
- Command line:
63
-
64
- ```powershell
65
- dsh plugin --profile desktop add dsh-desktop-statusbar
66
- ```
67
-
68
- ### Install from npm
69
-
70
- Both ways above install from the npm registry; the package name is `dsh-desktop-statusbar`. To check the current version on npm:
71
-
72
- ```powershell
73
- npm view dsh-desktop-statusbar version
74
- ```
75
-
76
- ### When the built-in updater fails
77
-
78
- The one-click update button inside the plugin can fail on some desktop builds — it either does nothing or reports a failure. Do not keep clicking it. Use the official install entry instead and **append `@version` to the package name** to pin the exact version:
79
-
80
- ```powershell
81
- dsh plugin --profile desktop add dsh-desktop-statusbar@3.0.0
82
- ```
83
-
84
- The same string works in the plugin panel — type `dsh-desktop-statusbar@3.0.0` into the **Add plugin** field.
85
-
86
- Use whatever version you see (the version on the release page, or the output of the `npm view` command above). Pinning the version has a second benefit: **you get exactly the build you asked for**, with no chance of a stale cached package.
87
-
88
- Also listed on [dshmarket](https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/), [dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) and [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar).
89
-
90
- ## Usage
91
-
92
- Open **Settings → Status bar**:
93
-
94
- ![Settings page](docs/settings.en.png)
95
-
96
- - **Context occupancy**: the ring at the head of the bar — progress shows the share of context used, the gap marks the compaction threshold, and the colour shows the run state (grey idle / green running / red error / amber pending approval)
97
- - **Stats fields**: ticking controls visibility only, so unticking hides a field without moving it; drag the handle on the right to reorder; "Reset settings" restores the factory order
98
- - **Custom model prices**: enter a model name and "Add" to create an entry; "Edit" opens the editor and changes are written on save; tick "peak / off-peak pricing" to split by time of day, otherwise a flat all-day price applies
99
- - **Currency**: CNY or USD in the top-right corner of the editor. Switching replaces the two built-in models with that currency's official reference prices (edited entries are kept) and changes the symbol in the cost fields; the balance follows the currency reported by the API
100
- - **Holidays**: click "Update holidays" to fetch and write the next year's public-holiday calendar
101
- - **Balance**: refreshed once a minute
102
-
103
- ### Billing rules
104
-
105
- Peak hours are **09:00–12:00 and 14:00–18:00 Beijing time, Monday to Friday**, and off-peak rates are half the peak rates; Chinese public holidays and weekends are billed off-peak all day (matching the [official docs](https://api-docs.deepseek.com/quick_start/pricing), checked 2026-09).
106
-
107
- ![Custom model prices](docs/pricing.en.png)
108
-
109
- ## Known limitations
110
-
111
- - Fastest / slowest TTFT and speed come from a new host-side projection: **you must fully quit and restart DSH** before it starts collecting
112
- - A model with no price is not billed; adding the price back-fills its earlier calls
113
- - One-click update relies on `pnpm`: the desktop app uses the copy bundled with the host, while CLI / web usage needs `pnpm` on the system. If neither is found, the update says so explicitly **and logs every location it tried**; you can also point it at a specific command with the `DSH_DESKTOP_STATUSBAR_PNPM` environment variable
114
-
115
- ## Development
116
-
117
- Every test is a standalone script meant to be run with plain node — no test framework.
118
-
119
- ```powershell
120
- npm test # runs every verify*.js under tests/, then checks project vs installed plugin dir
121
- npm run sync # copies lib/ into the installed plugin dir
122
- ```
123
-
124
- Development scripts under `tools/` ship with the package (the `files` field includes them),
125
- so both a git clone and an npm install get them:
126
-
127
- | Script | Purpose |
128
- |---|---|
129
- | `tools/test.cjs` | full test run + consistency guard |
130
- | `tools/sync-to-plugin.cjs` | project `lib/` → installed plugin dir |
131
- | `tools/sync-from-plugin.cjs` | installed plugin dir → project `lib/` |
132
- | `tools/plugin-dir.cjs` | locates the plugin dir |
133
- | `tools/shot.cjs` | regenerates the README screenshots |
134
-
135
- They are only used while developing; the plugin never loads them at runtime.
136
- `npm test` needs the repository's `tests/` directory, so an npm-installed copy can only run
137
- `sync-*` and `shot`.
138
-
139
- The plugin directory is located automatically: environment variable `DSH_STATUS_BAR_PLUGIN_DIR` →
140
- known layouts under `~/.dsh` (`local-plugins/`, each `profiles/*/node_modules/`) → derived from the
141
- `tools/` location. No code changes needed when switching machine or user name.
142
-
143
- ## Licence
144
-
145
- [MIT](LICENSE): free to use, modify and redistribute; keep the copyright and licence notice.
1
+ <h1 align="center">dsh-desktop-statusbar</h1>
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/raphael-y7/dsh-desktop-statusbar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/raphael-y7/dsh-desktop-statusbar?style=flat&logo=github&color=f5f5f5"></a>
5
+ <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm downloads" src="https://img.shields.io/npm/dt/dsh-desktop-statusbar?style=flat&logo=npm&label=downloads&color=e74c3c"></a>
6
+ <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?style=flat&color=9B59B6"></a>
7
+ <a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.5-%234d6bfe?style=flat"></a>
8
+ <a href="https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/"><img alt="dshmarket" src="https://img.shields.io/badge/dshmarket-listed-%23e6b800?style=flat"></a>
9
+ <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300897B?style=flat"></a>
10
+ <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-%23e67e22?style=flat"></a>
11
+ <br>
12
+ <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%230099cc?style=flat"></a>
13
+ <img alt="language" src="https://img.shields.io/badge/javascript-100%25-%23ec407a?style=flat">
14
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%2327ae60?style=flat"></a>
15
+ </p>
16
+
17
+ <p align="center"><a href="README.md">中文</a> | English</p>
18
+
19
+ Replaces the stats line under the message input in the DSH desktop app with a configurable status bar: fields, ordering, per-model prices and currency are all configurable, with live cost estimates using DeepSeek's official peak/off-peak rates.
20
+
21
+ ![Status bar](docs/statusbar.en.png)
22
+
23
+ ## Features
24
+
25
+ - **9 optional fields plus the context ring**: context occupancy (the ring at the head of the bar), peak / off-peak check, turns & steps, cache hit rate, output speed, TTFT, run time, this turn cost, session cost, balance
26
+ - **Click a field for details**:
27
+
28
+ | Field | Content |
29
+ | --- | --- |
30
+ | Context ring (bar head) | System prompt / tool definitions / messages |
31
+ | Peak / off-peak check | Usage heat map: day / week / month / year |
32
+ | Turns & steps | Context compactions / skills injected / tool calls |
33
+ | Combined hit | This turn / highest / lowest cache hit rate |
34
+ | TPS | This turn / fastest / slowest speed |
35
+ | TTFT | This turn / fastest / slowest first-token delay |
36
+ | Run time | Wait time / model time / tool calls |
37
+ | This turn cost | Token breakdown for this turn |
38
+ | Session cost | Cumulative token breakdown for this session |
39
+ | Balance | Top-up balance / granted balance / quota left |
40
+
41
+ - **Session data drill-down**: context compactions mark the node they happened at, skills injected counts the skills injected in this session, and tool calls list every tool the session used with its call count; click the title to go back up
42
+ - **Version check and update**: DSH checks for the latest version on startup, shows a hint next to the "Status bar" nav item when one is available, and offers a one-click update button in settings
43
+ - **GitHub support**: your support is the biggest motivation for the developer to keep going! Click the button to open the GitHub project page and help with a star — thanks, everyone!
44
+ - **Cost estimation**: priced with the official peak/off-peak rules; each call is computed from the moment it happened and the model it used
45
+ - **Price book**: your own prices, an optional peak/off-peak split, and a CNY / USD currency switch
46
+ - **Also**: one-click holiday calendar update, balance refreshed every minute, bilingual UI
47
+
48
+ ## Install
49
+
50
+ In the DSH desktop app, open **Plugins → Add plugin** and install by package name:
51
+
52
+ ```
53
+ dsh-desktop-statusbar
54
+ ```
55
+
56
+ Where the npm registry is not reachable, the same dialog offers the China mainland mirror as the install source. A GitHub repository URL is also accepted:
57
+
58
+ ```
59
+ https://github.com/raphael-y7/dsh-desktop-statusbar
60
+ ```
61
+
62
+ Command line:
63
+
64
+ ```powershell
65
+ dsh plugin --profile desktop add dsh-desktop-statusbar
66
+ ```
67
+
68
+ ### Install from npm
69
+
70
+ Both ways above install from the npm registry; the package name is `dsh-desktop-statusbar`. To check the current version on npm:
71
+
72
+ ```powershell
73
+ npm view dsh-desktop-statusbar version
74
+ ```
75
+
76
+ ### When the built-in updater fails
77
+
78
+ The one-click update button inside the plugin can fail on some desktop builds — it either does nothing or reports a failure. Do not keep clicking it. Use the official install entry instead and **append `@version` to the package name** to pin the exact version:
79
+
80
+ ```powershell
81
+ dsh plugin --profile desktop add dsh-desktop-statusbar@3.0.0
82
+ ```
83
+
84
+ The same string works in the plugin panel — type `dsh-desktop-statusbar@3.0.0` into the **Add plugin** field.
85
+
86
+ Use whatever version you see (the version on the release page, or the output of the `npm view` command above). Pinning the version has a second benefit: **you get exactly the build you asked for**, with no chance of a stale cached package.
87
+
88
+ Also listed on [dshmarket](https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/), [dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) and [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar).
89
+
90
+ ## Usage
91
+
92
+ Open **Settings → Status bar**:
93
+
94
+ ![Settings page](docs/settings.en.png)
95
+
96
+ - **Context occupancy**: the ring at the head of the bar — progress shows the share of context used, the gap marks the compaction threshold, and the colour shows the run state (grey idle / green running / red error / amber pending approval)
97
+ - **Stats fields**: ticking controls visibility only, so unticking hides a field without moving it; drag the handle on the right to reorder; "Reset settings" restores the factory order
98
+ - **Custom model prices**: enter a model name and "Add" to create an entry; "Edit" opens the editor and changes are written on save; tick "peak / off-peak pricing" to split by time of day, otherwise a flat all-day price applies
99
+ - **Currency**: CNY or USD in the top-right corner of the editor. Switching replaces the two built-in models with that currency's official reference prices (edited entries are kept) and changes the symbol in the cost fields; the balance follows the currency reported by the API
100
+ - **Holidays**: click "Update holidays" to fetch and write the next year's public-holiday calendar
101
+ - **Balance**: refreshed once a minute
102
+
103
+ ### Billing rules
104
+
105
+ Peak hours are **09:00–12:00 and 14:00–18:00 Beijing time, Monday to Friday**, and off-peak rates are half the peak rates; Chinese public holidays and weekends are billed off-peak all day (matching the [official docs](https://api-docs.deepseek.com/quick_start/pricing), checked 2026-09).
106
+
107
+ ![Custom model prices](docs/pricing.en.png)
108
+
109
+ ## Known limitations
110
+
111
+ - Fastest / slowest TTFT and speed come from a new host-side projection: **you must fully quit and restart DSH** before it starts collecting
112
+ - A model with no price is not billed; adding the price back-fills its earlier calls
113
+ - One-click update relies on `pnpm`: the desktop app uses the copy bundled with the host, while CLI / web usage needs `pnpm` on the system. If neither is found, the update says so explicitly **and logs every location it tried**; you can also point it at a specific command with the `DSH_DESKTOP_STATUSBAR_PNPM` environment variable
114
+
115
+ ## Development
116
+
117
+ Every test is a standalone script meant to be run with plain node — no test framework.
118
+
119
+ ```powershell
120
+ npm test # runs every verify*.js under tests/, then checks project vs installed plugin dir
121
+ npm run sync # copies lib/ into the installed plugin dir
122
+ ```
123
+
124
+ Development scripts under `tools/` ship with the package (the `files` field includes them),
125
+ so both a git clone and an npm install get them:
126
+
127
+ | Script | Purpose |
128
+ |---|---|
129
+ | `tools/test.cjs` | full test run + consistency guard |
130
+ | `tools/sync-to-plugin.cjs` | project `lib/` → installed plugin dir |
131
+ | `tools/sync-from-plugin.cjs` | installed plugin dir → project `lib/` |
132
+ | `tools/plugin-dir.cjs` | locates the plugin dir |
133
+ | `tools/shot.cjs` | regenerates the README screenshots |
134
+
135
+ They are only used while developing; the plugin never loads them at runtime.
136
+ `npm test` needs the repository's `tests/` directory, so an npm-installed copy can only run
137
+ `sync-*` and `shot`.
138
+
139
+ The plugin directory is located automatically: environment variable `DSH_STATUS_BAR_PLUGIN_DIR` →
140
+ known layouts under `~/.dsh` (`local-plugins/`, each `profiles/*/node_modules/`) → derived from the
141
+ `tools/` location. No code changes needed when switching machine or user name.
142
+
143
+ ## Licence
144
+
145
+ [MIT](LICENSE): free to use, modify and redistribute; keep the copyright and licence notice.
package/README.md CHANGED
@@ -1,142 +1,142 @@
1
- <h1 align="center">dsh-desktop-statusbar</h1>
2
-
3
- <p align="center">
4
- <a href="https://github.com/raphael-y7/dsh-desktop-statusbar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/raphael-y7/dsh-desktop-statusbar?style=flat&logo=github&color=f5f5f5"></a>
5
- <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm downloads" src="https://img.shields.io/npm/dt/dsh-desktop-statusbar?style=flat&logo=npm&label=downloads&color=e74c3c"></a>
6
- <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?style=flat&color=9B59B6"></a>
7
- <a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.5-%234d6bfe?style=flat"></a>
8
- <a href="https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/"><img alt="dshmarket" src="https://img.shields.io/badge/dshmarket-listed-%23e6b800?style=flat"></a>
9
- <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300897B?style=flat"></a>
10
- <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-%23e67e22?style=flat"></a>
11
- <br>
12
- <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%230099cc?style=flat"></a>
13
- <img alt="language" src="https://img.shields.io/badge/javascript-100%25-%23ec407a?style=flat">
14
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%2327ae60?style=flat"></a>
15
- </p>
16
-
17
- <p align="center">中文 | <a href="README.en.md">English</a></p>
18
-
19
- 以一条可配置的状态栏替换 DSH 桌面端对话区底部的统计行:字段、顺序、模型单价与计价单位均可配置,费用按官方峰谷口径实时估算。
20
-
21
- ![底栏效果](docs/statusbar.png)
22
-
23
- ## 功能
24
-
25
- - **9 个可选字段 + 栏首上下文圆环**:上下文占用(栏首圆环)、峰谷判断、轮次&步数、缓存命中率、输出速度、首字平均、运行用时、本轮费用、总计费用、余额
26
- - **点击字段可查看详情**:
27
-
28
- | 字段 | 内容 |
29
- | --- | --- |
30
- | 上下文占用(栏首圆环) | 系统提示词 / 工具定义 / 对话消息 |
31
- | 峰谷判断 | 日 / 周 / 月 / 年数据统计热力图 |
32
- | 轮次&步数 | 上下文压缩 / 技能注入 / 工具调用 |
33
- | 综合命中 | 本轮 / 最高 / 最低缓存命中率 |
34
- | 综合速度 | 本轮 / 最快 / 最慢速度 |
35
- | 首字平均 | 本轮 / 最快 / 最慢首字延迟 |
36
- | 运行用时 | 等待用时 / 模型用时 / 工具调用 |
37
- | 本轮费用 | 本轮会话的 token 明细 |
38
- | 总计费用 | 当前会话的累计 token 明细 |
39
- | 余额 | 充值余额 / 赠金余额 / 剩余配额 |
40
-
41
- - **会话数据下钻**:上下文压缩逐次标注发生节点,技能注入统计当前会话注入的技能,工具调用列出会话使用的所有工具与各自次数;点击标题返回上一层
42
- - **版本自检与更新**:DSH 启动时自动检测最新版本,发现新版时在「状态栏」导航项旁显示提示,并在设置页提供一键更新按钮
43
- - **费用估算**:按官方峰谷口径计价,每条调用按其发生时刻与所用模型分别计算
44
- - **价格库**:自定义单价、峰谷分档、CNY / USD 计价单位
45
- - **GitHub支持**:用户的支持是开发者持续开发的最大动力!点击按钮转跳GitHub项目页,帮忙点亮Star支持一下,感谢各位!
46
- - **其他**:节假日日历一键更新、账户余额每分钟刷新、中英双语
47
-
48
- ## 安装
49
-
50
- 在 DSH 桌面端打开 **插件 → 添加插件**,输入包名后安装:
51
-
52
- ```
53
- dsh-desktop-statusbar
54
- ```
55
-
56
- 网络受限时,可在同一对话框内将安装源切换为「中国大陆镜像源」。亦支持 GitHub 仓库地址:
57
-
58
- ```
59
- https://github.com/raphael-y7/dsh-desktop-statusbar
60
- ```
61
-
62
- 命令行方式:
63
-
64
- ```powershell
65
- dsh plugin --profile desktop add dsh-desktop-statusbar
66
- ```
67
-
68
- ### 从 npm 安装
69
-
70
- 插件面板与命令行两种方式,安装源默认都是 npm registry,包名为 `dsh-desktop-statusbar`。想确认 npm 上的当前版本:
71
-
72
- ```powershell
73
- npm view dsh-desktop-statusbar version
74
- ```
75
-
76
- ### 插件自带的更新失效时
77
-
78
- 插件里那个一键更新按钮,在某些桌面端版本上会失败(点了没反应、或者直接显示失败)。这时不要反复点,改用官方安装入口、**在包名后面加上 `@版本号`** 指定到具体版本,就能精确装上:
79
-
80
- ```powershell
81
- dsh plugin --profile desktop add dsh-desktop-statusbar@3.0.0
82
- ```
83
-
84
- 插件面板里同样可以这样填 —— 在「添加插件」的输入框里写 `dsh-desktop-statusbar@3.0.0`。
85
-
86
- 版本号填你看到的最新版本即可(发布页右侧的版本号,或上面那条 `npm view` 命令的输出)。带上版本号还有一个好处:**装上的就是你想要的那一版**,不会因为缓存拿到旧包。
87
-
88
- 本插件亦收录于 [dshmarket](https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/)、[dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) 与 [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar)。
89
-
90
- ## 使用
91
-
92
- 打开 **设置 → 状态栏**:
93
-
94
- ![设置页](docs/settings.png)
95
-
96
- - **上下文占用**:栏首圆环,进度表示上下文占用比例,缺口表示上下文压缩阈值,颜色表示运行状态(空闲灰 / 运行绿 / 报错红 / 待审批黄)
97
- - **统计字段**:勾选控制显示,取消勾选仅隐藏、不改变位置;拖动右侧把手调整顺序;「恢复默认设置」恢复出厂顺序并全选
98
- - **自定义模型价格**:输入模型名并「添加」以新增条目;「修改」展开编辑区,保存后写入;需区分峰谷时段时勾选「峰谷计价」,否则按全天同价计算
99
- - **计价单位**:价格编辑区右上角可选 CNY 或 USD。切换时内置的两款模型改用对应币种的官方参考价(已修改的条目保留),费用段的符号随之变化;余额按接口返回的币种显示
100
- - **节假日**:点击「更新节假峰谷」获取并写入下一年的放假安排
101
- - **余额**:每分钟自动刷新
102
-
103
- ### 计费口径
104
-
105
- 高峰时段为**北京时间周一至周五 9:00-12:00、14:00-18:00**,空闲价为高峰价的一半;法定节假日与周末全天按空闲价计费(与[官方文档](https://api-docs.deepseek.com/zh-cn/quick_start/pricing)一致,2026-09 核对)。
106
-
107
- ![自定义模型价格](docs/pricing.png)
108
-
109
- ## 已知限制
110
-
111
- - 最快 / 最慢首字与速度来自 host 新增的投影,**升级后需完全退出并重启 DSH** 才开始统计
112
- - 价格库中缺少单价的模型不计费,补充单价后自动补算
113
- - 一键更新依赖 pnpm 可执行文件:桌面端用宿主随包提供的 pnpm,命令行 / 网页端需要系统里有 `pnpm`。都找不到时会明确提示「找不到 pnpm」,并把**尝试过的每个位置**一并写进日志;也可以用环境变量 `DSH_DESKTOP_STATUSBAR_PNPM` 直接指定要用的命令
114
-
115
- ## 开发
116
-
117
- 每个测试都是独立脚本,直接用 node 跑,不需要任何测试框架。
118
-
119
- ```powershell
120
- npm test # runs every verify*.js under tests/, then checks project vs installed plugin dir
121
- npm run sync # copies lib/ into the installed plugin dir
122
- ```
123
-
124
- `tools/` 下的开发脚本随包一起发布(`files` 里有它),克隆仓库或装 npm 包都能拿到:
125
-
126
- | 脚本 | 作用 |
127
- |---|---|
128
- | `tools/test.cjs` | 全量测试 + 一致性守卫 |
129
- | `tools/sync-to-plugin.cjs` | 项目 `lib/` → 已安装插件目录 |
130
- | `tools/sync-from-plugin.cjs` | 已安装插件目录 → 项目 `lib/` |
131
- | `tools/plugin-dir.cjs` | 自动定位插件目录 |
132
- | `tools/shot.cjs` | 生成 README 截图 |
133
-
134
- 它们只在开发时用,插件运行时不会加载。`npm test` 需要仓库里的 `tests/` 目录,
135
- 所以从 npm 装的包只能跑 `sync-*` / `shot` 这几个。
136
-
137
- 插件目录的位置自动探测,顺序是:环境变量 `DSH_STATUS_BAR_PLUGIN_DIR` → `~/.dsh` 下的已知安装布局
138
- (`local-plugins/`、各 `profiles/*/node_modules/`)→ 由 `tools/` 位置推导。换机器、换用户名都不用改代码。
139
-
140
- ## 许可
141
-
142
- [MIT](LICENSE):可自由使用、修改与再分发;保留版权与许可声明即可。
1
+ <h1 align="center">dsh-desktop-statusbar</h1>
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/raphael-y7/dsh-desktop-statusbar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/raphael-y7/dsh-desktop-statusbar?style=flat&logo=github&color=f5f5f5"></a>
5
+ <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm downloads" src="https://img.shields.io/npm/dt/dsh-desktop-statusbar?style=flat&logo=npm&label=downloads&color=e74c3c"></a>
6
+ <a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?style=flat&color=9B59B6"></a>
7
+ <a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.1--rc.5-%234d6bfe?style=flat"></a>
8
+ <a href="https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/"><img alt="dshmarket" src="https://img.shields.io/badge/dshmarket-listed-%23e6b800?style=flat"></a>
9
+ <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300897B?style=flat"></a>
10
+ <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-%23e67e22?style=flat"></a>
11
+ <br>
12
+ <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%230099cc?style=flat"></a>
13
+ <img alt="language" src="https://img.shields.io/badge/javascript-100%25-%23ec407a?style=flat">
14
+ <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%2327ae60?style=flat"></a>
15
+ </p>
16
+
17
+ <p align="center">中文 | <a href="README.en.md">English</a></p>
18
+
19
+ 以一条可配置的状态栏替换 DSH 桌面端对话区底部的统计行:字段、顺序、模型单价与计价单位均可配置,费用按官方峰谷口径实时估算。
20
+
21
+ ![底栏效果](docs/statusbar.png)
22
+
23
+ ## 功能
24
+
25
+ - **9 个可选字段 + 栏首上下文圆环**:上下文占用(栏首圆环)、峰谷判断、轮次&步数、缓存命中率、输出速度、首字平均、运行用时、本轮费用、总计费用、余额
26
+ - **点击字段可查看详情**:
27
+
28
+ | 字段 | 内容 |
29
+ | --- | --- |
30
+ | 上下文占用(栏首圆环) | 系统提示词 / 工具定义 / 对话消息 |
31
+ | 峰谷判断 | 日 / 周 / 月 / 年数据统计热力图 |
32
+ | 轮次&步数 | 上下文压缩 / 技能注入 / 工具调用 |
33
+ | 综合命中 | 本轮 / 最高 / 最低缓存命中率 |
34
+ | 综合速度 | 本轮 / 最快 / 最慢速度 |
35
+ | 首字平均 | 本轮 / 最快 / 最慢首字延迟 |
36
+ | 运行用时 | 等待用时 / 模型用时 / 工具调用 |
37
+ | 本轮费用 | 本轮会话的 token 明细 |
38
+ | 总计费用 | 当前会话的累计 token 明细 |
39
+ | 余额 | 充值余额 / 赠金余额 / 剩余配额 |
40
+
41
+ - **会话数据下钻**:上下文压缩逐次标注发生节点,技能注入统计当前会话注入的技能,工具调用列出会话使用的所有工具与各自次数;点击标题返回上一层
42
+ - **版本自检与更新**:DSH 启动时自动检测最新版本,发现新版时在「状态栏」导航项旁显示提示,并在设置页提供一键更新按钮
43
+ - **费用估算**:按官方峰谷口径计价,每条调用按其发生时刻与所用模型分别计算
44
+ - **价格库**:自定义单价、峰谷分档、CNY / USD 计价单位
45
+ - **GitHub支持**:用户的支持是开发者持续开发的最大动力!点击按钮转跳GitHub项目页,帮忙点亮Star支持一下,感谢各位!
46
+ - **其他**:节假日日历一键更新、账户余额每分钟刷新、中英双语
47
+
48
+ ## 安装
49
+
50
+ 在 DSH 桌面端打开 **插件 → 添加插件**,输入包名后安装:
51
+
52
+ ```
53
+ dsh-desktop-statusbar
54
+ ```
55
+
56
+ 网络受限时,可在同一对话框内将安装源切换为「中国大陆镜像源」。亦支持 GitHub 仓库地址:
57
+
58
+ ```
59
+ https://github.com/raphael-y7/dsh-desktop-statusbar
60
+ ```
61
+
62
+ 命令行方式:
63
+
64
+ ```powershell
65
+ dsh plugin --profile desktop add dsh-desktop-statusbar
66
+ ```
67
+
68
+ ### 从 npm 安装
69
+
70
+ 插件面板与命令行两种方式,安装源默认都是 npm registry,包名为 `dsh-desktop-statusbar`。想确认 npm 上的当前版本:
71
+
72
+ ```powershell
73
+ npm view dsh-desktop-statusbar version
74
+ ```
75
+
76
+ ### 插件自带的更新失效时
77
+
78
+ 插件里那个一键更新按钮,在某些桌面端版本上会失败(点了没反应、或者直接显示失败)。这时不要反复点,改用官方安装入口、**在包名后面加上 `@版本号`** 指定到具体版本,就能精确装上:
79
+
80
+ ```powershell
81
+ dsh plugin --profile desktop add dsh-desktop-statusbar@3.0.0
82
+ ```
83
+
84
+ 插件面板里同样可以这样填 —— 在「添加插件」的输入框里写 `dsh-desktop-statusbar@3.0.0`。
85
+
86
+ 版本号填你看到的最新版本即可(发布页右侧的版本号,或上面那条 `npm view` 命令的输出)。带上版本号还有一个好处:**装上的就是你想要的那一版**,不会因为缓存拿到旧包。
87
+
88
+ 本插件亦收录于 [dshmarket](https://awesome-dsh-plugin.com/p/raphael-y7/dsh-desktop-statusbar/)、[dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) 与 [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar)。
89
+
90
+ ## 使用
91
+
92
+ 打开 **设置 → 状态栏**:
93
+
94
+ ![设置页](docs/settings.png)
95
+
96
+ - **上下文占用**:栏首圆环,进度表示上下文占用比例,缺口表示上下文压缩阈值,颜色表示运行状态(空闲灰 / 运行绿 / 报错红 / 待审批黄)
97
+ - **统计字段**:勾选控制显示,取消勾选仅隐藏、不改变位置;拖动右侧把手调整顺序;「恢复默认设置」恢复出厂顺序并全选
98
+ - **自定义模型价格**:输入模型名并「添加」以新增条目;「修改」展开编辑区,保存后写入;需区分峰谷时段时勾选「峰谷计价」,否则按全天同价计算
99
+ - **计价单位**:价格编辑区右上角可选 CNY 或 USD。切换时内置的两款模型改用对应币种的官方参考价(已修改的条目保留),费用段的符号随之变化;余额按接口返回的币种显示
100
+ - **节假日**:点击「更新节假峰谷」获取并写入下一年的放假安排
101
+ - **余额**:每分钟自动刷新
102
+
103
+ ### 计费口径
104
+
105
+ 高峰时段为**北京时间周一至周五 9:00-12:00、14:00-18:00**,空闲价为高峰价的一半;法定节假日与周末全天按空闲价计费(与[官方文档](https://api-docs.deepseek.com/zh-cn/quick_start/pricing)一致,2026-09 核对)。
106
+
107
+ ![自定义模型价格](docs/pricing.png)
108
+
109
+ ## 已知限制
110
+
111
+ - 最快 / 最慢首字与速度来自 host 新增的投影,**升级后需完全退出并重启 DSH** 才开始统计
112
+ - 价格库中缺少单价的模型不计费,补充单价后自动补算
113
+ - 一键更新依赖 pnpm 可执行文件:桌面端用宿主随包提供的 pnpm,命令行 / 网页端需要系统里有 `pnpm`。都找不到时会明确提示「找不到 pnpm」,并把**尝试过的每个位置**一并写进日志;也可以用环境变量 `DSH_DESKTOP_STATUSBAR_PNPM` 直接指定要用的命令
114
+
115
+ ## 开发
116
+
117
+ 每个测试都是独立脚本,直接用 node 跑,不需要任何测试框架。
118
+
119
+ ```powershell
120
+ npm test # runs every verify*.js under tests/, then checks project vs installed plugin dir
121
+ npm run sync # copies lib/ into the installed plugin dir
122
+ ```
123
+
124
+ `tools/` 下的开发脚本随包一起发布(`files` 里有它),克隆仓库或装 npm 包都能拿到:
125
+
126
+ | 脚本 | 作用 |
127
+ |---|---|
128
+ | `tools/test.cjs` | 全量测试 + 一致性守卫 |
129
+ | `tools/sync-to-plugin.cjs` | 项目 `lib/` → 已安装插件目录 |
130
+ | `tools/sync-from-plugin.cjs` | 已安装插件目录 → 项目 `lib/` |
131
+ | `tools/plugin-dir.cjs` | 自动定位插件目录 |
132
+ | `tools/shot.cjs` | 生成 README 截图 |
133
+
134
+ 它们只在开发时用,插件运行时不会加载。`npm test` 需要仓库里的 `tests/` 目录,
135
+ 所以从 npm 装的包只能跑 `sync-*` / `shot` 这几个。
136
+
137
+ 插件目录的位置自动探测,顺序是:环境变量 `DSH_STATUS_BAR_PLUGIN_DIR` → `~/.dsh` 下的已知安装布局
138
+ (`local-plugins/`、各 `profiles/*/node_modules/`)→ 由 `tools/` 位置推导。换机器、换用户名都不用改代码。
139
+
140
+ ## 许可
141
+
142
+ [MIT](LICENSE):可自由使用、修改与再分发;保留版权与许可声明即可。