dsh-desktop-statusbar 1.0.0 → 1.0.1
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 +77 -77
- package/README.en.md +120 -0
- package/README.md +120 -104
- package/package.json +63 -60
package/LICENSE
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
Required Notice: Copyright 2026 北浮森屿 (https://github.com/
|
|
2
|
-
|
|
3
|
-
PolyForm Noncommercial License 1.0.0
|
|
4
|
-
|
|
5
|
-
https://polyformproject.org/licenses/noncommercial/1.0.0
|
|
6
|
-
|
|
7
|
-
## Acceptance
|
|
8
|
-
|
|
9
|
-
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
-
|
|
11
|
-
## Copyright License
|
|
12
|
-
|
|
13
|
-
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
-
|
|
15
|
-
## Distribution License
|
|
16
|
-
|
|
17
|
-
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
-
|
|
19
|
-
## Notices
|
|
20
|
-
|
|
21
|
-
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
-
|
|
23
|
-
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
-
|
|
25
|
-
## Changes and New Works License
|
|
26
|
-
|
|
27
|
-
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
-
|
|
29
|
-
## Patent License
|
|
30
|
-
|
|
31
|
-
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
-
|
|
33
|
-
## Noncommercial Purposes
|
|
34
|
-
|
|
35
|
-
Any noncommercial purpose is a permitted purpose.
|
|
36
|
-
|
|
37
|
-
## Personal Uses
|
|
38
|
-
|
|
39
|
-
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
-
|
|
41
|
-
## Noncommercial Organizations
|
|
42
|
-
|
|
43
|
-
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
-
|
|
45
|
-
## Fair Use
|
|
46
|
-
|
|
47
|
-
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
-
|
|
49
|
-
## No Other Rights
|
|
50
|
-
|
|
51
|
-
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
-
|
|
53
|
-
## Patent Defense
|
|
54
|
-
|
|
55
|
-
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
-
|
|
57
|
-
## Violations
|
|
58
|
-
|
|
59
|
-
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
-
|
|
61
|
-
## No Liability
|
|
62
|
-
|
|
63
|
-
_**As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.**_
|
|
64
|
-
|
|
65
|
-
## Definitions
|
|
66
|
-
|
|
67
|
-
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
-
|
|
69
|
-
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
-
|
|
71
|
-
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
-
|
|
73
|
-
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
-
|
|
75
|
-
**Use** means anything you do with the software requiring one of your licenses.
|
|
76
|
-
|
|
77
|
-
© PolyForm Project Inc.
|
|
1
|
+
Required Notice: Copyright 2026 北浮森屿 (https://github.com/raphael-y7/dsh-desktop-statusbar)
|
|
2
|
+
|
|
3
|
+
PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
https://polyformproject.org/licenses/noncommercial/1.0.0
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
_**As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.**_
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
|
76
|
+
|
|
77
|
+
© PolyForm Project Inc.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
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=social"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?color=red"></a>
|
|
6
|
+
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-green"></a>
|
|
7
|
+
<a href="https://github.com/anywhere-labs/dsh-desktop"><img alt="dsh desktop" src="https://img.shields.io/badge/dsh%20desktop-2.0.10-%238957e5"></a>
|
|
8
|
+
<a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%235fa04e"></a>
|
|
9
|
+
<img alt="language" src="https://img.shields.io/github/languages/top/raphael-y7/dsh-desktop-statusbar?color=yellow">
|
|
10
|
+
<a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-orange"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center"><a href="README.md">中文</a> | English</p>
|
|
14
|
+
|
|
15
|
+
Replaces the stats line under the composer in the DSH desktop app with a configurable status bar: pick your own fields, arrange their order, enter per-model prices, and get live cost estimates using DeepSeek's official peak/off-peak rates.
|
|
16
|
+
|
|
17
|
+
> Noncommercial license ([PolyForm Noncommercial 1.0.0](LICENSE)): free to use and modify for personal use, study, teaching and nonprofit organizations; **commercial use is not permitted**.
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **10 optional fields**: session status (running state + peak/off-peak window), turns and steps, cache hit rate, time to first token, output speed, elapsed time, current-turn cost, session cost, balance, token count
|
|
24
|
+
- **Custom order**: drag the handle in the settings page to reorder; unchecking a field only hides it without changing its position; "Restore defaults" returns to the factory order with every field selected
|
|
25
|
+
- **Cost estimation**: priced with DeepSeek's official peak/off-peak rules — each call is calculated with the model and the moment it actually happened, then summed, so calls that cross time windows or models never get mixed up
|
|
26
|
+
- **Model price library**: set your own price per model, with a "peak/off-peak pricing" toggle (unchecked means one flat price all day); adding a price later retroactively recalculates earlier calls that had been skipped
|
|
27
|
+
- **Account balance**: reads the DeepSeek balance endpoint directly, refreshed every minute (the key stays in local memory only — never written to disk, never forwarded)
|
|
28
|
+
- **Bilingual UI**: follows the DSH language setting
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### Option 1: plugin marketplace / npm
|
|
33
|
+
|
|
34
|
+
Published on [npm](https://www.npmjs.com/package/dsh-desktop-statusbar) and listed in [DSH 1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar) (category: UI Enhancements):
|
|
35
|
+
|
|
36
|
+
```powershell
|
|
37
|
+
dsh plugin --profile desktop add dsh-desktop-statusbar
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Replace `desktop` with your own profile name. You can also install straight from the GitHub source (identical content):
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
dsh plugin --profile desktop add github:raphael-y7/dsh-desktop-statusbar
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Option 2: manual installation
|
|
47
|
+
|
|
48
|
+
1. Clone the project into the DSH local plugin directory:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
git clone https://github.com/raphael-y7/dsh-desktop-statusbar "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. Install the single dependency (`zod`):
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
cd "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
58
|
+
npm install --omit=dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. Register it with DSH's own command line (it adds the dependency declaration and the link for you):
|
|
62
|
+
|
|
63
|
+
```powershell
|
|
64
|
+
dsh plugin --profile desktop add "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
4. Restart DSH and refresh the page.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
Open **Settings → Status bar**:
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
- **Basics**: enable the status bar, allow wrapping
|
|
76
|
+
- **Data fields**: check the fields you want, drag the six-dot handle on the right to reorder
|
|
77
|
+
- **Custom model prices**: enter the prices for the models you use (per million tokens, in CNY). Click "Edit" to expand, then "Save" to commit; a new model defaults to a flat all-day price — enable "peak/off-peak pricing" when you need the split
|
|
78
|
+
|
|
79
|
+
### Billing rules
|
|
80
|
+
|
|
81
|
+
Peak hours are **Beijing time, Monday to Friday, 09:00–12:00 and 14:00–18:00**; everything else is off-peak and costs half the peak rate — consistent with DeepSeek's official documentation ([Models & Pricing](https://api-docs.deepseek.com/zh-cn/quick_start/pricing), checked 2026-09-15).
|
|
82
|
+
|
|
83
|
+
Public holidays and make-up workdays are **not handled separately**: the official rule only looks at the day of the week, so a holiday falling on a weekday is still billed as peak/off-peak, and a make-up workday falling on a weekend is still billed at the off-peak rate.
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
### Things to know
|
|
88
|
+
|
|
89
|
+
Models **without a price in the library are skipped and not billed** (not a miscalculation — the price is simply unknown). Once you add the price, every earlier call of that model is recalculated into the total. The status bar fields update immediately; there is no need to reopen the session.
|
|
90
|
+
|
|
91
|
+
## Known limitations
|
|
92
|
+
|
|
93
|
+
- The model name shown by "current session usage" is reported by the status bar to the plugin backend and then read by the settings page — the DSH settings page is a global slot and cannot read session projections, so this detour is unavoidable
|
|
94
|
+
- Hiding the official stats line relies on the DSH slot contract (`conversation.composer.dock`) rather than the official component's class names, so DSH rebuilding its assets will not break it; if DSH changes the slot itself, this plugin has to follow
|
|
95
|
+
- The session projection keeps only the latest 4000 calls; older ones no longer take part in cost recalculation
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
tests/ 16 test scripts (plain Node, no browser needed)
|
|
101
|
+
tools/ test.cjs runs them all; sync-from-plugin.cjs copies the plugin directory sources into the project
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
node tools/test.cjs
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Coverage: field placeholders and formatting, peak/off-peak boundaries across weekends and weekdays, price self-healing and recalculation, storage-key migration, metric hover, host routes, navigation icon replacement, dead-code scan.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
This project uses the [PolyForm Noncommercial 1.0.0](LICENSE): **permitted** for personal use, research, study, teaching and hobby projects, as well as charitable, educational, public research, public safety/health, environmental and government use; **permitted** to modify and redistribute (with the license and attribution preserved); **commercial use is not permitted**.
|
|
113
|
+
|
|
114
|
+
This is not an OSI-approved open source license — the source is public, but commercial use requires separate permission.
|
|
115
|
+
|
|
116
|
+
## Acknowledgements
|
|
117
|
+
|
|
118
|
+
The idea comes from the DSH community project [`@bananiceee/dsh-status-bar`](https://www.npmjs.com/package/@bananiceee/dsh-status-bar) (MIT): hide the official stats line and take over with a self-built bar.
|
|
119
|
+
|
|
120
|
+
This project is an **independent implementation**. Line-by-line comparison against version 0.1.10 of that project: of 1415 non-empty lines, 247 are textually identical (17.5%), and 190 of those are short lines such as `}` and `);`; **only 9 identical lines are longer than 40 characters**, all of them required DSH platform integration boilerplate (`ctx.slots.inject(...)`, `useProjection("tokenUsage")`, module wrapper scaffolding) and generic function names (`apply`, `formatTokens`, `segmentView`). Beyond those there is no shared code.
|
package/README.md
CHANGED
|
@@ -1,104 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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=social"></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/dsh-desktop-statusbar"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-desktop-statusbar?color=red"></a>
|
|
6
|
+
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-green"></a>
|
|
7
|
+
<a href="https://github.com/anywhere-labs/dsh-desktop"><img alt="dsh desktop" src="https://img.shields.io/badge/dsh%20desktop-2.0.10-%238957e5"></a>
|
|
8
|
+
<a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%235fa04e"></a>
|
|
9
|
+
<img alt="language" src="https://img.shields.io/github/languages/top/raphael-y7/dsh-desktop-statusbar?color=yellow">
|
|
10
|
+
<a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-orange"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">中文 | <a href="README.en.md">English</a></p>
|
|
14
|
+
|
|
15
|
+
把 DSH 桌面端对话区底部的统计行换成一条可配置的状态栏:字段自己挑、顺序自己排、模型单价自己填,费用按官方峰谷口径实时估算。
|
|
16
|
+
|
|
17
|
+
> 非商业许可([PolyForm Noncommercial 1.0.0](LICENSE)):个人使用、学习、教学、非营利组织都可以自由使用和修改,**禁止商业用途**。
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## 功能
|
|
22
|
+
|
|
23
|
+
- **10 个可选字段**:会话状态(运行状态 + 峰谷时段)、轮次与步数、缓存命中率、首字延迟、输出速度、运行用时、本次费用、会话费用、余额、Token 计数
|
|
24
|
+
- **自定义顺序**:设置页里拖动把手调整顺序,取消勾选只隐藏、不改变位置;点「恢复默认设置」一键回到出厂顺序并全选
|
|
25
|
+
- **费用估算**:按 DeepSeek 官方的峰谷口径计价,每条调用按**自己发生的那一刻**和**自己使用的模型**分别计算后累加,跨时段、跨模型都不会串价
|
|
26
|
+
- **模型价格库**:可自定义每个模型的单价;支持「峰谷计价」开关(不勾选就是全天同价);补填单价后,之前没算上的历史调用会自动补算
|
|
27
|
+
- **账户余额**:直连 DeepSeek 余额接口,每分钟刷新(key 只在本机内存中使用,不落盘、不转发)
|
|
28
|
+
- **中英双语**:跟随 DSH 的语言设置
|
|
29
|
+
|
|
30
|
+
## 安装
|
|
31
|
+
|
|
32
|
+
### 方式一:插件市场 / npm
|
|
33
|
+
|
|
34
|
+
已发布到 [npm](https://www.npmjs.com/package/dsh-desktop-statusbar),并收录进 [DSH 1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar)(分类:UI 增强):
|
|
35
|
+
|
|
36
|
+
```powershell
|
|
37
|
+
dsh plugin --profile desktop add dsh-desktop-statusbar
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
把 `desktop` 换成你自己的 profile 名。不想走 npm 也可以直接装 GitHub 源(内容与 npm 版一致):
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
dsh plugin --profile desktop add github:raphael-y7/dsh-desktop-statusbar
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 方式二:手动安装
|
|
47
|
+
|
|
48
|
+
1. 把本项目放进 DSH 的本地插件目录:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
git clone https://github.com/raphael-y7/dsh-desktop-statusbar "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. 安装依赖(只有一个,`zod`):
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
cd "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
58
|
+
npm install --omit=dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. 用 DSH 自己的命令行装进 profile(它会自动补上依赖声明与链接):
|
|
62
|
+
|
|
63
|
+
```powershell
|
|
64
|
+
dsh plugin --profile desktop add "$env:USERPROFILE\.dsh\local-plugins\dsh-desktop-statusbar"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
4. 重启 DSH,刷新页面。
|
|
68
|
+
|
|
69
|
+
## 使用
|
|
70
|
+
|
|
71
|
+
打开 **设置 → 状态栏**:
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
- **基础**:启用状态栏、允许换行
|
|
76
|
+
- **数据字段**:勾选要显示的字段,按住右侧六点拖动排序
|
|
77
|
+
- **自定义模型价格**:填写你使用的模型单价(每百万 tokens / 元)。点「修改」展开编辑,改完点「保存」才写入;新增的模型默认全天同价,需要区分峰谷时勾上「峰谷计价」
|
|
78
|
+
|
|
79
|
+
### 计费口径
|
|
80
|
+
|
|
81
|
+
高峰时段为**北京时间周一至周五 9:00-12:00、14:00-18:00**,其余为空闲时段,空闲价为高峰价的一半 —— 与 DeepSeek 官方文档一致([模型 & 价格](https://api-docs.deepseek.com/zh-cn/quick_start/pricing),2026-09-15 核对)。
|
|
82
|
+
|
|
83
|
+
节假日与调休**不单独处理**:官方规则只按星期几判断,所以法定假日落在工作日仍按峰谷算,调休上班的周末仍按空闲价。
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
### 需要注意
|
|
88
|
+
|
|
89
|
+
价格库里**没有单价的模型会被跳过不计费**(不是算错,是不知道单价)。补上单价后,该模型此前所有调用会自动补算进总计。底栏的字段会即时更新,不用重开会话。
|
|
90
|
+
|
|
91
|
+
## 已知限制
|
|
92
|
+
|
|
93
|
+
- 「当前会话使用」显示的模型名由底栏上报给插件后端再由设置页读取 —— DSH 的设置页是全局槽,拿不到会话投影,所以这一步绕不开
|
|
94
|
+
- 隐藏官方状态栏依赖 DSH 的 slot 契约(`conversation.composer.dock`),不依赖官方组件的类名,因此 DSH 更新构建产物不会失效;但如果 DSH 改动 slot 本身,需要跟着改
|
|
95
|
+
- 会话投影只保留最近 4000 条调用记录,超出后最旧的记录不再参与费用重算
|
|
96
|
+
|
|
97
|
+
## 开发
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
tests/ 16 个测试脚本(纯 Node,不需要浏览器)
|
|
101
|
+
tools/ test.cjs 跑全部测试、sync-from-plugin.cjs 把插件目录的源码同步进项目
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
node tools/test.cjs
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
测试覆盖:字段占位与格式化、峰谷边界与跨周末/工作日、价格自愈与补算、存储键迁移、指标悬停、host 路由、导航图标替换、死代码扫描。
|
|
109
|
+
|
|
110
|
+
## 许可
|
|
111
|
+
|
|
112
|
+
本项目采用 [PolyForm Noncommercial 1.0.0](LICENSE):**允许**个人使用、研究、学习、教学、业余项目,以及慈善、教育、公共研究、公共安全/健康、环保、政府机构使用;**允许**修改与再分发(需保留许可与署名);**禁止**任何商业用途。
|
|
113
|
+
|
|
114
|
+
这不是 OSI 认可的开源许可证 —— 源码公开,但商业使用需要另行获得授权。
|
|
115
|
+
|
|
116
|
+
## 致谢
|
|
117
|
+
|
|
118
|
+
思路来自 DSH 社区的 [`@bananiceee/dsh-status-bar`](https://www.npmjs.com/package/@bananiceee/dsh-status-bar)(MIT 许可):隐藏官方统计行、用自建底栏接管。
|
|
119
|
+
|
|
120
|
+
本项目为**独立实现**。与该项目的 0.1.10 版逐行比对结果:非空行 1415 行中有 247 行文字相同(17.5%),其中 190 行是 `}`、`);` 这类短行;**长于 40 字符的相同行仅 9 行**,全部是 DSH 平台集成的必要写法(`ctx.slots.inject(...)`、`useProjection("tokenUsage")`、模块包装样板等)与通用函数命名(`apply`、`formatTokens`、`segmentView` 等)。除这些之外没有相同代码片段。
|
package/package.json
CHANGED
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-desktop-statusbar",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:10 个字段可选可排序,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。",
|
|
6
|
-
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"dsh"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"default": "./lib/
|
|
31
|
-
},
|
|
32
|
-
"./
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
},
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"@deepseek-ai/dsh-client-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-desktop-statusbar",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "把 DSH 桌面端对话区底部的统计行换成可配置状态栏:10 个字段可选可排序,按官方峰谷口径估算费用,支持自定义模型单价与账户余额。",
|
|
6
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
9
|
+
},
|
|
10
|
+
"author": "北浮森屿 (https://github.com/raphael-y7)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/raphael-y7/dsh-desktop-statusbar.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/raphael-y7/dsh-desktop-statusbar#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/raphael-y7/dsh-desktop-statusbar/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"dsh",
|
|
21
|
+
"dsh-plugin",
|
|
22
|
+
"deepseek-harness",
|
|
23
|
+
"statusbar",
|
|
24
|
+
"token-usage",
|
|
25
|
+
"cost"
|
|
26
|
+
],
|
|
27
|
+
"main": "./lib/index.js",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"default": "./lib/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./client": {
|
|
33
|
+
"default": "./lib/client.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"lib",
|
|
39
|
+
"cordis.patch.yml",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "node tools/test.cjs"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"zod": "^4.4.0"
|
|
48
|
+
},
|
|
49
|
+
"dsh": {
|
|
50
|
+
"bundle": {
|
|
51
|
+
"patch": "./cordis.patch.yml"
|
|
52
|
+
},
|
|
53
|
+
"client": {
|
|
54
|
+
"inject": [
|
|
55
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
58
|
+
"@deepseek-ai/dsh-client-locale"
|
|
59
|
+
],
|
|
60
|
+
"platform": "web"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|