@ljwei-stak/model-router-galgame 0.4.23 → 0.4.25

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.
@@ -28,6 +28,7 @@ import {
28
28
  } from './shared/web-routing.mjs'
29
29
  import { registerNpmUpdateRoute } from './shared/npm-update.mjs'
30
30
  import { registerGalGameRoutes } from './shared/gal-game-service.mjs'
31
+ import { watcherStatus } from './shared/watcher.mjs'
31
32
 
32
33
  let settingsRuntimePromise
33
34
  let routerSettings = { ...DEFAULT_ROUTER_SETTINGS }
@@ -233,7 +234,7 @@ function webMessage(plan) {
233
234
  id: newMessageId(),
234
235
  role: 'user',
235
236
  content: [{ type: 'text', text }],
236
- source: { kind: 'plugin', plugin: name, form: 'web-capability', summary: '联网与可见浏览器策略' },
237
+ source: { kind: 'plugin', plugin: name, form: 'instructions', summary: '联网与可见浏览器策略' },
237
238
  }
238
239
  }
239
240
 
@@ -271,7 +272,7 @@ function personaMessage(state, agent, step) {
271
272
  id: newMessageId(),
272
273
  role: 'user',
273
274
  content: [{ type: 'text', text }],
274
- source: { kind: 'plugin', plugin: name, form: 'persona', summary: '最终答复表达层' },
275
+ source: { kind: 'plugin', plugin: name, form: 'instructions', summary: '最终答复表达层' },
275
276
  }
276
277
  }
277
278
 
@@ -496,7 +497,7 @@ export function apply(ctx) {
496
497
  // the whole composer submission; the GAL client sends this command
497
498
  // without image bytes so the attachment remains available for the next
498
499
  // user turn.
499
- input: { hint: 'mode collective|single | plan | safety', images: true },
500
+ input: { hint: 'mode collective|single | plan | safety | watcher', images: true },
500
501
  recordInput: true,
501
502
  handler: ({ agent, rawInput }) => {
502
503
  const state = stateFor(agent)
@@ -517,10 +518,17 @@ export function apply(ctx) {
517
518
  if (value === 'safety' || value === 'approval') {
518
519
  return { kind: 'success', text: JSON.stringify({ ...approvalGateStatus(ctx), context: approvalSafetyContext(state, state.lastStep) }) }
519
520
  }
521
+ if (value === 'watcher') {
522
+ const watcher = watcherStatus(ctx, agent)
523
+ return { kind: 'success', text: JSON.stringify({
524
+ ...watcher,
525
+ router: { mode: state.mode, lastRoute: watcher.insights?.turn?.route ?? null },
526
+ }) }
527
+ }
520
528
  if (value === 'web' || value === 'network') {
521
529
  return { kind: 'success', text: JSON.stringify({ ...webCapabilityStatus(ctx), context: webCapabilityForPlan(state.taskText, state.plan) }) }
522
530
  }
523
- return { kind: 'error', text: '用法:/router mode collective、/router mode single、/router plan、/router safety 或 /router web' }
531
+ return { kind: 'error', text: '用法:/router mode collective、/router mode single、/router plan、/router safety、/router web 或 /router watcher' }
524
532
  },
525
533
  })
526
534
 
@@ -0,0 +1,29 @@
1
+ /** Read the current agent's native Watcher projection without changing its session. */
2
+ export const WATCHER_PACKAGE = '@ljwei-stak/dsh-watcher-for-mrg'
3
+ export const WATCHER_VERSION = '0.4.0'
4
+ export const WATCHER_PROJECTION = 'watcherInsights'
5
+
6
+ export function watcherStatus(ctx, agent) {
7
+ const status = {
8
+ package: WATCHER_PACKAGE,
9
+ version: WATCHER_VERSION,
10
+ bundled: true,
11
+ readOnly: true,
12
+ projection: WATCHER_PROJECTION,
13
+ sessionId: agent?.session?.id ?? null,
14
+ }
15
+ let projections
16
+ try { projections = ctx.get?.('sessionProjections') ?? ctx.sessionProjections } catch {}
17
+ if (typeof projections?.snapshot !== 'function') return { ...status, status: 'unavailable' }
18
+ if (!agent?.session) return { ...status, status: 'no-session' }
19
+ try {
20
+ const snapshot = projections.snapshot(agent.session, [WATCHER_PROJECTION])
21
+ const insights = snapshot?.values?.[WATCHER_PROJECTION]
22
+ if (!insights) return { ...status, status: 'not-loaded' }
23
+ if (insights.sessionId !== status.sessionId) return { ...status, status: 'session-mismatch' }
24
+ return { ...status, status: 'ready', asOfSeq: snapshot.asOfSeq, insights: structuredClone(insights) }
25
+ } catch (error) {
26
+ ctx.logger?.warn?.(`model-router: Watcher projection failed: ${String(error)}`)
27
+ return { ...status, status: 'error' }
28
+ }
29
+ }
@@ -16,9 +16,22 @@
16
16
 
