dsh-model-capability-sync 0.2.0 → 0.2.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 +11 -0
- package/README.md +56 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
Notable changes, newest first. The plugin follows semantic versioning: the
|
|
4
4
|
settings surface and the config it writes are the public contract.
|
|
5
5
|
|
|
6
|
+
## 0.2.1
|
|
7
|
+
|
|
8
|
+
Documentation only — no code or behaviour change.
|
|
9
|
+
|
|
10
|
+
- The README shipped with 0.2.0 still described the pre-release state, so the
|
|
11
|
+
npm page showed a milestone table saying publishing was pending while 0.2.0
|
|
12
|
+
was already `latest`. It now matches the code: nine match rules, the editable
|
|
13
|
+
capability cells, the fixed-width table, and 61 tests / 26 packaging checks.
|
|
14
|
+
- `P2.9` (layout and hand editing) and `F15.1`–`F15.5` (the rules that work
|
|
15
|
+
follows) are recorded in the plan and requirements.
|
|
16
|
+
|
|
6
17
|
## 0.2.0
|
|
7
18
|
|
|
8
19
|
Everything below landed after 0.1.0 was published, so 0.1.0 users see the
|
package/README.md
CHANGED
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
1. **补全能力**:拿你已配置的模型 id 去 [models.dev](https://models.dev) 查事实,把
|
|
9
9
|
`上下文窗口 / 输出上限 / 是否支持图片 / 推理档位` 写回官方适配器的配置。
|
|
10
|
+
查不到的、或者目录数字不对的,**可以直接在表格里手改**。
|
|
10
11
|
2. **重定向名称**:给每个模型的显示名称加上 `【供应商】` 前缀,同名模型一眼分得清。
|
|
11
12
|
3. **重排顺序**:按「供应商分组」或「名称字母序」重排模型列表,随时可重排一次。
|
|
12
13
|
|
|
13
14
|
**它不发任何推理请求,也不注册 LLM 路由**——调用仍然由官方插件负责。
|
|
14
15
|
名称重定向只改 `name` 字段,**模型 ID 始终不变**,所以实际调用、路由、计费都不受影响。
|
|
15
16
|
|
|
17
|
+
当前版本 **0.2.0**,已发布到 npm。
|
|
18
|
+
|
|
16
19
|
## 为什么需要它
|
|
17
20
|
|
|
18
21
|
中转网关(NewAPI、Cline、Trae 之类)的 `/models` 只返回模型 id,不告诉你上下文多大、
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
┌──────────────────────┐ RPC ┌──────────────────────────┐
|
|
30
33
|
│ 读 llm-pi-ai 的配置 │ ───────► │ 下载 models.dev(带缓存) │
|
|
31
34
|
│ 列出模型 / 勾选 │ ◄─────── │ 匹配 id → 能力字段 │
|
|
32
|
-
│
|
|
35
|
+
│ 预览 / 手改字段 │ └──────────────────────────┘
|
|
33
36
|
│ 应用 → settings.mutate│
|
|
34
37
|
└──────────────────────┘
|
|
35
38
|
```
|
|
@@ -53,6 +56,20 @@
|
|
|
53
56
|
手动预热:`node --experimental-strip-types scripts/warm-cache.mjs`。
|
|
54
57
|
宿主进程连不上 models.dev 时页面依然可用。
|
|
55
58
|
|
|
59
|
+
### 手改能力参数
|
|
60
|
+
|
|
61
|
+
**上下文 / 输出 / 图片三列可以直接改**,不用完全依赖目录:
|
|
62
|
+
|
|
63
|
+
- **上下文 / 输出**:数字输入框,接受表格自己显示的写法(`1M`、`128K`、`1,000,000`)。
|
|
64
|
+
- **图片**:三态下拉 —— 沿用目录值 / 支持 / 纯文本。
|
|
65
|
+
- **手填值标蓝**,一眼能看出哪些不是目录给的。
|
|
66
|
+
- **手填值优先**:覆盖目录值,且**不受「覆盖已有值」开关限制**——那个开关管的是
|
|
67
|
+
"目录值要不要覆盖你已存的值",不是"你能不能决定这条配置写什么"。
|
|
68
|
+
- **手填值独立保存**:重新点「分析能力」不会丢失。
|
|
69
|
+
- **清空输入框 = 清除手填值**,不会写成 `0`。
|
|
70
|
+
- **目录查不到的模型也有表格行**,匹配列显示「目录未收录」,同样可以手填全部参数。
|
|
71
|
+
这类模型恰恰最需要手填。
|
|
72
|
+
|
|
56
73
|
### 匹配规则
|
|
57
74
|
|
|
58
75
|
由严到松,命中哪一条会在「匹配方式」列标出来:
|
|
@@ -61,12 +78,12 @@
|
|
|
61
78
|
| --- | --- | --- |
|
|
62
79
|
| 1 | 精确 | `gemini-3.8-flash` |
|
|
63
80
|
| 2 | 忽略大小写 | `GLM-5.3` → `glm-5.3` |
|
|
64
|
-
| 3 |
|
|
81
|
+
| 3 | 版本分隔符双向折叠 | `claude-sonnet-4.5` ↔ `claude-sonnet-4-5` |
|
|
65
82
|
| 4 | 剥变体标记 | `gemini-3.8-flash-tiered` → `gemini-3.8-flash` |
|
|
66
83
|
| 5 | 前缀匹配 | `nemotron-3.5-lightning` → `nemotron-3.5-lightning-30b-a3b` |
|
|
67
84
|
| 6 | 逐段剥供应商前缀 | `cline/dots-studio/dots-3-note-preview:free` → `dots-studio/dots-3-note-preview` |
|
|
68
85
|
| 7 | 去经销商命名空间 | `raccoon/sn-glm-5-3` → `glm-5-3` |
|
|
69
|
-
| 8 | 显示名称(空格转横线) | `Qwen3.8 Flash` → `qwen3.8-flash
|
|
86
|
+
| 8 | 显示名称(空格转横线) | `Qwen3.8 Flash` → `qwen3.8-flash` |
|
|
70
87
|
| 9 | 别名(手工兜底) | 你自己配的 id 映射 |
|
|
71
88
|
|
|
72
89
|
**变体标记**包括销售点后缀与路由标签,会循环剥(网关常叠加多个):
|
|
@@ -78,13 +95,14 @@
|
|
|
78
95
|
- 路由标签:`:free` `:beta` `:nitro` 等 `:xxx`
|
|
79
96
|
- 构建号:尾部纯数字,如 `kimi-k3-1` → `kimi-k3`
|
|
80
97
|
|
|
81
|
-
**版本分隔符双向折叠**:`.`、`-`、`_` 在数字之间视为同一写法。目录里
|
|
82
|
-
是点号,而经销商给的 `sn-sensenova-6-8-flash-lite`
|
|
98
|
+
**版本分隔符双向折叠**:`.`、`-`、`_` 在数字之间视为同一写法。目录里
|
|
99
|
+
`sensenova-6.8-flash-lite` 是点号,而经销商给的 `sn-sensenova-6-8-flash-lite` 是横线,
|
|
100
|
+
不折叠就永远对不上。
|
|
83
101
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
102
|
+
**空格转横线**:显示名称是给人看的,词与词之间用空格(`Qwen3.8 Flash`),目录里的 id
|
|
103
|
+
用分隔符(`qwen3.8-flash`)。两者没有任何共同形态,大小写、版本点、变体标记都跨不过
|
|
104
|
+
这个空格。规则只改写**候选**(把空格当横线),且仍要求精确命中,所以
|
|
105
|
+
`Dots Studio: …` 这类带真实空格的名称不会被硬掰成别的模型。
|
|
88
106
|
|
|
89
107
|
**去经销商命名空间**:有些聚合商在自己的池子前面加 2–4 个字母的标签
|
|
90
108
|
(`raccoon/sn-glm-5-3` 的 `sn-`)。`sn` 不是目录里的供应商 id,只是经销商的缩写。
|
|
@@ -99,6 +117,10 @@
|
|
|
99
117
|
**优先选第一方厂商**的目录条目(`openai`/`anthropic`/`google`/`deepseek`/`nvidia`…),
|
|
100
118
|
避免被聚合站的错误数字带偏;同分时取事实最全的条目。
|
|
101
119
|
|
|
120
|
+
同一模型在不同供应商下大小写常常不同(`alibaba` 是 `qwen3.8-flash`,`scnet-token-plan`
|
|
121
|
+
是 `Qwen3.8-Flash`)。精确命中时**同组的其他大小写写法一起参与打分**,否则碰巧大小写
|
|
122
|
+
一致的那个经销商就会挤掉第一方。
|
|
123
|
+
|
|
102
124
|
**别名放在最后**:别名是手工兜底,若放在名称匹配之前,被别名处理过的名称会被所有
|
|
103
125
|
同名行继承,等于失效。
|
|
104
126
|
|
|
@@ -141,14 +163,25 @@
|
|
|
141
163
|
- 未重定向的行按规则**预演**排序键,因此重定向与否排序结果相同。
|
|
142
164
|
- 补全能力、重定向、重排三个动作写入时都按当前排序落盘,列表顺序与配置顺序始终一致。
|
|
143
165
|
|
|
166
|
+
### 表格布局
|
|
167
|
+
|
|
168
|
+
表格用固定列宽 + 比例分配,ID 和名称折行,单元格内控件收缩到列宽内,
|
|
169
|
+
**正常情况下不需要横向滚动**。只有窗口窄到放不下时才出现横向滚动条。
|
|
170
|
+
|
|
144
171
|
## 安装
|
|
145
172
|
|
|
146
|
-
从 npm
|
|
173
|
+
从 npm 安装:
|
|
147
174
|
|
|
148
175
|
```sh
|
|
149
176
|
dsh plugin --profile web add dsh-model-capability-sync
|
|
150
177
|
```
|
|
151
178
|
|
|
179
|
+
指定版本:
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
dsh plugin --profile web add dsh-model-capability-sync@0.2.0
|
|
183
|
+
```
|
|
184
|
+
|
|
152
185
|
从本地 tarball 安装:
|
|
153
186
|
|
|
154
187
|
```sh
|
|
@@ -174,14 +207,14 @@ dsh plugin --profile web add /path/to/dsh-model-capability-sync
|
|
|
174
207
|
| --- | --- |
|
|
175
208
|
| `src/index.ts` | 宿主半:RPC 通道 `preview`(目录能力)+ `live`(当前生效) |
|
|
176
209
|
| `src/catalog.ts` | models.dev 下载 / 缓存(内存 + 本机文件)/ 索引 |
|
|
177
|
-
| `src/match.ts` | 网关 id →
|
|
210
|
+
| `src/match.ts` | 网关 id → 目录条目的匹配规则 |
|
|
178
211
|
| `src/mapping.ts` | 目录条目 → 能力字段(纯函数) |
|
|
179
212
|
| `src/sort.ts` | 模型排序(前缀分组 / 重定向后名称) |
|
|
180
213
|
| `src/client/apply.ts` | 注册设置节、样式、RPC 与 settings 注入 |
|
|
181
|
-
| `src/client/SyncSection.tsx` | 设置页主体(能力表 + 重定向 + 重排) |
|
|
214
|
+
| `src/client/SyncSection.tsx` | 设置页主体(能力表 + 手改 + 重定向 + 重排) |
|
|
182
215
|
| `src/client/rename.ts` | 名称重定向规则(纯函数) |
|
|
183
|
-
| `src/client/shared.ts` |
|
|
184
|
-
| `src/client/locale.ts` | 界面文案(zh / en
|
|
216
|
+
| `src/client/shared.ts` | 配置读取工具、写入合并、数值解析(纯函数) |
|
|
217
|
+
| `src/client/locale.ts` | 界面文案(zh / en 逐键镜像,73 键) |
|
|
185
218
|
| `scripts/` | 构建、冒烟、发布检查、规则单元测试 |
|
|
186
219
|
| `docs/` | 需求、技术选型、设计规范、开发计划、发版 |
|
|
187
220
|
|
|
@@ -193,12 +226,13 @@ npm run typecheck # 两端类型检查
|
|
|
193
226
|
npm run build # lib/index.js + lib/client.js
|
|
194
227
|
npm run verify:package # 发布卫生检查(26 项)
|
|
195
228
|
|
|
196
|
-
# 单元测试(离线,不需要 profile
|
|
229
|
+
# 单元测试(离线,不需要 profile 或网络),共 61 条
|
|
197
230
|
npm run test:rename # 名称重定向规则(11 条)
|
|
198
231
|
npm run test:match # id 匹配规则(29 条)
|
|
199
232
|
npm run test:sort # 两种排序(6 条)
|
|
200
233
|
npm run test:write-merge # 写入后状态合并(6 条)
|
|
201
234
|
npm run test:locale # 文案键完整性(3 条)
|
|
235
|
+
npm run test:fields # 手填值解析与覆盖(6 条)
|
|
202
236
|
|
|
203
237
|
# 真实目录冒烟(需联网)
|
|
204
238
|
node --experimental-strip-types scripts/smoke.mjs
|
|
@@ -214,22 +248,25 @@ node --experimental-strip-types scripts/smoke.mjs
|
|
|
214
248
|
| P2.5 | 差异预览、筛选、排序、写入位置文案 | ✅ |
|
|
215
249
|
| P2.6 | 名称重定向(自动加 `【供应商】`,含 `【other】` 兜底) | ✅ |
|
|
216
250
|
| P2.7 | 排序二选一 + 一键重排 | ✅ |
|
|
217
|
-
| P2.8 |
|
|
251
|
+
| P2.8 | 匹配规则扩展(版本分隔符 / 变体标记 / 前缀 / 经销商命名空间 / 空格转横线) | ✅ |
|
|
252
|
+
| P2.9 | 表格适配面板宽度 + 能力参数可直接手改 | ✅ |
|
|
218
253
|
| P3 | 别名表、手动覆盖 | ⬜ |
|
|
219
254
|
| P4 | 迁移旧适配器的模型清单并停用它 | ⬜ |
|
|
220
|
-
| P5 |
|
|
255
|
+
| P5 | 打包发布 | ✅ 0.2.0 已发布到 npm |
|
|
221
256
|
|
|
257
|
+
P5 的「社区目录」一项仍待办:目前只发了 npm,还没有提交到 DSH 插件市场。
|
|
222
258
|
发版步骤见仓库内的 `docs/publishing.md`。
|
|
223
259
|
|
|
224
260
|
## 已知边界
|
|
225
261
|
|
|
226
262
|
- models.dev 描述的是**官方模型**能力;中转网关背后实际路由到哪个上游,目录说了不算。
|
|
227
|
-
本插件给的是"最可能的答案"
|
|
263
|
+
本插件给的是"最可能的答案",最终仍建议用一张真图验证。手改功能就是为这种情况准备的。
|
|
228
264
|
- **前缀匹配是唯一可能误判的规则**:`north-mini-code` 同时能匹配
|
|
229
265
|
`north-mini-code-1-0` 和 `north-mini-code-free`。按「第一方优先 + 事实最全」取舍,
|
|
230
266
|
界面上标为「前缀匹配」,可信度自行判断。
|
|
231
267
|
- 纯代号且没有显示名称的模型无法推断,例如 `1fmodel`;目录里确实没有的模型
|
|
232
|
-
|
|
268
|
+
(新模型、厂商自造别名)在表格里标为「目录未收录」,可以手填参数,
|
|
269
|
+
也可以在 P3 的别名表里手工指定。
|
|
233
270
|
- 名称重定向只改显示名称,**不改模型 ID**。若某个客户端只认 ID 而忽略名称,
|
|
234
271
|
重定向对它不可见。
|
|
235
272
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-capability-sync",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Fill model capabilities (context window, output cap, input modalities, reasoning efforts) into an already-configured DeepSeek Harness LLM provider by matching gateway model ids against the models.dev catalog. Host half fetches and matches; browser half previews and writes through the official settings service.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|