@ljwei-stak/dsh-model-router 0.19.0 → 0.20.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.
@@ -1,6 +1,8 @@
1
1
  # 模型路由工作台:配置、规划与实际执行
2
2
 
3
- 适用版本:正式版 `@ljwei-stak/dsh-model-router@0.18.2`;声明兼容 DeepSeek Harness Desktop `0.2.0-rc.1 / 0.2.0-rc.2`。安装与开发见[中文 README](../README.zh.md),旧包迁移见[迁移说明](archive/MIGRATION.md)。
3
+ 适用版本:`@ljwei-stak/dsh-model-router@0.20.0`。声明兼容 DeepSeek Harness Desktop `0.2.0-rc.1 / 0.2.0-rc.2`。安装与开发见[中文 README](../README.zh.md),旧包迁移见[迁移说明](archive/MIGRATION.md)。
4
+
5
+ 0.20.0 在工作台增加**官方工具协作**和明确的执行环境选择。默认保留 CLI 自身配置的模型,分别记录推荐、请求和实际回报模型。Windows Claude 单包执行及 Claude → MiniMax 依赖交接、实际文件整合已通过;具体入口、费用和未验证范围见[验收记录](releases/0.20.0-validation.md)。
4
6
 
5
7
  0.15.0 新增四页布局、规划后直接展示路由建议、执行输入变化时丢弃旧预览,以及历史裁剪和重试后的费用累计保留。源码中的独立 UI 预览使用模拟数据,用于组件检查,不代表真实账号调用或桌面端到端验收。
6
8
 
@@ -28,7 +30,7 @@
28
30
  | 输入/输出单价 | 两项同时填写,单位 **USD / 百万 token**;未知留空,零表示确实按零价估算。 |
29
31
  | 缓存价 | 可选缓存读取/写入单价;应与相应供应商计费口径一致。 |
30
32
  | 擅长方向 | 英文小写标签,逗号分隔,例如 `code, reasoning`。 |
31
- | 官方 CLI 模型名 | 仅填厂商 CLI 已验证接受的名称;不等同于 Harness 模型 ID。ZCode 不支持逐次换模型。 |
33
+ | 官方 CLI 模型名 | 留空保留 CLI 自身配置的模型;仅显式填写厂商 CLI 已验证接受的名称才切换,不自动传 Harness 模型 ID。ZCode 不支持逐次换模型。 |
32
34
  | LiveBench 准确模型名称 | 可选的显式基准映射,须确认模型版本与推理档位一致;不自动猜测别名,也不证明实际执行参数。 |
33
35
  | 执行方式 | `auto`、`official` 优先适用的官方工具;`api` 只走模型目录 API。 |
34
36
  | 计费方式 | 默认 `subscription-first`;也可指定 `api-only` 或 `subscription-only`。 |
@@ -68,15 +70,26 @@
68
70
 
69
71
  ## 在工作台执行:预览后确认
70
72
 
71
- **在工作台执行**沿用任务文本和规划模式,允许选择路由方案并填写工作区。它仅发起只读执行;需要 CLI 修改文件时使用官方会话。
73
+ **在工作台执行**沿用任务文本和规划模式,允许选择执行方式、路由方案并填写工作区。
74
+
75
+ | 执行方式 | 适用范围 |
76
+ | --- | --- |
77
+ | **模型路由(只读)** | 支持单任务、团队分工和指定模型;沿用路由 CLI/API 及订阅失败策略,保持只读。 |
78
+ | **官方工具协作** | 先在上方选择**团队分工**;仅用当前模式已就绪的官方 CLI 顺序执行工作包,不自动回退 API。可选**只读检查**或**编辑文件**。 |
72
79
 
73
80
  1. 输入已经存在的工作区绝对路径,例如 `F:\projects\demo`;留空沿用上次运行的路径。
