dsh-team-router 0.0.0-stage → 0.3.3
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 +51 -2
- package/cordis.patch.yml +8 -0
- package/docs/IMPLEMENTATION_PLAN.md +605 -0
- package/docs/IMPLEMENTATION_STATUS.md +67 -0
- package/examples/router.patch.yml +30 -0
- package/icon.svg +6 -0
- package/lib/authorization.d.ts +16 -0
- package/lib/authorization.js +30 -0
- package/lib/authorization.js.map +1 -0
- package/lib/categories.d.ts +23 -0
- package/lib/categories.js +140 -0
- package/lib/categories.js.map +1 -0
- package/lib/client.d.ts +3 -0
- package/lib/client.js +1286 -0
- package/lib/client.js.map +7 -0
- package/lib/config.d.ts +73 -0
- package/lib/config.js +76 -0
- package/lib/config.js.map +1 -0
- package/lib/editor.d.ts +102 -0
- package/lib/editor.js +206 -0
- package/lib/editor.js.map +1 -0
- package/lib/execution-store.d.ts +86 -0
- package/lib/execution-store.js +118 -0
- package/lib/execution-store.js.map +1 -0
- package/lib/index.d.ts +34 -0
- package/lib/index.js +302 -0
- package/lib/index.js.map +1 -0
- package/lib/migration.d.ts +14 -0
- package/lib/migration.js +20 -0
- package/lib/migration.js.map +1 -0
- package/lib/native-team.d.ts +27 -0
- package/lib/native-team.js +69 -0
- package/lib/native-team.js.map +1 -0
- package/lib/policy.d.ts +43 -0
- package/lib/policy.js +235 -0
- package/lib/policy.js.map +1 -0
- package/lib/recommendations.d.ts +59 -0
- package/lib/recommendations.js +77 -0
- package/lib/recommendations.js.map +1 -0
- package/lib/routing-editor.d.ts +100 -0
- package/lib/routing-editor.js +256 -0
- package/lib/routing-editor.js.map +1 -0
- package/lib/routing-policy.d.ts +70 -0
- package/lib/routing-policy.js +165 -0
- package/lib/routing-policy.js.map +1 -0
- package/lib/store.d.ts +34 -0
- package/lib/store.js +113 -0
- package/lib/store.js.map +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +81 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-team-router contributors
|
|
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
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-team-router
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 DSH 原生队友按任务类别选模型。`dsh-team-router@0.3.3` 的同一个安装包支持 DSH **`0.2.2-rc.3`、`0.2.2-rc.4`、`0.2.2-rc.5`**,需要 Node.js 24+。更新的宿主版本通过兼容测试后再加入,不需要开启版本豁免。当前仅支持原生队友,Codex、agy、Cursor 外部 Agent 执行尚未开放。
|
|
4
|
+
|
|
5
|
+
## 原生分工与分类路由
|
|
6
|
+
|
|
7
|
+
**是否分工,由主助手(Lead)决定;插件只负责分类委派时的模型选择。** 以「帮我写一份发布说明」为例:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Lead 判断是否分工
|
|
11
|
+
├─ 自己写 → 直接回复
|
|
12
|
+
├─ 原生委派 → 按 DSH 原生规则选模型 ┐
|
|
13
|
+
└─ 分类委派 → 选择 writing → 按配置和授权选模型 ┴→ 队友执行 → Lead 验收
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
日常直接说需求即可,不必手写工具参数。保存策略**不会自动拆任务或接管普通委派**;只有 Lead 使用 `team_route_delegate` 时才会套用类别配置。停用插件仍可使用原生团队;关闭主会话的团队协作开关,则该会话也不再提供分类委派。两者都不会取消已启动的任务。
|
|
17
|
+
|
|
18
|
+
## 快速开始
|
|
19
|
+
|
|
20
|
+
1. 在当前 DSH Web 对应的 profile 中,通过插件管理器安装 npm 包 `dsh-team-router` 并启用,刷新页面。
|
|
21
|
+
2. 打开 **插件 → 团队任务路由**,在说明下方的表格中编辑:首行是默认目标,其余七行左侧是类别,右侧是路由配置。也可从 **设置 → 团队任务路由** 进入。两处共用已保存的策略,不共享未保存的草稿。七类默认继承会话模型;可单独指定模型和推理强度,或点 **预览推荐配置 → 确认应用到草稿**,最后点 **保存策略**。
|
|
22
|
+
3. 在主会话的 **模型与推理等级** 菜单开启 **启用智能体团队协作**。想验证配置时,可以说:「请按 `writing` 类别委派一份发布说明,再用 `team_route_status` 查看本次配置目标。」
|
|
23
|
+
|
|
24
|
+
保存只影响**之后新建的分类委派**。目录中可见的模型不一定获当前会话授权;未记录子代理模型白名单时,只能显式选择当前父模型。
|
|
25
|
+
|
|
26
|
+
## 七个内置类别
|
|
27
|
+
|
|
28
|
+
| 类别 | 适合的任务 |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `visual-engineering` | 前端界面、交互和布局 |
|
|
31
|
+
| `ultrabrain` | 高难推理、算法和架构决策 |
|
|
32
|
+
| `deep` | 需要持续探索、实现和验证的任务 |
|
|
33
|
+
| `artistry` | 创意构思和发散设计 |
|
|
34
|
+
| `quick` | 范围明确的小改动和查询 |
|
|
35
|
+
| `unspecified` | 不适合其他类别的通用任务 |
|
|
36
|
+
| `writing` | 文档、说明和报告 |
|
|
37
|
+
|
|
38
|
+
## 从旧版升级
|
|
39
|
+
|
|
40
|
+
如果已有旧路由,请在设置页确认迁移并保存后再委派。插件会先备份旧策略,只映射旧默认路由;关键词规则、角色映射和成员手动覆盖不再参与选模。
|
|
41
|
+
|
|
42
|
+
## 开发与参考
|
|
43
|
+
|
|
44
|
+
运行 `npm ci --ignore-scripts` 安装依赖,`npm run check` 执行类型检查、测试和构建,`npm pack --ignore-scripts` 生成安装包。
|
|
45
|
+
|
|
46
|
+
[V2 配置示例](<examples/router.patch.yml>) · [实施方案](<docs/IMPLEMENTATION_PLAN.md>) · [验证记录与外部执行器限制](<docs/IMPLEMENTATION_STATUS.md>) · [MIT 许可证](<LICENSE>)
|
|
47
|
+
|
|
48
|
+
## 维护者发布
|
|
49
|
+
|
|
50
|
+
[GitHub Actions](<.github/workflows/publish.yml>) 在面向 `main` 的 PR 和 `main` 推送上检查,不发布。CI 只构建一次,在 `engines.dsh` 列出的每个宿主版本上独立安装并验证同一个包;任一项失败即不发布。推送与包清单、锁文件一致的 `vX.Y.Z` 稳定版标签,且提交已在 `main` 时,CI 才把验证过的安装包发布到 npm `latest`。
|
|
51
|
+
|
|
52
|
+
首次需由包维护者在 [npm 包设置](https://www.npmjs.com/package/dsh-team-router/access) 添加 GitHub Actions Trusted Publisher:仓库 `MorseWayne/dsh-team-router`、工作流 `publish.yml`、Environment 留空,允许 **Publish**。不需要 `NPM_TOKEN`。之后在干净、已同步的 `main` 上运行 `npm version patch`(或 `minor` / `major`),再运行 `git push --atomic origin main "$(git describe --tags --exact-match HEAD)"`,即可触发发布。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Install AFTER the official Agent Teams bundle. No native rows are replaced.
|
|
2
|
+
# Do not inject policyV2 into this composition layer: legacy user configuration
|
|
3
|
+
# must remain detectable until the user explicitly confirms migration.
|
|
4
|
+
# Empty configuration renders all seven presets with safe native inheritance.
|
|
5
|
+
- insert:
|
|
6
|
+
- id: team-router
|
|
7
|
+
name: dsh-team-router
|
|
8
|
+
config: {}
|