dsh-plugin-subagent-director 0.1.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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.md +135 -0
- package/lib/bridge-contract.d.ts +41 -0
- package/lib/bridge-contract.d.ts.map +1 -0
- package/lib/bridge-contract.js +7 -0
- package/lib/bridge-contract.js.map +1 -0
- package/lib/bridge-entry.d.ts +29 -0
- package/lib/bridge-entry.d.ts.map +1 -0
- package/lib/bridge-entry.js +10 -0
- package/lib/bridge-entry.js.map +1 -0
- package/lib/client/RoleCard.d.ts +23 -0
- package/lib/client/RoleCard.d.ts.map +1 -0
- package/lib/client/RoleCard.js +72 -0
- package/lib/client/RoleCard.js.map +1 -0
- package/lib/client/SubagentModelDock.d.ts +29 -0
- package/lib/client/SubagentModelDock.d.ts.map +1 -0
- package/lib/client/SubagentModelDock.js +32 -0
- package/lib/client/SubagentModelDock.js.map +1 -0
- package/lib/client/SubagentOptionsSection.d.ts +23 -0
- package/lib/client/SubagentOptionsSection.d.ts.map +1 -0
- package/lib/client/SubagentOptionsSection.js +164 -0
- package/lib/client/SubagentOptionsSection.js.map +1 -0
- package/lib/client/index.d.ts +44 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +1541 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client/locales.d.ts +13 -0
- package/lib/client/locales.d.ts.map +1 -0
- package/lib/client/locales.js +107 -0
- package/lib/client/locales.js.map +1 -0
- package/lib/client/store-logic.d.ts +105 -0
- package/lib/client/store-logic.d.ts.map +1 -0
- package/lib/client/store-logic.js +143 -0
- package/lib/client/store-logic.js.map +1 -0
- package/lib/client/store.d.ts +104 -0
- package/lib/client/store.d.ts.map +1 -0
- package/lib/client/store.js +223 -0
- package/lib/client/store.js.map +1 -0
- package/lib/client/subagent-model.d.ts +47 -0
- package/lib/client/subagent-model.d.ts.map +1 -0
- package/lib/client/subagent-model.js +81 -0
- package/lib/client/subagent-model.js.map +1 -0
- package/lib/client/ui.d.ts +26 -0
- package/lib/client/ui.d.ts.map +1 -0
- package/lib/client/ui.js +102 -0
- package/lib/client/ui.js.map +1 -0
- package/lib/config.d.ts +63 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +26 -0
- package/lib/config.js.map +1 -0
- package/lib/delegation-tool.d.ts +169 -0
- package/lib/delegation-tool.d.ts.map +1 -0
- package/lib/delegation-tool.js +404 -0
- package/lib/delegation-tool.js.map +1 -0
- package/lib/envelope.d.ts +97 -0
- package/lib/envelope.d.ts.map +1 -0
- package/lib/envelope.js +136 -0
- package/lib/envelope.js.map +1 -0
- package/lib/guidance.d.ts +37 -0
- package/lib/guidance.d.ts.map +1 -0
- package/lib/guidance.js +46 -0
- package/lib/guidance.js.map +1 -0
- package/lib/index.d.ts +29 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +63 -0
- package/lib/index.js.map +1 -0
- package/lib/remote.d.ts +102 -0
- package/lib/remote.d.ts.map +1 -0
- package/lib/remote.js +254 -0
- package/lib/remote.js.map +1 -0
- package/lib/route-resolver.d.ts +118 -0
- package/lib/route-resolver.d.ts.map +1 -0
- package/lib/route-resolver.js +71 -0
- package/lib/route-resolver.js.map +1 -0
- package/lib/settings.d.ts +157 -0
- package/lib/settings.d.ts.map +1 -0
- package/lib/settings.js +118 -0
- package/lib/settings.js.map +1 -0
- package/package.json +110 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本项目的所有显著变更都会记录在此文件中。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-08-14
|
|
6
|
+
|
|
7
|
+
首个公开发布版本。
|
|
8
|
+
|
|
9
|
+
### 新增
|
|
10
|
+
|
|
11
|
+
- 四级模型路由解析链(单次调用参数 > 角色绑定 > 插件默认 > 继承主代理),字段级覆盖、未配置零侵入;
|
|
12
|
+
- `subagent_role` 模型可见委派工具:`role`/`provider`/`model`/`reasoningEffort` 可选参数,前景/one-shot 后台/continuable 后台三种执行路线;
|
|
13
|
+
- 角色模板:命名角色携带职责描述、persona 与可选模型绑定,写入 settings 命名空间 `subagent-director`;
|
|
14
|
+
- 主代理角色清单指引(系统提示段落,无角色时不注入);
|
|
15
|
+
- 设置界面「子代理导演」:默认模型配置 + 角色卡片增删改(中英双语);
|
|
16
|
+
- 子代理实际运行模型读数(composer dock,零额外请求);
|
|
17
|
+
- 设置命名空间桥接条目 `subagent-director-bridge`:自注册 `/subagent-director` HTTP 路由,绕开 Web API 的 settings 白名单限制;
|
|
18
|
+
- 129 个单元测试(路由解析、schema 校验、桥接信封、client 纯逻辑)。
|
|
19
|
+
|
|
20
|
+
### 文档
|
|
21
|
+
|
|
22
|
+
- README(中英双语):安装、配置示例、角色模板、FAQ;
|
|
23
|
+
- MIT License。
|
|
24
|
+
|
|
25
|
+
[0.1.0]: https://github.com/SeverusZh/dsh-plugin-subagent-director/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +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.
|
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
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.x-blue">
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
[English](#english) · [特性](#特性) · [快速开始](#快速开始) · [角色模板](#角色模板) · [术语](#术语) · [开发](#开发) · [路线图](#路线图) · [FAQ](#faq)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 特性
|
|
16
|
+
|
|
17
|
+
- **供应商与模型选择** —— 为 subagent 配置默认 LLM 供应商(route)与模型;每次委派也可以由模型显式指定;
|
|
18
|
+
- **角色模板** —— 定义「代码审查员」「翻译员」等角色:职责描述(给主代理看)+ persona(注入子代理)+ 可选模型绑定;
|
|
19
|
+
- **四级回退链** —— 单次调用参数 > 角色绑定 > 插件默认 > 继承主代理(未配置时零侵入);
|
|
20
|
+
- **主代理指引** —— 系统提示自动注入角色清单,主代理知道何时委派给谁;
|
|
21
|
+
- **设置界面** —— DSH 设置面板内可视化配置(默认模型 + 角色卡片增删改);
|
|
22
|
+
- **continuable 后台** —— 返回可续聊子代理 id,配合 send_message 持续委派;
|
|
23
|
+
- **可观测性** —— 打开子代理会话时,composer 下方显示其实际运行的供应商/模型。
|
|
24
|
+
|
|
25
|
+
## 快速开始
|
|
26
|
+
|
|
27
|
+
### 安装
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
dsh plugin --profile <name> add dsh-plugin-subagent-director
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
或本地开发时以 file: / link: 路径挂载(示例见下)。
|
|
34
|
+
|
|
35
|
+
### 配置(cordis.patch.yml)
|
|
36
|
+
|
|
37
|
+
需要**两个插件条目**(本包拆分了桥接条目,用于把设置命名空间暴露给 Web UI):
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
- insert:
|
|
41
|
+
- id: subagent-director
|
|
42
|
+
name: dsh-plugin-subagent-director
|
|
43
|
+
config:
|
|
44
|
+
subagentProvider: spawn # 传输:spawn(无父上下文)/ fork(继承父历史)
|
|
45
|
+
toolName: subagent_role # 模型可见工具名
|
|
46
|
+
enableRunInBackground: true
|
|
47
|
+
backgroundMode: one-shot # one-shot 或 continuable
|
|
48
|
+
maxDepth: 3
|
|
49
|
+
- insert:
|
|
50
|
+
- id: subagent-director-bridge
|
|
51
|
+
name: dsh-plugin-subagent-director/bridge
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 角色模板(设置界面或 settings.yaml)
|
|
55
|
+
|
|
56
|
+
settings 命名空间 `subagent-director`:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
subagent-director:
|
|
60
|
+
defaultRole: code-reviewer
|
|
61
|
+
fallbackOnInvalid: true
|
|
62
|
+
roles:
|
|
63
|
+
code-reviewer:
|
|
64
|
+
displayName: 代码审查员
|
|
65
|
+
description: 审查代码质量、安全与可维护性,输出结构化评审意见
|
|
66
|
+
persona: 你是严谨的代码审查员,逐条指出问题并给出修改建议
|
|
67
|
+
provider: deepseek-official
|
|
68
|
+
model: deepseek-reasoner
|
|
69
|
+
translator:
|
|
70
|
+
displayName: 翻译员
|
|
71
|
+
description: 在中文与英文之间翻译技术文档
|
|
72
|
+
provider: <pi-ai-route>
|
|
73
|
+
model: qwen2.5-7b
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 使用
|
|
77
|
+
|
|
78
|
+
对话中委派(主代理会看到角色清单指引,自动选择工具与角色):
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
subagent_role({ role: "translator", prompt: "把 README.md 翻译成英文" })
|
|
82
|
+
subagent_role({ role: "code-reviewer", model: "deepseek-chat", prompt: "..." }) # 临时覆盖模型
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 术语
|
|
86
|
+
|
|
87
|
+
- **subagentProvider(传输)**:`spawn` / `fork` / `acp`——子代理跑在哪条传输链路上;
|
|
88
|
+
- **provider(LLM route)**:`deepseek-official`、pi-ai route——模型请求实际发给哪个供应商。
|
|
89
|
+
|
|
90
|
+
两者是**两套命名空间**,配置时不要混淆。
|
|
91
|
+
|
|
92
|
+
## 开发
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install
|
|
96
|
+
npm test # vitest(129 用例)
|
|
97
|
+
npm run typecheck
|
|
98
|
+
npm run build # host(tsc) + client(rolldown bundle)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 路线图
|
|
102
|
+
|
|
103
|
+
- v0.2:子代理目录内直接展示实际模型;composer 快捷选择「本次委派模型」;
|
|
104
|
+
- v0.3:顶替内置 subagent 工具名(无感升级);对 workflow/ralph 的默认模型兜底;
|
|
105
|
+
- 欢迎通过 Issue / PR 提出想法。
|
|
106
|
+
|
|
107
|
+
## FAQ
|
|
108
|
+
|
|
109
|
+
**为什么需要两个插件条目?**
|
|
110
|
+
DSH 的 Web API 只向白名单内的 settings 命名空间开放读写。本插件通过自注册的 `/subagent-director` HTTP 路由桥接自己的命名空间,而该路由依赖的 webServer 服务只能经 cordis `inject` 获取,因此拆成独立的 `subagent-director-bridge` 条目(无 Web 的 headless 场景它会自动不激活,主条目不受影响)。
|
|
111
|
+
|
|
112
|
+
**未配置任何角色时行为如何?**
|
|
113
|
+
与未安装本插件时完全一致:subagent 继承主代理模型,零侵入。
|
|
114
|
+
|
|
115
|
+
**新供应商/API 会自动出现吗?**
|
|
116
|
+
会。设置页订阅了供应商与设置变更事件,在 Models 页新增供应商/API key 后,下拉列表自动刷新,无需重启。
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
[MIT](./LICENSE) © Subagent Director contributors
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## English
|
|
125
|
+
|
|
126
|
+
**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.
|
|
127
|
+
|
|
128
|
+
- **Provider/model selection** — a configurable default route plus optional per-call `provider`/`model` arguments on the `subagent_role` tool;
|
|
129
|
+
- **Role templates** — named roles carrying a description, a persona, and an optional model binding;
|
|
130
|
+
- **Four-layer resolution** — call args > role binding > plugin default > inherit from the parent agent (zero intrusion when unconfigured);
|
|
131
|
+
- **Settings UI** — manage defaults and role cards in the DSH settings panel;
|
|
132
|
+
- **Continuable background** — durable subagent ids with send_message follow-ups;
|
|
133
|
+
- **Observability** — the addressed subagent’s actual provider/model shown under the composer.
|
|
134
|
+
|
|
135
|
+
**Install** — add two patch rows to your profile’s cordis.patch.yml: `dsh-plugin-subagent-director` (main) and `dsh-plugin-subagent-director/bridge` (Web settings bridge). See the Chinese section above for full configuration examples. License: MIT.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract shared by the Host bridge (src/remote.ts) and the client store
|
|
3
|
+
* (src/client/store.ts) for the self-published "/subagent-director" settings
|
|
4
|
+
* channel. Kept in a plain module so the browser bundle can import it without
|
|
5
|
+
* pulling any Host-only runtime dependency into the client.
|
|
6
|
+
*
|
|
7
|
+
* The channel bypasses the Host apiproxy's exposedNamespaces() allowlist,
|
|
8
|
+
* which answers `settings-not-exposed` for namespaces outside the model-provider
|
|
9
|
+
* plane (dsh-host-apiproxy/lib/index.js:2410-2423, 3470-3475). The client calls
|
|
10
|
+
* connection.rpc.call(channel, endpoint, payload) and the Host handler answers
|
|
11
|
+
* with the existing RpcResult shape.
|
|
12
|
+
*/
|
|
13
|
+
import type { SettingsNamespaceView } from '@deepseek-ai/dsh-host-apiproxy/api';
|
|
14
|
+
/** Absolute RPC channel the bridge owns on the Host web server. */
|
|
15
|
+
export declare const SUBAGENT_DIRECTOR_RPC_CHANNEL = "/subagent-director";
|
|
16
|
+
/** Endpoint that returns the namespace's redacted wire view. */
|
|
17
|
+
export declare const SUBAGENT_DIRECTOR_RPC_VIEW = "settingsView";
|
|
18
|
+
/** Endpoint that applies one path-op mutation. */
|
|
19
|
+
export declare const SUBAGENT_DIRECTOR_RPC_MUTATE = "settingsMutate";
|
|
20
|
+
/** Successful settingsView bridge response. */
|
|
21
|
+
export interface DirectorViewSuccess {
|
|
22
|
+
writable: boolean;
|
|
23
|
+
/** The redacted namespace wire view, absent when the namespace is not registered. */
|
|
24
|
+
view: SettingsNamespaceView | undefined;
|
|
25
|
+
}
|
|
26
|
+
/** Request payload for the settingsMutate bridge endpoint. */
|
|
27
|
+
export interface DirectorMutateRequest {
|
|
28
|
+
ns: string;
|
|
29
|
+
ops: SettingsPathOpViewLike[];
|
|
30
|
+
expectedRevision?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Structural subset of the wire mutate op; the Host casts to the real type. */
|
|
33
|
+
export type SettingsPathOpViewLike = {
|
|
34
|
+
op: 'set';
|
|
35
|
+
path: string[];
|
|
36
|
+
value: unknown;
|
|
37
|
+
} | {
|
|
38
|
+
op: 'unset';
|
|
39
|
+
path: string[];
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=bridge-contract.d.ts.map
|
|
@@ -0,0 +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;AAE7D,+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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Absolute RPC channel the bridge owns on the Host web server. */
|
|
2
|
+
export const SUBAGENT_DIRECTOR_RPC_CHANNEL = '/subagent-director';
|
|
3
|
+
/** Endpoint that returns the namespace's redacted wire view. */
|
|
4
|
+
export const SUBAGENT_DIRECTOR_RPC_VIEW = 'settingsView';
|
|
5
|
+
/** Endpoint that applies one path-op mutation. */
|
|
6
|
+
export const SUBAGENT_DIRECTOR_RPC_MUTATE = 'settingsMutate';
|
|
7
|
+
//# sourceMappingURL=bridge-contract.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subagent Director — optional settings bridge plugin entry.
|
|
3
|
+
*
|
|
4
|
+
* This is a SEPARATE loader entry from the main `subagent-director` plugin
|
|
5
|
+
* because the Host web server service is only reachable through cordis
|
|
6
|
+
* `inject` — tree-external plugins cannot see it through `ctx.get()`
|
|
7
|
+
* (verified: dsh-client-connection itself declares `inject = ["webServer"]`,
|
|
8
|
+
* dsh-client-connection/lib/index.js:479, and a third-party plugin probing
|
|
9
|
+
* ctx.get("webServer") never registers its routes).
|
|
10
|
+
*
|
|
11
|
+
* Load this entry in Web profiles alongside the main entry to enable the
|
|
12
|
+
* "/subagent-director" settings bridge that bypasses the apiproxy
|
|
13
|
+
* exposedNamespaces() allowlist. In headless profiles this entry simply never
|
|
14
|
+
* activates (cordis inject waits for webServer, which is absent), so the main
|
|
15
|
+
* entry keeps working there unchanged.
|
|
16
|
+
*
|
|
17
|
+
* Profile patch example (cordis.patch.yml):
|
|
18
|
+
* - insert:
|
|
19
|
+
* - id: subagent-director-bridge
|
|
20
|
+
* name: dsh-plugin-subagent-director/bridge
|
|
21
|
+
*/
|
|
22
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
23
|
+
/** Cordis plugin name for the bridge entry. */
|
|
24
|
+
export declare const name = "subagent-director-bridge";
|
|
25
|
+
/** Required services: webServer (route owner) and settings (data seam). */
|
|
26
|
+
export declare const inject: string[];
|
|
27
|
+
/** Register the settings bridge route; dispose on unload. */
|
|
28
|
+
export declare function apply(ctx: Context): void;
|
|
29
|
+
//# sourceMappingURL=bridge-entry.d.ts.map
|
|
@@ -0,0 +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,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAA4B,CAAC;AAEhD,6DAA6D;AAC7D,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { installDirectorRemoteBridge } from './remote.js';
|
|
2
|
+
/** Cordis plugin name for the bridge entry. */
|
|
3
|
+
export const name = 'subagent-director-bridge';
|
|
4
|
+
/** Required services: webServer (route owner) and settings (data seam). */
|
|
5
|
+
export const inject = ['webServer', 'settings'];
|
|
6
|
+
/** Register the settings bridge route; dispose on unload. */
|
|
7
|
+
export function apply(ctx) {
|
|
8
|
+
installDirectorRemoteBridge(ctx);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=bridge-entry.js.map
|
|
@@ -0,0 +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,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAEhD,6DAA6D;AAC7D,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,2BAA2B,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModelProviderGroup } from '@deepseek-ai/dsh-client-connection/client';
|
|
2
|
+
import type { SubagentDirectorKey } from './locales.js';
|
|
3
|
+
import type { RoleDraft, StoredRole } from './store-logic.js';
|
|
4
|
+
export interface RoleCardProps {
|
|
5
|
+
/** Persisted role id (kebab-case). */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Persisted role value. */
|
|
8
|
+
role: StoredRole;
|
|
9
|
+
/** Whether this role is the defaultRole. */
|
|
10
|
+
isDefault: boolean;
|
|
11
|
+
/** Available providers (for the provider select). */
|
|
12
|
+
groups: readonly ModelProviderGroup[];
|
|
13
|
+
/** Section copy. */
|
|
14
|
+
t: (key: SubagentDirectorKey) => string;
|
|
15
|
+
/** Commit an edited role; returns a localized failure message or undefined. */
|
|
16
|
+
onSave: (draft: RoleDraft) => Promise<string | undefined>;
|
|
17
|
+
/** Delete this role; returns a localized failure message or undefined. */
|
|
18
|
+
onDelete: () => Promise<string | undefined>;
|
|
19
|
+
/** Promote this role to default; returns a localized failure message or undefined. */
|
|
20
|
+
onSetDefault: () => Promise<string | undefined>;
|
|
21
|
+
}
|
|
22
|
+
export declare function RoleCard({ id, role, isDefault, groups, t, onSave, onDelete, onSetDefault }: RoleCardProps): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=RoleCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleCard.d.ts","sourceRoot":"","sources":["../../src/client/RoleCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAc9D,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtC,oBAAoB;IACpB,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,MAAM,CAAC;IACxC,+EAA+E;IAC/E,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1D,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,sFAAsF;IACtF,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjD;AASD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAmJvH"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** One role template card: read-only summary plus an inline editor.
|
|
3
|
+
* Provider/model/effort selects cascade from the model catalog; writes go
|
|
4
|
+
* through the controller as path ops, and failures return a localized message. */
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { cardStyle, dangerButtonStyle, fieldLabelStyle, ghostButtonStyle, primaryButtonStyle, rowStyle, selectStyle, textAreaStyle, textInputStyle, token, } from './ui.js';
|
|
7
|
+
function effortsFor(groups, provider, model) {
|
|
8
|
+
if (!provider || !model)
|
|
9
|
+
return [];
|
|
10
|
+
const group = groups.find((g) => g.id === provider);
|
|
11
|
+
const entry = group?.models.find((m) => m.id === model);
|
|
12
|
+
return entry?.reasoning?.efforts ?? [];
|
|
13
|
+
}
|
|
14
|
+
export function RoleCard({ id, role, isDefault, groups, t, onSave, onDelete, onSetDefault }) {
|
|
15
|
+
const [editing, setEditing] = useState(false);
|
|
16
|
+
const [busy, setBusy] = useState(false);
|
|
17
|
+
const [failure, setFailure] = useState(undefined);
|
|
18
|
+
const [draft, setDraft] = useState({
|
|
19
|
+
displayName: role.displayName,
|
|
20
|
+
description: role.description,
|
|
21
|
+
persona: role.persona ?? '',
|
|
22
|
+
provider: role.provider ?? '',
|
|
23
|
+
model: role.model ?? '',
|
|
24
|
+
reasoningEffort: role.reasoningEffort ?? '',
|
|
25
|
+
});
|
|
26
|
+
const provider = draft.provider || role.provider;
|
|
27
|
+
const model = draft.model || role.model;
|
|
28
|
+
const modelOptions = provider ? (groups.find((g) => g.id === provider)?.models ?? []) : [];
|
|
29
|
+
const effortOptions = effortsFor(groups, provider, model);
|
|
30
|
+
const save = async () => {
|
|
31
|
+
setBusy(true);
|
|
32
|
+
setFailure(undefined);
|
|
33
|
+
try {
|
|
34
|
+
const message = await onSave(draft);
|
|
35
|
+
if (message !== undefined) {
|
|
36
|
+
setFailure(message);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setEditing(false);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
setBusy(false);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const remove = async () => {
|
|
46
|
+
if (!window.confirm(t('confirmDeleteRole').replace('{id}', id)))
|
|
47
|
+
return;
|
|
48
|
+
setBusy(true);
|
|
49
|
+
setFailure(undefined);
|
|
50
|
+
try {
|
|
51
|
+
const message = await onDelete();
|
|
52
|
+
if (message !== undefined)
|
|
53
|
+
setFailure(message);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
setBusy(false);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const setField = (field, value) => {
|
|
60
|
+
setDraft((d) => ({ ...d, [field]: value }));
|
|
61
|
+
};
|
|
62
|
+
if (editing) {
|
|
63
|
+
return (_jsxs("div", { style: cardStyle, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'baseline', gap: 8 }, children: [_jsx("strong", { style: { color: token.labelPrimary, fontSize: 14 }, children: t('roleDisplayName') }), isDefault ? _jsx("span", { style: { color: token.accent, fontSize: 12 }, children: t('defaultRoleBadge') }) : null] }), _jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('roleDisplayName') }), _jsx("input", { style: textInputStyle, value: draft.displayName, placeholder: t('displayNamePlaceholder'), onChange: (e) => setField('displayName', e.target.value) })] }), _jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('roleDescription') }), _jsx("textarea", { style: textAreaStyle, value: draft.description, placeholder: t('descriptionPlaceholder'), onChange: (e) => setField('description', e.target.value) })] }), _jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('rolePersona') }), _jsx("textarea", { style: textAreaStyle, value: draft.persona, placeholder: t('personaPlaceholder'), onChange: (e) => setField('persona', e.target.value) })] }), _jsxs("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: 8 }, children: [_jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('provider') }), _jsxs("select", { style: selectStyle, value: draft.provider, disabled: groups.length === 0, onChange: (e) => setField('provider', e.target.value), children: [_jsx("option", { value: "", children: "\u2014" }), groups.map((g) => (_jsx("option", { value: g.id, children: g.name }, g.id)))] })] }), _jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('model') }), _jsxs("select", { style: selectStyle, value: draft.model, disabled: modelOptions.length === 0, onChange: (e) => setField('model', e.target.value), children: [_jsx("option", { value: "", children: "\u2014" }), modelOptions.map((m) => (_jsx("option", { value: m.id, children: m.name }, m.id)))] })] }), _jsxs("div", { style: rowStyle, children: [_jsx("label", { style: fieldLabelStyle, children: t('reasoningEffort') }), _jsxs("select", { style: selectStyle, value: draft.reasoningEffort, disabled: effortOptions.length === 0, onChange: (e) => setField('reasoningEffort', e.target.value), children: [_jsx("option", { value: "", children: "\u2014" }), effortOptions.map((e) => (_jsx("option", { value: e.id, children: e.name }, e.id)))] })] })] }), failure !== undefined ? _jsx("div", { style: { color: token.danger, fontSize: 12 }, children: failure }) : null, _jsxs("div", { style: { display: 'flex', gap: 8 }, children: [_jsx("button", { style: primaryButtonStyle, disabled: busy, onClick: save, children: "Edit" }), _jsx("button", { style: ghostButtonStyle, disabled: busy, onClick: () => setEditing(false), children: t('cancel') })] })] }));
|
|
64
|
+
}
|
|
65
|
+
return (_jsxs("div", { style: cardStyle, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', gap: 8 }, children: [_jsx("strong", { style: { color: token.labelPrimary, fontSize: 14 }, children: role.displayName || id }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [_jsx("span", { style: { color: token.labelTertiary, fontSize: 12, fontVariantNumeric: 'tabular-nums' }, children: id }), isDefault ? _jsx("span", { style: { color: token.accent, fontSize: 12 }, children: t('defaultRoleBadge') }) : null] })] }), role.description ? (_jsx("p", { style: { margin: 0, color: token.labelSecondary, fontSize: 13, lineHeight: '18px' }, children: role.description })) : null, _jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', gap: 8 }, children: [_jsx(Metadata, { label: t('provider'), value: role.provider }), _jsx(Metadata, { label: t('model'), value: role.model }), _jsx(Metadata, { label: t('reasoningEffort'), value: role.reasoningEffort }), role.persona ? _jsx(Metadata, { label: t('persona'), value: role.persona }) : null] }), failure !== undefined ? _jsx("div", { style: { color: token.danger, fontSize: 12 }, children: failure }) : null, _jsxs("div", { style: { display: 'flex', gap: 8 }, children: [_jsx("button", { style: ghostButtonStyle, disabled: busy, onClick: () => setEditing(true), children: t('save') }), _jsx("button", { style: ghostButtonStyle, disabled: busy || isDefault, onClick: () => (void onSetDefault(), undefined), children: t('setDefaultRole') }), _jsx("button", { style: dangerButtonStyle, disabled: busy, onClick: remove, children: t('deleteRole') })] })] }));
|
|
66
|
+
}
|
|
67
|
+
function Metadata({ label, value }) {
|
|
68
|
+
if (!value)
|
|
69
|
+
return null;
|
|
70
|
+
return (_jsxs("span", { style: { color: token.labelSecondary, fontSize: 12 }, children: [label, ": ", _jsx("span", { style: { color: token.labelPrimary }, children: value })] }));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=RoleCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleCard.js","sourceRoot":"","sources":["../../src/client/RoleCard.tsx"],"names":[],"mappings":";AAAA;;kFAEkF;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,EACd,KAAK,GACN,MAAM,SAAS,CAAC;AAqBjB,SAAS,UAAU,CAAC,MAAqC,EAAE,QAA4B,EAAE,KAAyB;IAChH,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;IACxD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,IAAI,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ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
|
|
|
1
|
+
/**
|
|
2
|
+
* Subagent Director — M3b observability dock readout.
|
|
3
|
+
*
|
|
4
|
+
* Contributes a single ambient line to the `conversation.composer.dock` seat
|
|
5
|
+
* (the band under the composer card). When the current session is an
|
|
6
|
+
* addressed subagent child it shows the provider/model that child actually
|
|
7
|
+
* ran on, read off the opened transcript's latest assistant message (zero
|
|
8
|
+
* extra RPC — see subagent-model.ts). When the transcript has not yet proven
|
|
9
|
+
* a model — a just-created child, or a transcript whose provider reported no
|
|
10
|
+
* provenance — it degrades to a short notice. Ordinary sessions render
|
|
11
|
+
* nothing, so the dock stays clean.
|
|
12
|
+
*
|
|
13
|
+
* The dock is an additive list slot declared by ui-conversation at runtime;
|
|
14
|
+
* we only contribute an occupant, never re-declare it. Our compile-time
|
|
15
|
+
* SlotMap augmentation in index.ts narrows the registration typing.
|
|
16
|
+
*/
|
|
17
|
+
import type { ConversationSnapshot } from '@deepseek-ai/dsh-client-runtime/client';
|
|
18
|
+
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
19
|
+
/** Owner currency of the composer dock as ui-conversation declares it. */
|
|
20
|
+
export interface ComposerDockOwner {
|
|
21
|
+
readonly session: ConversationSnapshot | undefined;
|
|
22
|
+
}
|
|
23
|
+
/** Full props of the dock entry: runtime (owner session) plus the locale seat. */
|
|
24
|
+
export type SubagentModelDockProps = PropsRuntime<'conversation.composer.dock'> & PropsLocale<typeof NS>;
|
|
25
|
+
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
26
|
+
export declare const NS: 'settings.subagentDirector';
|
|
27
|
+
/** Render the provider/model readout for an addressed subagent, or nothing. */
|
|
28
|
+
export declare function SubagentModelDock({ session, t, }: SubagentModelDockProps): React.JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=SubagentModelDock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentModelDock.d.ts","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIlF,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACtD;AAED,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;AAEzG,kFAAkF;AAClF,eAAO,MAAM,EAAE,EAAG,2BAAoC,CAAC;AAmBvD,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,EAC9B,OAAO,EACP,CAAC,GACJ,EAAE,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAmBnD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { formatModelRef, isAddressedSubagent, latestSubagentModel } from './subagent-model.js';
|
|
3
|
+
/** Locale namespace shared with the settings page (registered in index apply). */
|
|
4
|
+
export const NS = 'settings.subagentDirector';
|
|
5
|
+
/** Inline styling using the shared token surface (no CSS pipeline; M2 deviation). */
|
|
6
|
+
const style = {
|
|
7
|
+
root: {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
gap: 6,
|
|
11
|
+
padding: '3px 16px',
|
|
12
|
+
fontSize: 12,
|
|
13
|
+
lineHeight: '16px',
|
|
14
|
+
color: 'var(--dsw-alias-label-tertiary)',
|
|
15
|
+
},
|
|
16
|
+
ref: {
|
|
17
|
+
color: 'var(--dsw-alias-label-secondary)',
|
|
18
|
+
fontFamily: 'var(--dsw-font-family-mono, monospace)',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/** Render the provider/model readout for an addressed subagent, or nothing. */
|
|
22
|
+
export function SubagentModelDock({ session, t, }) {
|
|
23
|
+
if (!isAddressedSubagent(session))
|
|
24
|
+
return null;
|
|
25
|
+
const lookup = latestSubagentModel(session);
|
|
26
|
+
if (!lookup.found) {
|
|
27
|
+
return (_jsx("div", { style: style.root, role: "status", children: t('modelNotRecorded') }));
|
|
28
|
+
}
|
|
29
|
+
const ref = lookup;
|
|
30
|
+
return (_jsxs("div", { style: style.root, role: "status", children: [_jsx("span", { children: t('modelRanOn') }), _jsx("span", { style: style.ref, title: t('modelRanOnTitle', { model: formatModelRef(ref) }), children: formatModelRef(ref) })] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=SubagentModelDock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentModelDock.js","sourceRoot":"","sources":["../../src/client/SubagentModelDock.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAyB,MAAM,qBAAqB,CAAC;AAUtH,kFAAkF;AAClF,MAAM,CAAC,MAAM,EAAE,GAAG,2BAAoC,CAAC;AAEvD,qFAAqF;AACrF,MAAM,KAAK,GAA2C;IAClD,IAAI,EAAE;QACF,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,iCAAiC;KAC3C;IACD,GAAG,EAAE;QACD,KAAK,EAAE,kCAAkC;QACzC,UAAU,EAAE,wCAAwC;KACvD;CACJ,CAAC;AAEF,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,EAC9B,OAAO,EACP,CAAC,GACoB;IACrB,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAA+B,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CACH,cAAK,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAC,QAAQ,YAChC,CAAC,CAAC,kBAAkB,CAAC,GACpB,CACT,CAAC;IACN,CAAC;IACD,MAAM,GAAG,GAAqB,MAAM,CAAC;IACrC,OAAO,CACH,eAAK,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAC,QAAQ,aACjC,yBAAO,CAAC,CAAC,YAAY,CAAC,GAAQ,EAC9B,eAAM,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,YAC9E,cAAc,CAAC,GAAG,CAAC,GACjB,IACL,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-web-react';
|
|
2
|
+
import type { SubagentDirectorKey } from './locales.js';
|
|
3
|
+
import type { SubagentOptionsState, SubagentOptionsStore } from './store.js';
|
|
4
|
+
/** Injected dependencies of {@link SubagentOptionsSection} (slot `inject`). */
|
|
5
|
+
export interface SubagentOptionsSectionInjected {
|
|
6
|
+
/** The page store (loaded on mount, refreshed on pushed invalidations). */
|
|
7
|
+
controller: SubagentOptionsStore;
|
|
8
|
+
/** uSES subscription hook bound to the store. */
|
|
9
|
+
useSnapshot: SnapshotSelectorHook<SubagentOptionsState>;
|
|
10
|
+
/** Wire faces the page writes through (kept for parity with the slot contract). */
|
|
11
|
+
api: unknown;
|
|
12
|
+
/** Section copy. */
|
|
13
|
+
t: (key: SubagentDirectorKey) => string;
|
|
14
|
+
}
|
|
15
|
+
/** Props delivered by the slot outlet: the inject face spread flat. */
|
|
16
|
+
export type SubagentOptionsSectionProps = Partial<SubagentOptionsSectionInjected>;
|
|
17
|
+
/**
|
|
18
|
+
* Render the Subagent Director settings section content column.
|
|
19
|
+
* @param props - slot-delivered injected dependencies.
|
|
20
|
+
* @returns the section, or null while the shell has not injected yet.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SubagentOptionsSection(props: SubagentOptionsSectionProps): JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=SubagentOptionsSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentOptionsSection.d.ts","sourceRoot":"","sources":["../../src/client/SubagentOptionsSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAiB7E,+EAA+E;AAC/E,MAAM,WAAW,8BAA8B;IAC3C,2EAA2E;IAC3E,UAAU,EAAE,oBAAoB,CAAC;IACjC,iDAAiD;IACjD,WAAW,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACxD,mFAAmF;IACnF,GAAG,EAAE,OAAO,CAAC;IACb,oBAAoB;IACpB,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,MAAM,CAAC;CAC3C;AAED,uEAAuE;AACvE,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAqBlF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAI7F"}
|