74
- 2. 点击**预览执行计划**。宿主根据当前目录、登录、额度、预算和方案给出与 `model_router_execute` 相同的决策,包括适用的省钱降级。
75
- 3. 核对预估费用、路线、工作包及全部确认项。超预算和直接启动无沙箱 CLI 的原因会合并展示。
81
+ 2. 选择执行方式;官方协作还需选择任务权限。点击**预览执行计划**。模型路由沿用 `model_router_execute` 的决策;官方协作与 `model_router_team_execute` 共用团队规划和执行逻辑,按所选权限筛选已配置路线、已安装且就绪的 CLI,因此可能与本地建议不同。
82
+ 3. 核对预估费用、每包路线、读写权限和全部确认项。**编辑文件**要求干净 Git 仓库与审批,先在独立工作树执行;全部步骤成功后,原仓库仍干净且基线匹配时才整合源码补丁。Git 忽略产物另行核查;整合失败会保留工作树供检查。
83
+
84
+ Windows 独立工作树保存在用户私有临时目录中,按原仓库路径分别存储;避免原工程所在盘只有普通修改权限、无法初始化 Harness ACL 的情况。源工程权限不因该操作改变。失败后可从运行记录查看独立路径;系统清理临时目录后可能无法续跑,重要成果应及时审阅和归档。
85
+
86
+ 编辑权限下还需选择**执行环境**。默认 **Harness 受限环境**保留进程沙箱,但 Windows 后端会限制状态写入及部分子进程管道;登录成功不能消除这些限制。**厂商 CLI 正常环境**保留原登录、配置、技能和 MCP,以当前用户权限运行,启动与续跑均须额外确认;工具可访问工作树外当前用户有权访问的资源,Git 工作树只负责改动回收。失败不会自动切换环境。运行记录会标明实际环境。
87
+
88
+ **只读检查**使用各 CLI 的受限工具集。Claude 此模式禁用 shell、技能和既有 MCP,并忽略用户设置;需要正常工具协作时选择**编辑文件**,在隔离工作树执行。
76
89
  4. 明确确认执行后才调用模型/CLI。期间状态变化可能导致宿主拒绝旧确认,需重新审阅。
77
90
  5. 在下方**执行记录与子任务**看结果、状态、实际渠道、原始失败原因和费用。实际运行可能计费。
78
91
 
79
- 修改任务、模式、路由方案或工作区等执行输入后,正在请求或已经返回的旧预览会被丢弃。重新预览并核对当前请求后才能确认执行。
92
+ 修改任务、规划模式、执行方式、任务权限、路由方案或工作区等输入后,正在请求或已经返回的旧预览会被丢弃。重新预览并核对当前请求后才能确认执行。官方协作不代替缺失的 CLI,不支持当前权限的工具也不会进入该模式的计划。
80
93
 
81
94
  **预览不会启动模型,确认会启动。** 模型 API 将任务文本发给供应商;CLI 可能读取工作区或其他其权限允许的文件。只读不等于所有 CLI 只能读取工作区,先看**预算与安全 → 安全边界**。
82
95
 
@@ -86,6 +99,8 @@
86
99
 
87
100
  记录展示分配模型、执行渠道、费用、步骤依赖和错误。任务/回答摘录会本地保存,因此分享日志或截图前先脱敏。
88
101
 
102
+ CLI 记录分别保留 Harness 推荐模型、显式请求 CLI 模型和 CLI 回报的实际模型,同时保留可用的入口、沙箱、用量及金额证据。无显式 CLI 映射时使用厂商自身配置;参数中的请求名称不等于实际模型证明。单工具 `cliModel` 可覆盖档案映射;团队 `cliModelsJson` 优先按工作包 ID,其次工具 ID,最后采用档案映射。没有实际回报时请核对厂商运行记录。
103
+
89
104
  - **只读路由/团队失败**:重跑失败步骤及依赖它的未完成步骤;已完成结果作为上下文保留。允许时可改派另一条已配置路线。
