dsh-subagent-profile 0.1.0 → 0.2.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/README.md +34 -3
- package/README.zh.md +33 -2
- package/cordis.patch.yml +2 -2
- package/index.mjs +359 -172
- package/lib/client.js +250 -56
- package/lib/pure.mjs +331 -0
- package/lib/shims.mjs +215 -0
- package/package.json +7 -3
- package/presets/orchestrator/agent.cordis.yml +7 -9
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- Hero -->
|
|
4
4
|
<div align="center">
|
|
5
|
-
<b style="font-size: 1.15em;"
|
|
5
|
+
<b style="font-size: 1.15em;">Subagent dispatch, profiled — the right agent for the right task (preset / model / reasoning effort)</b><br /><br />
|
|
6
6
|
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
7
|
-
<img alt="
|
|
8
|
-
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%
|
|
7
|
+
<img alt="npm" src="https://img.shields.io/npm/v/dsh-subagent-profile.svg" />
|
|
8
|
+
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%200.1.1--rc.2-blue.svg" />
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div align="center">English · <a href="README.zh.md">中文</a></div>
|
|
@@ -90,6 +90,37 @@ Delegation never lets a subagent gain more power than you already have — this
|
|
|
90
90
|
|
|
91
91
|
- **Background** one-shot dispatch requires `@deepseek-ai/dsh-jobs` and `@deepseek-ai/dsh-tool-jobs` to be loaded; otherwise it fails with "background jobs unavailable".
|
|
92
92
|
- **Continuable** mode goes through the DSH standard composition path, so the `preset` swap and `reasoningEffort` are ignored (the child inherits the parent preset at the default reasoning effort).
|
|
93
|
+
- **Continuable** tool gate is a plugin-side mitigation: the child's `allow` is pre-computed as a closed set — parent tool set − `run_code` − `deny`, then intersected with `allow`. **Assumption:** continuable inherits the parent preset, so the child's tool set ≈ the parent's. **Failure condition:** any host behavior change that makes the child's tool set differ from the parent's (not only preset swap — e.g. a future preset swap, composing a different tool set) means the parent set can contain tools the child does not have, so `tools.restrict` throws "unknown tool" and this mitigation automatically degrades to fail-loud (conservatively safe); it must then be replaced with a true parent ∩ child intersection once the upstream provides a provider guard seam.
|
|
94
|
+
|
|
95
|
+
## Repository structure
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
dsh-subagent-profile/
|
|
99
|
+
├── index.mjs # host side: the plugin itself (dispatch tool, profile provider, service, HTTP routes)
|
|
100
|
+
├── lib/
|
|
101
|
+
│ ├── client.js # browser side: settings page + dispatch tool-call card
|
|
102
|
+
│ ├── pure.mjs # dependency-free pure functions (sanitize / prune / guard math — unit-tested)
|
|
103
|
+
│ └── shims.mjs # the single @deepseek-ai import facade (guards fail loud, helpers degrade softly)
|
|
104
|
+
├── presets/orchestrator/ # bundled "orchestrator" agent preset (self-installed, synced on every startup)
|
|
105
|
+
├── cordis.patch.yml # bundle patch: inserts the plugin row into the host composition
|
|
106
|
+
├── package.json # metadata, files whitelist, exports
|
|
107
|
+
├── scripts/release.mjs # release helper (version bump / tag checks)
|
|
108
|
+
├── docs/
|
|
109
|
+
│ └── screenshots/ # README screenshots
|
|
110
|
+
├── test/ # host-side tests (node:test, zero extra deps; 96 cases)
|
|
111
|
+
│ ├── README.md / README.zh.md # test directory guide (EN/ZH)
|
|
112
|
+
│ ├── harness/ctx.mjs # fake Cordis ctx + ~/.dsh isolation
|
|
113
|
+
│ ├── characterization.test.mjs # apply() behavior snapshot
|
|
114
|
+
│ └── *.test.mjs # pure / input-schema / persist / continuable-guard / cost-guard / gating / recycle / facade
|
|
115
|
+
├── README.md / README.zh.md # this document (EN/ZH)
|
|
116
|
+
└── LICENSE
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
Found a bug or have an idea? [Open an issue](https://github.com/muzyLink/dsh-subagent-profile/issues) or submit a pull request — all contributions are welcome.
|
|
122
|
+
|
|
123
|
+
If this plugin has been useful to you, please give it a ⭐ on GitHub — it helps others find it.
|
|
93
124
|
|
|
94
125
|
## Credits
|
|
95
126
|
|
package/README.zh.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<div align="center">
|
|
5
5
|
<b style="font-size: 1.15em;">子 Agent 派发方案化插件 —— 用对的人(预设 / 模型 / 推理强度)干对的事</b><br /><br />
|
|
6
6
|
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
7
|
-
<img alt="
|
|
8
|
-
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%
|
|
7
|
+
<img alt="npm" src="https://img.shields.io/npm/v/dsh-subagent-profile.svg" />
|
|
8
|
+
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%200.1.1--rc.2-blue.svg" />
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div align="center"><a href="README.md">English</a> · 中文</div>
|
|
@@ -90,6 +90,37 @@ dispatch(
|
|
|
90
90
|
|
|
91
91
|
- **后台**一次性派发需要加载 `@deepseek-ai/dsh-jobs` 与 `@deepseek-ai/dsh-tool-jobs`,否则报「background jobs unavailable」。
|
|
92
92
|
- **可续跑**模式走 DSH 标准组合路径,因此 `preset` 换用与 `reasoningEffort` 会被忽略(继承父预设、使用默认推理强度)。
|
|
93
|
+
- **可续跑**工具门为插件侧缓解:子 Agent 的 `allow` 预加工为闭集 —— 父工具集 − `run_code` − `deny`,再与 `allow` 取交集。**假设:** 可续跑继承父预设 ⇒ 子工具集 ≈ 父工具集。**失效条件:** 任何导致子工具集与父工具集不一致的宿主行为变化(非仅换用预设——例如未来允许换用预设、组合不同工具集等),父集都可能含子集没有的工具,`tools.restrict` 会抛「未知工具」→ 本缓解自动降级为 fail-loud(保守安全);待上游提供 provider 守卫接缝后替换为真交集。
|
|
94
|
+
|
|
95
|
+
## 目录结构
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
dsh-subagent-profile/
|
|
99
|
+
├── index.mjs # 宿主侧:插件本体(dispatch 工具、profile provider、服务、HTTP 路由)
|
|
100
|
+
├── lib/
|
|
101
|
+
│ ├── client.js # 浏览器侧:设置页 + dispatch 工具调用卡片
|
|
102
|
+
│ ├── pure.mjs # 无依赖纯函数(净化 / 剪枝 / 护栏计算——可单测)
|
|
103
|
+
│ └── shims.mjs # @deepseek-ai 依赖唯一入口(facade:守卫型 fail-loud、功能映射型软降级)
|
|
104
|
+
├── presets/orchestrator/ # 内置「编排者模式」agent 预设(自安装,每次启动同步)
|
|
105
|
+
├── cordis.patch.yml # bundle 补丁:把插件行插入宿主组成
|
|
106
|
+
├── package.json # 元数据、files 发布白名单、exports
|
|
107
|
+
├── scripts/release.mjs # 发布脚本(版本 bump / tag 校验)
|
|
108
|
+
├── docs/
|
|
109
|
+
│ └── screenshots/ # README 截图
|
|
110
|
+
├── test/ # 宿主侧自动化测试(node:test,零新增依赖;96 用例)
|
|
111
|
+
│ ├── README.md / README.zh.md # 测试目录说明(中英双语)
|
|
112
|
+
│ ├── harness/ctx.mjs # 假宿主环境(fake ctx + ~/.dsh 隔离)
|
|
113
|
+
│ ├── characterization.test.mjs # apply() 行为快照
|
|
114
|
+
│ └── *.test.mjs # pure / input-schema / persist / continuable-guard / cost-guard / gating / recycle / facade
|
|
115
|
+
├── README.md / README.zh.md # 本文档(中英双语)
|
|
116
|
+
└── LICENSE
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 贡献
|
|
120
|
+
|
|
121
|
+
发现 Bug 或有新想法?欢迎[提 Issue](https://github.com/muzyLink/dsh-subagent-profile/issues)或提交 Pull Request,任何形式的贡献都欢迎。
|
|
122
|
+
|
|
123
|
+
如果这个插件帮到了你,欢迎在 GitHub 上点个 ⭐,让更多人看到它。
|
|
93
124
|
|
|
94
125
|
## 致谢
|
|
95
126
|
|
package/cordis.patch.yml
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# dsh-subagent-profile bundle patch: inserts the dual-face plugin row into the
|
|
2
|
-
# profile roster. The node
|
|
2
|
+
# profile roster. The node side (exports ".") runs in the host process — it
|
|
3
3
|
# registers the dispatch tool, the profile provider, the subagent-profiles
|
|
4
4
|
# service, and the /subagent-profiles/* loopback HTTP routes; the `dsh.client`
|
|
5
|
-
# declaration in package.json makes the browser
|
|
5
|
+
# declaration in package.json makes the browser side (exports "./client", served
|
|
6
6
|
# at /plugins/<id>/client.js) load in the web GUI as the settings page and the
|
|
7
7
|
# dispatch tool-call card.
|
|
8
8
|
- insert:
|