@ljwei-stak/model-router-galgame 0.4.19 → 0.4.20

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.
@@ -61926,10 +61926,7 @@ function createUpdateApi({
61926
61926
  return unknownItem(`GitHub Release \u68C0\u67E5\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`, desktopEnvironment.version);
61927
61927
  }
61928
61928
  };
61929
- const installPlugin = !pluginInstallable ? null : async (item, signal) => {
61930
- if (item?.known === true && item.available !== true) {
61931
- return { changed: false, restartRequired: false, message: item.reason || "npm \u63D2\u4EF6\u5DF2\u662F\u6700\u65B0\u7248\u3002" };
61932
- }
61929
+ const installPlugin = !pluginInstallable ? null : async (_item, signal) => {
61933
61930
  return rpcValue(
61934
61931
  await connectionRpc.call(PLUGIN_UPDATE_CHANNEL, PLUGIN_UPDATE_ENDPOINT, {}, signal),
61935
61932
  "npm \u63D2\u4EF6\u66F4\u65B0"
@@ -61971,7 +61968,7 @@ var gal_scene_default = { version: 1, settings: { stageW: 1920, stageH: 1080, sh
61971
61968
 
61972
61969
  // .dsh-plugin/client/index.mjs
61973
61970
  var name = "gal-view";
61974
- var PLUGIN_VERSION = "0.4.19";
61971
+ var PLUGIN_VERSION = "0.4.20";
61975
61972
  function createUpdateApi2(ctx) {
61976
61973
  let connection;
61977
61974
  try {
@@ -0,0 +1,783 @@
1
+ # DeepSeek Harness 插件安装完整教程
2
+
3
+ > 📦 从零开始,手把手教你安装 Model Router + GALGame 插件
4
+
5
+ ---
6
+
7
+ ## 📋 目录
8
+
9
+ 1. [前置要求](#1-前置要求)
10
+ 2. [下载插件](#2-下载插件)
11
+ 3. [安装插件](#3-安装插件)
12
+ 4. [配置 DeepSeek](#4-配置-deepseek)
13
+ 5. [验证安装](#5-验证安装)
14
+ 6. [启动使用](#6-启动使用)
15
+ 7. [常见问题](#7-常见问题)
16
+
17
+ ---
18
+
19
+ ## 1. 前置要求
20
+
21
+ ### ✅ 确认 DeepSeek Harness 已安装
22
+
23
+ ```bash
24
+ # 检查 Harness 版本
25
+ dsh version
26
+
27
+ # 预期输出示例:
28
+ # 已验证:@deepseek-ai/dsh 0.1.2-rc.1;桌面端使用 DSH Desktop 2.0.5+
29
+ ```
30
+
31
+ **如果未安装 Harness**,请先安装:
32
+
33
+ #### Windows 安装
34
+
35
+ ```powershell
36
+ # 方法1: 使用官方安装器
37
+ # 从 DeepSeek 官网下载 Harness 安装包
38
+ # https://platform.deepseek.com/harness
39
+
40
+ # 方法2: 使用命令行(需要管理员权限)
41
+ winget install DeepSeek.Harness
42
+ ```
43
+
44
+ #### macOS 安装
45
+
46
+ ```bash
47
+ # 方法1: 使用 Homebrew
48
+ brew install deepseek-harness
49
+
50
+ # 方法2: 手动下载安装包
51
+ # 从官网下载 .dmg 文件并安装
52
+ ```
53
+
54
+ #### Linux 安装
55
+
56
+ ```bash
57
+ # 方法1: 使用包管理器
58
+ curl -fsSL https://platform.deepseek.com/install.sh | sh
59
+
60
+ # 方法2: 下载二进制文件
61
+ wget https://platform.deepseek.com/releases/harness-linux-x64.tar.gz
62
+ tar -xzf harness-linux-x64.tar.gz
63
+ sudo mv dsh /usr/local/bin/
64
+ ```
65
+
66
+ ### ✅ 确认网络连接
67
+
68
+ 插件需要联网获取 LiveBench 评分数据(可选)。
69
+
70
+ ### ✅ 准备 DeepSeek API Key(推荐)
71
+
72
+ 1. 访问 https://platform.deepseek.com
73
+ 2. 注册/登录账号
74
+ 3. 在"API Keys"页面创建新的 API Key
75
+ 4. 复制保存(后续配置时使用)
76
+
77
+ ---
78
+
79
+ ## 2. 下载插件
80
+
81
+ ### 方法1: npm registry 安装(推荐)
82
+
83
+ 插件已经发布为公开 npm 包。直接安装时不需要克隆仓库:
84
+
85
+ ```powershell
86
+ pnpm config set registry https://registry.npmjs.org/
87
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.20
88
+ pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.20
89
+ ```
90
+
91
+ ### 方法2: Git 克隆(仅源码开发)
92
+
93
+ ```bash
94
+ # 克隆插件仓库
95
+ git clone https://github.com/ljwei-stak/model-router-galgame.git
96
+
97
+ # 进入插件目录
98
+ cd model-router-galgame
99
+ ```
100
+
101
+ ### 方法3: 下载压缩包(仅源码开发)
102
+
103
+ 1. 访问项目 GitHub Release 页面
104
+ 2. 下载最新版本的 `model-router-galgame.zip`
105
+ 3. 解压到本地目录
106
+
107
+ ```bash
108
+ # Windows (使用 PowerShell)
109
+ Expand-Archive -Path model-router-galgame.zip -DestinationPath C:\harness-plugins\
110
+
111
+ # macOS/Linux
112
+ unzip model-router-galgame.zip -d ~/harness-plugins/
113
+ cd ~/harness-plugins/model-router-galgame
114
+ ```
115
+
116
+ ### 方法4: 直接使用现有目录(仅源码开发)
117
+
118
+ 如果你已经有插件文件(如本次适配工作的目录):
119
+
120
+ ```bash
121
+ # 假设插件在 F:\DeepSeek_harness\model-router-galgame
122
+ cd F:\DeepSeek_harness\model-router-galgame
123
+ ```
124
+
125
+ ---
126
+
127
+ ## 3. 安装插件
128
+
129
+ ### 步骤1: 确认插件目录结构
130
+
131
+ 确保目录包含以下关键文件:
132
+
133
+ ```
134
+ model-router-galgame/
135
+ ├── package.json ✅ 必需
136
+ ├── .dsh-plugin/ ✅ 必需
137
+ │ ├── index.mjs
138
+ │ ├── client.js
139
+ │ └── shared/
140
+ ├── aipicture/ ✅ 必需(立绘资源)
141
+ ├── cordis.patch.yml
142
+ └── README.md
143
+ ```
144
+
145
+ ### 步骤2: 执行安装命令
146
+
147
+ 插件已发布到 npm,直接使用公开包名安装(推荐):
148
+
149
+ ```powershell
150
+ pnpm config set registry https://registry.npmjs.org/
151
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.20
152
+ pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.20
153
+ ```
154
+
155
+ 其中 `@0.4.20` 可以替换为通过 `npm view @ljwei-stak/model-router-galgame version --registry=https://registry.npmjs.org/` 查询到的版本号。官方 ModLens、审批门控、ModSearch 和 Ego Browser 依赖会自动解析,无需另行安装。
156
+
157
+ 如果正在本地开发,再使用目录安装:
158
+
159
+ ```bash
160
+ # 进入插件目录
161
+ cd /path/to/model-router-galgame
162
+
163
+ # 安装插件到 Web profile
164
+ dsh plugin --profile web add .
165
+
166
+ # 如果使用绝对路径
167
+ dsh plugin --profile web add /path/to/model-router-galgame
168
+ ```
169
+
170
+ **预期输出**:
171
+ ```
172
+ ✓ Plugin '@ljwei-stak/model-router-galgame' added to profile 'web'
173
+ ```
174
+
175
+ ### 步骤3: 验证插件已安装
176
+
177
+ ```bash
178
+ # 列出已安装的插件
179
+ dsh plugin --profile web list
180
+
181
+ # 预期输出包含:
182
+ # @ljwei-stak/model-router-galgame@0.4.20
183
+ ```
184
+
185
+ ### 步骤4: 重启 Harness
186
+
187
+ ```bash
188
+ # 停止 Harness
189
+ dsh stop
190
+
191
+ # 启动 Harness
192
+ dsh start
193
+
194
+ # 或者一步重启
195
+ dsh restart
196
+ ```
197
+
198
+ **等待启动完成**(约10-30秒)
199
+
200
+ ---
201
+
202
+ ## 4. 配置 DeepSeek
203
+
204
+ ### 步骤1: 打开 Harness 设置
205
+
206
+ 1. 启动 Harness 后,打开浏览器访问 `http://localhost:3000`(默认地址)
207
+ 2. 点击右上角 **设置** 图标(齿轮⚙️)
208
+ 3. 进入 **LLM** → **Providers** 页面
209
+
210
+ ### 步骤2: 添加 DeepSeek Provider
211
+
212
+ 点击 **Add Provider** 按钮,填写以下信息:
213
+
214
+ ```yaml
215
+ # Provider 配置
216
+ ID: deepseek
217
+ Name: DeepSeek
218
+ Type: openai-compatible # 或者选择 deepseek
219
+
220
+ # API 配置
221
+ API Key: sk-your-api-key-here # 粘贴你的 API Key
222
+ Base URL: https://api.deepseek.com # 或你的中转地址
223
+
224
+ # 模型配置(点击 Add Model 添加)
225
+ Models:
226
+ - ID: deepseek-chat
227
+ Name: DeepSeek V3
228
+ Type: chat
229
+
230
+ - ID: deepseek-reasoner
231
+ Name: DeepSeek R1
232
+ Type: chat
233
+ ```
234
+
235
+ **配置截图参考**:
236
+ ```
237
+ ┌──────────────────────────────────────┐
238
+ │ Provider ID: deepseek │
239
+ │ Provider Name: DeepSeek │
240
+ │ API Key: sk-********************* │
241
+ │ Base URL: https://api.deepseek.com │
242
+ │ │
243
+ │ Models: │
244
+ │ ┌──────────────────────────────────┐│
245
+ │ │ • deepseek-chat ││
246
+ │ │ • deepseek-reasoner ││
247
+ │ └──────────────────────────────────┘│
248
+ │ │
249
+ │ [Save] [Cancel] │
250
+ └──────────────────────────────────────┘
251
+ ```
252
+
253
+ ### 步骤3: 保存配置
254
+
255
+ 点击 **Save** 按钮保存配置。
256
+
257
+ ### 步骤4: 测试连接
258
+
259
+ ```bash
260
+ # 测试模型是否可用
261
+ dsh model list --provider deepseek
262
+
263
+ # 预期输出:
264
+ # deepseek/deepseek-chat
265
+ # deepseek/deepseek-reasoner
266
+ ```
267
+
268
+ 或者在 Web 界面:
269
+ 1. 创建新对话
270
+ 2. 模型选择器中应该能看到 DeepSeek 模型
271
+ 3. 发送测试消息:"你好"
272
+
273
+ ---
274
+
275
+ ## 5. 验证安装
276
+
277
+ ### ✅ 检查1: 插件是否加载
278
+
279
+ 打开浏览器开发者工具(F12),查看 Console:
280
+
281
+ **预期输出**(无错误):
282
+ ```
283
+ [model-router] Plugin loaded successfully
284
+ [model-router] Discovered 2 models
285
+ ```
286
+
287
+ **如果有错误**:参见[常见问题](#7-常见问题)
288
+
289
+ ### ✅ 检查2: GAL 界面是否显示
290
+
291
+ 创建新对话后,应该看到:
292
+ - ✅ 模型娘立绘(右侧或底部)
293
+ - ✅ 对话框带有模型娘名牌
294
+ - ✅ 打字机效果
295
+
296
+ **对比截图**:
297
+
298
+ ```
299
+ 未安装插件:
300
+ ┌─────────────────────────┐
301
+ │ 标准对话框 │
302
+ │ ┌─────────────────────┐ │
303
+ │ │ User: 你好 │ │
304
+ │ │ Assistant: 你好! │ │
305
+ │ └─────────────────────┘ │
306
+ └─────────────────────────┘
307
+
308
+ 安装插件后:
309
+ ┌─────────────────────────┬─────────┐
310
+ │ 对话框 │ 立绘 │
311
+ │ ┌─────────────────────┐ │ ┌─────┐│
312
+ │ │ 主人: 你好 │ │ │ 🐋 ││
313
+ │ │ │ │ │ ││
314
+ │ │ DeepSeek·小鲸鱼: │ │ │ ││
315
+ │ │ 你好!先把问题列... │ │ └─────┘│
316
+ │ └─────────────────────┘ │ │
317
+ └─────────────────────────┴─────────┘
318
+ ```
319
+
320
+ ### ✅ 检查3: 路由功能是否正常
321
+
322
+ 在对话框输入命令:
323
+
324
+ ```bash
325
+ /router plan
326
+ ```
327
+
328
+ **预期输出**(JSON格式):
329
+ ```json
330
+ {
331
+ "mode": "collective",
332
+ "complexity": { "value": 0, "band": "simple" },
333
+ "taskType": "general",
334
+ "candidates": [...],
335
+ "selected": null
336
+ }
337
+ ```
338
+
339
+ ### ✅ 检查4: 运行完整测试
340
+
341
+ ```bash
342
+ # 进入插件目录
343
+ cd /path/to/model-router-galgame
344
+
345
+ # 安装测试依赖(首次运行)
346
+ npm install
347
+
348
+ # 运行测试套件
349
+ npm test
350
+
351
+ # 预期输出:
352
+ # ✓ 21+ tests passed
353
+ ```
354
+
355
+ ---
356
+
357
+ ## 6. 启动使用
358
+
359
+ ### 🎮 基础使用
360
+
361
+ #### 1. 创建新对话
362
+
363
+ 点击 Harness 界面的 **New Chat** 按钮。
364
+
365
+ #### 2. 选择模式
366
+
367
+ ```bash
368
+ # 集体协作模式(默认,推荐)
369
+ /router mode collective
370
+
371
+ # 单独会话模式(手动选择模型)
372
+ /router mode single
373
+ ```
374
+
375
+ #### 3. 开始提问
376
+
377
+ ```
378
+ 你好!请介绍一下你自己
379
+ ```
380
+
381
+ 插件会:
382
+ - 自动分析任务类型
383
+ - 选择最优模型
384
+ - 以模型娘角色回答
385
+ - 显示对应立绘
386
+
387
+ #### 4. 查看路由分析
388
+
389
+ ```bash
390
+ /router plan
391
+ ```
392
+
393
+ 查看插件的路由决策细节。
394
+
395
+ ### 🎯 典型场景示例
396
+
397
+ #### 场景1: 代码调试
398
+
399
+ ```python
400
+ 这段代码有问题,帮我找出来:
401
+
402
+ def add(a, b):
403
+ return a + b
404
+ print("Done") # 这行永远不会执行
405
+ ```
406
+
407
+ **插件行为**:
408
+ - 任务类型:`code`
409
+ - 复杂度:`simple`
410
+ - 选择模型:DeepSeek(code专长)
411
+ - 表达风格:推理研究员·小鲸鱼
412
+
413
+ #### 场景2: 系统设计(复杂任务)
414
+
415
+ ```
416
+ 设计一个电商网站的后端架构,包括:
417
+ 1. 用户系统
418
+ 2. 商品管理
419
+ 3. 订单处理
420
+ 4. 支付集成
421
+ ```
422
+
423
+ **插件行为**:
424
+ - 任务类型:`code`
425
+ - 复杂度:`complex`
426
+ - 启动协作模式:
427
+ - 阶段1: 问题建模
428
+ - 阶段2: 架构设计
429
+ - 阶段3: 风险评估
430
+ - 阶段4: 方案整合
431
+
432
+ #### 场景3: 简单翻译
433
+
434
+ ```
435
+ 翻译成英文:今天天气真好
436
+ ```
437
+
438
+ **插件行为**:
439
+ - 任务类型:`general`
440
+ - 复杂度:`simple`
441
+ - 选择模型:DeepSeek Flash(低成本)
442
+ - 费用:~$0.00001
443
+
444
+ ---
445
+
446
+ ## 7. 常见问题
447
+
448
+ ### ❌ 问题1: 插件未加载
449
+
450
+ **症状**:
451
+ - 界面没有变化
452
+ - 没有模型娘立绘
453
+ - `/router` 命令无响应
454
+
455
+ **排查步骤**:
456
+
457
+ ```bash
458
+ # 1. 确认插件已安装
459
+ dsh plugin --profile web list
460
+ # 应该能看到 model-router-galgame
461
+
462
+ # 2. 检查 Harness 日志
463
+ dsh logs
464
+
465
+ # 查找错误信息,例如:
466
+ # [ERROR] Failed to load plugin: model-router-galgame
467
+
468
+ # 3. 检查插件目录权限
469
+ ls -la /path/to/model-router-galgame
470
+ # 确保文件可读
471
+
472
+ # 4. 从 npm registry 重新安装插件
473
+ pnpm config set registry https://registry.npmjs.org/
474
+ dsh plugin --profile web remove @ljwei-stak/model-router-galgame
475
+ dsh plugin --profile web add @ljwei-stak/model-router-galgame@latest
476
+ dsh restart
477
+ ```
478
+
479
+ ### ❌ 问题2: 立绘不显示
480
+
481
+ **症状**:
482
+ - 对话框样式正常
483
+ - 但没有模型娘图片
484
+
485
+ **解决方案**:
486
+
487
+ ```bash
488
+ # 1. 检查图片文件
489
+ ls aipicture/*.png
490
+ # 应该有 DeepSeek1.png, ChatGPT1.png 等14个文件
491
+
492
+ # 2. 检查浏览器控制台
493
+ # 打开 F12 → Network 标签页
494
+ # 查找图片加载失败的请求(404错误)
495
+
496
+ # 3. 重新构建客户端
497
+ cd /path/to/model-router-galgame
498
+ npm run build:client
499
+ dsh restart
500
+
501
+ # 4. 清除浏览器缓存
502
+ # Ctrl+Shift+Delete → 清除缓存
503
+ ```
504
+
505
+ ### ❌ 问题3: DeepSeek 模型不可用
506
+
507
+ **症状**:
508
+ - 插件正常加载
509
+ - 但路由器没有选择 DeepSeek
510
+
511
+ **排查步骤**:
512
+
513
+ ```bash
514
+ # 1. 验证模型可见
515
+ dsh model list --provider deepseek
516
+
517
+ # 如果为空,检查 provider 配置
518
+
519
+ # 2. 测试 API Key
520
+ curl https://api.deepseek.com/v1/models \
521
+ -H "Authorization: Bearer sk-your-api-key"
522
+
523
+ # 应该返回模型列表
524
+
525
+ # 3. 检查 provider 配置
526
+ # 在 Harness 设置中确认:
527
+ # - API Key 正确
528
+ # - Base URL 正确
529
+ # - 模型 ID 正确(deepseek-chat)
530
+
531
+ # 4. 查看路由日志
532
+ dsh logs | grep "model-router"
533
+ # 查找 "model discovery" 相关消息
534
+ ```
535
+
536
+ ### ❌ 问题4: 路由决策异常
537
+
538
+ **症状**:
539
+ - 简单任务却选择了昂贵模型
540
+ - 或者完全没有选择模型
541
+
542
+ **排查步骤**:
543
+
544
+ ```bash
545
+ # 1. 查看详细路由方案
546
+ /router plan
547
+
548
+ # 检查输出:
549
+ # - taskType: 是否正确识别任务类型
550
+ # - complexity: 是否合理评估复杂度
551
+ # - candidates: 是否有可用候选
552
+ # - selected: 是否有选中的模型
553
+
554
+ # 2. 检查 LiveBench 状态
555
+ # 在路由方案的 optimization.liveBench 字段:
556
+ # - fetchedAt: 是否成功刷新
557
+ # - error: 是否有错误信息
558
+
559
+ # 3. 手动触发刷新
560
+ # 重启 Harness 会重新获取 LiveBench 数据
561
+ dsh restart
562
+
563
+ # 4. 使用本地评分
564
+ # 如果 LiveBench 持续失败,插件会自动使用实验基线
565
+ # 这是正常的降级行为
566
+ ```
567
+
568
+ ### ❌ 问题5: npm test 失败
569
+
570
+ **症状**:
571
+ - 运行测试时报错
572
+
573
+ **解决方案**:
574
+
575
+ ```bash
576
+ # 1. 安装依赖
577
+ npm install
578
+
579
+ # 2. 检查 Node.js 版本
580
+ node --version
581
+ # 需要 v18.0.0 或更高版本
582
+
583
+ # 3. 清除缓存重新安装
584
+ rm -rf node_modules package-lock.json
585
+ npm install
586
+
587
+ # 4. 单独运行测试文件定位问题
588
+ node --test tests/router.test.mjs
589
+ ```
590
+
591
+ ### ❌ 问题6: 性能问题
592
+
593
+ **症状**:
594
+ - 响应缓慢
595
+ - 界面卡顿
596
+
597
+ **优化方案**:
598
+
599
+ ```bash
600
+ # 1. 降低 LiveBench 刷新频率
601
+ # 在 Model Router 设置中:
602
+ liveBenchTtlMs: 1800000 # 30分钟
603
+
604
+ # 2. 减少日志输出
605
+ # 在 Harness 配置中:
606
+ logLevel: "warn" # 只输出警告和错误
607
+
608
+ # 3. 使用本地 LiveBench 镜像
609
+ # 如果网络慢,使用缓存的快照
610
+ liveBenchEndpoint: "file:///path/to/local-snapshot.json"
611
+
612
+ # 4. 禁用协作模式(如不需要)
613
+ /router mode single
614
+ ```
615
+
616
+ ---
617
+
618
+ ## 8. 高级配置(可选)
619
+
620
+ ### 配置价格与预算
621
+
622
+ 在 Harness 设置 → Model Router:
623
+
624
+ ```yaml
625
+ pricing:
626
+ deepseek-chat:
627
+ input: 0.14
628
+ output: 0.28
629
+ cacheRead: 0.014
630
+ cacheWrite: 0.028
631
+ currency: "USD"
632
+
633
+ budgetUsd: 0.01 # 单任务预算上限
634
+ cacheReadRatio: 0.3 # 假设30%缓存命中
635
+ cacheWriteRatio: 0.1
636
+ ```
637
+
638
+ ### 自定义 LiveBench 端点
639
+
640
+ ```yaml
641
+ # 使用镜像加速
642
+ liveBenchEndpoint: "https://your-mirror.com/livebench.json"
643
+
644
+ # 或使用本地文件
645
+ liveBenchEndpoint: "file:///path/to/snapshot.json"
646
+ ```
647
+
648
+ ### 调整路由权重
649
+
650
+ 编辑 `.dsh-plugin/shared/router.mjs`:
651
+
652
+ ```javascript
653
+ export const OBJECTIVE_WEIGHTS = Object.freeze({
654
+ simple: {
655
+ quality: 0.20, // 降低质量权重
656
+ cost: 0.70, // 提高成本权重
657
+ latency: 0.06,
658
+ specialty: 0.02,
659
+ risk: 0.02
660
+ },
661
+ // ... balanced, complex
662
+ })
663
+ ```
664
+
665
+ 保存后重启 Harness。
666
+
667
+ ---
668
+
669
+ ## 9. 卸载插件(如需要)
670
+
671
+ ```bash
672
+ # 1. 移除插件
673
+ dsh plugin --profile web remove @ljwei-stak/model-router-galgame
674
+
675
+ # 2. 重启 Harness
676
+ dsh restart
677
+
678
+ # 3. 删除插件文件(可选)
679
+ rm -rf /path/to/model-router-galgame
680
+ ```
681
+
682
+ ---
683
+
684
+ ## 10. 更新插件与完整客户端
685
+
686
+ ### 设置页更新控件
687
+
688
+ 插件和 DSH Desktop 使用不同的版本号与发布渠道,设置页不再把两者视为同一个 Release:
689
+
690
+ | 控件 | 更新来源与行为 |
691
+ |------|----------------|
692
+ | **检查更新** | 独立检查 npm 官方 registry 上的 `@ljwei-stak/model-router-galgame` 和 [`anywhere-labs/dsh-desktop` 最新 Release](https://github.com/anywhere-labs/dsh-desktop/releases)。其中一项检查失败时,另一项结果仍然有效。 |
693
+ | **仅从 npm 更新插件** | DSH Desktop 先解析 npm `latest`,再在当前 profile 中以 `--save-exact` 添加解析出的 `@ljwei-stak/model-router-galgame@<确切版本>`,并指定 `https://registry.npmjs.org/`。完成后完全退出并重启 DSH Desktop。 |
694
+ | **仅更新完整客户端** | 调用 DSH Desktop 原生更新器检查并安装官方客户端 Release,不会顺带安装或替代 npm 插件。 |
695
+ | **一键更新插件与客户端** | 按需先安装 npm 插件,再调用完整客户端原生更新;两项都可用时两项都会执行。 |
696
+ | **查看 npm 包 / 客户端 Releases** | 分别打开 [插件 npm 页面](https://www.npmjs.com/package/@ljwei-stak/model-router-galgame) 和 [官方客户端 Releases](https://github.com/anywhere-labs/dsh-desktop/releases)。纯网页环境不能写入本机时也使用这两个入口。 |
697
+
698
+ `ljwei-stak/deepseek-harness` Release 不再是插件或完整客户端的统一更新源,完整客户端安装包也不代表已经包含同版本插件。
699
+
700
+ ### 命令行从 npm registry 更新插件(推荐)
701
+
702
+ ```powershell
703
+ pnpm config set registry https://registry.npmjs.org/
704
+ pnpm dsh plugin --profile web update @ljwei-stak/model-router-galgame
705
+ pnpm dsh plugin --profile desktop update @ljwei-stak/model-router-galgame
706
+ pnpm dsh --profile web --dump-config | Select-String "model-router-galgame|dsh-approval-gate"
707
+ ```
708
+
709
+ ### Git 更新插件(仅源码开发)
710
+
711
+ ```bash
712
+ cd /path/to/model-router-galgame
713
+ git pull origin main
714
+ dsh plugin --profile web add .
715
+ dsh restart
716
+ ```
717
+
718
+ ### 手动更新插件
719
+
720
+ 1. 下载新版本
721
+ 2. 备份旧版本配置
722
+ 3. 卸载旧插件
723
+ 4. 安装新插件
724
+ 5. 恢复配置
725
+
726
+ ---
727
+
728
+ ## 11. 获取帮助
729
+
730
+ ### 📖 文档资源
731
+
732
+ - **快速入门**: `QUICK_START.zh.md`
733
+ - **完整报告**: `DEEPSEEK_ADAPTATION_REPORT.md`
734
+ - **优化建议**: `MODEL_OPTIMIZATION.md`
735
+ - **文档索引**: `ADAPTATION_INDEX.md`
736
+
737
+ ### 🐛 问题反馈
738
+
739
+ - **GitHub Issues**: (项目仓库地址)
740
+ - **DeepSeek 社区**: https://platform.deepseek.com/community
741
+ - **邮件支持**: support@example.com
742
+
743
+ ### 💬 社区讨论
744
+
745
+ - Discord: (社区链接)
746
+ - QQ群: (群号)
747
+ - 微信群: (添加方式)
748
+
749
+ ---
750
+
751
+ ## 12. 总结
752
+
753
+ ### ✅ 安装完成检查清单
754
+
755
+ - [ ] 已安装 DSH Desktop 2.0.5+,或已验证的 `@deepseek-ai/dsh@0.1.2-rc.1`
756
+ - [ ] 已从 npm registry 安装 `@ljwei-stak/model-router-galgame`
757
+ - [ ] 插件已通过 `dsh plugin --profile <name> add` 安装
758
+ - [ ] Harness 已重启
759
+ - [ ] DeepSeek provider 已配置
760
+ - [ ] API Key 已添加
761
+ - [ ] 模型已添加(deepseek-chat等)
762
+ - [ ] 浏览器能看到模型娘立绘
763
+ - [ ] `/router plan` 命令有响应
764
+ - [ ] 测试对话正常工作
765
+
766
+ ### 🎉 恭喜!
767
+
768
+ 如果以上清单全部完成,你已经成功安装了 Model Router + GALGame 插件!
769
+
770
+ **下一步**:
771
+ 1. 阅读 `QUICK_START.zh.md` 了解基本用法
772
+ 2. 尝试不同的任务场景
773
+ 3. 查看 `大模型娘人物设定.md` 了解角色
774
+ 4. 探索高级配置选项
775
+
776
+ **祝你使用愉快!** 🚀
777
+
778
+ ---
779
+
780
+ **文档版本**: 1.0
781
+ **更新日期**: 2026-09-01
782
+ **适用插件版本**: 0.4.20
783
+ **已验证宿主版本**: DSH Desktop 2.0.5 / `@deepseek-ai/dsh@0.1.2-rc.1`
@@ -0,0 +1,72 @@
1
+ # 官方 ModLens 部署与集成指南
2
+
3
+ > 纠错:ModLens 不是运行在 `localhost:8000` 的 Docker/Python 服务,也没有
4
+ > `/v1/understand` 或 `/v1/understand/batch` 接口。旧的 `modlens-service` 只是本项目
5
+ > 早期创建的关键词测试桩,不能读取图片像素,现已废止。
6
+
7
+ ## 安装到 DeepSeek Harness
8
+
9
+ ModLens 3.25.4 是原生 DSH bundle。公开的 Model Router npm 包会自动安装它:
10
+
11
+ ```powershell
12
+ pnpm config set registry https://registry.npmjs.org/
13
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.20
14
+ pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.20
15
+ ```
16
+
17
+ 安装结果位于对应的 `F:\DeepSeek_harness\.dsh\profiles\<profile>` 目录,
18
+ `@ljwei-stak/model-router-galgame` 和 `@liustack/modlens` 会同时出现在依赖闭包和
19
+ `dsh.profile.bundles` 中。安装或更新后请重启对应 profile。
20
+
21
+ 本地开发时可以直接安装源码目录:
22
+
23
+ ```powershell
24
+ pnpm dsh plugin --profile web add F:\DeepSeek_harness\model-router-galgame
25
+ ```
26
+
27
+ ## 官方运行方式
28
+
29
+ 官方插件在 DSH 内完成四件事:
30
+
31
+ 1. 注册 `modlens_read_image` 工具。
32
+ 2. 自动发现纯文本 DeepSeek、GLM、MiMo Pro 路由,并生成
33
+ `<原模型> (modlens vision)` 包装条目。
34
+ 3. 对包装路由中的图片附件调用 `ctx.attachments.readImage()`,运行同一 npm 包内的
35
+ ModLens CLI,把图片转换为结构化证据后再交给原纯文本模型。
36
+ 4. 在 Web 中提供粘贴转临时路径和“视觉引擎(ModLens)”设置卡。
37
+
38
+ 因此不需要启动额外的 8000 端口服务,也不需要本项目实现
39
+ `ModLensClient`/`ModLensIntegration` HTTP 客户端。
40
+
41
+ ## 配置与检查
42
+
43
+ 视觉引擎配置由官方 CLI 管理,文件为:
44
+
45
+ ```text
46
+ C:\Users\Jianw\.modlens\config.json
47
+ ```
48
+
49
+ 也可在 DSH 的“设置 → 插件 → 插件配置 → 视觉引擎(ModLens)”中修改。检查命令:
50
+
51
+ ```powershell
52
+ pnpm exec modlens doctor
53
+ ```
54
+
55
+ 当前固定使用 `claude-cli`。它能完成调用链,但本机实测一次读取约 157 秒,而且对
56
+ DSH 截图产生严重误识别,不适合准确率或延迟验收。官方推荐的快速路径是
57
+ `gemini-api`(文档标称约 5–10 秒),也可配置真实的 OpenAI-compatible 多模态端点。
58
+
59
+ ## 与 GAL 路由器的边界
60
+
61
+ GAL 不实现第二套 ModLens 协议,也不保存视觉引擎密钥。它只做两项协调:
62
+
63
+ - 模型下拉框读取 DSH 官方 `modelCatalog()`,因此普通、原生视觉和
64
+ `(modlens vision)` 条目同时可见并通过 `selectModel()` 切换。
65
+ - 集体模式中,如果本轮含图片、算法选中的目标是纯文本模型且存在对应官方包装路由,
66
+ 仅把该次请求的 provider 改为包装 provider;原生视觉模型保持不变。
67
+
68
+ ## 验收口径
69
+
70
+ 插件安装、包装模型出现和 CLI 成功返回,只证明集成链路可执行。代码截图识别、图表
71
+ 数据提取、成本节省和端到端延迟必须使用真实视觉引擎逐项测量,不能用测试桩返回值
72
+ 或官方宣传值代替实测。
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write plugins/model-router-galgame/README.md
5
- README.md: b7d045f1e8adc707ef3ab2e79ef75bbbd8dd8238
6
- README.zh.md: 586d2533af0bae92b4c9879c1a717bc152067b2e
5
+ README.md: e994858590d5d9b2b34bd2d920bfdb29e2b39104
6
+ README.zh.md: f68c76a54cf2f7a0cbe7edeb42d1112fe32aebad
package/README.md CHANGED
@@ -24,7 +24,7 @@ This plugin installs on an original DeepSeek Harness checkout. It adds a cost-aw
24
24
 
25
25
  ### Requirements
26
26
 
27
- - DeepSeek Harness / DSH Desktop 0.4.8 or newer.
27
+ - Verified targets: DSH Desktop 2.0.5 or `@deepseek-ai/dsh@0.1.2-rc.1`. The in-app update controls require DSH Desktop 2.0.5 or newer.
28
28
  - Node.js 22.19 or newer (the current DSH Desktop release uses Node 24).
29
29
  - At least one LLM provider configured in Harness.
30
30
  - A network connection to the npm registry for the first installation.
@@ -164,10 +164,10 @@ pnpm dsh plugin --profile web add "@ljwei-stak/model-router-galgame@$routerVersi
164
164
  ```
165
165
 
166
166
  For a reproducible deployment, replace `$routerVersion` with a concrete version
167
- that you have verified with `npm view` (for example `0.4.19`):
167
+ that you have verified with `npm view` (for example `0.4.20`):
168
168
 
169
169
  ```powershell
170
- pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.19
170
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.20
171
171
  ```
172
172
 
173
173
  You can also ask pnpm to update an already-installed package within its declared
package/README.zh.md CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  ### 前置条件
26
26
 
27
- - DeepSeek Harness / DSH Desktop 0.4.8 或更高版本。
27
+ - 已验证目标为 DSH Desktop 2.0.5 或 `@deepseek-ai/dsh@0.1.2-rc.1`;插件内更新控件需要 DSH Desktop 2.0.5 或更高版本。
28
28
  - Node.js 22.19 或更高版本(当前 DSH Desktop 使用 Node 24)。
29
29
  - Harness 中至少配置一个 LLM provider。
30
30
  - 首次安装需要能够访问 npm registry。
@@ -151,10 +151,10 @@ pnpm dsh plugin --profile web add "@ljwei-stak/model-router-galgame@$routerVersi
151
151
  ```
152
152
 
153
153
  如果需要可复现部署,请把 `$routerVersion` 替换为通过 `npm view` 确认过的具体版本号
154
- (例如 `0.4.19`):
154
+ (例如 `0.4.20`):
155
155
 
156
156
  ```powershell
157
- pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.19
157
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.20
158
158
  ```
159
159
 
160
160
  已经安装过插件时,也可以让 pnpm 在当前版本范围内更新:
@@ -263,7 +263,7 @@ Harness 原生审批界面处理。路由器不会改变审批结论,只会在
263
263
 
264
264
  ## 数学路由模型
265
265
 
266
- 本节按照 `RESEARCH_PAPER_FRAMEWORK.md` 的论文框架,完整说明当前 `0.4.19`
266
+ 本节按照 `RESEARCH_PAPER_FRAMEWORK.md` 的论文框架,完整说明当前 `0.4.20`
267
267
  实现。生产路由器与离线实验插件共用质量下限、费用模型、目标函数和回退语义;
268
268
  生产实现进一步加入 Pareto 剪枝与有界全局搜索,因此不再是互相独立的逐阶段局部贪心。
269
269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ljwei-stak/model-router-galgame",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "type": "module",
5
5
  "description": "DeepSeek Harness plugin: adaptive model routing, cost analysis and GAL view",
6
6
  "repository": {
@@ -42,10 +42,12 @@
42
42
  ".dsh-plugin/index.mjs",
43
43
  ".dsh-plugin/client.js",
44
44
  ".dsh-plugin/shared/**/*.mjs",
45
- "cordis.patch.yml",
46
- "README.md",
47
- "README.zh.md",
48
- "LICENSE"
45
+ "cordis.patch.yml",
46
+ "README.md",
47
+ "README.zh.md",
48
+ "INSTALLATION_GUIDE.zh.md",
49
+ "MODLENS_DEPLOYMENT.md",
50
+ "LICENSE"
49
51
  ],
50
52
  "scripts": {
51
53
  "build:client": "node scripts/build-client.mjs",