17
17
  ---
18
18
 
19
+ ## Watcher 工作路径与用量统计
20
+
21
+ 0.4.25 聚合包自动安装 `@ljwei-stak/dsh-watcher-for-mrg@0.4.0`。重启后,在普通
22
+ 对话或 GAL 工作会话的原生标题栏点击眼睛按钮,可查看工作路径、工具执行和模型用量;
23
+ 设置中的 Watcher 页面提供本地会话汇总。`/router watcher` 可检查当前会话投影是否
24
+ 加载。此功能不改变模型路由和审批规则,也不额外发起模型请求。
25
+
26
+ 同一配置只保留一个 Watcher 实例。安装 Router 前先执行 `dsh plugin list`;若列表中
27
+ 有独立安装的上游 `dsh-watcher` 或 `@ljwei-stak/dsh-watcher-for-mrg`,按实际包名执行
28
+ `dsh plugin remove dsh-watcher` 或
29
+ `dsh plugin remove @ljwei-stak/dsh-watcher-for-mrg`。然后再安装 Router 聚合包,避免
30
+ 重复 loader ID。详情见 [Watcher 项目](https://github.com/ljwei-stak/dsh-watcher-For_MRG)。
31
+
19
32
  ## PPT 生成扩展
20
33
 
21
- 从 0.4.22 起,Router 聚合包自动安装并加载 PPT Master;当前 0.4.23 固定使用 `@ljwei-stak/ppt-master-for-mgr@6.3.2`,修复 Python 3.13 及更新版本在 Windows DSH 沙箱中导出 PPTX 时的临时目录权限错误。制作 PPT 时使用普通工作会话或 GAL 工作会话,在代理预设中启用 DSH 原生 `skill`、文件和终端工具,并在实际执行环境中安装 Python 3.10+;继续保留宿主沙箱和审批设置。
34
+ 从 0.4.22 起,Router 聚合包自动安装并加载 PPT Master;当前 0.4.25 固定使用 `@ljwei-stak/ppt-master-for-mgr@6.3.2`,修复 Python 3.13 及更新版本在 Windows DSH 沙箱中导出 PPTX 时的临时目录权限错误。制作 PPT 时使用普通工作会话或 GAL 工作会话,在代理预设中启用 DSH 原生 `skill`、文件和终端工具,并在实际执行环境中安装 Python 3.10+;继续保留宿主沙箱和审批设置。
22
35
 
23
36
  ```sh
24
37
  npx --yes --package=@ljwei-stak/ppt-master-for-mgr@6.3.2 ppt-master-for-mgr doctor
@@ -37,7 +50,7 @@ npx --yes --package=@ljwei-stak/ppt-master-for-mgr@6.3.2 ppt-master-for-mgr doct
37
50
  dsh version
38
51
 
39
52
  # 预期输出示例:
40
- # 已验证:@deepseek-ai/dsh 0.1.2-rc.1;桌面端使用 DSH Desktop 2.0.5+
53
+ # 已验证:@deepseek-ai/dsh 0.1.2-rc.1;桌面端使用 DSH Desktop 2.0.7+
41
54
  ```
42
55
 
43
56
  **如果未安装 Harness**,请先安装:
@@ -98,8 +111,8 @@ sudo mv dsh /usr/local/bin/
98
111
 
99
112
  ```powershell
100
113
  pnpm config set registry https://registry.npmjs.org/
101
- pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.23
102
- pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.23
114
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.25
115
+ pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.25
103
116
  ```
104
117
 
105
118
  ### 方法2: Git 克隆(仅源码开发)
@@ -163,11 +176,11 @@ model-router-galgame/
163
176
 
164
177
  ```powershell
165
178
  pnpm config set registry https://registry.npmjs.org/
166
- pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.23
167
- pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.23
179
+ pnpm dsh plugin --profile web add @ljwei-stak/model-router-galgame@0.4.25
180
+ pnpm dsh plugin --profile desktop add @ljwei-stak/model-router-galgame@0.4.25
168
181
  ```
169
182
 
170
- 其中 `@0.4.23` 可以替换为通过 `npm view @ljwei-stak/model-router-galgame version --registry=https://registry.npmjs.org/` 查询到的版本号。官方 ModLens、审批门控、ModSearch、Ego Browser 和 PPT Master 依赖会自动解析;PPT 的 Python 依赖另按本指南开头步骤配置。
183
+ 其中 `@0.4.25` 可以替换为通过 `npm view @ljwei-stak/model-router-galgame version --registry=https://registry.npmjs.org/` 查询到的版本号。官方 ModLens、审批门控、ModSearch、Ego Browser、PPT Master 和 Watcher 依赖会自动解析;PPT 的 Python 依赖另按本指南开头步骤配置。
171
184
 
172
185
  如果正在本地开发,再使用目录安装:
173
186
 
@@ -194,7 +207,7 @@ dsh plugin --profile web add /path/to/model-router-galgame
194
207
  dsh plugin --profile web list
195
208
 
196
209
  # 预期输出包含:
197
- # @ljwei-stak/model-router-galgame@0.4.23
210
+ # @ljwei-stak/model-router-galgame@0.4.25
198
211
  ```
199
212
 
200
213
  ### 步骤4: 重启 Harness
@@ -774,7 +787,7 @@ dsh restart
774
787
 
775
788
  ### ✅ 安装完成检查清单
776
789
 
777
- - [ ] 已安装 DSH Desktop 2.0.5+,或已验证的 `@deepseek-ai/dsh@0.1.2-rc.1`
790
+ - [ ] 已安装 DSH Desktop 2.0.7+,或已验证的 `@deepseek-ai/dsh@0.1.2-rc.1`
778
791
  - [ ] 已从 npm registry 安装 `@ljwei-stak/model-router-galgame`
779
792
  - [ ] 插件已通过 `dsh plugin --profile <name> add` 安装
780
793
  - [ ] Harness 已重启
@@ -801,5 +814,5 @@ dsh restart
801
814
 
802
815
  **文档版本**: 1.0
803
816
  **更新日期**: 2026-09-01
804
- **适用插件版本**: 0.4.23
805
- **已验证宿主版本**: DSH Desktop 2.0.5 / `@deepseek-ai/dsh@0.1.2-rc.1`
817
+ **适用插件版本**: 0.4.25
818
+ **已验证宿主版本**: DSH Desktop 2.0.7 / `@deepseek-ai/dsh@0.1.2-rc.1`
package/README.md CHANGED
@@ -4,7 +4,7 @@ English | [中文](README.zh.md)
4
4
 
5
5
  A model-routing and GAL conversation plugin for DeepSeek Harness / DSH Desktop. It combines task assignment, cost estimates, model-character dialogue, web tools, PPT generation skills, and approval integration in one npm package, and runs inside an existing DSH host.
6
6
 
7
- **Current release: 0.4.23** · [npm package](https://www.npmjs.com/package/@ljwei-stak/model-router-galgame) · [GitHub Releases](https://github.com/ljwei-stak/model-router-galgame/releases) · [DSH Desktop](https://github.com/anywhere-labs/dsh-desktop/releases)
7
+ **Current release: 0.4.25** · [npm package](https://www.npmjs.com/package/@ljwei-stak/model-router-galgame) · [GitHub Releases](https://github.com/ljwei-stak/model-router-galgame/releases) · [DSH Desktop](https://github.com/anywhere-labs/dsh-desktop/releases)
8
8
 
9
9
  ## Features
10
10
 
@@ -42,19 +42,41 @@ Story mode does not require provider credentials. Free mode requires a working m
42
42
  - **Ego Browser** provides visible browser tools for tasks requiring JavaScript, login sessions, or page interaction. The router guides models to switch to the browser after search failures; users complete CAPTCHAs and human verification.
43
43
  - **Approval integration** attaches work-package, stage, model, and task-count context to sandbox escalation requests in multi-task work. Approval decisions, human confirmation, auditing, and learning are handled by `@ljwei-stak/dsh-approval-gate` and the host permission policy. Installing the router does not enable automatic approval.
44
44
  - **OpenCode Zen compatibility** repairs OpenCode endpoint overrides mistakenly set to official website URLs while preserving custom gateways.
45
+ - **DSH 2.0.7 session compatibility** uses the host's supported plugin-source forms for routing, persona, and web context, so new Router messages remain loadable after the host migrates its session format.
45
46
 
46
47
  ### PowerPoint generation with PPT Master
47
48
 
48
49
  - **PPT Master** is bundled as a native DSH skill. In a normal work conversation, a PowerPoint/PPT/PPTX request can load `ppt-master` through the host's `skill` tool and follow its planning, SVG, validation, and PPTX export workflow.
49
50
  - Model Router keeps the host's skill catalog, loaded skill instructions, and file/terminal tools available when it chooses a model or advances a work stage. Use ordinary chat or the GAL conversation view for presentation work; story mode does not run tools, and free-play character dialogue is not the work agent.
50
51
  - The package includes the skill, Python scripts, and templates. Python dependencies require the explicit setup below; npm installation does not install Python or run pip. Generated presentations belong in the conversation's writable workspace.
51
- - Router 0.4.23 bundles PPT Master 6.3.2, which fixes PPTX staging-directory permissions under the Windows DSH sandbox with Python 3.13 or newer. Host sandbox and approval settings remain in effect.
52
+ - Router 0.4.25 bundles PPT Master 6.3.2, which fixes PPTX staging-directory permissions under the Windows DSH sandbox with Python 3.13 or newer. Host sandbox and approval settings remain in effect.
53
+
54
+ ### Watcher work paths and model usage
55
+
56
+ Router 0.4.25 includes [`@ljwei-stak/dsh-watcher-for-mrg@0.4.0`](https://github.com/ljwei-stak/dsh-watcher-For_MRG).
57
+ Open the eye button in the native session header from Chat or the GAL work view
58
+ to inspect turns, parallel tools, retries, timing, and recorded token usage.
59
+ The Watcher settings section summarizes local session usage; provider and model
60
+ identities stay separate when Router switches models. Only reasoning already
61
+ recorded by the provider is shown. Story and free-play dialogue are outside the
62
+ native work-session statistics.
63
+
64
+ `/router watcher` reads the current session's `watcherInsights` projection and
65
+ reports whether it is loaded, together with Router's latest route. Watcher does
66
+ not alter routing, prompts, tools, approvals, or model requests.
67
+
68
+ Install the Router aggregate package once. Before installing it, check `dsh plugin list`
69
+ in the same profile. If either upstream `dsh-watcher` or the scoped
70
+ `@ljwei-stak/dsh-watcher-for-mrg` is listed as a standalone plugin, remove the listed
71
+ package with `dsh plugin remove dsh-watcher` or
72
+ `dsh plugin remove @ljwei-stak/dsh-watcher-for-mrg`. Router supplies its own pinned
73
+ Watcher entry, and retaining either standalone entry would duplicate the loader ID.
52
74
 
53
75
  ### Separate plugin and desktop updates
54
76
 
55
77
  "GAL 视窗 → 项目更新" (GAL view → Project updates) checks the plugin's npm version and the official DSH Desktop version separately. It offers "仅更新 npm 插件" (Update only the npm plugin), "仅更新完整客户端" (Update only the full client), and "一键更新插件与客户端" (Update plugin and client). Desktop plugin installation runs through the authenticated host connection. Fully exit and restart DSH Desktop after a successful installation.
56
78
 
57
- A page opened in a regular browser can check the plugin version and open download pages, but cannot install the desktop client or change its profile directly. The plugin's `0.4.23` version and DSH Desktop's version are independent.
79
+ A page opened in a regular browser can check the plugin version and open download pages, but cannot install the desktop client or change its profile directly. The plugin's `0.4.25` version and DSH Desktop's version are independent.
58
80
 
59
81
  ## Installation
60
82
 
@@ -62,7 +84,7 @@ A page opened in a regular browser can check the plugin version and open downloa
62
84
 
63
85
  | Environment | Requirements and installation entry point |
64
86
  | --- | --- |
65
- | DSH Desktop installed | Verified with DSH Desktop 2.0.5. On Windows / macOS, use "打开 DSH 终端" (Open DSH terminal) in Settings. If this entry is unavailable, use the CLI instructions below with the actual profile. |
87
+ | DSH Desktop installed | Verified with DSH Desktop 2.0.7. On Windows / macOS, use "打开 DSH 终端" (Open DSH terminal) in Settings. If this entry is unavailable, use the CLI instructions below with the actual profile. |
66
88
  | Harness Web / CLI | Verified with `@deepseek-ai/dsh@0.1.2-rc.1`. Requires working `dsh` and `pnpm` commands and an explicit `--profile`. |
67
89
  | Node.js | The plugin declares `>=22.19`; the official CLI above requires `^22.19.0` or `>=24.0.0`. Node.js 24 is recommended. Prefer the bundled runtime for desktop installations. |
68
90
  | Models and network | Routing, AI conversation, and free mode require at least one working model provider. Story mode requires no model API. Installation requires access to `https://registry.npmjs.org/`. |
@@ -76,7 +98,7 @@ Installing this npm package does not install DSH Desktop, model services, or a b
76
98
 
77
99
  ```sh
78
100
  dsh --version
79
- dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
101
+ dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
80
102
  ```
81
103
 
82
104
  3. After installation succeeds, use the desktop restart control, or explicitly quit from the system tray and reopen the app. Select the same profile. Closing the window may only hide the application.
@@ -91,7 +113,7 @@ If you do not have a global `dsh` but already have Node.js/npm and pnpm, replace
91
113
 
92
114
  ```sh
93
115
  dsh --version
94
- dsh plugin --profile web add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
116
+ dsh plugin --profile web add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
95
117
  dsh --profile web --dump-config
96
118
  ```
97
119
 
@@ -113,16 +135,17 @@ For desktop, run this in the DSH terminal opened by the app:
113
135
  dsh --dump-config
114
136
  ```
115
137
 
116
- For Web / CLI, use `dsh --profile web --dump-config`. The combined configuration should include all six plugins below, with no duplicate loader IDs. A configuration dump does not replace checking that the host starts successfully. Install only the Router aggregate package; its dependencies and bundle entries are added automatically.
138
+ For Web / CLI, use `dsh --profile web --dump-config`. The combined configuration should include all seven plugins below, with no duplicate loader IDs. A configuration dump does not replace checking that the host starts successfully. Install only the Router aggregate package; its dependencies and bundle entries are added automatically.
117
139
 
118
- | Plugin | Pinned version for 0.4.23 | Purpose |
140
+ | Plugin | Pinned version for 0.4.25 | Purpose |
119
141
  | --- | --- | --- |
120
- | `@ljwei-stak/model-router-galgame` | `0.4.23` | Routing, GAL view, story/free modes, and update controls |
142
+ | `@ljwei-stak/model-router-galgame` | `0.4.25` | Routing, GAL view, story/free modes, and update controls |
121
143
  | `@liustack/modlens` | `3.25.4` | Image understanding through compatible routes |
122
144
  | `@liustack/modsearch` | `5.10.1` | Search and page reading |
123
145
  | `@ljwei-stak/dsh-ego-browser` | `0.8.3` | Visible browser tools |
124
146
  | `@ljwei-stak/dsh-approval-gate` | `0.5.3` | Approval policies and auditing |
125
147
  | `@ljwei-stak/ppt-master-for-mgr` | `6.3.2` | Native PPT skill, scripts, and templates |
148
+ | `@ljwei-stak/dsh-watcher-for-mrg` | `0.4.0` | Read-only work paths and actual model usage |
126
149
 
127
150
  `schemastery@3.18.0` and PPT Master's native skill provider are also installed automatically as runtime dependencies. These dependencies are pinned: updating Router uses the dependency combination declared by the new Router package, rather than updating every dependency to its own `latest`.
128
151
 
@@ -161,6 +184,7 @@ To play without a model API, open **"GAL视窗 → GAL游戏 → 剧情模式" (
161
184
  | `/router plan` | Show the latest routing plan for the current conversation |
162
185
  | `/router safety` | Show approval bridge status and the current stage context |
163
186
  | `/router web` | Show declared web capabilities, host service detection, and task strategy |
187
+ | `/router watcher` | Read Watcher statistics and loading status for the current session |
164
188
 
165
189
  The default mode is `collective`. `/router safety` and `/router web` are status summaries; they do not certify that end-to-end approval or browser diagnostics have passed. Routing summaries do not expose private model chain-of-thought.
166
190
 
@@ -214,7 +238,7 @@ For example, only after confirming that ModLens is a duplicate standalone depend
214
238
 
215
239
  ```sh
216
240
  dsh plugin remove @liustack/modlens
217
- dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
241
+ dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
218
242
  ```
219
243
 
220
244
  For Web / CLI, add `--profile web` after `plugin` in both commands. Handle other duplicate dependencies according to the actual error; do not remove all plugins at once. These removal commands are unnecessary when no duplicate entry exists.
@@ -230,7 +254,7 @@ dsh plugin add /absolute/path/to/model-router-galgame
230
254
 
231
255
  Replace the path with the actual absolute path and quote it if it contains spaces. For Web / CLI, use `dsh plugin --profile web add <actual-path>`. The npm package includes ready-to-load build output, but excludes the full client source, tests, and original assets.
232
256
 
233
- After modifying client source, run `npm test`, `npm run build:client`, and `npm run check:client` in the plugin repository. The current build script depends on build output from an adjacent `DSH-Desktop` source checkout and on esbuild. Installing this plugin's npm dependencies alone is not enough to set up the complete build environment. A `SKIP` result does not count as successful build verification.
257
+ After cloning, run `pnpm install --frozen-lockfile`. The lockfile pins the DSH SDK used to build the browser client, so an adjacent DSH Desktop source checkout is not required. After modifying client source, run `npm test`, `npm run build:client`, `npm run check:client`, and `pnpm peers check`. A `SKIP` result does not count as successful build verification.
234
258
 
235
259
  ## Mathematical routing model
236
260
 
package/README.zh.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  适用于 DeepSeek Harness / DSH Desktop 的模型路由与 GAL 对话插件。它把任务分配、费用估算、模型角色对话、联网工具、PPT 生成技能和审批适配整合为一个 npm 插件包,需要在已有的 DSH 宿主中使用。
6
6
 
7
- **当前发布版本:0.4.23** · [npm 包](https://www.npmjs.com/package/@ljwei-stak/model-router-galgame) · [GitHub Releases](https://github.com/ljwei-stak/model-router-galgame/releases) · [DSH Desktop](https://github.com/anywhere-labs/dsh-desktop/releases)
7
+ **当前发布版本:0.4.25** · [npm 包](https://www.npmjs.com/package/@ljwei-stak/model-router-galgame) · [GitHub Releases](https://github.com/ljwei-stak/model-router-galgame/releases) · [DSH Desktop](https://github.com/anywhere-labs/dsh-desktop/releases)
8
8
 
9
9
  ## 功能介绍
10
10
 
@@ -42,19 +42,37 @@
42
42
  - **Ego Browser**:为需要 JavaScript、登录态或页面交互的任务提供可见浏览器工具。路由器向模型提供搜索失败后切换浏览器的指导;验证码和人机验证交由用户完成。
43
43
  - **审批适配**:在多任务沙箱升级请求中附加工作包、阶段、模型和任务数量。审批决定、人工确认、审计与学习由 `@ljwei-stak/dsh-approval-gate` 和宿主权限策略负责,安装路由器不等于开启自动批准。
44
44
  - **OpenCode Zen 兼容**:修复误填成官方网页地址的 OpenCode 端点覆盖,保留自定义网关。
45
+ - **DSH 2.0.7 会话兼容**:路由、Persona 与联网指令只使用宿主支持的插件消息来源类型,避免 DSH 升级会话格式后无法重新加载 Router 消息。
45
46
 
46
47
  ### PPT Master 演示文稿生成
47
48
 
48
49
  - **PPT Master** 以 DSH 原生 skill 随包加载。在普通工作会话中收到 PowerPoint/PPT/PPTX 需求后,模型可通过宿主 `skill` 工具加载 `ppt-master`,按规划、SVG 制作、检查和 PPTX 导出的流程执行。
49
50
  - Model Router 在选择模型和推进工作阶段时保留宿主技能目录、已加载的技能指令及文件/终端工具。制作 PPT 应使用普通聊天或 GAL 工作会话;剧情模式不调用工具,自由模式的角色对话也不是工作代理。
50
51
  - 包内包含技能、Python 脚本和模板。Python 依赖需按下方步骤主动安装,npm 安装不会自动安装 Python 或运行 pip。生成的演示文稿保存在会话可写工作目录中。
51
- - Router 0.4.23 随包加载 PPT Master 6.3.2,修复 Python 3.13 及更新版本在 Windows DSH 沙箱中导出 PPTX 时的临时目录权限错误,宿主沙箱和审批设置仍然生效。
52
+ - Router 0.4.25 随包加载 PPT Master 6.3.2,修复 Python 3.13 及更新版本在 Windows DSH 沙箱中导出 PPTX 时的临时目录权限错误,宿主沙箱和审批设置仍然生效。
53
+
54
+ ### Watcher 工作路径与模型用量
55
+
56
+ Router 0.4.25 聚合 [`@ljwei-stak/dsh-watcher-for-mrg@0.4.0`](https://github.com/ljwei-stak/dsh-watcher-For_MRG)。
57
+ 在普通对话或 GAL 工作视图中,点击原生会话标题栏的眼睛按钮,可查看轮次、并行工具、
58
+ 重试、耗时和已记录的 token 用量。设置中的 Watcher 页面汇总本地会话用量;Router
59
+ 切换模型时按供应商和模型分别统计。推理记录只显示供应商已写入会话的内容。
60
+ 剧情模式和自由模式的独立角色对话不计入原生工作会话统计。
61
+
62
+ `/router watcher` 只读查询当前会话的 `watcherInsights`,报告加载状态、统计和
63
+ Router 最近使用的路由。Watcher 不修改模型路由、提示词、工具、审批或模型请求。
64
+
65
+ 只需安装 Router 聚合包。安装前先在同一 profile 执行 `dsh plugin list`。如果列表中
66
+ 存在独立安装的上游 `dsh-watcher` 或 `@ljwei-stak/dsh-watcher-for-mrg`,按列表中的包名
67
+ 执行 `dsh plugin remove dsh-watcher` 或
68
+ `dsh plugin remove @ljwei-stak/dsh-watcher-for-mrg`。Router 会加载其固定版本的 Watcher;
69
+ 保留任一独立条目都会形成重复的 loader ID。
52
70
 
53
71
  ### 插件与桌面端分别更新
54
72
 
55
73
  “GAL 视窗 → 项目更新”分别检查插件 npm 版本和官方 DSH Desktop 版本。支持“仅更新 npm 插件”“仅更新完整客户端”和“一键更新插件与客户端”。桌面端插件安装通过已认证的宿主连接执行,成功后需要完全退出并重启 DSH Desktop。
56
74
 
57
- 普通浏览器中的页面可以查询插件版本、打开下载页面,但不能直接安装桌面端或修改其 profile。插件的 `0.4.23` 与 DSH Desktop 的版本号相互独立。
75
+ 普通浏览器中的页面可以查询插件版本、打开下载页面,但不能直接安装桌面端或修改其 profile。插件的 `0.4.25` 与 DSH Desktop 的版本号相互独立。
58
76
 
59
77
  ## 安装
60
78
 
@@ -62,7 +80,7 @@
62
80
 
63
81
  | 环境 | 要求与安装入口 |
64
82
  | --- | --- |
65
- | 已安装 DSH Desktop | 已验证 DSH Desktop 2.0.5。Windows / macOS 使用设置页的“打开 DSH 终端”;没有该入口时按下方 CLI 方式指定实际 profile。 |
83
+ | 已安装 DSH Desktop | 已验证 DSH Desktop 2.0.7。Windows / macOS 使用设置页的“打开 DSH 终端”;没有该入口时按下方 CLI 方式指定实际 profile。 |
66
84
  | Harness Web / CLI | 已验证 `@deepseek-ai/dsh@0.1.2-rc.1`。需要可用的 `dsh` 与 `pnpm`,使用明确的 `--profile`。 |
67
85
  | Node.js | 插件声明 `>=22.19`;上述官方 CLI 要求 `^22.19.0` 或 `>=24.0.0`,建议 Node.js 24。桌面端优先使用其内置运行时。 |
68
86
  | 模型与网络 | 路由、AI 对话与自由模式至少需要一个可用的模型 provider;剧情模式不需要模型 API。安装时能访问 `https://registry.npmjs.org/`。 |
@@ -76,7 +94,7 @@
76
94
 
77
95
  ```sh
78
96
  dsh --version
79
- dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
97
+ dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
80
98
  ```
81
99
 
82
100
  3. 安装成功后,使用桌面端的重启入口,或从托盘明确退出后重新打开,仍选择刚才的 profile。仅关闭窗口可能只是隐藏应用。
@@ -91,7 +109,7 @@ dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/m
91
109
 
92
110
  ```sh
93
111
  dsh --version
94
- dsh plugin --profile web add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
112
+ dsh plugin --profile web add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
95
113
  dsh --profile web --dump-config
96
114
  ```
97
115
 
@@ -113,16 +131,17 @@ dsh web
113
131
  dsh --dump-config
114
132
  ```
115
133
 
116
- Web / CLI 使用 `dsh --profile web --dump-config`。组合后的配置应包含以下六个插件,且没有重复 loader ID。配置导出不能替代实际启动验证;只需安装 Router 聚合包,依赖和 bundle 条目会自动加入。
134
+ Web / CLI 使用 `dsh --profile web --dump-config`。组合后的配置应包含以下七个插件,且没有重复 loader ID。配置导出不能替代实际启动验证;只需安装 Router 聚合包,依赖和 bundle 条目会自动加入。
117
135
 
118
- | 插件 | 0.4.23 固定依赖版本 | 用途 |
136
+ | 插件 | 0.4.25 固定依赖版本 | 用途 |
119
137
  | --- | --- | --- |
120
- | `@ljwei-stak/model-router-galgame` | `0.4.23` | 路由、GAL 视窗、剧情/自由模式和更新入口 |
138
+ | `@ljwei-stak/model-router-galgame` | `0.4.25` | 路由、GAL 视窗、剧情/自由模式和更新入口 |
121
139
  | `@liustack/modlens` | `3.25.4` | 兼容路由的图片理解 |
122
140
  | `@liustack/modsearch` | `5.10.1` | 搜索与页面读取 |
123
141
  | `@ljwei-stak/dsh-ego-browser` | `0.8.3` | 可见浏览器工具 |
124
142
  | `@ljwei-stak/dsh-approval-gate` | `0.5.3` | 审批策略与审计 |
125
143
  | `@ljwei-stak/ppt-master-for-mgr` | `6.3.2` | 原生 PPT 技能、脚本和模板 |
144
+ | `@ljwei-stak/dsh-watcher-for-mrg` | `0.4.0` | 只读工作路径与实际模型用量 |
126
145
 
127
146
  `schemastery@3.18.0` 和 PPT Master 的原生技能提供器也会作为运行依赖自动安装。上述依赖采用固定版本;更新 Router 时使用新 Router 包声明的依赖组合,而不是自动升级每个依赖到各自的 `latest`。
128
147
 
@@ -161,6 +180,7 @@ npx --yes --package=@ljwei-stak/ppt-master-for-mgr@6.3.2 ppt-master-for-mgr doct
161
180
  | `/router plan` | 查看当前会话最近一次路由方案 |
162
181
  | `/router safety` | 查看审批桥接状态和当前阶段上下文 |
163
182
  | `/router web` | 查看联网能力声明、宿主服务探测和任务策略 |
183
+ | `/router watcher` | 只读查看当前会话的 Watcher 统计和加载状态 |
164
184
 
165
185
  默认模式为 `collective`。`/router safety` 和 `/router web` 是状态摘要,不代表审批服务或浏览器端到端诊断已通过;路由摘要不展示模型私有思维链。
166
186
 
@@ -214,7 +234,7 @@ Web / CLI 使用 `dsh plugin --profile web remove @ljwei-stak/model-router-galga
214
234
 
215
235
  ```sh
216
236
  dsh plugin remove @liustack/modlens
217
- dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.23
237
+ dsh plugin add --save-exact --registry=https://registry.npmjs.org/ @ljwei-stak/model-router-galgame@0.4.25
218
238
  ```
219
239
 
220
240
  Web / CLI 在两条命令的 `plugin` 后加 `--profile web`。其他重复依赖按实际报错处理,不要一次删除全部插件。没有重复条目时不需要执行这些移除命令。
@@ -230,7 +250,7 @@ dsh plugin add /absolute/path/to/model-router-galgame
230
250
 
231
251
  把路径替换为实际绝对路径,含空格时加引号;Web / CLI 使用 `dsh plugin --profile web add <实际路径>`。npm 包含可直接加载的构建产物,但不包含完整客户端源码、测试和原始素材。
232
252
 
233
- 修改客户端源码后,在插件仓库运行 `npm test`、`npm run build:client` 和 `npm run check:client`。当前构建脚本依赖相邻的 `DSH-Desktop` 源码构建产物及 esbuild;仅安装本插件的 npm 依赖不足以建立完整构建环境。出现 `SKIP` 不算构建校验通过。
253
+ 克隆后先执行 `pnpm install --frozen-lockfile`。锁文件固定了构建浏览器客户端所需的 DSH SDK,不再要求相邻的 DSH Desktop 源码目录。修改客户端源码后,运行 `npm test`、`npm run build:client`、`npm run check:client` 和 `pnpm peers check`。出现 `SKIP` 不算构建校验通过。
234
254
 
235
255
  ## 数学路由模型
236
256
 
package/cordis.patch.yml CHANGED
@@ -12,6 +12,9 @@
12
12
  # Register PPT Master in the host's native skill catalog.
13
13
  - id: ppt-master-for-mgr
14
14
  name: '@ljwei-stak/ppt-master-for-mgr'
15
+ # Watcher observes the native session log in Chat and GAL work views.
16
+ - id: dsh-watcher
17
+ name: '@ljwei-stak/dsh-watcher-for-mrg'
15
18
  # The router annotates multi-task approval requests; dsh-approval-gate
16
19
  # owns the Flash decision, human handoff, audit and snapshot UI.
17
20
  - id: dsh-approval-gate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ljwei-stak/model-router-galgame",
3
- "version": "0.4.23",
3
+ "version": "0.4.25",
4
4
  "type": "module",
5
5
  "description": "DeepSeek Harness plugin: adaptive model routing, cost analysis and GAL view",
6
6
  "repository": {
@@ -67,13 +67,31 @@
67
67
  "@ljwei-stak/dsh-approval-gate": "0.5.3",
68
68
  "schemastery": "3.18.0",
69
69
  "@ljwei-stak/dsh-ego-browser": "0.8.3",
70
- "@ljwei-stak/ppt-master-for-mgr": "6.3.2"
70
+ "@ljwei-stak/ppt-master-for-mgr": "6.3.2",
71
+ "@ljwei-stak/dsh-watcher-for-mrg": "0.4.0"
71
72
  },
72
73
  "peerDependencies": {
73
- "@deepseek-ai/dsh-settings": "^0.1.1-rc.1",
74
+ "@deepseek-ai/dsh-settings": "^0.1.1-rc.1 || ^0.1.2-rc.1",
74
75
  "@deepseek-ai/schemastery": "^3.18.1"
75
76
  },
76
77
  "devDependencies": {
78
+ "@deepseek-ai/cordis": "4.0.2",
79
+ "@deepseek-ai/dsh-api-remotes": "0.1.2-rc.1",
80
+ "@deepseek-ai/dsh-api-session-controller": "0.1.2-rc.1",
81
+ "@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
82
+ "@deepseek-ai/dsh-client-ui-chat": "0.1.2-rc.1",
83
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1",
84
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
85
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
86
+ "@deepseek-ai/dsh-client-ui-session": "0.1.2-rc.1",
87
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1",
88
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
89
+ "@deepseek-ai/dsh-invariants": "0.1.2-rc.1",
90
+ "@deepseek-ai/dsh-scope": "0.1.2-rc.1",
91
+ "@deepseek-ai/dsh-session": "0.1.2-rc.1",
92
+ "@deepseek-ai/dsh-session-projection": "0.1.2-rc.1",
93
+ "@deepseek-ai/dsh-session-stats": "0.1.2-rc.1",
94
+ "@deepseek-ai/dsh-settings": "0.1.2-rc.1",
77
95
  "esbuild": "0.28.2",
78
96
  "lucide-react": "1.41.0",
79
97
  "playwright": "1.63.0",