@dsh-plugins/dsh-llm-hub 1.7.0 → 1.9.0
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 +47 -0
- package/README.en.md +6 -2
- package/README.md +11 -6
- package/lib/client.js +180 -703
- package/lib/index.js +110 -56
- package/package.json +6 -3
- package/scripts/gate-lib.mjs +38 -0
- package/scripts/prepublish-gate.mjs +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.9.0] - 2026-10-10
|
|
6
|
+
|
|
7
|
+
### 🚀 下线智能路由配置界面,替换为只读用量/模型展示 Chip,修复可用模型统计 Bug
|
|
8
|
+
|
|
9
|
+
- **下线智能路由配置界面与切换浮层**:
|
|
10
|
+
- 移除设置页左侧独立的「路由」配置分区(原 `RoutingCard` / `RoutingSection`,包含分组编辑、主力与兜底模型设定、排序与自动保存);
|
|
11
|
+
- 移除输入框左侧原本可点击切换「公司 / 个人」分组和智能开关的 `SmartRouteChip` 浮层菜单;
|
|
12
|
+
- 替换为只读状态信息位 **`ProviderUsageChip`**,展示当前供应商 · 模型 · 可用数 · 配额 · 用量,点击仅查看只读详情,模型切换统一回归上方主模型下拉。
|
|
13
|
+
- **修复 Hero 看板可用模型数显示为破折号的 Bug 并去重**:
|
|
14
|
+
- 后端在全量探测状态快照 `baseVerdicts` 中补齐已配可用 provider 的 `modelIds` 与 `modelCount`;
|
|
15
|
+
- 前端顶部 Hero KPI 卡片在聚合可用模型数时,对所有健康可用供应商下的同名模型做跨供应商 `Set` 去重,解决重复计数并正确渲染真实模型数。
|
|
16
|
+
- **功能与稳定性增强**:
|
|
17
|
+
- 智能提取实际有余额的币种(避免因 USD:0 导致多币种账户显示为 0);
|
|
18
|
+
- DeepSeek 单 Key 模式下提供轮转引导,多 Key 模式下展示实时余额与脱敏状态 chips;
|
|
19
|
+
- 补回丢失的外部子代理注入调用,恢复本地 Harness(Codex / Claude / Antigravity)自动探测与注册。
|
|
20
|
+
|
|
21
|
+
## [1.8.0] - 2026-09-29
|
|
22
|
+
|
|
23
|
+
### 🔧 适配 DSH 0.1.7 的 settings 架构(升级到 0.1.7 后配置读不到的那版)
|
|
24
|
+
|
|
25
|
+
**症状**:升到 DSH 0.1.7 后,路由组「凭空消失」—— chip 不渲染,设置页路由卡是空的,
|
|
26
|
+
写接口一律拒绝。数据其实好好躺在配置里,只是没人读。
|
|
27
|
+
|
|
28
|
+
**根因**:0.1.7 把 settings 架构整个换掉了。`settings.register(ns, schema)` 和
|
|
29
|
+
`settings.get(ns)` 双双消失(0.1.5 的 `dsh-settings` 里有 20 处 `register` 引用,
|
|
30
|
+
0.1.7 是 0 处)。老代码里 `settings.register(...)` 抛 `TypeError` 被 catch 吞掉,
|
|
31
|
+
`hubRegistered` 恒为 false,于是整个 `dsh-llm-hub` 段的读写全部短路。
|
|
32
|
+
|
|
33
|
+
**改造**
|
|
34
|
+
- 导出 `Config`,配置改由 `apply(ctx, config)` 注入(0.1.7 的官方姿势,
|
|
35
|
+
`@deepseek-ai/dsh-llm-pi-ai` 的 providers 段同款)
|
|
36
|
+
- 读自己的段走 `config.routing.get()`;读**别人**的段(`llm-pi-ai` / `llm-deepseek`)
|
|
37
|
+
走 `settings.describe()` —— 0.1.7 里那是唯一的跨插件读法
|
|
38
|
+
- 拆掉 `hubRegistered` 守卫(该概念已不存在)
|
|
39
|
+
- 三个字段全部标 `.volatile()`:`settings.update()` 拒绝「没有 volatile 字段的条目」
|
|
40
|
+
(原话:`Plugin entry "dsh-llm-hub" has no volatile fields`),而 volatile 的语义
|
|
41
|
+
正是本插件要的 —— 路由组/预警/别名都是每次请求惰性重读的,切一次路由不该重跑 apply
|
|
42
|
+
- `@deepseek-ai/schemastery` 加为 **devDependency**(静态 import 需要它才能加载;
|
|
43
|
+
运行时依赖仍是零 —— 它由 DSH 宿主提供)
|
|
44
|
+
|
|
45
|
+
**配置迁移**:0.1.7 启动时把全局 `settings.yaml` 迁进 profile 的 `cordis.patch.yml`
|
|
46
|
+
并把原文件改名为 `settings.yaml.imported`。本插件的段需要一条 `dsh-llm-hub` entry;
|
|
47
|
+
未迁移时该段读为空,也就是上面那个症状。
|
|
48
|
+
|
|
49
|
+
**验证**:157 个单测 + 门禁全过;真机确认路由组、设置页路由卡、跨插件读(balance 能
|
|
50
|
+
解析出真实 key)、写路径(`routing/select` 200)全部恢复。
|
|
51
|
+
|
|
5
52
|
## [1.7.0] - 2026-09-29
|
|
6
53
|
|
|
7
54
|
### 🧭 路由设置卡:始终折叠,展开才编辑
|
package/README.en.md
CHANGED
|
@@ -30,10 +30,14 @@ On DSH's Models page, the official adapters leave half the job undone. This plug
|
|
|
30
30
|
> Only Node.js is required — **no global dsh install**; upstream's official entry is `npx @deepseek-ai/dsh`. If dsh is installed globally, use `dsh` instead.
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
|
-
npx @deepseek-ai/dsh plugin --profile
|
|
33
|
+
npx @deepseek-ai/dsh plugin --profile <your-profile> add @dsh-plugins/dsh-llm-hub
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
> **Desktop app users**: the official Electron app owns the `desktop` profile exclusively — the CLI
|
|
37
|
+
> refuses plugin operations on it (`profile "desktop" is managed exclusively by the Electron application`).
|
|
38
|
+
> Install and update from the plugin manager inside the app; the CLI form above is for self-managed profiles.
|
|
39
|
+
|
|
40
|
+
Add `@dsh-plugins/dsh-llm-hub` to `dsh.profile.bundles` in `~/.dsh/profiles/<your-profile>/package.json`, then restart the DSH desktop app (quit and reopen it).
|
|
37
41
|
Open **Settings → Models** — a new row appears under the provider cards.
|
|
38
42
|
|
|
39
43
|
<sub>A boot-graph change requires a restart; hot reload won't pick it up. `cordis.patch.yml` is inserted automatically by the bundle mechanism.</sub>
|
package/README.md
CHANGED
|
@@ -48,11 +48,10 @@ DSH 的模型页上,官方适配器有一半事情没做。这个插件把它
|
|
|
48
48
|
> 前提:装好 Node.js 即可,**无需全局安装 dsh** —— 官方入口就是 `npx @deepseek-ai/dsh`。已全局安装的可把它换成 `dsh`。
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
|
-
npx @deepseek-ai/dsh plugin --profile
|
|
51
|
+
npx @deepseek-ai/dsh plugin --profile <你的 profile> add @dsh-plugins/dsh-llm-hub
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
再把 `@dsh-plugins/dsh-llm-hub`
|
|
55
|
-
然后重启 DSH(结束当前进程后重新运行 `npx @deepseek-ai/dsh web`)。打开**设置 → 模型**,provider 卡片下方会多出一行。
|
|
54
|
+
再把 `@dsh-plugins/dsh-llm-hub` 加进该 profile 的 `package.json` 的 `dsh.profile.bundles` 数组,然后重启 DSH。打开**设置 → 模型**,provider 卡片下方会多出一行。
|
|
56
55
|
|
|
57
56
|
<sub>boot graph 变了必须重启,热载不生效;`cordis.patch.yml` 由 bundle 机制自动 insert。</sub>
|
|
58
57
|
|
|
@@ -84,7 +83,7 @@ npx @deepseek-ai/dsh plugin --profile web add @dsh-plugins/dsh-llm-hub
|
|
|
84
83
|
升级:
|
|
85
84
|
|
|
86
85
|
```sh
|
|
87
|
-
npx @deepseek-ai/dsh plugin --profile
|
|
86
|
+
npx @deepseek-ai/dsh plugin --profile <你的 profile> update @dsh-plugins/dsh-llm-hub@^1.5.1
|
|
88
87
|
# 重启 DSH
|
|
89
88
|
```
|
|
90
89
|
|
|
@@ -499,12 +498,18 @@ publish。Release 的存在性单独探测,所以「npm 发成功但 Release
|
|
|
499
498
|
<a href="https://github.com/webkubor/dsh-env-inspector">🖥️ 电脑环境</a>
|
|
500
499
|
</p>
|
|
501
500
|
|
|
502
|
-
一行装齐(只需 Node.js),装完重启 DSH
|
|
501
|
+
一行装齐(只需 Node.js),装完重启 DSH 即可。**把 `PROFILE` 换成你自己的 profile 名**:
|
|
503
502
|
|
|
504
503
|
```bash
|
|
505
|
-
|
|
504
|
+
PROFILE=<你的 profile>
|
|
505
|
+
npx -y @deepseek-ai/dsh plugin --profile "$PROFILE" add dsh-bloom-theme @dsh-plugins/dsh-llm-hub @dsh-plugins/dsh-user-mirror @dsh-plugins/dsh-env-inspector && PROFILE="$PROFILE" node -e 'const f=(process.env.DSH_HOME||require("os").homedir()+"/.dsh")+"/profiles/"+process.env.PROFILE+"/package.json",p=require(f),b=p.dsh.profile.bundles;for(const n of Object.keys(p.dependencies))if(/^(dsh-bloom-theme|@dsh-plugins\/)/.test(n)&&!b.includes(n))b.push(n);require("fs").writeFileSync(f,JSON.stringify(p,null,2)+"\n")'
|
|
506
506
|
```
|
|
507
507
|
|
|
508
|
+
> **桌面端用户**:官方 Electron 端独占 `desktop` profile,命令行对它做插件操作会被拒
|
|
509
|
+
> (`profile "desktop" is managed exclusively by the Electron application`)——
|
|
510
|
+
> 请在应用内的**插件管理**里安装与升级。下面的 CLI 写法只适用于自建 profile。
|
|
511
|
+
|
|
512
|
+
|
|
508
513
|
---
|
|
509
514
|
|
|
510
515
|
## License
|