90
105
  - **可编辑团队失败**:符合条件时在新独立工作树中套用此前改动后续跑;要求原仓库干净且仍在原基线。已经整合或等待人工整合的运行不能任意单步重跑。
91
106
  - **单工具调用失败**:重新执行原调用,生成关联的新运行;可编辑模式仍需审批。
@@ -95,10 +110,14 @@
95
110
 
96
111
  保存的任务文本最多 20,000 字符,单个回答最多 4,000 字符;历史不是完整交付文件的替代,重跑可能使用截断后的上下文。
97
112
 
113
+ 重跑完成后以新的步骤状态、回答和时间为准;已成功的步骤不应继续显示上次失败原因。记录中的只读/可编辑模式对应实际执行权限,不能从“官方 CLI”渠道名称单独推断。
114
+
98
115
  ## 官方工具:体检、安装与登录
99
116
 
100
117
  当前注册表包括 Kimi、Claude、Codex、MiniMax、MiMo、Grok、Gemini、OpenCode、Step Code 和 ZCode。点**重新体检**查看实际安装、版本、入口及账号状态;最新版查询失败时保持未知,不表示已无更新。
101
118
 
119
+ 版本检测与 CLI 登录状态命令绑定所选安装副本的实际入口。该副本缺失或入口不可用时,不使用 PATH 中另一份同名工具代替;对应登录状态保持未知。已安装、入口就绪、已登录和模型权限仍是四项独立检查。
120
+
102
121
  1. 未安装时可从卡片固定官方来源安装;npm 工具安装厂商 `@latest`。新厂商版本没有自动通过本项目测试。
103
122
  2. 安装中可查看日志或取消;取消后重新体检确认状态。
104
123
  3. 有更新时可更新;已安装版本比查询结果更高时不会降级。
@@ -147,7 +166,7 @@ MiniMax 官方 Windows 脚本的 `<# ... #>` 是 PowerShell 帮助注释。0.18.
147
166
 
148
167
  “—”表示当前厂商未提供相应渠道。每个工具的安装方式下拉框保留所有声明方式,并说明本机不适用的原因。MiniMax 官方脚本只接受官方 npm 源或 npmmirror;其他 npm 镜像请选 npm/pnpm 方式。
149
168
 
150
- 安装成功只表示所选目录的命令入口和版本已确认,不代表工具支持受限执行。Gemini 使用核验后的 npm/pnpm 包入口无界面执行;OpenCode、Step 当前可安装和在终端中使用,尚不支持受限任务。缺少这类能力不再报安装失败。Kimi、MiMo、Grok 的独立原生脚本安装目前没有插件需要的 npm 文件摘要证明,自动任务会显示执行入口未就绪并回退到 API;npm/pnpm 安装保留可核验的执行路径。Windows Codex 脚本使用目录联接,插件不提供通用文件删除卸载;请按官方方式移除原生安装。
169
+ 安装成功只表示所选目录的命令入口和版本已确认,不代表工具支持受限执行。Gemini 使用核验后的 npm/pnpm 包入口无界面执行;OpenCode、Step 当前可安装和在终端中使用,尚不支持受限任务。缺少这类能力不再报安装失败。Kimi、MiMo、Grok 的独立原生脚本安装目前没有插件需要的 npm 文件摘要证明,会显示执行入口未就绪;模型路由可按策略使用 API,官方工具协作则不选用该入口且不自动回退。npm/pnpm 安装保留可核验的执行路径。Windows Codex 脚本使用目录联接,插件不提供通用文件删除卸载;请按官方方式移除原生安装。
151
170
 
152
171
  ### 安装方式的会话与 Agent 等价物
153
172
 
@@ -164,7 +183,8 @@ MiniMax 官方 Windows 脚本的 `<# ... #>` 是 PowerShell 帮助注释。0.18.
164
183
 
165
184
  | 工具 ID | 单工具/团队执行支持 |
