dsh-multi-router 0.6.1 → 0.6.2

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,12 @@
2
2
 
3
3
  本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。版本号从 `0.1` 起以功能迭代为主,接口在 `1.0` 前可能变化。
4
4
 
5
+ ## 0.6.2
6
+
7
+ - 修复旧用户升级后缺少新预制路由:启用或热加载时自动补齐 Qwen3.8-Max、Qwen3.8-Flash 与 Hy4 Preview,更新后直接出现在路由列表与模型选择器,无需手动补齐或重启。
8
+ - 记录已处理的预配置;重复启用不重复写入,用户改名、隐藏、改规则及旧预设的删除选择保留。新增预设处理后再次删除,不会在下一次启动恢复。
9
+ - 预配置处理记录随配置迁移;合并保留两端记录。升级写入使用现有文件锁与原子保存,损坏配置不自动重置。
10
+
5
11
  ## 0.6.1
6
12
 
7
13
  - 保留三家模型的默认 / 最大上下文和可选档位,原始模型、预制路由及动态免费模型默认最大,不再统一限制 200K;旧隐式默认自动迁移,显式自定义预算保留。
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.6.1。适配 DSH Desktop / Web 0.2.0-rc.2,Node.js ^22.19.0 或 >=24。
9
+ 版本:0.6.2。适配 DSH Desktop / Web 0.2.0-rc.2,Node.js ^22.19.0 或 >=24。
10
10
 
11
11
  ## 在 DSH 里管理
12
12
 
@@ -331,6 +331,8 @@ Free 自动免费路由排在首位,以下普通预配置按表中渠道顺序
331
331
 
332
332
  路由内部 ID 是 DSH 查找路由所需的标识,由插件维护;用户在面板只配置路由名称。目标模型 ID 决定实际调用哪个模型。上表为预配置的稳定内部标识,新建路由自动生成独立标识。GLM-5.2 已移出预配置,原始渠道模型不受影响。
333
333
 
334
+ 从 v0.6.2 起,升级后的首次启用或热加载自动补齐新引入的预配置,无需重启或手动点击。首次迁移补齐 Qwen3.8-Max / Flash 与 Hy4 Preview,已有同 ID 路由的名称、显隐和规则保持原样,旧预设中已移除的路由不会恢复。已处理的预设会记录在配置中,此后主动删除也不会在启动时恢复;需要恢复时可在「添加预配置」手动添加。记录随配置导入导出迁移。
335
+
334
336
  ## Free 动态免费模型(0.3.6)
335
337
 
336
338
  预配置内置 free 管理组,名称「Free · 动态免费模型」,排在预配置与路由管理列表首位。按确切的渠道与模型 ID 自动创建各模型的免费路由,DSH 模型列表分别展示「Free · 模型名 · 渠道」,排在普通预配置前。同一渠道同一模型的多个免费账号归为一个路由,不按展示名称模糊合并版本,也不把不同模型混为一个池。原 free 内部标识仅为旧会话保留,默认不在选择器展示。
package/cordis.patch.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  - insert:
2
- - id: llm-multi-router-v2-0.6.1
3
- name: ./lib/host-v0.6.1.js
2
+ - id: llm-multi-router-v2-0.6.2
3
+ name: ./lib/host-v0.6.2.js
package/lib/accounts.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  localAccountKey,
5
5
  normalizeLocalAccountKey,
6
6
  readPortableCredential
7
- } from "./chunk-VZPXRK7Q.js";
7
+ } from "./chunk-KGVTRS5K.js";
8
8
  import "./chunk-OK2T2UAZ.js";
9
9
  import "./chunk-TEZ2FMEO.js";
10
10
  import "./chunk-S5KMFAQM.js";
11
- import "./chunk-NGVWVIBM.js";
11
+ import "./chunk-5R3IOPSF.js";
12
12
  export {
13
13
  discoverLocalAccounts,
14
14
  importAccount,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ApiService
3
- } from "./chunk-625KMEYS.js";
3
+ } from "./chunk-Q34JSMGN.js";
4
4
  import "./chunk-4V52V5GO.js";
5
5
  import "./chunk-DNQPZMPF.js";
6
- import "./chunk-DZ4ZUAYH.js";
7
- import "./chunk-NGVWVIBM.js";
6
+ import "./chunk-5KYJADJ4.js";
7
+ import "./chunk-5R3IOPSF.js";
8
8
  export {
9
9
  ApiService
10
10
  };
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-DNQPZMPF.js";
5
5
  import {
6
6
  RouteError
7
- } from "./chunk-DZ4ZUAYH.js";
7
+ } from "./chunk-5KYJADJ4.js";
8
8
  import {
9
9
  REASONING_EFFORTS
10
- } from "./chunk-NGVWVIBM.js";
10
+ } from "./chunk-5R3IOPSF.js";
11
11
 
12
12
  // src/shim.mjs
13
13
  import { createServer } from "node:http";
