dsh-omni-router 0.6.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/LICENSE +21 -0
- package/README.md +133 -0
- package/README.zh-CN.md +133 -0
- package/agent.cordis.yml +183 -0
- package/docs/ARCHITECTURE.md +48 -0
- package/docs/CONFIGURATION.md +28 -0
- package/docs/INSTALL.md +43 -0
- package/install.ps1 +13 -0
- package/install.sh +14 -0
- package/package.json +36 -0
- package/preset.yml +3 -0
- package/scripts/install-preset.mjs +69 -0
- package/src/omni-router.mjs +708 -0
- package/test/omni-router.test.mjs +211 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 qwe225380
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Omni Router
|
|
2
|
+
|
|
3
|
+
> GitHub: https://github.com/qwe225380/dsh-omni-router
|
|
4
|
+
> [中文说明](./README.zh-CN.md)
|
|
5
|
+
|
|
6
|
+
**Omni Router** 是一个 DeepSeek Harness Agent 预设,它不是一个“单一功能插件”,而是一层**智能编排层**:把复杂度路由、思维模式路由、任务类型识别、Plan Mode、项目上下文、TDD、交付门、Git 工作流等能力组合成一个统一的、自动运行的工程闭环。
|
|
7
|
+
|
|
8
|
+
## Why Omni Router?
|
|
9
|
+
|
|
10
|
+
单独使用 dsh-routing-suite、dsh-trio、dsh-doublecheck、superpowers-dsh 时,你需要:
|
|
11
|
+
|
|
12
|
+
- 自己决定什么时候用哪个预设
|
|
13
|
+
- 自己记得先出方案还是直接做
|
|
14
|
+
- 自己记得要写测试、要验证、要过质量门
|
|
15
|
+
- 在不同插件/预设之间手动切换
|
|
16
|
+
|
|
17
|
+
使用 Omni Router 后,这些判断和编排会自动发生:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
任务进来
|
|
21
|
+
│
|
|
22
|
+
├─ 复杂度路由:plan / direct
|
|
23
|
+
├─ 思维模式路由:spec / react / balanced
|
|
24
|
+
├─ 任务类型识别:bugfix / feature / refactor / test / review
|
|
25
|
+
│
|
|
26
|
+
├─ 复杂任务
|
|
27
|
+
│ ├─ 自动进入 Plan Mode
|
|
28
|
+
│ ├─ 自动收集项目上下文
|
|
29
|
+
│ ├─ 生成代码化方案
|
|
30
|
+
│ ├─ 注入 TDD / 交付门 / Git 工作流 / 验收清单提示
|
|
31
|
+
│ ├─ 等你确认
|
|
32
|
+
│ └─ 执行 + 验证
|
|
33
|
+
│
|
|
34
|
+
└─ 简单任务
|
|
35
|
+
└─ 直接执行 + 轻量验证
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
### Core(核心,自带)
|
|
41
|
+
|
|
42
|
+
- **复杂度自动路由**:简单任务直接做,复杂/模糊任务先方案。
|
|
43
|
+
- **思维模式路由**:自动选择 `spec`(方案优先)/ `react`(直接执行)/ `balanced`(自动)。
|
|
44
|
+
- **任务类型识别**:`bugfix` / `feature` / `refactor` / `test` / `review` / `other`。
|
|
45
|
+
- **Plan Mode 集成**:复用 DSH 内置 Plan Mode,方案必须经你确认后才执行。
|
|
46
|
+
- **项目上下文收集**:按任务类型挑选关键文件,生成有界上下文摘要。
|
|
47
|
+
- **代码化方案模板**:目标、范围、涉及文件、步骤、接口/数据变更、测试计划、风险、兼容性、回滚、验收标准。
|
|
48
|
+
- **TDD 提示**:编码任务自动提示“先写失败测试 → 实现 → 通过”。
|
|
49
|
+
- **交付门提示**:完成前提示运行测试/doublecheck,防止“假完成”。
|
|
50
|
+
- **Git 工作流提示**:分支/worktree、规范 commit、diff 审查。
|
|
51
|
+
- **验收清单提示**:方案批准后自动用 todo 追踪验收标准。
|
|
52
|
+
- **轻量验证**:简单任务改完也要求跑测试或语法检查。
|
|
53
|
+
- **状态持久化**:分类/思维模式/任务类型写入会话事件,resume 可恢复。
|
|
54
|
+
- **降级保护**:Plan Mode 不可用时自动限制为只读工具。
|
|
55
|
+
- **可选 LLM 分类**:不确定的任务可交给模型二次判断。
|
|
56
|
+
- **手动控制**:`/omni` 命令 + `omni_*` 工具。
|
|
57
|
+
|
|
58
|
+
### Orchestrated(编排复用,推荐安装)
|
|
59
|
+
|
|
60
|
+
| 插件 | 提供能力 | Omni Router 如何用 |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| [dsh-trio](https://github.com/huey1in/trio) | 浏览器自动化、MCP、GitHub/GitLab | 需要浏览器/PR/远程操作时自动可用 |
|
|
63
|
+
| [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | 交付质量门、验证、返工检测 | 复杂编码任务完成前提示走质量门 |
|
|
64
|
+
| [superpowers-dsh](https://github.com/LayneChai/superpowers-dsh) | TDD、调试、规划、协作技能 | 编码任务自动提示加载对应技能 |
|
|
65
|
+
|
|
66
|
+
> 这些不是强制依赖。装了 → 完整能力;没装 → Omni Router 核心功能依然可用。
|
|
67
|
+
|
|
68
|
+
## Install
|
|
69
|
+
|
|
70
|
+
### One-command install
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Linux / macOS
|
|
74
|
+
./install.sh
|
|
75
|
+
|
|
76
|
+
# Windows PowerShell
|
|
77
|
+
./install.ps1
|
|
78
|
+
|
|
79
|
+
# Cross-platform
|
|
80
|
+
node scripts/install-preset.mjs
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then restart DSH and select **Omni Router (experimental)** in a new session.
|
|
84
|
+
|
|
85
|
+
## Manual overrides
|
|
86
|
+
|
|
87
|
+
- Say **“直接做”** / **“直接执行”** → force direct execution.
|
|
88
|
+
- Say **“先出方案”** / **“先设计方案”** → force plan-first.
|
|
89
|
+
- `/omni status` — show current routing state.
|
|
90
|
+
- `/omni plan` — enter plan-first mode.
|
|
91
|
+
- `/omni direct` — enter direct mode.
|
|
92
|
+
- `/omni mode spec|react|balanced` — set thinking mode.
|
|
93
|
+
- Model tools: `omni_status`, `omni_plan`, `omni_direct`, `omni_mode`.
|
|
94
|
+
|
|
95
|
+
## Configuration
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- id: omni-router
|
|
99
|
+
name: ./src/omni-router.mjs
|
|
100
|
+
config:
|
|
101
|
+
requireConfirmation: true
|
|
102
|
+
useLLMClassification: false
|
|
103
|
+
# planFirstKeywords: [自定义, 关键词]
|
|
104
|
+
# directKeywords: [直接跑, 马上改]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
See [docs/CONFIGURATION.md](./docs/CONFIGURATION.md) for details.
|
|
108
|
+
|
|
109
|
+
## Repository structure
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
omni-router/
|
|
113
|
+
├── agent.cordis.yml
|
|
114
|
+
├── preset.yml
|
|
115
|
+
├── src/omni-router.mjs
|
|
116
|
+
├── test/omni-router.test.mjs
|
|
117
|
+
├── scripts/install-preset.mjs
|
|
118
|
+
├── docs/
|
|
119
|
+
├── .github/workflows/ci.yml
|
|
120
|
+
├── README.md
|
|
121
|
+
├── README.zh-CN.md
|
|
122
|
+
└── LICENSE
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Test
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npm test
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Omni Router
|
|
2
|
+
|
|
3
|
+
> GitHub:https://github.com/qwe225380/dsh-omni-router
|
|
4
|
+
> [English](./README.md)
|
|
5
|
+
|
|
6
|
+
**Omni Router** 是一个 DeepSeek Harness Agent 预设,它不是一个“单一功能插件”,而是一层**智能编排层**:把复杂度路由、思维模式路由、任务类型识别、Plan Mode、项目上下文、TDD、交付门、Git 工作流等能力组合成一个统一的、自动运行的工程闭环。
|
|
7
|
+
|
|
8
|
+
## 为什么需要 Omni Router?
|
|
9
|
+
|
|
10
|
+
单独使用 dsh-routing-suite、dsh-trio、dsh-doublecheck、superpowers-dsh 时,你需要:
|
|
11
|
+
|
|
12
|
+
- 自己决定什么时候用哪个预设
|
|
13
|
+
- 自己记得先出方案还是直接做
|
|
14
|
+
- 自己记得要写测试、要验证、要过质量门
|
|
15
|
+
- 在不同插件/预设之间手动切换
|
|
16
|
+
|
|
17
|
+
使用 Omni Router 后,这些判断和编排会自动发生:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
任务进来
|
|
21
|
+
│
|
|
22
|
+
├─ 复杂度路由:plan / direct
|
|
23
|
+
├─ 思维模式路由:spec / react / balanced
|
|
24
|
+
├─ 任务类型识别:bugfix / feature / refactor / test / review
|
|
25
|
+
│
|
|
26
|
+
├─ 复杂任务
|
|
27
|
+
│ ├─ 自动进入 Plan Mode
|
|
28
|
+
│ ├─ 自动收集项目上下文
|
|
29
|
+
│ ├─ 生成代码化方案
|
|
30
|
+
│ ├─ 注入 TDD / 交付门 / Git 工作流 / 验收清单提示
|
|
31
|
+
│ ├─ 等你确认
|
|
32
|
+
│ └─ 执行 + 验证
|
|
33
|
+
│
|
|
34
|
+
└─ 简单任务
|
|
35
|
+
└─ 直接执行 + 轻量验证
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 功能
|
|
39
|
+
|
|
40
|
+
### 核心能力(自带)
|
|
41
|
+
|
|
42
|
+
- **复杂度自动路由**:简单任务直接做,复杂/模糊任务先方案。
|
|
43
|
+
- **思维模式路由**:自动选择 `spec`(方案优先)/ `react`(直接执行)/ `balanced`(自动)。
|
|
44
|
+
- **任务类型识别**:`bugfix` / `feature` / `refactor` / `test` / `review` / `other`。
|
|
45
|
+
- **Plan Mode 集成**:复用 DSH 内置 Plan Mode,方案必须经你确认后才执行。
|
|
46
|
+
- **项目上下文收集**:按任务类型挑选关键文件,生成有界上下文摘要。
|
|
47
|
+
- **代码化方案模板**:目标、范围、涉及文件、步骤、接口/数据变更、测试计划、风险、兼容性、回滚、验收标准。
|
|
48
|
+
- **TDD 提示**:编码任务自动提示“先写失败测试 → 实现 → 通过”。
|
|
49
|
+
- **交付门提示**:完成前提示运行测试/doublecheck,防止“假完成”。
|
|
50
|
+
- **Git 工作流提示**:分支/worktree、规范 commit、diff 审查。
|
|
51
|
+
- **验收清单提示**:方案批准后自动用 todo 追踪验收标准。
|
|
52
|
+
- **轻量验证**:简单任务改完也要求跑测试或语法检查。
|
|
53
|
+
- **状态持久化**:分类/思维模式/任务类型写入会话事件,resume 可恢复。
|
|
54
|
+
- **降级保护**:Plan Mode 不可用时自动限制为只读工具。
|
|
55
|
+
- **可选 LLM 分类**:不确定的任务可交给模型二次判断。
|
|
56
|
+
- **手动控制**:`/omni` 命令 + `omni_*` 工具。
|
|
57
|
+
|
|
58
|
+
### 编排复用(推荐安装)
|
|
59
|
+
|
|
60
|
+
| 插件 | 提供能力 | Omni Router 如何用 |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| [dsh-trio](https://github.com/huey1in/trio) | 浏览器自动化、MCP、GitHub/GitLab | 需要浏览器/PR/远程操作时自动可用 |
|
|
63
|
+
| [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | 交付质量门、验证、返工检测 | 复杂编码任务完成前提示走质量门 |
|
|
64
|
+
| [superpowers-dsh](https://github.com/LayneChai/superpowers-dsh) | TDD、调试、规划、协作技能 | 编码任务自动提示加载对应技能 |
|
|
65
|
+
|
|
66
|
+
> 这些不是强制依赖。装了 → 完整能力;没装 → Omni Router 核心功能依然可用。
|
|
67
|
+
|
|
68
|
+
## 安装
|
|
69
|
+
|
|
70
|
+
### 一键安装
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Linux / macOS
|
|
74
|
+
./install.sh
|
|
75
|
+
|
|
76
|
+
# Windows PowerShell
|
|
77
|
+
./install.ps1
|
|
78
|
+
|
|
79
|
+
# 跨平台
|
|
80
|
+
node scripts/install-preset.mjs
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
安装后重启 DSH,新建会话选择 **Omni Router (experimental)**。
|
|
84
|
+
|
|
85
|
+
## 手动控制
|
|
86
|
+
|
|
87
|
+
- 说 **“直接做”** / **“直接执行”** → 强制直接执行。
|
|
88
|
+
- 说 **“先出方案”** / **“先设计方案”** → 强制先出方案。
|
|
89
|
+
- `/omni status` — 查看当前路由状态。
|
|
90
|
+
- `/omni plan` — 进入方案优先模式。
|
|
91
|
+
- `/omni direct` — 进入直接执行模式。
|
|
92
|
+
- `/omni mode spec|react|balanced` — 设置思维模式。
|
|
93
|
+
- 模型工具:`omni_status` / `omni_plan` / `omni_direct` / `omni_mode`。
|
|
94
|
+
|
|
95
|
+
## 配置
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- id: omni-router
|
|
99
|
+
name: ./src/omni-router.mjs
|
|
100
|
+
config:
|
|
101
|
+
requireConfirmation: true
|
|
102
|
+
useLLMClassification: false
|
|
103
|
+
# planFirstKeywords: [自定义, 关键词]
|
|
104
|
+
# directKeywords: [直接跑, 马上改]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
详细说明见 [docs/CONFIGURATION.md](./docs/CONFIGURATION.md)。
|
|
108
|
+
|
|
109
|
+
## 仓库结构
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
omni-router/
|
|
113
|
+
├── agent.cordis.yml
|
|
114
|
+
├── preset.yml
|
|
115
|
+
├── src/omni-router.mjs
|
|
116
|
+
├── test/omni-router.test.mjs
|
|
117
|
+
├── scripts/install-preset.mjs
|
|
118
|
+
├── docs/
|
|
119
|
+
├── .github/workflows/ci.yml
|
|
120
|
+
├── README.md
|
|
121
|
+
├── README.zh-CN.md
|
|
122
|
+
└── LICENSE
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 测试
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npm test
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 许可证
|
|
132
|
+
|
|
133
|
+
MIT
|
package/agent.cordis.yml
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Omni Router (experimental)
|
|
2
|
+
#
|
|
3
|
+
# Auto-routes the first real user task by complexity:
|
|
4
|
+
# - simple / concrete task -> full tool catalog, direct execution
|
|
5
|
+
# - complex / ambiguous -> built-in plan mode, structured plan, approval gate
|
|
6
|
+
#
|
|
7
|
+
# This preset is intentionally minimal. It reuses the host profile's installed
|
|
8
|
+
# capabilities (browser/MCP/GitHub, quality gates, skills) when present and
|
|
9
|
+
# degrades gracefully when absent. It does not modify other presets.
|
|
10
|
+
|
|
11
|
+
# This file is an AGENT-PLANE composition. It must not own registries, sandbox,
|
|
12
|
+
# persistence, or model routes; those stay in the host composition.
|
|
13
|
+
|
|
14
|
+
# ── identity ────────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
- id: persona
|
|
17
|
+
name: '@deepseek-ai/dsh-persona'
|
|
18
|
+
config:
|
|
19
|
+
text: You are a helpful software engineer assistant.
|
|
20
|
+
|
|
21
|
+
- id: agent-instructions
|
|
22
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
23
|
+
config:
|
|
24
|
+
maxBytes: 65536
|
|
25
|
+
|
|
26
|
+
# ── shell ───────────────────────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
- id: tool-bash
|
|
29
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
30
|
+
disabled: !!js process.platform === 'win32'
|
|
31
|
+
|
|
32
|
+
- id: tool-pwsh
|
|
33
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
34
|
+
disabled: !!js process.platform !== 'win32'
|
|
35
|
+
|
|
36
|
+
# ── filesystem ──────────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
- id: tool-fs
|
|
39
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
40
|
+
|
|
41
|
+
- id: tool-fs-search
|
|
42
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
43
|
+
config:
|
|
44
|
+
sampleOverCapGlobResults: false
|
|
45
|
+
|
|
46
|
+
- id: tool-str-replace-editor
|
|
47
|
+
name: '@deepseek-ai/dsh-tool-str-replace-editor'
|
|
48
|
+
|
|
49
|
+
# ── background jobs ────────────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
- id: tool-jobs
|
|
52
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
53
|
+
|
|
54
|
+
# ── skills ──────────────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
- id: skill-filesystem
|
|
57
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
58
|
+
|
|
59
|
+
- id: tool-skill
|
|
60
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
61
|
+
|
|
62
|
+
# ── goals ───────────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
- id: tool-goal
|
|
65
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
66
|
+
|
|
67
|
+
# ── plan mode + omni-router ─────────────────────────────────────────────────
|
|
68
|
+
#
|
|
69
|
+
# Omni Router lives in the same isolated planMode realm so it can programmatically
|
|
70
|
+
# enter/leave plan mode for complex tasks.
|
|
71
|
+
|
|
72
|
+
- id: planning
|
|
73
|
+
name: cordis:group
|
|
74
|
+
group: true
|
|
75
|
+
isolate:
|
|
76
|
+
planMode: true
|
|
77
|
+
config:
|
|
78
|
+
- id: plan-mode
|
|
79
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
80
|
+
config:
|
|
81
|
+
section: |
|
|
82
|
+
You are in Omni Router plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
83
|
+
|
|
84
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan.
|
|
85
|
+
|
|
86
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
87
|
+
|
|
88
|
+
Produce a structured plan with these sections:
|
|
89
|
+
1. Goal — what outcome must be achieved, in one verifiable sentence.
|
|
90
|
+
2. Scope — what is in scope and what is out of scope.
|
|
91
|
+
3. Involved files / modules — which files and modules the change touches.
|
|
92
|
+
4. Implementation steps — concrete, ordered changes grouped by subsystem.
|
|
93
|
+
5. Interface / data changes — APIs, schemas, or data formats that change.
|
|
94
|
+
6. Test plan — which tests to add or update and how to verify.
|
|
95
|
+
7. Risks — likely failure modes and how they will be handled.
|
|
96
|
+
8. Compatibility / migration — backward compatibility and migration impact.
|
|
97
|
+
9. Rollback — how to revert safely if the change fails.
|
|
98
|
+
10. Acceptance criteria — observable checks that prove the work is done.
|
|
99
|
+
|
|
100
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer.
|
|
101
|
+
|
|
102
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
103
|
+
|
|
104
|
+
- id: omni-router
|
|
105
|
+
name: ./src/omni-router.mjs
|
|
106
|
+
config:
|
|
107
|
+
requireConfirmation: true
|
|
108
|
+
# planFirstKeywords: [自定义, 关键词]
|
|
109
|
+
# directKeywords: [直接跑, 马上改]
|
|
110
|
+
|
|
111
|
+
# ── compaction ──────────────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
- id: compaction
|
|
114
|
+
name: cordis:group
|
|
115
|
+
group: true
|
|
116
|
+
isolate:
|
|
117
|
+
compaction: true
|
|
118
|
+
toolResultPruner: true
|
|
119
|
+
config:
|
|
120
|
+
- id: compaction-basic
|
|
121
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
122
|
+
|
|
123
|
+
- id: command-compact
|
|
124
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
125
|
+
|
|
126
|
+
- id: tool-result-pruner
|
|
127
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
128
|
+
config:
|
|
129
|
+
thresholdChars: 8192
|
|
130
|
+
headChars: 4096
|
|
131
|
+
tailChars: 1024
|
|
132
|
+
|
|
133
|
+
# ── delegation and workflows ────────────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
- id: delegation
|
|
136
|
+
name: cordis:group
|
|
137
|
+
group: true
|
|
138
|
+
isolate:
|
|
139
|
+
workflowEngine: true
|
|
140
|
+
config:
|
|
141
|
+
- id: tool-subagent-control
|
|
142
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
143
|
+
|
|
144
|
+
- id: tool-subagent-list-agents
|
|
145
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
146
|
+
|
|
147
|
+
- id: tool-subagent
|
|
148
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
149
|
+
config:
|
|
150
|
+
provider: spawn
|
|
151
|
+
toolName: subagent
|
|
152
|
+
backgroundMode: continuable
|
|
153
|
+
|
|
154
|
+
- id: tool-subagent-fork
|
|
155
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
156
|
+
config:
|
|
157
|
+
provider: fork
|
|
158
|
+
toolName: subagent_fork
|
|
159
|
+
backgroundMode: continuable
|
|
160
|
+
|
|
161
|
+
- id: workflow-worker-thread
|
|
162
|
+
name: '@deepseek-ai/dsh-workflow-worker-thread'
|
|
163
|
+
config:
|
|
164
|
+
provider: spawn
|
|
165
|
+
|
|
166
|
+
- id: tool-workflow
|
|
167
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
168
|
+
|
|
169
|
+
# ── remaining model-facing rows ─────────────────────────────────────────────
|
|
170
|
+
|
|
171
|
+
- id: tool-ask-user
|
|
172
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
173
|
+
|
|
174
|
+
- id: tool-todo
|
|
175
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
176
|
+
config:
|
|
177
|
+
allowParallelInProgress: true
|
|
178
|
+
|
|
179
|
+
- id: tool-web
|
|
180
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
181
|
+
config:
|
|
182
|
+
fetch: false
|
|
183
|
+
searchTimeoutMs: 60000
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 架构说明
|
|
2
|
+
|
|
3
|
+
## 形态
|
|
4
|
+
|
|
5
|
+
Omni Router 是一个 **DeepSeek Harness Agent 预设**,不是 bundle 插件。
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
omni-router/
|
|
9
|
+
├── agent.cordis.yml # 预设装配
|
|
10
|
+
├── preset.yml # 模式定义
|
|
11
|
+
├── src/omni-router.mjs # 核心逻辑
|
|
12
|
+
├── test/omni-router.test.mjs # 单元测试
|
|
13
|
+
├── scripts/install-preset.mjs
|
|
14
|
+
├── docs/
|
|
15
|
+
└── .github/workflows/ci.yml
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 核心流程
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
用户第一条消息
|
|
22
|
+
│
|
|
23
|
+
├─ 识别复杂度(plan / direct)
|
|
24
|
+
├─ 识别任务类型(bugfix / feature / refactor / test / review / other)
|
|
25
|
+
│
|
|
26
|
+
├─ direct → 注入轻量验证提示 → 直接执行
|
|
27
|
+
│
|
|
28
|
+
└─ plan → 进入 Plan Mode
|
|
29
|
+
├─ 自动收集项目上下文
|
|
30
|
+
├─ 注入代码化方案模板
|
|
31
|
+
├─ 注入 TDD / 交付门 / Git 工作流提示
|
|
32
|
+
├─ 用户确认
|
|
33
|
+
└─ 执行
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 关键扩展点
|
|
37
|
+
|
|
38
|
+
| DSH 扩展点 | 用途 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `session/event` | 捕获首条用户消息并分类 |
|
|
41
|
+
| `system-prompt/assemble` | 注入方案模板、上下文、TDD/交付门/Git 提示 |
|
|
42
|
+
| `ctx.planMode` | 进入/退出内置 Plan Mode |
|
|
43
|
+
| `ctx.tools.register` | 注册 `omni_status` / `omni_plan` / `omni_direct` |
|
|
44
|
+
| `ctx.commands` | 注册 `/omni` 命令 |
|
|
45
|
+
|
|
46
|
+
## 状态持久化
|
|
47
|
+
|
|
48
|
+
分类结果通过 `omni/router` 事件写入会话日志,resume/reload 后可恢复。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# 配置说明
|
|
2
|
+
|
|
3
|
+
Omni Router 的配置集中在 `agent.cordis.yml` 的 `omni-router` 行:
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
- id: omni-router
|
|
7
|
+
name: ./src/omni-router.mjs
|
|
8
|
+
config:
|
|
9
|
+
requireConfirmation: true
|
|
10
|
+
useLLMClassification: false
|
|
11
|
+
# planFirstKeywords: [自定义, 关键词]
|
|
12
|
+
# directKeywords: [直接跑, 马上改]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 配置项
|
|
16
|
+
|
|
17
|
+
| 配置项 | 默认值 | 说明 |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `requireConfirmation` | `true` | 复杂任务是否必须进入 Plan Mode 等待确认 |
|
|
20
|
+
| `useLLMClassification` | `false` | 是否用模型对“不确定任务”做二次分类 |
|
|
21
|
+
| `planFirstKeywords` | 内置关键词 | 额外触发“方案优先”的关键词 |
|
|
22
|
+
| `directKeywords` | 内置关键词 | 额外触发“直接执行”的关键词 |
|
|
23
|
+
|
|
24
|
+
## 手动控制
|
|
25
|
+
|
|
26
|
+
- 对话中说 **“直接做”** / **“先出方案”** 可临时覆盖自动判断。
|
|
27
|
+
- 使用 `/omni plan`、`/omni direct`、`/omni status`、`/omni mode spec|react|balanced` 控制。
|
|
28
|
+
- 模型也可调用 `omni_mode` 工具设置思维模式。
|
package/docs/INSTALL.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# 安装指南
|
|
2
|
+
|
|
3
|
+
## 环境要求
|
|
4
|
+
|
|
5
|
+
- DeepSeek Harness 0.1.0-rc.6 或兼容版本
|
|
6
|
+
- Node.js >= 22
|
|
7
|
+
|
|
8
|
+
## 一键安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 从仓库根目录
|
|
12
|
+
./install.sh # Linux / macOS
|
|
13
|
+
./install.ps1 # Windows PowerShell
|
|
14
|
+
node scripts/install-preset.mjs # 跨平台
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
脚本会把预设安装到:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
~/.dsh/.agent-presets/omni-router
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
安装后:
|
|
24
|
+
|
|
25
|
+
1. 完全重启 DSH。
|
|
26
|
+
2. 新建空白会话。
|
|
27
|
+
3. 选择 **Omni Router (experimental)**。
|
|
28
|
+
4. 发送你的任务。
|
|
29
|
+
|
|
30
|
+
## 手动安装
|
|
31
|
+
|
|
32
|
+
```powershell
|
|
33
|
+
$target = Join-Path $env:USERPROFILE '.dsh\.agent-presets\omni-router'
|
|
34
|
+
if (Test-Path -LiteralPath $target) { throw "Preset already exists: $target" }
|
|
35
|
+
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $target) | Out-Null
|
|
36
|
+
Copy-Item -Recurse -LiteralPath '.\omni-router' -Destination $target
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 升级
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node scripts/install-preset.mjs --force
|
|
43
|
+
```
|
package/install.ps1
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
# One-command installer for Omni Router (Windows / PowerShell).
|
|
3
|
+
# Usage: ./install.ps1 [-Force]
|
|
4
|
+
|
|
5
|
+
param(
|
|
6
|
+
[switch]$Force
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
$ErrorActionPreference = 'Stop'
|
|
10
|
+
$root = $PSScriptRoot
|
|
11
|
+
$scriptArgs = @()
|
|
12
|
+
if ($Force) { $scriptArgs += '--force' }
|
|
13
|
+
node (Join-Path $root 'scripts/install-preset.mjs') @scriptArgs
|
package/install.sh
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# One-command installer for Omni Router (Linux / macOS).
|
|
3
|
+
# Usage: ./install.sh [--force]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
root="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
7
|
+
args=""
|
|
8
|
+
for arg in "$@"; do
|
|
9
|
+
if [ "$arg" = "--force" ]; then
|
|
10
|
+
args="$args --force"
|
|
11
|
+
fi
|
|
12
|
+
done
|
|
13
|
+
# shellcheck disable=SC2086
|
|
14
|
+
node "$root/scripts/install-preset.mjs" $args
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-omni-router",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Omni Router - auto-routing DeepSeek Harness preset: simple tasks run directly, complex tasks plan first with approval gate, coding tasks get TDD/delivery-gate guidance.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"dsh",
|
|
9
|
+
"dsh-plugin",
|
|
10
|
+
"deepseek-harness",
|
|
11
|
+
"agent-preset",
|
|
12
|
+
"router",
|
|
13
|
+
"plan-mode",
|
|
14
|
+
"tdd"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"agent.cordis.yml",
|
|
18
|
+
"preset.yml",
|
|
19
|
+
"src",
|
|
20
|
+
"test",
|
|
21
|
+
"docs",
|
|
22
|
+
"README.md",
|
|
23
|
+
"README.zh-CN.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"install.ps1",
|
|
26
|
+
"install.sh",
|
|
27
|
+
"scripts"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "node test/omni-router.test.mjs",
|
|
31
|
+
"install:preset": "node scripts/install-preset.mjs"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=22"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/preset.yml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
name: Omni Router (experimental)
|
|
2
|
+
description: Auto-routes tasks by complexity — simple tasks run directly, complex or ambiguous tasks enter plan mode and produce a structured plan (goal, scope, steps, risks, acceptance criteria) before execution. Reuses installed capabilities when available.
|
|
3
|
+
order: 6
|