@sligqoer/dsh-usage-stats 0.2.2 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # 更新日志 / Changelog
2
2
 
3
+ ## 0.2.3 - 2026-10-16
4
+
5
+ <a id="v023-zh"></a>
6
+ **简体中文** · [English](#v023-en)
7
+
8
+ ### 🐛 问题修复
9
+
10
+ - 适配 DSH Desktop 0.2.0-rc.2 的桌面渲染器标记:preload 桥 `dshDesktop` 只暴露 `protocolVersion`,不再提供 `deviceInfo` 函数。「用量统计」设置页此前因此不注册,现在新旧两种标记都接受,纯浏览器访问仍保持不挂载。`0.2.1-alpha.2` 与 `0.2.0-rc.2` 两个宿主版本均受支持。
11
+
12
+ <a id="v023-en"></a>
13
+ **English** · [简体中文](#v023-zh)
14
+
15
+ ### 🐛 Bug Fixes
16
+
17
+ - Adapt to the DSH Desktop 0.2.0-rc.2 renderer marker: the `dshDesktop` preload bridge exposes only `protocolVersion` and no longer carries a `deviceInfo` function. The usage statistics settings page failed to register because of this; both markers are now accepted, while plain browser tabs still never mount. Both `0.2.1-alpha.2` and `0.2.0-rc.2` hosts remain supported.
18
+
3
19
  ## 0.2.2 - 2026-10-16
4
20
 
5
21
  <a id="v022-zh"></a>
package/README.en.md CHANGED
@@ -74,7 +74,7 @@ Detection compares random-number samples with a reference library. Rankings and
74
74
 
75
75
  ## Installation
76
76
 
77
- Plugin version **0.2.2** requires **DSH Desktop `0.2.1-alpha.2` or `0.2.0-rc.2`**. The host plugin manager rejects installation or activation on a mismatched runtime.
77
+ Plugin version **0.2.3** requires **DSH Desktop `0.2.1-alpha.2` or `0.2.0-rc.2`**. The host plugin manager rejects installation or activation on a mismatched runtime.
78
78
 
79
79
  **Recommended: install the [npm package `@sligqoer/dsh-usage-stats`](https://www.npmjs.com/package/@sligqoer/dsh-usage-stats) through DSH Desktop.** It includes prebuilt modules, needs no Git checkout or local build, and supports Check updates when installed by package name.
80
80
 
package/README.md CHANGED
@@ -74,7 +74,7 @@
74
74
 
75
75
  ## 安装
76
76
 
77
- 当前插件版本为 **0.2.2**,适配 **DSH Desktop `0.2.1-alpha.2` 和 `0.2.0-rc.2`**。版本不匹配时,宿主插件管理器会拒绝安装或启用。
77
+ 当前插件版本为 **0.2.3**,适配 **DSH Desktop `0.2.1-alpha.2` 和 `0.2.0-rc.2`**。版本不匹配时,宿主插件管理器会拒绝安装或启用。
78
78
 
79
79
  **推荐通过 DSH Desktop 安装 [npm 包 `@sligqoer/dsh-usage-stats`](https://www.npmjs.com/package/@sligqoer/dsh-usage-stats)。** 已包含预构建模块,无需克隆仓库或在本机构建;通过包名安装后可使用插件页的「检查更新」。
80
80
 
package/lib/client.js CHANGED
@@ -8,7 +8,7 @@ var SECTION_ID = 'usage-stats'
8
8
 
9
9
  var STYLE_ID = 'dsh-usage-stats-styles'
10
10
 
11
- var PLUGIN_VERSION = "0.2.2"
11
+ var PLUGIN_VERSION = "0.2.3"
12
12
 
13
13
  var localeService = null
14
14
 
@@ -5477,7 +5477,14 @@ function registerLocale(ctx) {
5477
5477
  }
5478
5478
 
5479
5479
  function apply(ctx) {
5480
- if (!window.dshDesktop || typeof window.dshDesktop.deviceInfo !== 'function') return
5480
+ // DSH Desktop marks its renderer through the preload bridge dshDesktop.
5481
+ // 0.2.0-rc.2 exposes only { protocolVersion: 1 }; older builds carried a
5482
+ // deviceInfo() function. Accept either marker so the settings section
5483
+ // registers on both, while plain browser tabs (no bridge) still bail out.
5484
+ if (typeof window === 'undefined' || !window.dshDesktop) return
5485
+ var hasDeviceInfo = typeof window.dshDesktop.deviceInfo === 'function'
5486
+ var hasProtocolVersion = typeof window.dshDesktop.protocolVersion === 'number'
5487
+ if (!hasDeviceInfo && !hasProtocolVersion) return
5481
5488
  var slots = ctx.get('slots'); if (!slots) return
5482
5489
  registerLocale(ctx)
5483
5490
  var api = new UsageApi()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sligqoer/dsh-usage-stats",
3
3
  "description": "DSH Desktop 的用量统计、供应商配额、模型检测与控制插件。",
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",