@@ -117,4 +117,4 @@ function createShim(router, { modelPrefix = "" } = {}) {
117
117
  export {
118
118
  createShim
119
119
  };
120
- //# sourceMappingURL=chunk-BSAI3SW5.js.map
120
+ //# sourceMappingURL=chunk-3O3L3526.js.map
@@ -6,20 +6,20 @@ import {
6
6
  refreshWorkBuddyCheckinCredential,
7
7
  supportsCheckin,
8
8
  workbuddyToken
9
- } from "./chunk-2LH6TD2U.js";
9
+ } from "./chunk-74WQLVJO.js";
10
10
  import {
11
11
  discoverLocalAccounts,
12
12
  importAccount,
13
13
  localAccountKey,
14
14
  normalizeLocalAccountKey,
15
15
  readPortableCredential
16
- } from "./chunk-VZPXRK7Q.js";
16
+ } from "./chunk-KGVTRS5K.js";
17
17
  import {
18
18
  modelWithCurrentPromotion
19
19
  } from "./chunk-TEZ2FMEO.js";
20
20
  import {
21
21
  ApiService
22
- } from "./chunk-625KMEYS.js";
22
+ } from "./chunk-Q34JSMGN.js";
23
23
  import {
24
24
  hostIsLoopback
25
25
  } from "./chunk-DNQPZMPF.js";
@@ -28,7 +28,7 @@ import {
28
28
  contextInfo,
29
29
  matchModel,
30
30
  resolveContext
31
- } from "./chunk-DZ4ZUAYH.js";
31
+ } from "./chunk-5KYJADJ4.js";
32
32
  import {
33
33
  PROVIDERS,
34
34
  PROVIDER_NAMES,
@@ -38,13 +38,13 @@ import {
38
38
  routeReasoning,
39
39
  validateConfig,
40
40
  writePrivateJson
41
- } from "./chunk-NGVWVIBM.js";
41
+ } from "./chunk-5R3IOPSF.js";
42
42
 
43
43
  // src/manager.mjs
44
44
  import { createHash, randomBytes as randomBytes3, timingSafeEqual } from "node:crypto";
45
45
 
46
46
  // package.json
47
- var version = "0.6.1";
47
+ var version = "0.6.2";
48
48
 
49
49
  // src/manager.mjs
50
50
  import { readFile as readFile4, mkdir as mkdir2, mkdtemp as mkdtemp2, rm as rm3 } from "node:fs/promises";
@@ -106,7 +106,7 @@ var derive = promisify(scrypt);
106
106
  var FORMAT = "dsh-multi-router";
107
107
  var MAX_BYTES = 512 * 1024;
108
108
  var pick = (value, keys) => Object.fromEntries(keys.filter((k) => Object.hasOwn(value ?? {}, k)).map((k) => [k, value[k]]));
109
- var options = ["cooldownMs", "requestTimeoutMs", "catalogTtlMs", "retryServerErrors", "modelVisibility", "usageRetentionDays", "checkinSchedule", "sidebarUsage"];
109
+ var options = ["cooldownMs", "requestTimeoutMs", "catalogTtlMs", "retryServerErrors", "modelVisibility", "usageRetentionDays", "checkinSchedule", "sidebarUsage", "seenRoutePresets"];
110
110
  function settings(config) {
111
111
  return {
112
112
  ...pick(config, options),
@@ -231,6 +231,7 @@ async function prepareMigration(manager, raw, portable, mode) {
231
231
  const next = mode === "replace" ? { ...portable.config, accounts: imported } : {
232
232
  ...raw,
233
233
  ...pick(portable.config, options),
234
+ ...raw.seenRoutePresets || portable.config.seenRoutePresets ? { seenRoutePresets: [.../* @__PURE__ */ new Set([...raw.seenRoutePresets ?? [], ...portable.config.seenRoutePresets ?? []])] } : {},
234
235
  accounts: [...raw.accounts.map((a) => imported.find((b) => b.id === a.id) ?? a), ...imported.filter((a) => !raw.accounts.some((b) => b.id === a.id))],
235
236
  routes: { ...raw.routes, ...portable.config.routes },
236
237
  models: Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(raw.models ?? {}), ...Object.keys(portable.config.models)])].map((p) => [p, { ...raw.models?.[p], ...portable.config.models[p] }]))
@@ -1888,6 +1889,7 @@ var Manager = class {
1888
1889
  if (["tokens", "credits"].includes(strategy)) await this.telemetry.advance(input.id, this.router.candidates(input.id), JSON.stringify({ strategy, targets: route.targets }));
1889
1890
  } else if (input.action === "route.remove") {
1890
1891
  if (!Object.hasOwn(raw.routes, input.id)) bad("\u8DEF\u7531\u4E0D\u5B58\u5728");
1892
+ if (Object.hasOwn(ROUTE_PRESETS, input.id)) raw.seenRoutePresets = [.../* @__PURE__ */ new Set([...raw.seenRoutePresets ?? [], input.id])];
1891
1893
  delete raw.routes[input.id];
1892
1894
  } else if (input.action === "preset.add") {
1893
1895
  const id = input.id ?? "deepseek-v4.1-flash";
@@ -2025,4 +2027,4 @@ export {
2025
2027
  Manager,
2026
2028
  managementHandler
2027
2029
  };
2028
- //# sourceMappingURL=chunk-ZQZSXCVR.js.map
2030
+ //# sourceMappingURL=chunk-4EO5V6FW.js.map