166
185
  | --- | --- |
167
- | `claude-code`、`codex`、`mimo-code`、`grok-build` | 只读,以及经审批的可编辑执行。 |
186
+ | `claude-code`、`mimo-code`、`grok-build` | 只读,以及经审批的可编辑执行。 |
187
+ | `codex` | Windows 托管只读;暂不支持可编辑执行,也不进入可编辑团队计划。 |
168
188
  | `kimi-code`、`minimax-code`、`zcode` | 经审批的可编辑执行。 |
169
189
  | `gemini` | 路由无界面适配器,不进入单工具/团队托管执行器。 |
170
190
  | `opencode`、`stepcode` | 尚未核验受限执行入口;插件负责安装、检测与登录体检,执行请在终端中直接进行。 |
@@ -189,6 +209,8 @@ PTY 加载失败时卡片显示**管道模式**:全屏界面、箭头键、尺
189
209
 
190
210
  API 花费计入预算;订阅显示按 API 价折算的参考费用,不计入预算。预算和费用是本地估算/核算,不代替厂商账单;无法确定费用时显示未知。
191
211
 
212
+ 有效的 CLI 自报金额优先,包括 `0`。只有完整 token 用量与回报实际模型可核对到已配置模型或其显式 CLI 映射时,才按相应单价折算。缺失或不匹配的实际模型、不完整用量都保留未知费用;Harness 推荐模型的价格不能证明该 CLI 实际成本。预览仍可使用推荐路线作规划估算,须与实际核算区分。
213
+
192
214
  0.15.0 会保留裁剪详细历史及重试前的费用累计,避免超过 200 条历史或重跑步骤后预算漏算。此前旧版本已丢弃的消费记录无法恢复。
193
215
 
194
216
  ### 持续反馈与本地偏好
@@ -209,6 +231,8 @@ API 花费计入预算;订阅显示按 API 价折算的参考费用,不计
209
231
 
210
232
  **安全边界**显示各路线可读/写范围与沙箱。模型 API 没有本地进程文件访问;可编辑 CLI 要求 Harness 沙箱和独立 Git 工作树。缺少沙箱时可编辑托管执行被拒绝。交互终端始终在沙箱外运行。
211
233
 
234
+ Windows Codex 在 Harness 环境仅支持只读:其原 `CODEX_HOME` 状态仍可更新,内层保持 `--sandbox read-only`。在明确确认的厂商 CLI 正常环境中支持可编辑工作包,使用 Codex 自身 workspace-write 策略。本批真实 Codex 连接未通过,不能以安装或登录状态推断网络调用成功。
235
+
212
236
  ## 从官方会话启动任务
213
237
 
214
238
  在 Harness 选择正确工作区,使用自然语言明确要求调用插件工具。以下 JSON 是核对工具调用详情的示例,不需要粘贴到工作台任务框。
