dsh-subagent-profile 0.2.0 → 0.3.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 +20 -8
- package/README.zh.md +20 -8
- package/index.mjs +160 -1386
- package/lib/client.js +776 -695
- package/lib/core/catalog.mjs +83 -0
- package/lib/core/cost-guard.mjs +108 -0
- package/lib/core/delegation.mjs +61 -0
- package/lib/core/dispatch-tool.mjs +371 -0
- package/lib/core/http-routes.mjs +328 -0
- package/lib/core/intersection.mjs +27 -0
- package/lib/core/presets-sync.mjs +136 -0
- package/lib/core/profile-provider.mjs +241 -0
- package/lib/core/profiles-store.mjs +226 -0
- package/lib/{pure.mjs → core/pure.mjs} +114 -109
- package/lib/{shims.mjs → core/shims.mjs} +9 -9
- package/lib/core/whitelist.mjs +22 -0
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<div align="center">
|
|
5
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="Version: v0.3.0" src="https://img.shields.io/badge/Version-v0.3.0-blue.svg" />
|
|
7
8
|
<img alt="npm" src="https://img.shields.io/npm/v/dsh-subagent-profile.svg" />
|
|
8
9
|
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%200.1.1--rc.2-blue.svg" />
|
|
9
10
|
</div>
|
|
@@ -99,19 +100,25 @@ dsh-subagent-profile/
|
|
|
99
100
|
├── index.mjs # host side: the plugin itself (dispatch tool, profile provider, service, HTTP routes)
|
|
100
101
|
├── lib/
|
|
101
102
|
│ ├── client.js # browser side: settings page + dispatch tool-call card
|
|
102
|
-
│
|
|
103
|
-
│
|
|
103
|
+
│ └── core/ # host-side modules (lightweight layering)
|
|
104
|
+
│ ├── pure.mjs # dependency-free pure functions (sanitize / prune / guard math — unit-tested)
|
|
105
|
+
│ ├── shims.mjs # the single @deepseek-ai import facade (guards fail loud, helpers degrade softly)
|
|
106
|
+
│ └── *.mjs # catalog / whitelist / intersection / cost-guard / delegation / profiles-store /
|
|
107
|
+
│ # presets-sync / http-routes / profile-provider / dispatch-tool
|
|
104
108
|
├── presets/orchestrator/ # bundled "orchestrator" agent preset (self-installed, synced on every startup)
|
|
105
109
|
├── cordis.patch.yml # bundle patch: inserts the plugin row into the host composition
|
|
106
|
-
├──
|
|
107
|
-
├──
|
|
110
|
+
├── .gitea/workflows/ci.yml # bare-CI (Gitea Actions; needs an Act runner on the server)
|
|
111
|
+
├── package.json # metadata, files whitelist, exports (test / test:bare / preflight scripts)
|
|
112
|
+
├── scripts/
|
|
113
|
+
│ ├── release.mjs # release helper (version bump / tag checks)
|
|
114
|
+
│ └── preflight.mjs # preflight: preset-tree reconciliation + README badge == version (zero-dep)
|
|
108
115
|
├── docs/
|
|
109
116
|
│ └── screenshots/ # README screenshots
|
|
110
|
-
├── test/ # host-side tests (node:test, zero extra deps;
|
|
111
|
-
│ ├── README.md / README.zh.md # test directory guide (EN/ZH)
|
|
117
|
+
├── test/ # host-side tests (node:test, zero extra deps; 101 cases = 26 bare + 75 junction)
|
|
118
|
+
│ ├── README.md / README.zh.md # test directory guide (EN/ZH) — two-tier split explained
|
|
112
119
|
│ ├── harness/ctx.mjs # fake Cordis ctx + ~/.dsh isolation
|
|
113
|
-
│ ├──
|
|
114
|
-
│ └──
|
|
120
|
+
│ ├── pure / input-schema / catalog-integrity.test.mjs # bare tier (import-free, runs in bare CI)
|
|
121
|
+
│ └── characterization / facade / gating / persist / recycle / cost-guard / continuable-guard.test.mjs # junction tier (local only)
|
|
115
122
|
├── README.md / README.zh.md # this document (EN/ZH)
|
|
116
123
|
└── LICENSE
|
|
117
124
|
```
|
|
@@ -120,6 +127,11 @@ dsh-subagent-profile/
|
|
|
120
127
|
|
|
121
128
|
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
129
|
|
|
130
|
+
### CI (bare) & preflight
|
|
131
|
+
|
|
132
|
+
- **Gitea Actions** (`.gitea/workflows/ci.yml`): on `push` / `pull_request` to `v2-midterm` / `main`, runs the **bare-CI** subset — the tests that never load `@deepseek-ai` (`npm run test:bare`: pure / input-schema / catalog-integrity), `node --check` syntax checks, eslint (installed in isolation, since the bare environment cannot install the `@deepseek-ai` devDependencies), and `npm run preflight`. **Enabling Gitea Actions requires installing an Act runner on the server** (register it with the `ubuntu-latest` label); the workflow takes effect automatically once the runner is ready. Junction-dependent tests (characterization / facade / gating / persist / recycle / cost-guard / continuable-guard) run locally only — see `test/README.md` for the two-tier split and its rationale.
|
|
133
|
+
- **Preflight** (`npm run preflight`): zero-dependency self-check — ① reconciles the bundled `presets/` tree against a fresh `$DSH_HOME/.agent-presets` derived tree (byte-identical set, both directions; never touches the real `~/.dsh`), ② asserts the README version badge (`v<version>` in the hero) matches `package.json` `version`. Non-zero exit means drift — fix and re-run before release.
|
|
134
|
+
|
|
123
135
|
If this plugin has been useful to you, please give it a ⭐ on GitHub — it helps others find it.
|
|
124
136
|
|
|
125
137
|
## Credits
|
package/README.zh.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
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="Version: v0.3.0" src="https://img.shields.io/badge/Version-v0.3.0-blue.svg" />
|
|
7
8
|
<img alt="npm" src="https://img.shields.io/npm/v/dsh-subagent-profile.svg" />
|
|
8
9
|
<img alt="DSH" src="https://img.shields.io/badge/DSH-0.1.0--rc.6%20~%200.1.1--rc.2-blue.svg" />
|
|
9
10
|
</div>
|
|
@@ -99,19 +100,25 @@ dsh-subagent-profile/
|
|
|
99
100
|
├── index.mjs # 宿主侧:插件本体(dispatch 工具、profile provider、服务、HTTP 路由)
|
|
100
101
|
├── lib/
|
|
101
102
|
│ ├── client.js # 浏览器侧:设置页 + dispatch 工具调用卡片
|
|
102
|
-
│
|
|
103
|
-
│
|
|
103
|
+
│ └── core/ # 宿主侧模块(轻量分层)
|
|
104
|
+
│ ├── pure.mjs # 无依赖纯函数(净化 / 剪枝 / 护栏计算——可单测)
|
|
105
|
+
│ ├── shims.mjs # @deepseek-ai 依赖唯一入口(facade:守卫型 fail-loud、功能映射型软降级)
|
|
106
|
+
│ └── *.mjs # catalog / whitelist / intersection / cost-guard / delegation / profiles-store /
|
|
107
|
+
│ # presets-sync / http-routes / profile-provider / dispatch-tool
|
|
104
108
|
├── presets/orchestrator/ # 内置「编排者模式」agent 预设(自安装,每次启动同步)
|
|
105
109
|
├── cordis.patch.yml # bundle 补丁:把插件行插入宿主组成
|
|
106
|
-
├──
|
|
107
|
-
├──
|
|
110
|
+
├── .gitea/workflows/ci.yml # bare-CI(Gitea Actions;需服务器装 Act runner)
|
|
111
|
+
├── package.json # 元数据、files 发布白名单、exports(test / test:bare / preflight scripts)
|
|
112
|
+
├── scripts/
|
|
113
|
+
│ ├── release.mjs # 发布脚本(版本 bump / tag 校验)
|
|
114
|
+
│ └── preflight.mjs # preflight:preset 树对账 + README 徽章 == version(零依赖)
|
|
108
115
|
├── docs/
|
|
109
116
|
│ └── screenshots/ # README 截图
|
|
110
|
-
├── test/ # 宿主侧自动化测试(node:test,零新增依赖;
|
|
111
|
-
│ ├── README.md / README.zh.md #
|
|
117
|
+
├── test/ # 宿主侧自动化测试(node:test,零新增依赖;101 用例 = 26 bare + 75 junction)
|
|
118
|
+
│ ├── README.md / README.zh.md # 测试目录说明(中英双语)——两档测试划分
|
|
112
119
|
│ ├── harness/ctx.mjs # 假宿主环境(fake ctx + ~/.dsh 隔离)
|
|
113
|
-
│ ├──
|
|
114
|
-
│ └──
|
|
120
|
+
│ ├── pure / input-schema / catalog-integrity.test.mjs # bare 档(import-free,bare CI 可跑)
|
|
121
|
+
│ └── characterization / facade / gating / persist / recycle / cost-guard / continuable-guard.test.mjs # junction 档(仅本机)
|
|
115
122
|
├── README.md / README.zh.md # 本文档(中英双语)
|
|
116
123
|
└── LICENSE
|
|
117
124
|
```
|
|
@@ -120,6 +127,11 @@ dsh-subagent-profile/
|
|
|
120
127
|
|
|
121
128
|
发现 Bug 或有新想法?欢迎[提 Issue](https://github.com/muzyLink/dsh-subagent-profile/issues)或提交 Pull Request,任何形式的贡献都欢迎。
|
|
122
129
|
|
|
130
|
+
### CI(bare)与 preflight
|
|
131
|
+
|
|
132
|
+
- **Gitea Actions**(`.gitea/workflows/ci.yml`):`push` / `pull_request` 到 `v2-midterm` / `main` 时运行 **bare-CI** 子集——从不加载 `@deepseek-ai` 的测试(`npm run test:bare`:pure / input-schema / catalog-integrity)、`node --check` 全仓库语法检查、eslint 行门(eslint 在仓库外隔离安装,因裸环境装不到 `@deepseek-ai` devDependencies)、以及 `npm run preflight`。**启用 Gitea Actions 需服务器装 Act runner**(注册时带上 `ubuntu-latest` 标签),runner 就绪后本工作流自动生效。依赖 junction 的测试(characterization / facade / gating / persist / recycle / cost-guard / continuable-guard)仅本机跑——两档测试的划分与理由见 `test/README.zh.md`。
|
|
133
|
+
- **Preflight**(`npm run preflight`):零依赖自检——① `presets/` 与全新 `$DSH_HOME/.agent-presets` 派生树做 byte 一致集合对账(双向;绝不写真实 `~/.dsh`);② 断言 README 版本徽章(Hero 区 `v<version>`)与 `package.json` 的 `version` 一致。非零退出即漂移,发布前修复后重跑。
|
|
134
|
+
|
|
123
135
|
如果这个插件帮到了你,欢迎在 GitHub 上点个 ⭐,让更多人看到它。
|
|
124
136
|
|
|
125
137
|
## 致谢
|