dsh-plugin-subagent-director 0.2.1 → 0.3.0-beta.1
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/CHANGELOG.md +60 -21
- package/LICENSE +21 -21
- package/README.md +80 -74
- package/cordis.patch.yml +11 -11
- package/lib/bridge-contract.d.ts +21 -0
- package/lib/bridge-contract.d.ts.map +1 -1
- package/lib/bridge-contract.js +4 -0
- package/lib/bridge-contract.js.map +1 -1
- package/lib/bridge-entry.d.ts +5 -1
- package/lib/bridge-entry.d.ts.map +1 -1
- package/lib/bridge-entry.js +6 -2
- package/lib/bridge-entry.js.map +1 -1
- package/lib/client/SubagentCloseAction.d.ts +32 -0
- package/lib/client/SubagentCloseAction.d.ts.map +1 -0
- package/lib/client/SubagentCloseAction.js +99 -0
- package/lib/client/SubagentCloseAction.js.map +1 -0
- package/lib/client/SubagentModelDock.d.ts +19 -9
- package/lib/client/SubagentModelDock.d.ts.map +1 -1
- package/lib/client/SubagentModelDock.js +79 -4
- package/lib/client/SubagentModelDock.js.map +1 -1
- package/lib/client/index.d.ts +5 -0
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +229 -10
- package/lib/client/index.js.map +1 -1
- package/lib/client/locales.d.ts +1 -1
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +16 -2
- package/lib/client/locales.js.map +1 -1
- package/lib/client/subagent-model.d.ts +13 -0
- package/lib/client/subagent-model.d.ts.map +1 -1
- package/lib/client/subagent-model.js +20 -0
- package/lib/client/subagent-model.js.map +1 -1
- package/lib/close-tool.d.ts +29 -0
- package/lib/close-tool.d.ts.map +1 -0
- package/lib/close-tool.js +60 -0
- package/lib/close-tool.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/remote.d.ts +59 -3
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +148 -10
- package/lib/remote.js.map +1 -1
- package/lib/route-resolver.d.ts +7 -0
- package/lib/route-resolver.d.ts.map +1 -1
- package/lib/route-resolver.js +10 -1
- package/lib/route-resolver.js.map +1 -1
- package/lib/settings.d.ts.map +1 -1
- package/lib/settings.js +10 -2
- package/lib/settings.js.map +1 -1
- package/package.json +113 -113
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,46 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
3
|
本项目的所有显著变更都会记录在此文件中。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.3.0] - 2026-08-28
|
|
6
|
+
|
|
7
|
+
### 新增
|
|
8
|
+
|
|
9
|
+
- **`close_subagent` 模型可见工具**:主代理可按需释放「已完成但仍驻留」的
|
|
10
|
+
continuable 子代理(内部调用 DSH 核心 `drainContinuableChildren`,与
|
|
11
|
+
`send_message`/`interrupt_agent` 构成完整生命周期闭环;非驻留目标是安全
|
|
12
|
+
no-op)——[issue #1](https://github.com/SeverusZh/dsh-plugin-subagent-director/issues/1);
|
|
13
|
+
- **子代理会话页「终止可持续状态」按钮**:打开 continuable 子代理会话时,
|
|
14
|
+
会话标题操作区显示释放按钮(确认后经 `/subagent-director` 桥释放该子代理,
|
|
15
|
+
父代理不在线时给出明确提示);
|
|
16
|
+
- **可观测性打通**:composer 下方实际运行供应商/模型读数不再依赖尚未填充的
|
|
17
|
+
assistant provenance 字段,改为读取子代理会话的 `request/header` 记录
|
|
18
|
+
(`subagentModel` 桥端点),快照内已有 provenance 时仍走零请求快速路径,
|
|
19
|
+
读不到时优雅降级——移除 README「暂不可用」标注。
|
|
20
|
+
|
|
21
|
+
### 修复
|
|
22
|
+
|
|
23
|
+
- 未配置 `toolFilter` 的角色被 dsh-settings 物化为 `{allow:[],deny:[]}` 后
|
|
24
|
+
清空子代理全部工具(tools=0、「只执行一步」假象):空 filter 视为未配置,
|
|
25
|
+
schema 层不再物化空对象(`hasToolFilter` + `.default(undefined)`)——
|
|
26
|
+
[issue #2](https://github.com/SeverusZh/dsh-plugin-subagent-director/issues/2)。
|
|
27
|
+
|
|
28
|
+
### 兼容性
|
|
29
|
+
|
|
30
|
+
- `@deepseek-ai/dsh-subagent` peer 依赖下限提升至 `^0.1.0-rc.8`
|
|
31
|
+
(`drainContinuableChildren` 所在版本线)。
|
|
32
|
+
|
|
33
|
+
### 测试
|
|
34
|
+
|
|
35
|
+
- 单元测试由 150 增至 178:空 toolFilter 语义、close_subagent 工具、
|
|
36
|
+
桥接 `subagentClose`/`subagentModel` 端点、可观测性数据源合并。
|
|
37
|
+
|
|
38
|
+
### 文档
|
|
39
|
+
|
|
40
|
+
- README:新增「释放可持续子代理」特性、更新可观测性描述(中英双语)。
|
|
41
|
+
|
|
42
|
+
[0.3.0]: https://github.com/SeverusZh/dsh-plugin-subagent-director/releases/tag/v0.3.0
|
|
43
|
+
|
|
5
44
|
## [0.2.0] - 2026-08-17
|
|
6
45
|
|
|
7
46
|
### 新增
|
|
@@ -30,24 +69,24 @@
|
|
|
30
69
|
- 新增设计文档与实现计划(`docs/superpowers/`)。
|
|
31
70
|
|
|
32
71
|
## [0.1.0] - 2026-08-14
|
|
33
|
-
|
|
34
|
-
首个公开发布版本。
|
|
35
|
-
|
|
36
|
-
### 新增
|
|
37
|
-
|
|
38
|
-
- 四级模型路由解析链(单次调用参数 > 角色绑定 > 插件默认 > 继承主代理),字段级覆盖、未配置零侵入;
|
|
39
|
-
- `subagent_role` 模型可见委派工具:`role`/`provider`/`model`/`reasoningEffort` 可选参数,前景/one-shot 后台/continuable 后台三种执行路线;
|
|
40
|
-
- 角色模板:命名角色携带职责描述、persona 与可选模型绑定,写入 settings 命名空间 `subagent-director`;
|
|
41
|
-
- 主代理角色清单指引(系统提示段落,无角色时不注入);
|
|
42
|
-
- 设置界面「子代理导演」:默认模型配置 + 角色卡片增删改(中英双语);
|
|
43
|
-
- 子代理实际运行模型读数(composer dock,零额外请求);
|
|
44
|
-
- 设置命名空间桥接条目 `subagent-director-bridge`:自注册 `/subagent-director` HTTP 路由,绕开 Web API 的 settings 白名单限制;
|
|
45
|
-
- 129 个单元测试(路由解析、schema 校验、桥接信封、client 纯逻辑)。
|
|
46
|
-
|
|
47
|
-
### 文档
|
|
48
|
-
|
|
49
|
-
- README(中英双语):安装、配置示例、角色模板、FAQ;
|
|
50
|
-
- MIT License。
|
|
51
|
-
|
|
72
|
+
|
|
73
|
+
首个公开发布版本。
|
|
74
|
+
|
|
75
|
+
### 新增
|
|
76
|
+
|
|
77
|
+
- 四级模型路由解析链(单次调用参数 > 角色绑定 > 插件默认 > 继承主代理),字段级覆盖、未配置零侵入;
|
|
78
|
+
- `subagent_role` 模型可见委派工具:`role`/`provider`/`model`/`reasoningEffort` 可选参数,前景/one-shot 后台/continuable 后台三种执行路线;
|
|
79
|
+
- 角色模板:命名角色携带职责描述、persona 与可选模型绑定,写入 settings 命名空间 `subagent-director`;
|
|
80
|
+
- 主代理角色清单指引(系统提示段落,无角色时不注入);
|
|
81
|
+
- 设置界面「子代理导演」:默认模型配置 + 角色卡片增删改(中英双语);
|
|
82
|
+
- 子代理实际运行模型读数(composer dock,零额外请求);
|
|
83
|
+
- 设置命名空间桥接条目 `subagent-director-bridge`:自注册 `/subagent-director` HTTP 路由,绕开 Web API 的 settings 白名单限制;
|
|
84
|
+
- 129 个单元测试(路由解析、schema 校验、桥接信封、client 纯逻辑)。
|
|
85
|
+
|
|
86
|
+
### 文档
|
|
87
|
+
|
|
88
|
+
- README(中英双语):安装、配置示例、角色模板、FAQ;
|
|
89
|
+
- MIT License。
|
|
90
|
+
|
|
52
91
|
[0.1.0]: https://github.com/SeverusZh/dsh-plugin-subagent-director/releases/tag/v0.1.0
|
|
53
92
|
[0.2.0]: https://github.com/SeverusZh/dsh-plugin-subagent-director/releases/tag/v0.2.0
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Subagent Director 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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Subagent Director 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,19 +1,20 @@
|
|
|
1
|
-
# 🎬 Subagent Director(子代理导演)
|
|
2
|
-
|
|
3
|
-
> 为 DeepSeek Harness 的 subagent 指定 LLM 供应商与模型,并用「角色模板」规划主代理与子代理的分工。
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<img alt="npm version" src="https://img.shields.io/npm/v/dsh-plugin-subagent-director?label=npm">
|
|
7
|
-
<img alt="license" src="https://img.shields.io/npm/l/dsh-plugin-subagent-director">
|
|
8
|
-
<img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.1.0--rc.
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
# 🎬 Subagent Director(子代理导演)
|
|
2
|
+
|
|
3
|
+
> 为 DeepSeek Harness 的 subagent 指定 LLM 供应商与模型,并用「角色模板」规划主代理与子代理的分工。
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img alt="npm version" src="https://img.shields.io/npm/v/dsh-plugin-subagent-director?label=npm">
|
|
7
|
+
<img alt="license" src="https://img.shields.io/npm/l/dsh-plugin-subagent-director">
|
|
8
|
+
<img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek%20Harness-0.1.0--rc.6-blue">
|
|
9
|
+
<img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg">
|
|
10
|
+
</p>
|
|
11
|
+
|
|
11
12
|
[English](#english) · [特性](#特性) · [快速开始](#快速开始) · [角色模板](#角色模板) · [术语](#术语) · [开发](#开发) · [FAQ](#faq)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 特性
|
|
16
|
-
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 特性
|
|
17
|
+
|
|
17
18
|
- **供应商与模型选择** —— 为 subagent 配置默认 LLM 供应商(route)与模型;每次委派也可以由模型显式指定;
|
|
18
19
|
- **默认模型兜底** —— 配置 `defaultProvider`/`defaultModel` 后,即使模型调用内置
|
|
19
20
|
`subagent`/`subagent_fork` 工具,未显式指定模型的子代理也会自动使用该模型
|
|
@@ -22,20 +23,24 @@
|
|
|
22
23
|
- **角色按显示名引用** —— `role` 参数未命中 id 时按 `displayName` 精确匹配(重名
|
|
23
24
|
取定义顺序第一个并提示),模型按显示名也能命中模板;
|
|
24
25
|
- **角色模板** —— 定义「代码审查员」「翻译员」等角色:职责描述(给主代理看)+ persona(注入子代理)+ 可选模型绑定;
|
|
25
|
-
- **四级回退链** —— 单次调用参数 > 角色绑定 > 插件默认 > 继承主代理(未配置时零侵入);
|
|
26
|
-
- **主代理指引** —— 系统提示自动注入角色清单,主代理知道何时委派给谁;
|
|
27
|
-
- **设置界面** —— DSH 设置面板内可视化配置(默认模型 + 角色卡片增删改);
|
|
28
|
-
- **continuable 后台** —— 返回可续聊子代理 id,配合 send_message 持续委派;
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
- **四级回退链** —— 单次调用参数 > 角色绑定 > 插件默认 > 继承主代理(未配置时零侵入);
|
|
27
|
+
- **主代理指引** —— 系统提示自动注入角色清单,主代理知道何时委派给谁;
|
|
28
|
+
- **设置界面** —— DSH 设置面板内可视化配置(默认模型 + 角色卡片增删改);
|
|
29
|
+
- **continuable 后台** —— 返回可续聊子代理 id,配合 send_message 持续委派;
|
|
30
|
+
- **释放可持续子代理** —— 模型可见工具 `close_subagent(subagent_id)` 与子代理会话
|
|
31
|
+
页的「终止可持续状态」按钮,主动释放已完成但仍驻留的 continuable 子代理
|
|
32
|
+
(内部调用 DSH 核心 `drainContinuableChildren`);
|
|
33
|
+
- **可观测性** —— 打开子代理会话时,composer 下方显示其实际运行的供应商/模型
|
|
34
|
+
(从会话 `request/header` 记录读取真实路由;读不到时优雅降级);
|
|
35
|
+
|
|
36
|
+
## 快速开始
|
|
37
|
+
|
|
38
|
+
### 安装
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
dsh plugin --profile <name> add dsh-plugin-subagent-director
|
|
42
|
+
```
|
|
43
|
+
|
|
39
44
|
或本地开发时以 `dsh plugin --profile <name> add link:<绝对路径>` 挂载本地 checkout
|
|
40
45
|
(配置示例见下)。
|
|
41
46
|
|
|
@@ -106,9 +111,9 @@ subagent-director:
|
|
|
106
111
|
description: 中英互译技术文档、代码注释与沟通内容,保留术语准确性与语气
|
|
107
112
|
persona: 你是专业翻译。术语统一、句式自然、保留原文意图;专有名词与技术缩写保持原文,拿不准的术语标注出来。
|
|
108
113
|
```
|
|
109
|
-
|
|
110
|
-
### 使用
|
|
111
|
-
|
|
114
|
+
|
|
115
|
+
### 使用
|
|
116
|
+
|
|
112
117
|
对话中委派(主代理会看到角色清单指引,自动选择工具与角色):
|
|
113
118
|
|
|
114
119
|
```text
|
|
@@ -118,51 +123,52 @@ subagent_role({ role: "code-reviewer", model: "deepseek-chat", prompt: "..." })
|
|
|
118
123
|
|
|
119
124
|
`role` 参数支持用角色 id 或显示名引用:未命中 id 时会按 `displayName` 精确匹配
|
|
120
125
|
(多个同名角色取定义顺序第一个并提示);建议始终用 id,见系统提示中的 Delegate 行。
|
|
121
|
-
|
|
122
|
-
## 术语
|
|
123
|
-
|
|
124
|
-
- **subagentProvider(传输)**:`spawn` / `fork` / `acp`——子代理跑在哪条传输链路上;
|
|
125
|
-
- **provider(LLM route)**:`deepseek-official`、pi-ai route——模型请求实际发给哪个供应商。
|
|
126
|
-
|
|
127
|
-
两者是**两套命名空间**,配置时不要混淆。
|
|
128
|
-
|
|
129
|
-
## 开发
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npm install
|
|
133
|
-
npm test # vitest(129 用例)
|
|
134
|
-
npm run typecheck
|
|
135
|
-
npm run build # host(tsc) + client(rolldown bundle)
|
|
136
|
-
```
|
|
137
|
-
|
|
126
|
+
|
|
127
|
+
## 术语
|
|
128
|
+
|
|
129
|
+
- **subagentProvider(传输)**:`spawn` / `fork` / `acp`——子代理跑在哪条传输链路上;
|
|
130
|
+
- **provider(LLM route)**:`deepseek-official`、pi-ai route——模型请求实际发给哪个供应商。
|
|
131
|
+
|
|
132
|
+
两者是**两套命名空间**,配置时不要混淆。
|
|
133
|
+
|
|
134
|
+
## 开发
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npm install
|
|
138
|
+
npm test # vitest(129 用例)
|
|
139
|
+
npm run typecheck
|
|
140
|
+
npm run build # host(tsc) + client(rolldown bundle)
|
|
141
|
+
```
|
|
142
|
+
|
|
138
143
|
## FAQ
|
|
139
|
-
|
|
140
|
-
**为什么需要两个插件条目?**
|
|
141
|
-
DSH 的 Web API 只向白名单内的 settings 命名空间开放读写。本插件通过自注册的 `/subagent-director` HTTP 路由桥接自己的命名空间,而该路由依赖的 webServer 服务只能经 cordis `inject` 获取,因此拆成独立的 `subagent-director-bridge` 条目(无 Web 的 headless 场景它会自动不激活,主条目不受影响)。
|
|
142
|
-
|
|
144
|
+
|
|
145
|
+
**为什么需要两个插件条目?**
|
|
146
|
+
DSH 的 Web API 只向白名单内的 settings 命名空间开放读写。本插件通过自注册的 `/subagent-director` HTTP 路由桥接自己的命名空间,而该路由依赖的 webServer 服务只能经 cordis `inject` 获取,因此拆成独立的 `subagent-director-bridge` 条目(无 Web 的 headless 场景它会自动不激活,主条目不受影响)。
|
|
147
|
+
|
|
143
148
|
**未配置任何角色时行为如何?**
|
|
144
149
|
未配置任何角色且未配置默认模型时与未安装本插件完全一致(零侵入)。配置了
|
|
145
150
|
`defaultProvider`/`defaultModel` 且未关闭 `applyDefaultRoute` 时,所有未显式
|
|
146
151
|
指定模型的子代理(含内置工具发起的)都会使用该默认模型。
|
|
147
|
-
|
|
148
|
-
**新供应商/API 会自动出现吗?**
|
|
149
|
-
会。设置页订阅了供应商与设置变更事件,在 Models 页新增供应商/API key 后,下拉列表自动刷新,无需重启。
|
|
150
|
-
|
|
151
|
-
## License
|
|
152
|
-
|
|
153
|
-
[MIT](./LICENSE) © Subagent Director contributors
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## English
|
|
158
|
-
|
|
159
|
-
**Subagent Director** is an out-of-tree DeepSeek Harness plugin that lets you choose an LLM provider and model for subagents, and plan main-agent/subagent responsibilities through role templates.
|
|
160
|
-
|
|
161
|
-
- **Provider/model selection** — a configurable default route plus optional per-call `provider`/`model` arguments on the `subagent_role` tool;
|
|
162
|
-
- **Role templates** — named roles carrying a description, a persona, and an optional model binding;
|
|
163
|
-
- **Four-layer resolution** — call args > role binding > plugin default > inherit from the parent agent (zero intrusion when unconfigured);
|
|
164
|
-
- **Settings UI** — manage defaults and role cards in the DSH settings panel;
|
|
165
|
-
- **Continuable background** — durable subagent ids with send_message follow-ups;
|
|
166
|
-
- **
|
|
167
|
-
|
|
152
|
+
|
|
153
|
+
**新供应商/API 会自动出现吗?**
|
|
154
|
+
会。设置页订阅了供应商与设置变更事件,在 Models 页新增供应商/API key 后,下拉列表自动刷新,无需重启。
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
[MIT](./LICENSE) © Subagent Director contributors
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## English
|
|
163
|
+
|
|
164
|
+
**Subagent Director** is an out-of-tree DeepSeek Harness plugin that lets you choose an LLM provider and model for subagents, and plan main-agent/subagent responsibilities through role templates.
|
|
165
|
+
|
|
166
|
+
- **Provider/model selection** — a configurable default route plus optional per-call `provider`/`model` arguments on the `subagent_role` tool;
|
|
167
|
+
- **Role templates** — named roles carrying a description, a persona, and an optional model binding;
|
|
168
|
+
- **Four-layer resolution** — call args > role binding > plugin default > inherit from the parent agent (zero intrusion when unconfigured);
|
|
169
|
+
- **Settings UI** — manage defaults and role cards in the DSH settings panel;
|
|
170
|
+
- **Continuable background** — durable subagent ids with send_message follow-ups;
|
|
171
|
+
- **Release continuable children** — a model-facing `close_subagent(subagent_id)` tool plus a "Release subagent" button in the subagent session header, freeing resident children through the core `drainContinuableChildren` API;
|
|
172
|
+
- **Observability** — the addressed subagent’s actual provider/model shown under the composer, read from the session’s `request/header` records (graceful degradation when no run is recorded yet).
|
|
173
|
+
|
|
168
174
|
**Install** — `dsh plugin --profile <name> add dsh-plugin-subagent-director` mounts the main and bridge entries automatically from the package's bundle patch (`cordis.patch.yml`); optionally override the main entry's config in your profile's cordis.patch.yml (see the Chinese section above). License: MIT.
|
package/cordis.patch.yml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# dsh-plugin-subagent-director bundle patch.
|
|
2
|
-
#
|
|
3
|
-
# Adds the plugin's two entries: the main entry and the settings bridge that
|
|
4
|
-
# exposes the `subagent-director` settings namespace to the Web UI.
|
|
5
|
-
# Install: dsh plugin --profile <name> add dsh-plugin-subagent-director
|
|
6
|
-
# Restart `dsh --profile <name>` after installing.
|
|
7
|
-
- insert:
|
|
8
|
-
- id: subagent-director
|
|
9
|
-
name: dsh-plugin-subagent-director
|
|
10
|
-
- insert:
|
|
11
|
-
- id: subagent-director-bridge
|
|
1
|
+
# dsh-plugin-subagent-director bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# Adds the plugin's two entries: the main entry and the settings bridge that
|
|
4
|
+
# exposes the `subagent-director` settings namespace to the Web UI.
|
|
5
|
+
# Install: dsh plugin --profile <name> add dsh-plugin-subagent-director
|
|
6
|
+
# Restart `dsh --profile <name>` after installing.
|
|
7
|
+
- insert:
|
|
8
|
+
- id: subagent-director
|
|
9
|
+
name: dsh-plugin-subagent-director
|
|
10
|
+
- insert:
|
|
11
|
+
- id: subagent-director-bridge
|
|
12
12
|
name: dsh-plugin-subagent-director/bridge
|
package/lib/bridge-contract.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export declare const SUBAGENT_DIRECTOR_RPC_CHANNEL = "/subagent-director";
|
|
|
17
17
|
export declare const SUBAGENT_DIRECTOR_RPC_VIEW = "settingsView";
|
|
18
18
|
/** Endpoint that applies one path-op mutation. */
|
|
19
19
|
export declare const SUBAGENT_DIRECTOR_RPC_MUTATE = "settingsMutate";
|
|
20
|
+
/** Endpoint that releases one resident continuable child of a live parent. */
|
|
21
|
+
export declare const SUBAGENT_DIRECTOR_RPC_CLOSE = "subagentClose";
|
|
22
|
+
/** Endpoint that returns the actual provider/model of one child session. */
|
|
23
|
+
export declare const SUBAGENT_DIRECTOR_RPC_MODEL = "subagentModel";
|
|
20
24
|
/** Successful settingsView bridge response. */
|
|
21
25
|
export interface DirectorViewSuccess {
|
|
22
26
|
writable: boolean;
|
|
@@ -38,4 +42,21 @@ export type SettingsPathOpViewLike = {
|
|
|
38
42
|
op: 'unset';
|
|
39
43
|
path: string[];
|
|
40
44
|
};
|
|
45
|
+
/** Request payload for the subagentClose bridge endpoint. */
|
|
46
|
+
export interface DirectorCloseRequest {
|
|
47
|
+
parentSessionId: string;
|
|
48
|
+
childSessionId: string;
|
|
49
|
+
}
|
|
50
|
+
/** Request payload for the subagentModel bridge endpoint. */
|
|
51
|
+
export interface DirectorModelRequest {
|
|
52
|
+
sessionId: string;
|
|
53
|
+
}
|
|
54
|
+
/** Successful subagentModel bridge response. */
|
|
55
|
+
export type DirectorModelSuccess = {
|
|
56
|
+
found: true;
|
|
57
|
+
provider: string;
|
|
58
|
+
model: string;
|
|
59
|
+
} | {
|
|
60
|
+
found: false;
|
|
61
|
+
};
|
|
41
62
|
//# sourceMappingURL=bridge-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-contract.d.ts","sourceRoot":"","sources":["../src/bridge-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEhF,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAClE,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,kDAAkD;AAClD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge-contract.d.ts","sourceRoot":"","sources":["../src/bridge-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEhF,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAClE,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,kDAAkD;AAClD,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAC7D,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAC3D,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,qFAAqF;IACrF,IAAI,EAAE,qBAAqB,GAAG,SAAS,CAAC;CACzC;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,sBAAsB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,GAC9B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC7C;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpC,6DAA6D;AAC7D,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,gDAAgD;AAChD,MAAM,MAAM,oBAAoB,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
package/lib/bridge-contract.js
CHANGED
|
@@ -4,4 +4,8 @@ export const SUBAGENT_DIRECTOR_RPC_CHANNEL = '/subagent-director';
|
|
|
4
4
|
export const SUBAGENT_DIRECTOR_RPC_VIEW = 'settingsView';
|
|
5
5
|
/** Endpoint that applies one path-op mutation. */
|
|
6
6
|
export const SUBAGENT_DIRECTOR_RPC_MUTATE = 'settingsMutate';
|
|
7
|
+
/** Endpoint that releases one resident continuable child of a live parent. */
|
|
8
|
+
export const SUBAGENT_DIRECTOR_RPC_CLOSE = 'subagentClose';
|
|
9
|
+
/** Endpoint that returns the actual provider/model of one child session. */
|
|
10
|
+
export const SUBAGENT_DIRECTOR_RPC_MODEL = 'subagentModel';
|
|
7
11
|
//# sourceMappingURL=bridge-contract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-contract.js","sourceRoot":"","sources":["../src/bridge-contract.ts"],"names":[],"mappings":"AAcA,mEAAmE;AACnE,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AACzD,kDAAkD;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"bridge-contract.js","sourceRoot":"","sources":["../src/bridge-contract.ts"],"names":[],"mappings":"AAcA,mEAAmE;AACnE,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AACzD,kDAAkD;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,gBAAgB,CAAC;AAC7D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAC3D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC"}
|
package/lib/bridge-entry.d.ts
CHANGED
|
@@ -22,7 +22,11 @@
|
|
|
22
22
|
import type { Context } from '@deepseek-ai/cordis';
|
|
23
23
|
/** Cordis plugin name for the bridge entry. */
|
|
24
24
|
export declare const name = "subagent-director-bridge";
|
|
25
|
-
/** Required services: webServer (route owner)
|
|
25
|
+
/** Required services: webServer (route owner), settings (data seam), and the
|
|
26
|
+
* agent/subagent services backing the subagentClose endpoint (drain needs the
|
|
27
|
+
* exact live parent Agent). agents/subagents are dsh-base-level services that
|
|
28
|
+
* every profile mounts; headless profiles never activate this entry because
|
|
29
|
+
* webServer is absent. */
|
|
26
30
|
export declare const inject: string[];
|
|
27
31
|
/** Register the settings bridge route; dispose on unload. */
|
|
28
32
|
export declare function apply(ctx: Context): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-entry.d.ts","sourceRoot":"","sources":["../src/bridge-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,+CAA+C;AAC/C,eAAO,MAAM,IAAI,6BAA6B,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"bridge-entry.d.ts","sourceRoot":"","sources":["../src/bridge-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,+CAA+C;AAC/C,eAAO,MAAM,IAAI,6BAA6B,CAAC;AAE/C;;;;0BAI0B;AAC1B,eAAO,MAAM,MAAM,UAAmD,CAAC;AAEvE,6DAA6D;AAC7D,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
|
package/lib/bridge-entry.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { installDirectorRemoteBridge } from './remote.js';
|
|
2
2
|
/** Cordis plugin name for the bridge entry. */
|
|
3
3
|
export const name = 'subagent-director-bridge';
|
|
4
|
-
/** Required services: webServer (route owner)
|
|
5
|
-
|
|
4
|
+
/** Required services: webServer (route owner), settings (data seam), and the
|
|
5
|
+
* agent/subagent services backing the subagentClose endpoint (drain needs the
|
|
6
|
+
* exact live parent Agent). agents/subagents are dsh-base-level services that
|
|
7
|
+
* every profile mounts; headless profiles never activate this entry because
|
|
8
|
+
* webServer is absent. */
|
|
9
|
+
export const inject = ['webServer', 'settings', 'agents', 'subagents'];
|
|
6
10
|
/** Register the settings bridge route; dispose on unload. */
|
|
7
11
|
export function apply(ctx) {
|
|
8
12
|
installDirectorRemoteBridge(ctx);
|
package/lib/bridge-entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-entry.js","sourceRoot":"","sources":["../src/bridge-entry.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,IAAI,GAAG,0BAA0B,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"bridge-entry.js","sourceRoot":"","sources":["../src/bridge-entry.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,IAAI,GAAG,0BAA0B,CAAC;AAE/C;;;;0BAI0B;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEvE,6DAA6D;AAC7D,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,2BAA2B,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subagent Director — "release sustained state" header action (issue #1).
|
|
3
|
+
*
|
|
4
|
+
* Contributes one button to the `conversation.session.header.actions` seat
|
|
5
|
+
* (the additive per-session control row beside the session title). It renders
|
|
6
|
+
* only while the CURRENT session is a continuable subagent child
|
|
7
|
+
* (snapshot.subagent.address.mode === 'continuable') and otherwise returns
|
|
8
|
+
* null, so ordinary sessions and one-shot children see nothing.
|
|
9
|
+
*
|
|
10
|
+
* Clicking asks the Host bridge's `subagentClose` endpoint to
|
|
11
|
+
* drainContinuableChildren under the address's durable parent authority; on
|
|
12
|
+
* success the button turns into a settled label (the child's handle is
|
|
13
|
+
* released), on failure a short inline error shows the core message.
|
|
14
|
+
*
|
|
15
|
+
* The seat is a list slot declared by ui-conversation; the framework session
|
|
16
|
+
* standard kit supplies `useSession`/`sessionId` (dsh-client-runtime merge),
|
|
17
|
+
* the registration injects the RPC caller.
|
|
18
|
+
*/
|
|
19
|
+
import type { ClientConnectionRpc } from '@deepseek-ai/dsh-client-connection/client';
|
|
20
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
21
|
+
/** Business face injected by the registration (client/index.ts). */
|
|
22
|
+
export interface SubagentCloseActionInjected {
|
|
23
|
+
/** Generic RPC caller for the /subagent-director bridge channel. */
|
|
24
|
+
rpc: ClientConnectionRpc;
|
|
25
|
+
}
|
|
26
|
+
/** Full props: framework session kit + injected RPC + locale seat. */
|
|
27
|
+
export type SubagentCloseActionProps = PropsRuntime<'conversation.session.header.actions'> & InjectFace<SubagentCloseActionInjected> & PropsLocale<typeof NS>;
|
|
28
|
+
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
29
|
+
export declare const NS: 'settings.subagentDirector';
|
|
30
|
+
/** Render the release-sustained-state button for a continuable child, or nothing. */
|
|
31
|
+
export declare function SubagentCloseAction({ useSession, sessionId, rpc, t, }: SubagentCloseActionProps): React.JSX.Element | null;
|
|
32
|
+
//# sourceMappingURL=SubagentCloseAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentCloseAction.d.ts","sourceRoot":"","sources":["../../src/client/SubagentCloseAction.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAErF,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAS9F,oEAAoE;AACpE,MAAM,WAAW,2BAA2B;IAC1C,oEAAoE;IACpE,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AAED,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,qCAAqC,CAAC,GACxF,UAAU,CAAC,2BAA2B,CAAC,GACvC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;AAEzB,kFAAkF;AAClF,eAAO,MAAM,EAAE,EAAG,2BAAoC,CAAC;AAiCvD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,SAAS,EACT,GAAG,EACH,CAAC,GACF,EAAE,wBAAwB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAiErD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Subagent Director — "release sustained state" header action (issue #1).
|
|
4
|
+
*
|
|
5
|
+
* Contributes one button to the `conversation.session.header.actions` seat
|
|
6
|
+
* (the additive per-session control row beside the session title). It renders
|
|
7
|
+
* only while the CURRENT session is a continuable subagent child
|
|
8
|
+
* (snapshot.subagent.address.mode === 'continuable') and otherwise returns
|
|
9
|
+
* null, so ordinary sessions and one-shot children see nothing.
|
|
10
|
+
*
|
|
11
|
+
* Clicking asks the Host bridge's `subagentClose` endpoint to
|
|
12
|
+
* drainContinuableChildren under the address's durable parent authority; on
|
|
13
|
+
* success the button turns into a settled label (the child's handle is
|
|
14
|
+
* released), on failure a short inline error shows the core message.
|
|
15
|
+
*
|
|
16
|
+
* The seat is a list slot declared by ui-conversation; the framework session
|
|
17
|
+
* standard kit supplies `useSession`/`sessionId` (dsh-client-runtime merge),
|
|
18
|
+
* the registration injects the RPC caller.
|
|
19
|
+
*/
|
|
20
|
+
import { useEffect, useState } from 'react';
|
|
21
|
+
import { SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_CLOSE, } from '../bridge-contract.js';
|
|
22
|
+
import { isContinuableChild } from './subagent-model.js';
|
|
23
|
+
import { dangerButtonStyle, token } from './ui.js';
|
|
24
|
+
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
25
|
+
export const NS = 'settings.subagentDirector';
|
|
26
|
+
/** Inline styling using the shared token surface (no CSS pipeline; M2 deviation). */
|
|
27
|
+
const style = {
|
|
28
|
+
wrap: {
|
|
29
|
+
display: 'inline-flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
gap: 8,
|
|
32
|
+
},
|
|
33
|
+
button: {
|
|
34
|
+
...dangerButtonStyle,
|
|
35
|
+
height: 24,
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
padding: '0 10px',
|
|
38
|
+
},
|
|
39
|
+
settled: {
|
|
40
|
+
color: token.labelTertiary,
|
|
41
|
+
fontSize: 12,
|
|
42
|
+
lineHeight: '16px',
|
|
43
|
+
},
|
|
44
|
+
error: {
|
|
45
|
+
color: token.danger,
|
|
46
|
+
fontSize: 12,
|
|
47
|
+
lineHeight: '16px',
|
|
48
|
+
maxWidth: 260,
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
textOverflow: 'ellipsis',
|
|
51
|
+
whiteSpace: 'nowrap',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
/** Render the release-sustained-state button for a continuable child, or nothing. */
|
|
55
|
+
export function SubagentCloseAction({ useSession, sessionId, rpc, t, }) {
|
|
56
|
+
const session = useSession((s) => s);
|
|
57
|
+
const [state, setState] = useState('idle');
|
|
58
|
+
const [error, setError] = useState(null);
|
|
59
|
+
// Reset the outcome when the user switches to another session.
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setState('idle');
|
|
62
|
+
setError(null);
|
|
63
|
+
}, [sessionId]);
|
|
64
|
+
if (!isContinuableChild(session))
|
|
65
|
+
return null;
|
|
66
|
+
const address = session.subagent.address;
|
|
67
|
+
const onClose = async () => {
|
|
68
|
+
if (state === 'closing')
|
|
69
|
+
return;
|
|
70
|
+
setState('closing');
|
|
71
|
+
setError(null);
|
|
72
|
+
try {
|
|
73
|
+
const result = await rpc.call(SUBAGENT_DIRECTOR_RPC_CHANNEL, SUBAGENT_DIRECTOR_RPC_CLOSE, {
|
|
74
|
+
parentSessionId: address.parentSessionId,
|
|
75
|
+
childSessionId: address.childSessionId,
|
|
76
|
+
});
|
|
77
|
+
if (result.ok) {
|
|
78
|
+
setState('closed');
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
setState('failed');
|
|
82
|
+
setError(result.error.message);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
setState('failed');
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
if (state === 'closed') {
|
|
90
|
+
return (_jsx("div", { style: style.wrap, role: "status", children: _jsx("span", { style: style.settled, children: t('closedSubagent') }) }));
|
|
91
|
+
}
|
|
92
|
+
return (_jsxs("div", { style: style.wrap, children: [_jsx("button", { type: "button", style: style.button, disabled: state === 'closing', onClick: () => {
|
|
93
|
+
const confirmed = typeof window === 'undefined' ||
|
|
94
|
+
window.confirm(t('confirmCloseContinuable', { id: address.childSessionId }));
|
|
95
|
+
if (confirmed)
|
|
96
|
+
void onClose();
|
|
97
|
+
}, title: t('closeContinuableTitle', { id: address.childSessionId }), children: state === 'closing' ? t('closingContinuable') : t('closeContinuable') }), state === 'failed' && (_jsx("span", { style: style.error, role: "alert", children: t('closeFailed', { message: error ?? '' }) }))] }));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=SubagentCloseAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentCloseAction.js","sourceRoot":"","sources":["../../src/client/SubagentCloseAction.tsx"],"names":[],"mappings":"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"}
|