dsh-desktop-statusbar 2.1.2 → 2.2.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/README.en.md CHANGED
@@ -1,15 +1,17 @@
1
1
  <h1 align="center">dsh-desktop-statusbar</h1>
2
2
 
3
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://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.0--rc.2-%234d6bfe"></a>
6
- <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300a884"></a>
7
- <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-orange"></a>
8
- <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>
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.2-%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>
9
11
  <br>
10
- <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%238b5cf6"></a>
11
- <img alt="language" src="https://img.shields.io/github/languages/top/raphael-y7/dsh-desktop-statusbar?color=yellow">
12
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%235fa04e"></a>
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>
13
15
  </p>
14
16
 
15
17
  <p align="center"><a href="README.md">中文</a> | English</p>
@@ -36,7 +38,7 @@ Replaces the stats line under the message input in the DSH desktop app with a co
36
38
  | Session cost | Cumulative token breakdown for this session |
37
39
  | Balance | Top-up balance / granted balance / quota left |
38
40
 
39
- - **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 by count; click the title to go back up
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
40
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
41
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!
42
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
@@ -71,7 +73,7 @@ Both ways above install from the npm registry; the package name is `dsh-desktop-
71
73
  npm view dsh-desktop-statusbar version
72
74
  ```
73
75
 
74
- Also listed on [dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) and [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar).
76
+ 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).
75
77
 
76
78
  ## Usage
77
79
 
@@ -96,6 +98,7 @@ Peak hours are **09:00–12:00 and 14:00–18:00 Beijing time, Monday to Friday*
96
98
 
97
99
  - Fastest / slowest TTFT and speed come from a new host-side projection: **you must fully quit and restart DSH** before it starts collecting
98
100
  - A model with no price is not billed; adding the price back-fills its earlier calls
101
+ - 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
99
102
 
100
103
  ## Development
101
104
 
package/README.md CHANGED
@@ -1,15 +1,17 @@
1
1
  <h1 align="center">dsh-desktop-statusbar</h1>
2
2
 
3
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://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.0--rc.2-%234d6bfe"></a>
6
- <a href="https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar"><img alt="dshfind" src="https://img.shields.io/badge/dshfind-listed-%2300a884"></a>
7
- <a href="https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar"><img alt="1024Store" src="https://img.shields.io/badge/1024Store-listed-orange"></a>
8
- <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>
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.2-%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>
9
11
  <br>
10
- <a href="https://nodejs.org/"><img alt="node" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-%238b5cf6"></a>
11
- <img alt="language" src="https://img.shields.io/github/languages/top/raphael-y7/dsh-desktop-statusbar?color=yellow">
12
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-%235fa04e"></a>
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>
13
15
  </p>
14
16
 
15
17
  <p align="center">中文 | <a href="README.en.md">English</a></p>
@@ -36,7 +38,7 @@
36
38
  | 总计费用 | 当前会话的累计 token 明细 |
37
39
  | 余额 | 充值余额 / 赠金余额 / 剩余配额 |
38
40
 
39
- - **会话数据下钻**:上下文压缩逐次标注发生节点,技能注入统计当前会话注入的技能,工具调用按次数列出会话使用的所有工具;点击标题返回上一层
41
+ - **会话数据下钻**:上下文压缩逐次标注发生节点,技能注入统计当前会话注入的技能,工具调用列出会话使用的所有工具与各自次数;点击标题返回上一层
40
42
  - **版本自检与更新**:DSH 启动时自动检测最新版本,发现新版时在「状态栏」导航项旁显示提示,并在设置页提供一键更新按钮
41
43
  - **费用估算**:按官方峰谷口径计价,每条调用按其发生时刻与所用模型分别计算
42
44
  - **价格库**:自定义单价、峰谷分档、CNY / USD 计价单位
@@ -71,7 +73,7 @@ dsh plugin --profile desktop add dsh-desktop-statusbar
71
73
  npm view dsh-desktop-statusbar version
