dsh-usage-state 0.4.9 → 0.4.11

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/CHANGELOG.md CHANGED
@@ -6,6 +6,31 @@
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.11] - 2026-10-30
10
+
11
+ ### Changed
12
+
13
+ - 插件管理、组件详情和设置统一使用中文“余额与额度”、英文“Balance & Quota”;通过官方 locale metadata 导出提供双语名称和简洁说明。npm 包名、配置与 RPC 标识保持不变。
14
+ - npm 安装说明突出账户余额、套餐额度、已用比例和重置倒计时;双语 README 同步展示名称与 rc.5 验证边界。
15
+
16
+ ### Fixed
17
+
18
+ - 兼容性 Draft PR 的中断恢复接受 GitHub 签名的 web-flow committer,并要求候选 tree 完全一致,防止覆盖额外内容;补充签名、内容与分页去重回归。
19
+
20
+ ### Compatibility
21
+
22
+ - 纳入 rc.5 精确回归候选和原检查证据;自动生成、按版本去重、历史补建及权限隔离经专项审查与验证。支持范围下界不变。
23
+ - 隔离 Web 使用 fixture 验证安装、RPC、模型切换、状态行和设置;真实 Desktop 账号、厂商余额、凭据落盘及完整视觉验收仍单独跟踪。
24
+
25
+ ## [0.4.10] - 2026-10-24
26
+
27
+ ### Compatibility
28
+
29
+ - 完成 DSH 0.2.1-rc.3 兼容性复验:实际 tarball 在隔离 Web 宿主安装并激活;设置页、getState/describeCredentials、文件凭据优先级、输入框上方状态行及隐藏/API配置往返均通过。
30
+ - 新版 DeepSeek API Key 动态 `/models` 目录可在插件设置及模型选择器中显示,切换新目录模型仍显示同一供应商余额;账号服务的 `getPlatformSession()` / `getBalance(client)` 契约保留。
31
+ - CI 兼容矩阵新增精确 0.2.1-rc.3,保留 rc.1/rc.2 和原锁定基线;344 项完整回归及 rc.3 的 19 项真实 Typert host/browser 与产物契约测试通过。
32
+ - 未发现需要修改运行代码的兼容问题,三个预构建入口沿用0.4.9。现有 engines.dsh 与 dsh-settings peer 范围已覆盖rc.3,支持下界不变。浏览器余额与模型目录使用fixture;真实Desktop登录钱包、凭据落盘和完整视觉验收不计入本次验证。
33
+
9
34
  ## [0.4.9] - 2026-10-23
10
35
 
11
36
  ### Added
@@ -146,7 +171,9 @@
146
171
 
147
172
  0.4.5起建立版本tag/Release;更早发布没有保存这些引用。0.3.0至0.4.4的比较端点来自各npm版本的gitHead;0.2系列引用对应实现提交,不能替代当时没有保存的正式发布产物。早期日期沿用历史版本记录。今后版本应按发布流程建立稳定引用。
148
173
 
149
- [Unreleased]: https://github.com/takboo/dsh-usage-state/compare/v0.4.9...HEAD
174
+ [Unreleased]: https://github.com/takboo/dsh-usage-state/compare/v0.4.11...HEAD
175
+ [0.4.11]: https://github.com/takboo/dsh-usage-state/compare/v0.4.10...v0.4.11
176
+ [0.4.10]: https://github.com/takboo/dsh-usage-state/compare/v0.4.9...v0.4.10
150
177
  [0.4.9]: https://github.com/takboo/dsh-usage-state/compare/v0.4.8...v0.4.9
151
178
  [0.4.8]: https://github.com/takboo/dsh-usage-state/compare/v0.4.7...v0.4.8
152
179
  [0.4.7]: https://github.com/takboo/dsh-usage-state/compare/v0.4.6...v0.4.7
package/README.en.md CHANGED
@@ -1,10 +1,10 @@
1
- # dsh-usage-state
1
+ # Balance & Quota (dsh-usage-state)
2
2
 
3
3
  [中文](README.md) | **English**
4
4
 
