@huanlin/dsh-plugin-yet-another-subagent 0.1.6 → 0.4.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 +26 -15
- package/lib/client.js +3125 -3099
- package/lib/index.js +5703 -5487
- package/lib/types/client/SettingsPage.d.ts +67 -49
- package/lib/types/client/SubagentCard.d.ts +57 -56
- package/lib/types/client/SubagentTreeView.d.ts +64 -63
- package/lib/types/client/index.d.ts +29 -29
- package/lib/types/client/locales.d.ts +13 -13
- package/lib/types/index.d.ts +42 -42
- package/lib/types/projection.d.ts +200 -103
- package/lib/types/repair.d.ts +66 -49
- package/lib/types/rpc.d.ts +69 -59
- package/package.json +26 -34
- package/lib/invariant.js +0 -21
- package/lib/types/invariant.d.ts +0 -16
package/README.md
CHANGED
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
## 架构
|
|
12
12
|
|
|
13
|
-
单 bundle
|
|
13
|
+
单 bundle,双入口(host `.` + client `./client`)。
|
|
14
|
+
|
|
15
|
+
> 不发布 `./invariant`:本插件的工具/RPC/projection 注册均无独立可分歧的运行时观察(HMR 安全性由测试证明),无内容可校验——按 DSH 0.1.2-rc.1 收紧后的 invariant 规则(禁止空 installer)省略该入口及其全部接线。
|
|
14
16
|
|
|
15
17
|
- **Host 半**(`src/index.ts`):
|
|
16
18
|
- 单一 `subagent` 工具,通过 `profile` 枚举参数选择 profile(非每 profile 一个工具)
|
|
17
19
|
- 复用官方 `spawn` provider,支持前台(foreground)和后台(continuable / one-shot)两种模式
|
|
18
20
|
- Profile 状态通过 settings seam 持久化到 `$DSH_HOME/settings.yaml`
|
|
19
|
-
- RPC CRUD:`profiles
|
|
20
|
-
- 两个 session projection:`subagentProfile`(父会话 childId→profileId 映射 + callId→childId)+ `yaSubagentProgress`(子会话实时 toolcall/token
|
|
21
|
+
- RPC CRUD:`ya-subagent.profiles.*` / `.tools.list` / `.sessions.repair`(`/api` 上的 exact Fetch route,经 `connection.fetch.register` 注册)
|
|
22
|
+
- 两个 session projection:`subagentProfile`(父会话 childId→profileId 映射 + callId→childId)+ `yaSubagentProgress`(子会话实时 toolcall/token/活动状态);wire view 已做引用记忆化,适配 dsh 0.1.2-alpha.3 起 change feed 的 `Object.is` 下发门控(内容不变即静默)
|
|
21
23
|
- **Client 半**(`src/client/index.ts`):
|
|
22
24
|
- `settings.section` — Profile 编辑页
|
|
23
25
|
- `tool.call.toolview`(key `subagent`)— `SubagentCard` 工具调用卡片
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
pnpm install # 安装开发依赖 + zod(唯一运行时 npm 依赖)
|
|
72
74
|
pnpm run typecheck # tsc --noEmit(通过 ../dsh 解析 DSH 源码)
|
|
73
75
|
pnpm test # vitest run
|
|
74
|
-
pnpm run build # tsc + tsdown → lib/index.js, lib/
|
|
76
|
+
pnpm run build # tsc + tsdown → lib/index.js, lib/client.js
|
|
75
77
|
```
|
|
76
78
|
|
|
77
79
|
### 类型检查
|
|
@@ -95,13 +97,12 @@ dsh plugin --profile web add "link:D:/Projects/deepseek-harness/yet-another-suba
|
|
|
95
97
|
```sh
|
|
96
98
|
pnpm run typecheck # 0 errors
|
|
97
99
|
pnpm test # 55 tests passing
|
|
98
|
-
pnpm run build # lib/index.js + lib/
|
|
100
|
+
pnpm run build # lib/index.js + lib/client.js
|
|
99
101
|
```
|
|
100
102
|
|
|
101
103
|
### 产物验证
|
|
102
104
|
|
|
103
105
|
- `lib/index.js` — Host bundle
|
|
104
|
-
- `lib/invariant.js` — Invariant companion
|
|
105
106
|
- `lib/client.js` — Client bundle(CSS-modules inline,`d` 前缀 hash 防 CSS 类名数字开头)
|
|
106
107
|
- `cordis.patch.yml` — Bundle patch layer
|
|
107
108
|
|
|
@@ -113,17 +114,27 @@ Profile 状态通过 DSH settings seam 持久化到 `$DSH_HOME/settings.yaml`
|
|
|
113
114
|
|
|
114
115
|
## RPC API
|
|
115
116
|
|
|
116
|
-
Profile CRUD 走
|
|
117
|
+
Profile CRUD 走 `/api` 通道上的 exact Fetch route(`ctx.connection.fetch.register`,与官方
|
|
118
|
+
dsh-client-file-upload 同模式)。不占用 `/api` 的单拦截器槽(该槽归 Typert gateway 所有);
|
|
119
|
+
信任栅栏与浏览器认证由 `/api` 载体统一执行。
|
|
117
120
|
|
|
118
|
-
| endpoint | payload | result (ok) |
|
|
121
|
+
| endpoint(wire method) | payload | result (ok) |
|
|
119
122
|
|----------|---------|-------------|
|
|
120
|
-
| `profiles.list` | `{}` | `{ profiles: SubagentProfile[] }` |
|
|
121
|
-
| `profiles.add` | `{ profile: SubagentProfile }` | `{ profiles: SubagentProfile[] }` |
|
|
122
|
-
| `profiles.update` | `{ profile: SubagentProfile }` | `{ profiles: SubagentProfile[] }` |
|
|
123
|
-
| `profiles.remove` | `{ id: string }` | `{ profiles: SubagentProfile[] }` |
|
|
124
|
-
| `tools.list` | `{}` | `{ tools: { name, description }[] }` |
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
| `ya-subagent.profiles.list` | `{}` | `{ profiles: SubagentProfile[] }` |
|
|
124
|
+
| `ya-subagent.profiles.add` | `{ profile: SubagentProfile }` | `{ profiles: SubagentProfile[] }` |
|
|
125
|
+
| `ya-subagent.profiles.update` | `{ profile: SubagentProfile }` | `{ profiles: SubagentProfile[] }` |
|
|
126
|
+
| `ya-subagent.profiles.remove` | `{ id: string }` | `{ profiles: SubagentProfile[] }` |
|
|
127
|
+
| `ya-subagent.tools.list` | `{}` | `{ tools: { name, description }[] }` |
|
|
128
|
+
| `ya-subagent.sessions.repair` | `{}` | `RepairStats` |
|
|
129
|
+
|
|
130
|
+
URL 形如 `POST /api/ya-subagent.profiles.list`(Connection client-request envelope,响应为
|
|
131
|
+
server-response envelope)。业务错误返回 `{ ok: false, error: { code: 'internal', message } }`。
|
|
132
|
+
|
|
133
|
+
> 历史注:v0.3.x 走 `connection.rpc.handle('/ya-subagent', …)` 专用通道;dsh 0.1.5 的
|
|
134
|
+
> 专用通道注册在 web profile 拓扑下无法挂载(webserver 服务与 connection 是兄弟 loader
|
|
135
|
+
> 行,`rpc.handle` 内部的 `owner.webServer` 解析永远失败),浏览器侧表现为
|
|
136
|
+
> `transport failure for /ya-subagent/profiles.list: HTTP 405`。v0.4.0 起改用 exact
|
|
137
|
+
> Fetch route。
|
|
127
138
|
|
|
128
139
|
## 已知限制
|
|
129
140
|
|