72
74
  ```
73
75
 
74
- 本插件亦收录于 [dshfind](https://dshfind.com/zh/plugins/raphael-y7/dsh-desktop-statusbar) 与 [1024Store](https://deepseek1024.com/plugins/Rapheal-Y7/dsh-desktop-statusbar)。
76
+ 本插件亦收录于 [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)。
75
77
 
76
78
  ## 使用
77
79
 
@@ -96,7 +98,7 @@ npm view dsh-desktop-statusbar version
96
98
 
97
99
  - 最快 / 最慢首字与速度来自 host 新增的投影,**升级后需完全退出并重启 DSH** 才开始统计
98
100
  - 价格库中缺少单价的模型不计费,补充单价后自动补算
99
- - 一键更新依赖 pnpm 可执行文件:桌面端用宿主随包提供的 pnpm,命令行 / 网页端用 PATH 上的 pnpm。两者都找不到时会明确提示「找不到 pnpm」,而不是静默失败
101
+ - 一键更新依赖 pnpm 可执行文件:桌面端用宿主随包提供的 pnpm,命令行 / 网页端需要系统里有 `pnpm`。都找不到时会明确提示「找不到 pnpm」,并把**尝试过的每个位置**一并写进日志;也可以用环境变量 `DSH_DESKTOP_STATUSBAR_PNPM` 直接指定要用的命令
100
102
 
101
103
  ## 开发
102
104
 
Binary file
package/docs/settings.png CHANGED
Binary file
@@ -242,7 +242,38 @@ const adapters = [
242
242
  if (Number.isFinite(total) !== true) return null;
243
243
  /* 积分不是货币:currency 留空让客户端不拼货币符号;不给 parts,
244
244
  气泡因此只显示总数、不列套餐构成。 */
245
- return { currency: '', total: formatCredits(total), parts: [], isCredits: true };
245
+ const out = { currency: '', total: formatCredits(total), parts: [], isCredits: true };
246
+ /* 套餐列表:新插件(dsh-connect-workbuddy)的 /usage 带 credits.packages,就是官方客户端
247
+ 「积分套餐」那一栏的数据。老插件 /status 只有 credits.total,**不产生 rewards** ——
248
+ 客户端据此保持现在的纯总数显示,不会因为字段缺失去猜。 */
249
+ const packages = Array.isArray(credits.packages) ? credits.packages : null;
250
+ if (packages === null) return out;
251
+ const rewards = [];
252
+ for (let i = 0; i < packages.length; i += 1) {
253
+ const one = packages[i];
254
+ if (one === null || one === undefined || typeof one !== 'object') continue;
255
+ const size = Number(one.size);
256
+ const remain = Number(one.remain);
257
+ /* size/remain 缺一个就没法算「已用/总量」:跳过这个包,
258
+ 不让一条坏数据把整条气泡弄崩(旧插件/上游漂移都可能缺字段)。 */
259
+ if (Number.isFinite(size) !== true || Number.isFinite(remain) !== true || size < 0) continue;
260
+ const name = typeof one.packageName === 'string' ? one.packageName : '';
261
+ if (name.length === 0) continue;
262
+ const monthly = one.monthly === true;
263
+ rewards.push({
264
+ name,
265
+ /* 「已用」与官方同口径:总量 - 剩余(connect 插件已按 CapacitySize/Remain 算好);
266
+ 剩余超过总量这种异常数据夹住到 0,不显示负数。 */
267
+ used: Math.max(0, size - remain),
268
+ total: size,
269
+ /* 一次性包看到期日;月度包看「下期刷新」(官方对月度包不显示「到期」,别编造到期时间) */
270
+ expireAt: monthly ? null : dateOfMs(one.expiresAtMs),
271
+ refreshAt: monthly ? dateOfMs(one.cycleRefreshMs) : null,
272
+ monthly,
273
+ });
274
+ }
275
+ out.rewards = rewards;
276
+ return out;
246
277
  }
247
278
  }
248
279
  ];
@@ -262,6 +293,23 @@ function formatCredits(value) {
262
293
  return whole.replace(/\B(?=(\d{3})+(?!\d))/g, ',') + rest;
263
294
  }
264
295
 
296
+ /**
297
+ * 毫秒时间戳 → 北京时间 'YYYY-MM-DD'(套餐气泡里的到期日/刷新日)。
298
+ *
299
+ * 为什么固定按北京时间算、不看运行环境时区:这个项目的所有「日」口径(峰谷计价、
300
+ * 签到日)都按北京时间;套餐到期时间给用户看的是**中国的日期**,跟着机器时区走
301
+ * 会在海外机器上差一天(服务端实测值如 1794056975000 = 北京时间 2026-11-07 21:09)。
302
+ * 取不到/非法值给 null —— 客户端显示「—」,绝不猜一个日期。
303
+ */
304
+ function dateOfMs(value) {
305
+ const ms = Number(value);
306
+ if (Number.isFinite(ms) !== true || ms <= 0) return null;
307
+ const bj = new Date(ms + 8 * 3600 * 1000);
308
+ const month = String(bj.getUTCMonth() + 1).padStart(2, '0');
309
+ const day = String(bj.getUTCDate()).padStart(2, '0');
310
+ return bj.getUTCFullYear() + '-' + month + '-' + day;
311
+ }
312
+
265
313
  /**
266
314
  * 会话线索 → 平台适配器。
267
315
  *