@@ -0,0 +1,26 @@
1
+ # 0.20.0 validation — 2026-10-15
2
+
3
+ This release was developed against DeepSeek Harness Desktop 0.2.0-rc.2 on Windows. Declared rc.1 compatibility is not a claim of a second real host run.
4
+
5
+ ## Real executions
6
+
7
+ - **Workbench execution:** the real desktop profile's authenticated preview/start RPC selected `official-team`, `workspace-write`, and explicitly confirmed `cli-native`. Claude read a small repository fixture, created a JSON file, ran a Python validation command and completed. The source repository received the Git patch; independent file readback matched the expected values. This was one work package, not a multi-agent team result.
8
+ - **Cross-vendor dependency:** the installed production team runtime ran a predeclared Claude analysis package followed by a MiniMax delivery package consuming its result. No mock CLI adapters were injected. Both used their existing vendor configuration. MiniMax read the fixture, wrote the handoff JSON and reported a successful PowerShell JSON check. The patch was integrated and independently read back. This second check directly invoked the installed runtime; it was not a workbench UI automation or an automatic-routing comparison. Ledger recording used the same checkout function with its development peers, since standalone import of the Desktop entry lacks host-provided peers.
9
+ - Both successful checks retained CLI defaults. The MiniMax result reported `minimax/MiniMax-M3`; Claude's actual model remained unknown in the saved records. Recommendation IDs are not proof of backend identity.
10
+ - The successful calls reported API amounts of $0.1381192 and $0.1157288. MiniMax supplied token usage under a subscription login, with no verified reference price. Earlier attempts with missing usage/prices remain unknown; $0.253848 is a known subtotal, not the batch's reconciled supplier bill.
11
+
12
+ ## Failures that shaped the fix
13
+
14
+ - Original terminal execution and managed execution differed in model arguments, environment, writable state and tool restrictions. Catalog IDs are now passed only through explicit CLI model mappings.
15
+ - The Windows ACL backend rejected worktree initialization on a source drive lacking WRITE_OWNER, before any CLI started. A no-model SDK probe reproduced that failure and succeeded in private user temporary storage. A real confined-write and cross-drive patch integration probe passed after relocating Windows worktrees.
16
+ - MiniMax then reached its CLI but could not write its original state directory. The SDK also limits libuv pipe creation by confined descendant processes, affecting some shell and MCP paths. Additional filesystem grants alone do not restore normal vendor behavior.
17
+ - The explicit `cli-native` option uses current user permissions outside Harness's process sandbox, retains Git worktree integration checks, and always requires its own confirmation. It is never an automatic response to a failed restricted run. Existing restricted records keep their environment when retried.
18
+ - A Claude restricted-environment attempt reported gateway 529 errors with a complete zero-usage/zero-cost terminal result. Codex attempts failed connection checks. These failures remain recorded rather than being silently replaced by API calls.
19
+
20
+ ## Scope and limits
21
+
22
+ Default execution remains Harness-restricted. Claude read-only disables shell, skills and existing MCP, and ignores user settings. Editable native execution offers normal vendor tools under user permissions; the worktree collects changes and is not an OS security boundary. Configured external MCP services may have their own effects.
23
+
24
+ The successful experiments exercised file and shell tools, dependency context, and patch integration. They do not establish that every vendor, model, skill or MCP service works. Codex network execution, remote MCP effects, and statistical quality–cost improvements remain unverified. Raw experiments, credentials, machine paths and screenshots stay in the private local archive.
25
+
26
+ Automated validation covers confirmation gates, stale previews, selected installation entries, native package trust, default-model behavior, partial/failed accounting, exceptions, retries, and Git isolation/integration. Final test totals are recorded in the release notes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ljwei-stak/dsh-model-router",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "type": "module",
5
5
  "description": "Model Router for official DeepSeek Harness Desktop: cost-aware task routing, dependent work packages and official vendor CLI discovery, installation and execution. GAL is available separately as @ljwei-stak/dsh-galgame.",
6
6
  "repository": {
@@ -74,6 +74,7 @@
74
74
  "cordis.patch.yml",
75
75
  "README.md",
76
76
  "README.zh.md",
77
+ "README.i18n.yaml",
77
78
  "docs/WORKBENCH_USER_GUIDE.zh.md",
78
79
  "docs/ROUTING_RESEARCH.zh.md",
79
80
  "docs/ROUTING_DERIVATION_EXPERIMENTS.zh.md",
@@ -91,7 +92,8 @@
91
92
  "docs/archive/MIGRATION.md",
92
93
  "LICENSE",
93
94
  "CHANGELOG.md",
94
- "docs/assets/router-only-0.12.0.png"
95
+ "docs/assets/router-only-0.12.0.png",
96
+ "docs/releases/0.20.0-validation.md"
95
97
  ],
