dsh-cost-meter 1.9.78 → 1.9.79

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
@@ -3,7 +3,7 @@
3
3
  <p align="center">Cost tracking and subscription quotas for DeepSeek Harness</p>
4
4
 
5
5
  <p align="center">
6
- <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.78-4176E6?style=flat-square" alt="version"></a>
6
+ <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.79-4176E6?style=flat-square" alt="version"></a>
7
7
  <a href="https://www.npmjs.com/package/dsh-cost-meter"><img src="https://img.shields.io/npm/dm/dsh-cost-meter?label=downloads&style=flat-square&color=4176E6" alt="npm monthly downloads"></a>
8
8
  <a href="https://github.com/Han-1413141/dsh-cost-meter/stargazers"><img src="https://img.shields.io/github/stars/Han-1413141/dsh-cost-meter?label=stars&style=flat-square&color=D9A400" alt="GitHub stars"></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT license"></a>
@@ -42,20 +42,20 @@ Restart `dsh web` after installation or updates. **Desktop** uses its bundled CL
42
42
  The PowerShell installer checks pnpm and Git and uses the `web` profile by default:
43
43
 
44
44
  ```powershell
45
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.78/install.ps1 | iex
45
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.79/install.ps1 | iex
46
46
  ```
47
47
 
48
48
  Install a pinned Git tag:
49
49
 
50
50
  ```sh
51
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.78
51
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.79
52
52
  ```
53
53
 
54
54
  See [installation and updates](docs/install.en.md) for uninstalling or installing without Git.
55
55
 
56
56
  </details>
57
57
 
58
- Current release **v1.9.78**: [release notes](docs/release-notes/v1.9.78.md) · [troubleshooting](docs/install-troubleshooting.md)
58
+ Current release **v1.9.79**: [release notes](docs/release-notes/v1.9.79.md) · [troubleshooting](docs/install-troubleshooting.md)
59
59
 
60
60
  ## Feature overview
61
61
 
package/README.zh-CN.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <p align="center">DeepSeek Harness 费用统计与订阅额度插件</p>
4
4
 
5
5
  <p align="center">
6
- <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.78-4176E6?style=flat-square" alt="version"></a>
6
+ <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.79-4176E6?style=flat-square" alt="version"></a>
7
7
  <a href="https://www.npmjs.com/package/dsh-cost-meter"><img src="https://img.shields.io/npm/dm/dsh-cost-meter?label=downloads&style=flat-square&color=4176E6" alt="npm monthly downloads"></a>
8
8
  <a href="https://github.com/Han-1413141/dsh-cost-meter/stargazers"><img src="https://img.shields.io/github/stars/Han-1413141/dsh-cost-meter?label=stars&style=flat-square&color=D9A400" alt="GitHub stars"></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT license"></a>
@@ -42,20 +42,20 @@ dsh plugin --profile web add dsh-cost-meter
42
42
  PowerShell 脚本自动检查 pnpm 和 Git,默认安装到 `web` Profile:
43
43
 
44
44
  ```powershell
45
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.78/install.ps1 | iex
45
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.79/install.ps1 | iex
46
46
  ```
47
47
 
48
48
  固定 Git tag 安装:
49
49
 
50
50
  ```sh
51
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.78
51
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.79
52
52
  ```
53
53
 
54
54
  更新、卸载及无 Git 的安装方法见[安装说明](docs/install.md)。
55
55
 
56
56
  </details>
57
57
 
58
- 当前版本 **v1.9.78**:[更新说明](docs/release-notes/v1.9.78.md) · [安装排障](docs/install-troubleshooting.md)
58
+ 当前版本 **v1.9.79**:[更新说明](docs/release-notes/v1.9.79.md) · [安装排障](docs/install-troubleshooting.md)
59
59
 
60
60
  ## 功能总览
61
61
 
@@ -0,0 +1,13 @@
1
+ ## v1.9.79 更新
2
+
3
+ - 侧栏「图标」样式将 DeepSeek 余额和峰谷时段合为一个按钮。圆环颜色显示当前时段,点击可查看余额和下次切换时间。
4
+ - 隐藏余额时,图标金额同步遮住。多个账号使用不同币种时,展开可分别查看。
5
+ - 感谢 [@chanyuenpang](https://github.com/chanyuenpang) 在 [#548](https://github.com/Han-1413141/dsh-cost-meter/pull/548) 贡献图标合并、时段配色和余额展示。
6
+
7
+ ## 升级
8
+
9
+ ```powershell
10
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.79/install.ps1 | iex
11
+ ```
12
+
13
+ 升级后重启 DSH。
@@ -1,20 +1,20 @@
1
- import { createHash } from 'node:crypto'
2
- import { setTimeout as sleep } from 'node:timers/promises'
3
- import { fetchWithRetry, readJsonBounded } from './net.js'
4
-
5
- import { readAgyPool } from './agy-link-pool.js'
6
-
7
- export async function queryAgyLinkQuota(base, { hostOrigin, force, locale, signal, fetchImpl, now, wait = sleep } = {}) {
8
- if (base.status === 'off') return base
9
- if (!hostOrigin) return { ...base, status: 'error', message: locale === 'en' ? 'The DSH web server is not ready' : 'DSH Web 服务尚未就绪' }
10
- const read = async (path, init) => {
11
- const response = await fetchWithRetry(hostOrigin + path, { ...init, signal, redirect: 'error' }, { attempts: 1, timeoutMs: 3500, fetchImpl })
12
- if (!response.ok) {
13
- await response.body?.cancel().catch(() => {})
14
- throw Object.assign(new Error('dsh-agy-link query failed'), { status: response.status })
15
- }
16
- return readJsonBounded(response, 524288, { signal })
17
- }
18
- return readAgyPool(base, { read, force, locale, signal, now, wait,
19
- hashId: id => createHash('sha256').update(id).digest('hex').slice(0, 16) })
20
- }
1
+ import { createHash } from 'node:crypto'
2
+ import { setTimeout as sleep } from 'node:timers/promises'
3
+ import { fetchWithRetry, readJsonBounded } from './net.js'
4
+
5
+ import { readAgyPool } from './agy-link-pool.js'
6
+
7
+ export async function queryAgyLinkQuota(base, { hostOrigin, force, locale, signal, fetchImpl, now, wait = sleep } = {}) {
8
+ if (base.status === 'off') return base
9
+ if (!hostOrigin) return { ...base, status: 'error', message: locale === 'en' ? 'The DSH web server is not ready' : 'DSH Web 服务尚未就绪' }
10
+ const read = async (path, init) => {
11
+ const response = await fetchWithRetry(hostOrigin + path, { ...init, signal, redirect: 'error' }, { attempts: 1, timeoutMs: 3500, fetchImpl })
12
+ if (!response.ok) {
13
+ await response.body?.cancel().catch(() => {})
14
+ throw Object.assign(new Error('dsh-agy-link query failed'), { status: response.status })
15
+ }
16
+ return readJsonBounded(response, 524288, { signal })
17
+ }
18
+ return readAgyPool(base, { read, force, locale, signal, now, wait,
19
+ hashId: id => createHash('sha256').update(id).digest('hex').slice(0, 16) })
20
+ }