dsh-multi-router 0.5.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。版本号从 `0.1` 起以功能迭代为主,接口在 `1.0` 前可能变化。
4
4
 
5
+ ## 0.5.1
6
+
7
+ - GitHub 插件更新检查只请求提交 SHA,不再下载完整提交差异,修复构建产物较大时「更新元数据过大」导致无法检查的问题。
8
+ - 增加 SHA 响应格式与异常响应回归验证。
9
+
5
10
  ## 0.5.0
6
11
 
7
12
  - 新增「积分签到」面板:接入 Trae CN 与 Qoder 签到,显示账号结果与奖励,支持手动领取、批量领取及按账号选择每日自动签到(默认关闭)。
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  一个插件内置 WorkBuddy、Trae、Qoder 的认证、模型发现和聊天传输,提供三家的多账号池及集中路由。运行不依赖原来三个 DSH 插件;三家代码随安装包一起打包。基于 MIT 上游,固定版本见 `upstream-lock.json`,许可见 `THIRD_PARTY_NOTICES.md`。
8
8
 
9
- 版本:0.5.0。适配 DSH Desktop / Web 0.2.0-rc.2,Node.js ^22.19.0 或 >=24。
9
+ 版本:0.5.1。适配 DSH Desktop / Web 0.2.0-rc.2,Node.js ^22.19.0 或 >=24。
10
10
 
11
11
  ## 在 DSH 里管理
12
12
 
@@ -135,7 +135,7 @@ dsh plugin --profile desktop add dsh-multi-router
135
135
  dsh plugin --profile web add dsh-multi-router
136
136
  ```
137
137
 
138
- 包地址:[dsh-multi-router · npm](https://www.npmjs.com/package/dsh-multi-router)。正式版本由 GitHub Release 自动测试、打包并发布到 npm `latest`,包中已包含编译产物,用户无需自行构建。需要固定版本时可安装 `dsh-multi-router@0.5.0`。
138
+ 包地址:[dsh-multi-router · npm](https://www.npmjs.com/package/dsh-multi-router)。正式版本由 GitHub Release 自动测试、打包并发布到 npm `latest`,包中已包含编译产物,用户无需自行构建。需要固定版本时可安装 `dsh-multi-router@0.5.1`。
139
139
 
140
140
  已使用 npm 来源的用户更新:
141
141
 
@@ -192,7 +192,7 @@ cd dsh-multi-router
192
192
  npm ci
193
193
  npm run check
194
194
  npm run pack:release
195
- dsh plugin --profile desktop add ./dsh-multi-router-0.5.0.tgz
195
+ dsh plugin --profile desktop add ./dsh-multi-router-0.5.1.tgz
196
196
  ```
197
197
 
198
198
  ### 配置账号
@@ -34,7 +34,7 @@ import {
34
34
  import { createHash as createHash2, randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
35
35
 
36
36
  // package.json
37
- var version = "0.5.0";
37
+ var version = "0.5.1";
38
38
 
39
39
  // src/manager.mjs
40
40
  import { readFile as readFile3, mkdir as mkdir2, mkdtemp as mkdtemp2, rm as rm3 } from "node:fs/promises";
@@ -335,7 +335,8 @@ async function locks(dir) {
335
335
  async function publicJson(url, fetchImpl, signal) {
336
336
  const res = await fetchImpl(url, {
337
337
  signal: AbortSignal.any([signal, AbortSignal.timeout(12e3)]),
338
- headers: { Accept: "application/json", "User-Agent": "dsh-multi-router-plugin-updates" },
338
+ // Request only the SHA: the default JSON includes file patches and can be megabytes.
339
+ headers: { Accept: "application/vnd.github.sha", "User-Agent": "dsh-multi-router-plugin-updates" },
339
340
  redirect: "error"
340
341
  });
341
342
  if (!res.ok) throw Error(res.status === 403 || res.status === 429 ? "\u8FDC\u7AEF\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" : res.status === 404 ? "\u4ED3\u5E93 / \u7248\u672C\u4E0D\u5B58\u5728\uFF0C\u6216\u9700\u8981\u79C1\u6709\u4ED3\u5E93\u6388\u6743" : `\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${res.status}\uFF09`);
@@ -345,7 +346,8 @@ async function publicJson(url, fetchImpl, signal) {
345
346
  if (size > 256 * 1024) throw Error("\u66F4\u65B0\u5143\u6570\u636E\u8FC7\u5927");
346
347
  chunks.push(Buffer.from(chunk));
347
348
  }
348
- return JSON.parse(Buffer.concat(chunks).toString("utf8"));
349
+ const text = Buffer.concat(chunks).toString("utf8").trim();
350
+ return /^[a-f0-9]{40}$/i.test(text) ? { sha: text } : JSON.parse(text);
349
351
  }
350
352
  var short = (sha) => sha?.slice(0, 8);
351
353
  async function registryVersion(service, profile, spec, signal) {
@@ -1610,4 +1612,4 @@ export {
1610
1612
  Manager,
1611
1613
  managementHandler
1612
1614
  };
1613
- //# sourceMappingURL=chunk-W5WP4ATM.js.map
1615
+ //# sourceMappingURL=chunk-C6JBDATB.js.map