96
98
  "scripts": {
97
99
  "build:client": "node scripts/build-client.mjs",
@@ -103,7 +105,7 @@
103
105
  "experiment:routing-summary": "node scripts/summarize-routing-search.mjs",
104
106
  "experiment:routing-adaptive": "node scripts/adaptive-routing-study.mjs",
105
107
  "audit:livebench": "node scripts/livebench-aggregate-audit.mjs",
106
- "test": "node --test tests/adaptive-*.test.mjs tests/dynamic-data.test.mjs tests/router.test.mjs tests/routing-optimizer.test.mjs tests/routing-evaluation.test.mjs tests/routing-paired-statistics.test.mjs tests/routing-selftest-tools.test.mjs tests/livebench-aggregate-audit.test.mjs tests/livebench-prior-study.test.mjs tests/routing-search-experiment.test.mjs tests/routing-regression-study.test.mjs tests/routing-search-summary.test.mjs tests/harness-*.test.mjs tests/official-tools.test.mjs tests/official-team-runtime.test.mjs tests/model-profiles.test.mjs tests/model-profile-editor.test.mjs tests/tool-install-state.test.mjs tests/tool-install-sdk-ui.test.mjs tests/vendor-adapters.test.mjs tests/desktop-compat.test.mjs tests/plugin-split.test.mjs tests/install-settings-host.test.mjs tests/task-executors.test.mjs tests/tool-install-preferences.test.mjs tests/roadmap.test.mjs tests/insights-state.test.mjs tests/billing-team-ledger.test.mjs tests/subscription-billing.test.mjs tests/subscription-host.test.mjs tests/test-pass-regressions.test.mjs tests/roadmap-gaps.test.mjs tests/cordis-inject.test.mjs tests/cli-terminal.test.mjs tests/cli-terminal-gateway.test.mjs tests/latest-versions.test.mjs tests/vendor-installer-validation.test.mjs tests/install-entry-selection.test.mjs tests/script-directory-safety.test.mjs tests/zcode-config.test.mjs tests/zcode-runtime.test.mjs",
108
+ "test": "node --test tests/adaptive-*.test.mjs tests/dynamic-data.test.mjs tests/router.test.mjs tests/routing-optimizer.test.mjs tests/routing-evaluation.test.mjs tests/routing-paired-statistics.test.mjs tests/routing-selftest-tools.test.mjs tests/livebench-aggregate-audit.test.mjs tests/livebench-prior-study.test.mjs tests/routing-search-experiment.test.mjs tests/routing-regression-study.test.mjs tests/routing-search-summary.test.mjs tests/harness-*.test.mjs tests/official-tools.test.mjs tests/official-tool-result.test.mjs tests/native-environment.test.mjs tests/native-entry-trust.test.mjs tests/tool-failure-ledger.test.mjs tests/official-team-runtime.test.mjs tests/model-profiles.test.mjs tests/model-profile-editor.test.mjs tests/tool-install-state.test.mjs tests/tool-install-sdk-ui.test.mjs tests/vendor-adapters.test.mjs tests/desktop-compat.test.mjs tests/plugin-split.test.mjs tests/install-settings-host.test.mjs tests/task-executors.test.mjs tests/tool-install-preferences.test.mjs tests/roadmap.test.mjs tests/insights-state.test.mjs tests/billing-team-ledger.test.mjs tests/subscription-billing.test.mjs tests/subscription-host.test.mjs tests/test-pass-regressions.test.mjs tests/roadmap-gaps.test.mjs tests/cordis-inject.test.mjs tests/cli-terminal.test.mjs tests/cli-terminal-gateway.test.mjs tests/latest-versions.test.mjs tests/vendor-installer-validation.test.mjs tests/install-entry-selection.test.mjs tests/script-directory-safety.test.mjs tests/zcode-config.test.mjs tests/zcode-runtime.test.mjs",
107
109
  "prepack": "node scripts/prepack.mjs",
108
110
  "pack:local": "npm pack --pack-destination dist"
109
111
  },