5
5
  [![CI](https://github.com/takboo/dsh-usage-state/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/takboo/dsh-usage-state/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/dsh-usage-state)](https://www.npmjs.com/package/dsh-usage-state)
6
6
 
7
- > **0.4.9** adds DeepSeek Harness account sign-in balances, separate from API Key queries. See the [GitHub Release](https://github.com/takboo/dsh-usage-state/releases/tag/v0.4.9) for the tarball and checksum and the [Changelog](CHANGELOG.md#049---2026-10-23) for details.
7
+ > **0.4.11** adds localized “Balance & Quota” names and descriptions in plugin management and settings, and verifies DSH **0.2.1-rc.5** in an isolated Web host and contract tests. See the [GitHub Release](https://github.com/takboo/dsh-usage-state/releases/tag/v0.4.11) for the tarball and checksum and the [Changelog](CHANGELOG.md#0411---2026-10-30) for details.
8
8
 
9
9
  Show the current model provider's **account balance** or **coding-plan quota** above the composer input in [DSH (DeepSeek Harness)](https://github.com/deepseek-ai/deepseek-harness). The line matches the input card's width and preserves the native statistics and context meter.
10
10
 
@@ -23,7 +23,7 @@ DeepSeek · ¥58.13
23
23
 
24
24
  ## Install
25
25
 
26
- Requires DSH matching `^0.2.0-rc.2 || ^0.2.1-rc.1` (verified on 0.2.0-rc.2, 0.2.1-rc.1, and 0.2.1-rc.2). The prebuilt plugin declares Node ≥20. Install into the `web` profile you actually use.
26
+ Requires DSH matching `^0.2.0-rc.2 || ^0.2.1-rc.1` (verified on 0.2.0-rc.2 and 0.2.1-rc.1/rc.2/rc.3/rc.5). The prebuilt plugin declares Node ≥20. Install into the `web` profile you actually use.
27
27
 
28
28
  Install from npm:
29
29
 
@@ -40,13 +40,13 @@ dsh plugin --profile web add github:takboo/dsh-usage-state
40
40
 
41
41
  This repository commits prebuilt artifacts for DSH's GitHub installation path. A floating Git branch may be ahead of npm; record the source and version/commit when reproducing an issue. This does not describe every npm Git installation's lifecycle.
42
42
 
43
- You can also search for `usage state` or `takboo` in [dsh-market](https://github.com/dsh-market/dsh-market); check the actual installation source and version afterwards. The plugin is on the [curated list](https://awesome-dsh-plugin.com); catalog visibility depends on the selected region and a successful catalog build.
43
+ You can also search for `Balance & Quota`, `dsh-usage-state` or `takboo` in [dsh-market](https://github.com/dsh-market/dsh-market); check the actual installation source and version afterwards. The plugin is on the [curated list](https://awesome-dsh-plugin.com); catalog visibility depends on the selected region and a successful catalog build.
44
44
 
45
45
  Use historical version 0.3.2 on DSH 0.1; it does not work on 0.2. Version 0.4.0 has a broken RPC mount, so upgrade to the **latest compatible release**. See the [Changelog](CHANGELOG.md) for version history.
46
46
 
47
47
  ## Quick start
48
48
 
49
- 1. Open **Settings → Usage state** to inspect providers, models and the detected source.
49
+ 1. Open **Settings → Balance & Quota** to inspect providers, models and the detected source.
50
50
  2. Keep Auto for recognized providers, or choose a supported API Key balance, Account balance, Coding Plan or Hidden option.
51
51
  3. Set your instance URL for a self-hosted Sub2API source. The current model's reading appears above the input.
52
52
  4. Use Refresh now for an explicit query. Check the settings error and the [troubleshooting guide (Chinese)](https://github.com/takboo/dsh-usage-state/blob/main/docs/troubleshooting.md) if it fails.
@@ -86,7 +86,7 @@ Provider settings and advanced controls:
86
86
 
87
87
  The host schedules refreshes 2 seconds after a turn ends and has a 5-minute fallback timer. The browser reads the RPC mirror every 30 seconds. Ordinary polling initializes a missing or changed account identity, otherwise it does not shorten idle queries to once a minute. Successful requests have a default 60-second minimum; explicit refresh can bypass it, and active retries after failure are not throttled by that successful-request interval. Editing the idle interval reschedules the timer.
88
88
 
89
- The plugin queries balances/quotas and reads the selected model and provider catalog. It writes no session logs and reports no readings to third parties. The host does not return stored key values to the browser; a key the user actively pastes is sent through DSH's credential service to the credential file in the selected home. Credential precedence follows the host: DSH 0.2.1-rc.1/rc.2 Web/Desktop prefers saved credentials, with environment values as fallback; 0.2.0-rc.2 prefers the environment. The settings page reflects the host’s actual write permissions.
89
+ The plugin queries balances/quotas and reads the selected model and provider catalog. It writes no session logs and reports no readings to third parties. The host does not return stored key values to the browser; a key the user actively pastes is sent through DSH's credential service to the credential file in the selected home. Credential precedence follows the host: DSH 0.2.1-rc.1/rc.2/rc.3 Web/Desktop prefers saved credentials, with environment values as fallback; 0.2.0-rc.2 prefers the environment. The settings page reflects the host’s actual write permissions.
90
90
 
91
91
  ## Known limitations
92
92
 
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # dsh-usage-state
1
+ # 余额与额度(dsh-usage-state)
2
2
 
3
3
  **中文** | [English](README.en.md)
4
4
 
5
5
  [![CI](https://github.com/takboo/dsh-usage-state/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/takboo/dsh-usage-state/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/dsh-usage-state)](https://www.npmjs.com/package/dsh-usage-state)
6
6
 
7
- > **0.4.9** 新增 DeepSeek Harness 账号登录余额,与 API Key 查询独立。安装包及校验文件见 [GitHub Release](https://github.com/takboo/dsh-usage-state/releases/tag/v0.4.9),详情见 [更新日志](CHANGELOG.md#049---2026-10-23)。
7
+ > **0.4.11** 在插件管理与设置中以“余额与额度 / Balance & Quota”展示,并提供双语说明。已完成 DSH **0.2.1-rc.5** 隔离 Web 与契约复验。安装包及校验文件见 [GitHub Release](https://github.com/takboo/dsh-usage-state/releases/tag/v0.4.11),详情见 [更新日志](CHANGELOG.md#0411---2026-10-30)。
8
8
 
9
9
  在 [DSH(DeepSeek Harness)](https://github.com/deepseek-ai/deepseek-harness) 输入框上方显示当前模型供应商的**账户余额**或**套餐额度**。状态行与输入卡片同宽,保留原生统计行和上下文计量器。
10
10
 
@@ -23,7 +23,7 @@ DeepSeek · ¥58.13
23
23
 
24
24
  ## 安装
25
25
 
26
- 要求:DSH版本满足 `^0.2.0-rc.2 || ^0.2.1-rc.1`(已验证0.2.0-rc.2、0.2.1-rc.1和0.2.1-rc.2),运行预构建插件声明Node≥20,安装到正在使用的 `web` profile。
26
+ 要求:DSH版本满足 `^0.2.0-rc.2 || ^0.2.1-rc.1`(已验证0.2.0-rc.2及0.2.1-rc.1/rc.2/rc.3/rc.5),运行预构建插件声明Node≥20,安装到正在使用的 `web` profile。
27
27
 
28
28
  从npm安装:
29
29
 
@@ -40,13 +40,13 @@ dsh plugin --profile web add github:takboo/dsh-usage-state
40
40
 
41
41
  本仓库提交预构建产物,供DSH的GitHub安装路径直接使用。浮动GitHub分支可能领先于npm;复现问题时记录安装来源和版本/提交。不要把这一行为推广到所有npm Git安装。
42
42
 
43
- 也可通过 [dsh-market](https://github.com/dsh-market/dsh-market) 搜索 `usage state` 或 `takboo` 安装;安装后核对实际来源与版本。本插件已进入 [精选列表](https://awesome-dsh-plugin.com);目录更新的可见时间取决于所用区域与成功构建。
43
+ 也可通过 [dsh-market](https://github.com/dsh-market/dsh-market) 搜索 `余额与额度`、`Balance & Quota`、`dsh-usage-state` 或 `takboo` 安装;安装后核对实际来源与版本。本插件已进入 [精选列表](https://awesome-dsh-plugin.com);目录更新的可见时间取决于所用区域与成功构建。
44
44
 
45
45
  DSH0.1使用历史版本0.3.2;该版本不适配0.2。0.4.0有RPC挂载缺陷,应升级至**最新兼容版**。完整版本记录见 [更新日志](CHANGELOG.md)。
46
46
 
47
47
  ## 快速开始
48
48
 
49
- 1. 打开 **设置→用量状态**,查看供应商、模型和检测到的数据源。
49
+ 1. 打开 **设置→余额与额度**,查看供应商、模型和检测到的数据源。
50
50
  2. 对已识别供应商保留“自动”,或选择其支持的API Key余额、账号余额、Coding Plan、隐藏。
51
51
  3. 自建Sub2API在高级区填写实例地址;已配置模型的当前读数显示在输入框上方。
52
52
  4. “立即刷新”用于主动查询;出错先查看设置页原因及 [排查指南](https://github.com/takboo/dsh-usage-state/blob/main/docs/troubleshooting.md)。
@@ -86,7 +86,7 @@ OpenCode Zen Go三个窗口,独立状态行位于输入框上方:
86
86
 
87
87
  宿主默认在回合结束2秒后调度刷新,并有5分钟兜底定时器;浏览器每30秒拉取RPC镜像。普通轮询仅在读数缺失或有效身份变化时初始化查询,不把idle查询改成每分钟一次。成功请求的默认最小间隔为60秒,显式刷新可绕过,失败的主动重试不受该成功间隔限制;修改空闲间隔会重调定时器。
88
88
 
89
- 插件查询余额/额度并读取当前模型及供应商目录,不写会话日志,也不向第三方上报这些读数。宿主不把已保存的密钥值返回浏览器;用户主动粘贴的草稿经DSH凭据服务写入所用home的凭据文件。凭据优先级跟随宿主:DSH 0.2.1-rc.1/rc.2 的 Web/桌面端优先使用已保存凭据,环境变量作为回退;0.2.0-rc.2 则优先使用环境变量。凭据权限以设置页实际返回为准。
89
+ 插件查询余额/额度并读取当前模型及供应商目录,不写会话日志,也不向第三方上报这些读数。宿主不把已保存的密钥值返回浏览器;用户主动粘贴的草稿经DSH凭据服务写入所用home的凭据文件。凭据优先级跟随宿主:DSH 0.2.1-rc.1/rc.2/rc.3 的 Web/桌面端优先使用已保存凭据,环境变量作为回退;0.2.0-rc.2 则优先使用环境变量。凭据权限以设置页实际返回为准。
90
90
 
91
91
  ## 已知限制
92
92
 
package/lib/client.js CHANGED
@@ -1585,8 +1585,8 @@ window.__ModuleLoader__.load({
1585
1585
  //#region src/client/locales.ts
1586
1586
  const LOCALE_NS = "usage-state";
1587
1587
  const zh = {
1588
- nav: "用量状态",
1589
- title: "用量状态",
1588
+ nav: "余额与额度",
1589
+ title: "余额与额度",
1590
1590
  intro: "为每个供应商选择显示账户余额(账号登录或 API Key 模式)或套餐额度(Coding Plan 模式)。数据由宿主定时刷新,密钥交给 DSH 凭据库保存,本插件不另存明文。",
1591
1591
  refreshNow: "立即刷新",
1592
1592
  refreshing: "刷新中…",
@@ -1668,8 +1668,8 @@ window.__ModuleLoader__.load({
1668
1668
  "window.month-code": "编程月用量"
1669
1669
  };
1670
1670
  const en = {
1671
- nav: "Usage state",
1672
- title: "Usage state",
1671
+ nav: "Balance & Quota",
1672
+ title: "Balance & Quota",
1673
1673
  intro: "Choose what to show for each provider: account balance (account sign-in or API Key mode) or coding-plan quota (Coding Plan mode). The host owns refresh timing, and DSH stores credentials — this plugin keeps no separate plaintext copy.",
1674
1674
  refreshNow: "Refresh now",
1675
1675
  refreshing: "Refreshing…",
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Balance & Quota",
4
+ "description": "Shows the current provider's account balance or coding-plan quota above the composer, with usage percentages and reset countdowns."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "余额与额度",
4
+ "description": "在输入框上方查看当前模型供应商的账户余额或套餐额度,显示已用比例和重置倒计时。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "dsh-usage-state",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "packageManager": "npm@11.19.1",
5
5
  "type": "module",
6
- "description": "DSH plugin: show account sign-in or API key balances and coding-plan quotas for the model in use",
6
+ "description": "Shows the current provider's account balance or coding-plan quota above the composer, with usage percentages and reset countdowns.",
7
7
  "license": "MIT",
8
8
  "engines": {
9
9
  "node": ">=20",
@@ -32,7 +32,9 @@
32
32
  "./typert": {
33
33
  "default": "./lib/typert.js"
34
34
  },
35
- "./package.json": "./package.json"
35
+ "./package.json": "./package.json",
36
+ "./locale/en.json": "./locale/en.json",
37
+ "./locale/zh.json": "./locale/zh.json"
36
38
  },
37
39
  "devDependencies": {
38
40
  "@deepseek-ai/cordis": "^4.0.4",
@@ -84,7 +86,9 @@
84
86
  "README.en.md",
85
87
  "LICENSE",
86
88
  "CHANGELOG.md",
87
- "docs/adapters.md"
89
+ "docs/adapters.md",
90
+ "locale/en.json",
91
+ "locale/zh.json"
88
92
  ],
89
93
  "keywords": [
90
94
  "deepseek",