dsh-model-switch 0.4.70 → 0.4.71

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,3 +1,12 @@
1
+ ## v0.4.71
2
+
3
+ 修复设置页供应商下拉中 DVR 孪生路由仍与基座成对出现的问题(桌面 0.4.70 实测截图报告)。
4
+
5
+ - **根因**:0.4.69 的孪生去重只加在分组编辑器**顶层**的供应商下拉(`groupProviderChoices`),而设置页其余全部供应商下拉——识图/记忆/压缩/命名/审查各能力卡的提供商下拉,以及**分组编辑器内每一行**(压缩/审查/命名/记忆/识图/子代理)的提供商下拉——都直接走共享构建器 `deriveRouteChoices`,原样列出目录中的 DVR 孪生(显示名「某某 + 自动识图」,id `<base>-vision`)。
6
+ - **修复(`src/client/main-row-controller.ts`)**:去重下沉到 `deriveRouteChoices`——构建列表后隐藏「id 以 `-vision` 结尾、基座 id 也在列表中、且不是当前选中值」的条目,一次覆盖所有下拉。三条保护:孤儿孪生(基座不在列表)仍显示,存量配置可达;当前选中值永不隐藏,已存孪生 id 的路由保持可见可改;models 列表与 unavailable 回退不变。`groupProviderChoices` 的列表级过滤随之移除(已继承),保留「存储孪生键且基座也已配置则跳过」的兜底。
7
+ - **测试**:`tests/client-controller.spec.ts` 新增 `deriveRouteChoices` 孪生去重组(基座在列表时隐藏 / 孤儿与当前选中保留 / 存量孪生路由的 models 不丢);既有 `groupProviderChoices` 三例回归不变。注:`settings-ui` 规格对 `main-row-controller` 有 vi.mock,下拉内容以 client-controller 单测为准。
8
+ - **验证**:`pnpm run check` 全绿。本改动为客户端纯函数投影,不触运行面;0.4.70 的 lab 矩阵(适配行行为)不受影响。桌面升级 0.4.71 后,设置页全部供应商下拉不再出现「+ 自动识图」孪生条目。
9
+
1
10
  ## v0.4.70
2
11
 
3
12
  0.4.69 lab 实测两条遗留观察的插件侧改进(维护版):
package/lib/client.js CHANGED
@@ -1259,15 +1259,21 @@ window.__ModuleLoader__.load({
1259
1259
  }
1260
1260
  function deriveRouteChoices(groups, route, allowedProviders) {
1261
1261
  const allowed = allowedProviders === void 0 ? void 0 : new Set(allowedProviders);
1262
- const providers = groups.filter((group) => allowed === void 0 || allowed.has(group.id)).map((group) => ({
1262
+ const listed = groups.filter((group) => allowed === void 0 || allowed.has(group.id)).map((group) => ({
1263
1263
  id: group.id,
1264
1264
  name: group.name
1265
1265
  }));
1266
- if (route?.provider !== void 0 && !providers.some((option) => option.id === route.provider)) providers.push({
1266
+ if (route?.provider !== void 0 && !listed.some((option) => option.id === route.provider)) listed.push({
1267
1267
  id: route.provider,
1268
1268
  name: route.provider,
1269
1269
  unavailable: true
1270
1270
  });
1271
+ const ids = new Set(listed.map((choice) => choice.id));
1272
+ const providers = listed.filter((choice) => {
1273
+ if (choice.id === route?.provider) return true;
1274
+ const base = canonicalGroupProvider(choice.id);
1275
+ return base === choice.id || !ids.has(base);
1276
+ });
1271
1277
  const models = (groups.find((item) => item.id === route?.provider)?.models ?? []).map((model) => ({
1272
1278
  id: model.id,
1273
1279
  name: model.name
@@ -1298,13 +1304,7 @@ window.__ModuleLoader__.load({
1298
1304
  * @returns catalog choices first (original order), then the missing providers.
1299
1305
  */
1300
1306
  function groupProviderChoices(groups, configured, current) {
1301
- const listed = deriveRouteChoices(groups, current === void 0 || current.trim() === "" ? void 0 : { provider: current }).providers;
1302
- const ids = new Set(listed.map((choice) => choice.id));
1303
- const choices = listed.filter((choice) => {
1304
- if (choice.id === current) return true;
1305
- const base = canonicalGroupProvider(choice.id);
1306
- return base === choice.id || !ids.has(base);
1307
- });
1307
+ const choices = deriveRouteChoices(groups, current === void 0 || current.trim() === "" ? void 0 : { provider: current }).providers;
1308
1308
  const seen = new Set(choices.map((choice) => choice.id));
1309
1309
  for (const provider of configured) {
1310
1310
  if (provider.trim() === "" || seen.has(provider)) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-switch",
3
- "version": "0.4.70",
3
+ "version": "0.4.71",
4
4
  "description": "Explicit model routing plus composer/Plan picker for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",