@dsh-cc/subagent-task 0.5.0 → 0.6.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 +17 -9
- package/README.zh.md +5 -4
- package/lib/background-start.d.ts +1 -1
- package/lib/background-start.d.ts.map +1 -1
- package/lib/background-start.js +7 -5
- package/lib/background-start.js.map +1 -1
- package/lib/catalog.d.ts +15 -2
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +67 -4
- package/lib/catalog.js.map +1 -1
- package/lib/epoch-collector.d.ts +1 -1
- package/lib/epoch-collector.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +15 -4
- package/lib/index.js.map +1 -1
- package/lib/plugin-agents.d.ts +77 -0
- package/lib/plugin-agents.d.ts.map +1 -0
- package/lib/plugin-agents.js +110 -0
- package/lib/plugin-agents.js.map +1 -0
- package/lib/suppress-settled.d.ts +1 -1
- package/lib/suppress-settled.js +1 -1
- package/lib/tool.d.ts +6 -1
- package/lib/tool.d.ts.map +1 -1
- package/lib/tool.js +73 -42
- package/lib/tool.js.map +1 -1
- package/package.json +19 -18
package/README.md
CHANGED
|
@@ -52,8 +52,19 @@ Given a `Task(subagent_type, description, prompt)` call from a CC preset session
|
|
|
52
52
|
- `toolFilter` = the definition's `toolRestriction` (allow/deny), **sanitized** of tool
|
|
53
53
|
names this composition no longer registers;
|
|
54
54
|
- `maxDepth` = 3 (matches the harness default; configurable).
|
|
55
|
-
4. **Any other type** (not found in the workspace) → an **error
|
|
56
|
-
available types in this workspace (or noting the workspace
|
|
55
|
+
4. **Any other type containing no colon** (not found in the workspace) → an **error
|
|
56
|
+
result** listing the available types in this workspace (or noting the workspace
|
|
57
|
+
defines none) — with a colon-aware hint when the type contains `:`.
|
|
58
|
+
5. **A type matching a plugin agent's scoped id (`plugin:agent`)** → a `spawn` with the
|
|
59
|
+
same fold as a file definition (persona, sanitized toolFilter, alias-resolved model,
|
|
60
|
+
`maxDepth` 3), enumerated live from the `subagents` seam. Plugin agents are addressed
|
|
61
|
+
**only by their scoped id** — a bare plugin agent name is not addressable, matching
|
|
62
|
+
Claude Code.
|
|
63
|
+
|
|
64
|
+
The resolution order is: reserved sentinels (`general-purpose` / `fork`) → workspace file
|
|
65
|
+
definitions → plugin agent scoped ids. File definitions and scoped plugin ids occupy
|
|
66
|
+
disjoint name spaces (file definitions whose `agentType` contains `:` are skipped with a
|
|
67
|
+
warning at discovery), so a scoped id can never shadow a file type and vice versa.
|
|
57
68
|
|
|
58
69
|
The dispatch is **foreground unless the child is explicitly or definition-pinned background**:
|
|
59
70
|
with `run_in_background` omitted, the run is foreground — the tool awaits the child to
|
|
@@ -133,9 +144,11 @@ Because the section text is composed synchronously but discovery is async, the f
|
|
|
133
144
|
assembly for an unknown workspace shows nothing, then `system-prompt/change` fires once
|
|
134
145
|
discovery lands and reassembly reveals the catalog. When a workspace defines no agents (or
|
|
135
146
|
there is no agent to scope to) the section renders an empty string and drops out of the
|
|
136
|
-
prompt. The catalog lists
|
|
147
|
+
prompt. The catalog lists file definitions plus plugin agents by their scoped ids — it
|
|
148
|
+
deliberately does **not** enumerate seam
|
|
137
149
|
backend provider names (`fork`/`spawn`/`codex`/`claude-code`) as if they were addressable
|
|
138
|
-
agent types
|
|
150
|
+
agent types; bare plugin agent names are not addressable either — only `plugin:agent`
|
|
151
|
+
scoped ids are.
|
|
139
152
|
|
|
140
153
|
## Workspace instructions on Task children
|
|
141
154
|
|
|
@@ -174,10 +187,6 @@ supplies the alias resolver. The cc preset **disables** the harness `tool-subage
|
|
|
174
187
|
lifetime and does not watch the filesystem. Editing a `.claude/agents` definition takes
|
|
175
188
|
effect on the next session for a workspace whose cache entry has not yet been created, and
|
|
176
189
|
on process restart otherwise. mtime-based invalidation is a follow-up.
|
|
177
|
-
- **No plugin-agent dispatch (v1).** Only file definitions under `.claude/agents` are
|
|
178
|
-
dispatched. Seam plugin agents (`AgentProvider`) are not addressed by `subagent_type` in v1
|
|
179
|
-
(their start contract does not carry the task text and their capability flags would reject
|
|
180
|
-
`maxDepth`) — see the parity matrix.
|
|
181
190
|
- **Reserved type names.** `general-purpose` and `fork` are sentinels, not file types. A
|
|
182
191
|
workspace file `.claude/agents/fork.md` is unreachable; `subagent_type: "fork"` always
|
|
183
192
|
means inherit completed parent turns.
|
|
@@ -208,7 +217,6 @@ supplies the alias resolver. The cc preset **disables** the harness `tool-subage
|
|
|
208
217
|
pins `background: true`.
|
|
209
218
|
- In-flight promotion of a running foreground Task to background (TUI Ctrl+B) — a follow-up,
|
|
210
219
|
not a limitation of the package's existence.
|
|
211
|
-
- Seam plugin-agent dispatch.
|
|
212
220
|
- CC frontmatter `permissionMode` / `isolation` / `memory` / `effort` projection onto the
|
|
213
221
|
child (the loader parses them, v1 does not consume them).
|
|
214
222
|
- `registerBaseAgents` in cc-shell (base-agent discovery moved here; see the cc-shell README).
|
package/README.zh.md
CHANGED
|
@@ -29,7 +29,10 @@ Claude Code 的 `Task` 工具允许主代理按 `subagent_type`(如 `deep-reason
|
|
|
29
29
|
- `agentOptions` = 来自 `ctx.get('ccModelRoutes').resolve(def.model)` 的别名解析结果 `{ provider?, model? }`(只透传解析到值的 provider/model 字段,绝不破坏按字段继承);
|
|
30
30
|
- `toolFilter` = 定义的 `toolRestriction`(allow/deny),**消毒**掉本组合已不再注册的工具名;
|
|
31
31
|
- `maxDepth` = 3(与 harness 默认一致;可配置)。
|
|
32
|
-
4.
|
|
32
|
+
4. **其它不含冒号的类型**(工作区内找不到)→ **报错结果**,附带本工作区可用类型清单(或说明本工作区未定义任何 agent);类型含 `:` 时提示带冒号感知的线索。
|
|
33
|
+
5. **命中插件 agent 的 scoped id(`plugin:agent`)** → 以 `spawn` 启动,折叠方式与文件定义相同(persona、消毒后的 toolFilter、别名解析的 model、`maxDepth` 3),并从 `subagents` seam **实时**枚举。插件 agent **只能用其 scoped id** 寻址——裸插件 agent 名不可寻址,与 Claude Code 一致。
|
|
34
|
+
|
|
35
|
+
解析顺序是:保留哨兵(`general-purpose` / `fork`)→ 工作区文件定义 → 插件 agent scoped id。文件定义与 scoped 插件 id 占据互不相交的名字空间(`agentType` 含 `:` 的文件定义在发现时被跳过并告警),因此 scoped id 永远不会遮蔽文件类型,反之亦然。
|
|
33
36
|
|
|
34
37
|
派发规则是**前台,除非显式指定或定义钉死了后台**:`run_in_background` 缺省时运行是前台——工具等待 child 跑完,非 `completed` 的 stop reason 以错误浮出,child 输出只拼接 `text` 块——除非定义钉了 `background: true`,此时缺省即后台。显式 `run_in_background: false` 覆盖钉死,强制前台。显式 `run_in_background: true`(或钉死时缺省)则把 child 作为 durable continuable 后台 agent 启动,并立即返回其 `agentId`。
|
|
35
38
|
|
|
@@ -60,7 +63,7 @@ Claude Code 的 `Task` 工具允许主代理按 `subagent_type`(如 `deep-reason
|
|
|
60
63
|
To delegate to one, pass its name as the `subagent_type` argument of the Task tool.
|
|
61
64
|
```
|
|
62
65
|
|
|
63
|
-
由于 section 文本是同步组装的而发现是异步的,未知工作区的首次组装会显示空,随后 discovery 落地后触发 `system-prompt/change`,重组即显示目录。当工作区未定义任何 agent(或没有可 scope 的 agent)时,section
|
|
66
|
+
由于 section 文本是同步组装的而发现是异步的,未知工作区的首次组装会显示空,随后 discovery 落地后触发 `system-prompt/change`,重组即显示目录。当工作区未定义任何 agent(或没有可 scope 的 agent)时,section 渲染空串并从提示词中消失。目录列出文件定义以及按 scoped id 呈现的插件 agent——刻意**不**把 seam 后端 provider 名(`fork`/`spawn`/`codex`/`claude-code`)当作可寻址的 agent 类型来枚举;裸插件 agent 名同样不可寻址——只有 `plugin:agent` scoped id 可以。
|
|
64
67
|
|
|
65
68
|
## Task child 上的工作区指令
|
|
66
69
|
|
|
@@ -79,7 +82,6 @@ harness 的 `agent-instructions` 插件会在**每个**会话(包括 Task child)
|
|
|
79
82
|
|
|
80
83
|
- **冷恢复丢弃其余 `agentOptions`。** 后台(continuable)派发已存在——`run_in_background: true` 或定义钉 `background: true`——但冷恢复只还原 `persona`/`toolFilter`/模型路由,丢弃其余全部 `agentOptions` 字段(别名标记的 `reasoningEffort`、`maxTokens`)。完整后台契约(父退出 drain、无 `outputFile`、fork + 后台被拒)见 parity matrix。
|
|
81
84
|
- **进程级发现缓存。** 注册表按工作区 root 缓存整个进程生命周期,不监听文件系统。编辑 `.claude/agents` 定义:对缓存条目尚未创建的工作区在下次会话生效,否则在进程重启后生效。基于 mtime 的失效刷为 follow-up。
|
|
82
|
-
- **v1 不做插件 agent 派发。** 只派发 `.claude/agents` 下的文件定义。seam 插件 agent(`AgentProvider`)在 v1 不被 `subagent_type` 寻址(其 start 契约不携带任务正文,且 capability 标志会拒绝 `maxDepth`)——见 parity matrix。
|
|
83
85
|
- **保留类型名。** `general-purpose` 与 `fork` 是哨兵,不是文件类型。工作区文件 `.claude/agents/fork.md` 不可达;`subagent_type: "fork"` 永远表示继承父已完成轮次。
|
|
84
86
|
- **指令文件仍会被扫描。** 剥离发生在 harness `agent-instructions` 插件已从磁盘读取工作区 CLAUDE.md / AGENTS.md 并注入之后;本监听器只把它们挡在 child 的模型可见批次之外,不改 harness 就无法阻止磁盘扫描。fork child 的父 seed 从不改写,seed 中已有的 CLAUDE.md 会被继承。
|
|
85
87
|
|
|
@@ -95,6 +97,5 @@ harness 的 `agent-instructions` 插件会在**每个**会话(包括 Task child)
|
|
|
95
97
|
|
|
96
98
|
- 把缺省的 `run_in_background` 视为后台的会话级策略(Claude Code 交互式的 omit=background 规则);dsh-cc 在缺省时保持前台,除非定义钉了 `background: true`。
|
|
97
99
|
- 正在运行的前台 Task 的在途转后台(TUI Ctrl+B)——follow-up,而非本包存在性上的限制。
|
|
98
|
-
- seam 插件 agent 派发。
|
|
99
100
|
- 把 CC frontmatter 的 `permissionMode` / `isolation` / `memory` / `effort` 投影到 child(loader 会解析,v1 不消费)。
|
|
100
101
|
- cc-shell 里的 `registerBaseAgents`(base agent 发现迁至此处;见 cc-shell README)。
|
|
@@ -171,7 +171,7 @@ export declare function assertLiveCapacity(seam: SubagentsLike, parent: Agent, s
|
|
|
171
171
|
export declare function assertContinuableCapable(seam: SubagentsLike): void;
|
|
172
172
|
/**
|
|
173
173
|
* Dispatch a FOREGROUND non-fork call by collecting the child's first epoch
|
|
174
|
-
* inline through the epoch collector (`docs/plans/2026-09-
|
|
174
|
+
* inline through the epoch collector (`docs/plans/2026-09-05-epoch-collector-dsh-cc.md`).
|
|
175
175
|
* Performs the same pin preallocation, pre-start pin write, and
|
|
176
176
|
* tombstone-on-throw as `startBackground` — a foreground-launched child is
|
|
177
177
|
* pinnable/resumable exactly like a background one. The child's settlement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-start.d.ts","sourceRoot":"","sources":["../src/background-start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAElF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,sEAAsE;AACtE,eAAO,MAAM,cAAc,UAAU,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,oCAAoC,yCAAyC,CAAA;AAE1F,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,EAAE,SAAS;YAA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iEtE"}
|
package/lib/background-start.js
CHANGED
|
@@ -152,8 +152,9 @@ function promotedResult(childId, captureWarning) {
|
|
|
152
152
|
+ 'to the background while it ran (status async_launched, backgroundedByUser: true); treat '
|
|
153
153
|
+ 'this exactly like a background launch — the result arrives as a later waking message, '
|
|
154
154
|
+ 'so do not compose on an inline result. '
|
|
155
|
-
+ 'Control it by that id: `list_agents` for status, `send_message` to continue
|
|
156
|
-
+ '
|
|
155
|
+
+ 'Control it by that id: `list_agents` for status, `send_message` to continue that same '
|
|
156
|
+
+ 'assignment (a new task needs a fresh `subagent_fork`), `interrupt_agent` to stop its '
|
|
157
|
+
+ 'current turn.'
|
|
157
158
|
+ (captureWarning !== undefined
|
|
158
159
|
? `\nresume pin capture failed: ${captureWarning}; this child will resume with legacy semantics`
|
|
159
160
|
: ''),
|
|
@@ -188,7 +189,7 @@ function outcomeToResult(childId, outcome, captureWarning) {
|
|
|
188
189
|
}
|
|
189
190
|
/**
|
|
190
191
|
* Dispatch a FOREGROUND non-fork call by collecting the child's first epoch
|
|
191
|
-
* inline through the epoch collector (`docs/plans/2026-09-
|
|
192
|
+
* inline through the epoch collector (`docs/plans/2026-09-05-epoch-collector-dsh-cc.md`).
|
|
192
193
|
* Performs the same pin preallocation, pre-start pin write, and
|
|
193
194
|
* tombstone-on-throw as `startBackground` — a foreground-launched child is
|
|
194
195
|
* pinnable/resumable exactly like a background one. The child's settlement
|
|
@@ -342,8 +343,9 @@ export async function startBackground(seam, request, capture) {
|
|
|
342
343
|
return {
|
|
343
344
|
text: `Background subagent started (agentId: ${started.childId}). It is running in the `
|
|
344
345
|
+ 'background; its report or finish notice will arrive as a waking message. Control it '
|
|
345
|
-
+ 'by that id: `list_agents` for status, `send_message` to continue
|
|
346
|
-
+ '
|
|
346
|
+
+ 'by that id: `list_agents` for status, `send_message` to continue that same '
|
|
347
|
+
+ 'assignment (a new task needs a fresh `subagent_fork`), `interrupt_agent` to stop its '
|
|
348
|
+
+ 'current turn.'
|
|
347
349
|
+ (captureWarning !== undefined
|
|
348
350
|
? `\nresume pin capture failed: ${captureWarning}; this child will resume with legacy semantics`
|
|
349
351
|
: ''),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-start.js","sourceRoot":"","sources":["../src/background-start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,iBAAiB,EAAyC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAA;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,sCAAsC,CAAA;AAyF1F;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA0C,OAAO,CAAC,GAAG;IAErD,MAAM,GAAG,GAAG,GAAG,CAAC,oCAAoC,CAAC,CAAA;IACrD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,KAAK,CAAA;IACjD,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;IAC/B,OAAO,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,OAAO,CAAA;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAqC,EACrC,UAAgD,EAChD,QAAiB;IAEjB,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAChD,IAAI,IAAI,CAAC,iBAAiB,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IAClD,IAAI,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC1B,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AsF;cACtF,6EAA6E;cAC7E,uFAAuF;cACvF,eAAe;cACf,CAAC,cAAc,KAAK,SAAS;gBAC7B,CAAC,CAAC,gCAAgC,cAAc,gDAAgD;gBAChG,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAA;AACH,CAAC"}
|
package/lib/catalog.d.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
import type { Context } from '@deepseek-ai/cordis';
|
|
24
24
|
import type { AgentDefinition } from '@dsh-cc/claude-code-agents';
|
|
25
25
|
import type { AgentRegistry } from './registry.ts';
|
|
26
|
+
import { PluginAgentIndex } from './plugin-agents.ts';
|
|
26
27
|
/** Default order slot for the catalog section (tool guidance owns 100–199). */
|
|
27
28
|
export declare const CATALOG_SECTION_ORDER = 110;
|
|
28
29
|
/** The section's unique name. */
|
|
@@ -35,17 +36,27 @@ export declare const CATALOG_SECTION_NAME = "cc:subagent-catalog";
|
|
|
35
36
|
export declare class AgentCatalogSection {
|
|
36
37
|
private readonly ctx;
|
|
37
38
|
private readonly registry;
|
|
39
|
+
private readonly pluginIndex;
|
|
38
40
|
/** Sorted definitions per workspace root, populated once discovery lands. */
|
|
39
41
|
private readonly snapshot;
|
|
40
42
|
/** Roots whose background discovery has already been kicked off. */
|
|
41
43
|
private readonly seen;
|
|
44
|
+
/**
|
|
45
|
+
* The scoped ids whose providers passed the brand guard when
|
|
46
|
+
* `subagent/provider-added` delivered them — so a later
|
|
47
|
+
* `subagent/provider-removed` (which carries only the NAME, not the
|
|
48
|
+
* provider) can be brand-checked by membership here.
|
|
49
|
+
*/
|
|
50
|
+
private readonly brandedIds;
|
|
42
51
|
/**
|
|
43
52
|
* Create a catalog cache holder bound to a registry.
|
|
44
53
|
* @param ctx - the host context whose `system-prompt` seam and
|
|
45
54
|
* `system-prompt/change` channel drive refresh.
|
|
46
55
|
* @param registry - the per-workspace definition cache to load from.
|
|
56
|
+
* @param pluginIndex - the live plugin agent view (defaults to a fresh
|
|
57
|
+
* index over this context).
|
|
47
58
|
*/
|
|
48
|
-
constructor(ctx: Context, registry: AgentRegistry);
|
|
59
|
+
constructor(ctx: Context, registry: AgentRegistry, pluginIndex?: PluginAgentIndex);
|
|
49
60
|
/** Register the catalog section plus its assemble-waterfall reconciliation.
|
|
50
61
|
*
|
|
51
62
|
* The seam is fetched with `ctx.get` rather than the `ctx.systemPrompt`
|
|
@@ -86,9 +97,11 @@ export declare class AgentCatalogSection {
|
|
|
86
97
|
* Mount the single global catalog section.
|
|
87
98
|
* @param ctx - the plug context carrying the `systemPrompt` seam.
|
|
88
99
|
* @param registry - the per-workspace definition cache.
|
|
100
|
+
* @param pluginIndex - the live plugin agent view (defaults to a fresh index
|
|
101
|
+
* over this context).
|
|
89
102
|
* @returns the exact Cordis effect disposer, or undefined when the seam is absent.
|
|
90
103
|
*/
|
|
91
|
-
export declare function mountAgentCatalog(ctx: Context, registry: AgentRegistry): (() => void) | undefined;
|
|
104
|
+
export declare function mountAgentCatalog(ctx: Context, registry: AgentRegistry, pluginIndex?: PluginAgentIndex): (() => void) | undefined;
|
|
92
105
|
/**
|
|
93
106
|
* Compose the section text from the sorted definitions. Returns '' when empty
|
|
94
107
|
* so the section contributes nothing to the prompt.
|
package/lib/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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GED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @module @dsh-cc/subagent-task/catalog
|
|
22
22
|
*/
|
|
23
23
|
import { cwdOf } from '@dsh-cc/memory';
|
|
24
|
+
import { PluginAgentIndex, isPluginAgentProvider } from "./plugin-agents.js";
|
|
24
25
|
/** Default order slot for the catalog section (tool guidance owns 100–199). */
|
|
25
26
|
export const CATALOG_SECTION_ORDER = 110;
|
|
26
27
|
/** The section's unique name. */
|
|
@@ -64,19 +65,30 @@ function agentFromScope(scope) {
|
|
|
64
65
|
export class AgentCatalogSection {
|
|
65
66
|
ctx;
|
|
66
67
|
registry;
|
|
68
|
+
pluginIndex;
|
|
67
69
|
/** Sorted definitions per workspace root, populated once discovery lands. */
|
|
68
70
|
snapshot = new Map();
|
|
69
71
|
/** Roots whose background discovery has already been kicked off. */
|
|
70
72
|
seen = new Set();
|
|
73
|
+
/**
|
|
74
|
+
* The scoped ids whose providers passed the brand guard when
|
|
75
|
+
* `subagent/provider-added` delivered them — so a later
|
|
76
|
+
* `subagent/provider-removed` (which carries only the NAME, not the
|
|
77
|
+
* provider) can be brand-checked by membership here.
|
|
78
|
+
*/
|
|
79
|
+
brandedIds = new Set();
|
|
71
80
|
/**
|
|
72
81
|
* Create a catalog cache holder bound to a registry.
|
|
73
82
|
* @param ctx - the host context whose `system-prompt` seam and
|
|
74
83
|
* `system-prompt/change` channel drive refresh.
|
|
75
84
|
* @param registry - the per-workspace definition cache to load from.
|
|
85
|
+
* @param pluginIndex - the live plugin agent view (defaults to a fresh
|
|
86
|
+
* index over this context).
|
|
76
87
|
*/
|
|
77
|
-
constructor(ctx, registry) {
|
|
88
|
+
constructor(ctx, registry, pluginIndex = new PluginAgentIndex(ctx)) {
|
|
78
89
|
this.ctx = ctx;
|
|
79
90
|
this.registry = registry;
|
|
91
|
+
this.pluginIndex = pluginIndex;
|
|
80
92
|
}
|
|
81
93
|
/** Register the catalog section plus its assemble-waterfall reconciliation.
|
|
82
94
|
*
|
|
@@ -128,7 +140,40 @@ export class AgentCatalogSection {
|
|
|
128
140
|
: section),
|
|
129
141
|
};
|
|
130
142
|
});
|
|
143
|
+
// Event-driven plugin invalidation (plan §9.3): the seam emits
|
|
144
|
+
// `subagent/provider-added` / `subagent/provider-removed` on the shared
|
|
145
|
+
// cordis bus. The events are declared via module augmentation in
|
|
146
|
+
// @deepseek-ai/dsh-subagent, which this package does not import — the
|
|
147
|
+
// augmentation is not in its type graph, so the same cast-through-
|
|
148
|
+
// `ctx.on` pattern other packages use applies (see
|
|
149
|
+
// packages/ui/tui/src/harness/driver-catalog.ts). The emit fires DIRECTLY
|
|
150
|
+
// from the listener — it is not mid-assembly, so no deferral is needed.
|
|
151
|
+
// A changed definition re-registers as remove+add, so no fingerprinting.
|
|
152
|
+
const providerAdded = 'subagent/provider-added';
|
|
153
|
+
const providerRemoved = 'subagent/provider-removed';
|
|
154
|
+
// Seed with providers that mounted BEFORE this listener started
|
|
155
|
+
// (production mounts cc-shell-glue before subagent-task): their add
|
|
156
|
+
// events already fired, but they are live in the index, so their
|
|
157
|
+
// removals must still invalidate the prompt — a removal is recognized
|
|
158
|
+
// only by membership in `brandedIds`.
|
|
159
|
+
for (const id of this.pluginIndex.knownIds())
|
|
160
|
+
this.brandedIds.add(id);
|
|
161
|
+
const disposeAdded = this.ctx.on(providerAdded, (provider) => {
|
|
162
|
+
if (!isPluginAgentProvider(provider))
|
|
163
|
+
return;
|
|
164
|
+
this.brandedIds.add(provider.name);
|
|
165
|
+
this.ctx.emit('system-prompt/change');
|
|
166
|
+
});
|
|
167
|
+
const disposeRemoved = this.ctx.on(providerRemoved, (name) => {
|
|
168
|
+
// The removed event carries only the name; membership in `brandedIds`
|
|
169
|
+
// proves the provider passed the brand guard when it was added.
|
|
170
|
+
if (typeof name !== 'string' || !this.brandedIds.delete(name))
|
|
171
|
+
return;
|
|
172
|
+
this.ctx.emit('system-prompt/change');
|
|
173
|
+
});
|
|
131
174
|
return () => {
|
|
175
|
+
disposeAdded();
|
|
176
|
+
disposeRemoved();
|
|
132
177
|
disposeListener();
|
|
133
178
|
disposeSection();
|
|
134
179
|
};
|
|
@@ -145,7 +190,23 @@ export class AgentCatalogSection {
|
|
|
145
190
|
return '';
|
|
146
191
|
const root = cwdOf(agent);
|
|
147
192
|
this.ensureDefs(root);
|
|
148
|
-
|
|
193
|
+
// Synchronous live scan, no caching: plugin mounts are effect-scoped and
|
|
194
|
+
// may appear or disappear between renders. SIDE-EFFECT-FREE (plan §9.3):
|
|
195
|
+
// invalidation rides the seam's lifecycle events (subscribed in `start`),
|
|
196
|
+
// so render only reads current state.
|
|
197
|
+
const pluginEntries = this.pluginIndex.list();
|
|
198
|
+
const merged = [
|
|
199
|
+
...(this.snapshot.get(root) ?? []),
|
|
200
|
+
...pluginEntries.map(entry => ({
|
|
201
|
+
// Plugin entries render under their scoped id (`plugin:agent`), with
|
|
202
|
+
// the provider definition's whenToUse as the guide line. The guard is
|
|
203
|
+
// definition-presence — builtin seam providers (spawn/fork/…) carry no
|
|
204
|
+
// definition and are excluded naturally by the index.
|
|
205
|
+
agentType: entry.id,
|
|
206
|
+
whenToUse: entry.definition.whenToUse,
|
|
207
|
+
})),
|
|
208
|
+
].sort((a, b) => a.agentType.localeCompare(b.agentType));
|
|
209
|
+
return renderCatalog(merged);
|
|
149
210
|
}
|
|
150
211
|
/**
|
|
151
212
|
* Kick background discovery for one workspace root exactly once. When it
|
|
@@ -169,12 +230,14 @@ export class AgentCatalogSection {
|
|
|
169
230
|
* Mount the single global catalog section.
|
|
170
231
|
* @param ctx - the plug context carrying the `systemPrompt` seam.
|
|
171
232
|
* @param registry - the per-workspace definition cache.
|
|
233
|
+
* @param pluginIndex - the live plugin agent view (defaults to a fresh index
|
|
234
|
+
* over this context).
|
|
172
235
|
* @returns the exact Cordis effect disposer, or undefined when the seam is absent.
|
|
173
236
|
*/
|
|
174
|
-
export function mountAgentCatalog(ctx, registry) {
|
|
237
|
+
export function mountAgentCatalog(ctx, registry, pluginIndex) {
|
|
175
238
|
if (ctx.get('systemPrompt') === undefined)
|
|
176
239
|
return undefined;
|
|
177
|
-
return new AgentCatalogSection(ctx, registry).start();
|
|
240
|
+
return new AgentCatalogSection(ctx, registry, pluginIndex).start();
|
|
178
241
|
}
|
|
179
242
|
/**
|
|
180
243
|
* Compose the section text from the sorted definitions. Returns '' when empty
|
package/lib/catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAExC,iCAAiC;AACjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAE/B;;;;GAIG;AACH,SAAS,YAAY,CAAI,OAAmB,EAAE,EAAU;IACtD,IAAI,KAAgD,CAAA;IACpD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;QACrD,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACxF,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IACtB,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AAI,CAAC,EAAE;YACL,IAAI,CAAC,QAAQ,CAAC,GAAG,CACf,IAAI,EACJ,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAC1E,CAAA;YACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QACvC,CAAC,EACD,GAAG,EAAE,GAAE,CAAC,CACT,CAAA;IACH,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAY,EACZ,QAAuB,EACvB,WAA8B;IAE9B,IAAI,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IAC3D,OAAO,IAAI,mBAAmB,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,KAAK,EAAE,CAAA;AACpE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAgC;IAC5D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAChC,MAAM,KAAK,GAAG;QACZ,wBAAwB;QACxB,EAAE;QACF,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG,CAAC,SAAS,MAAM,GAAG,CAAC,SAAS,EAAE,CAAC;QAC3D,EAAE;QACF,qFAAqF;KACtF,CAAA;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
package/lib/epoch-collector.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-cc epoch collector: inline first-epoch collection of a continuable
|
|
3
3
|
* subagent child with zero harness changes (normative design:
|
|
4
|
-
* `docs/plans/2026-09-
|
|
4
|
+
* `docs/plans/2026-09-05-epoch-collector-dsh-cc.md`).
|
|
5
5
|
*
|
|
6
6
|
* One shared `subagent/start` + `subagent/end` listener pair and one watch
|
|
7
7
|
* map (`Map<childId, { runId?, resolve }>`) serve every collector of the
|
package/lib/epoch-collector.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-cc epoch collector: inline first-epoch collection of a continuable
|
|
3
3
|
* subagent child with zero harness changes (normative design:
|
|
4
|
-
* `docs/plans/2026-09-
|
|
4
|
+
* `docs/plans/2026-09-05-epoch-collector-dsh-cc.md`).
|
|
5
5
|
*
|
|
6
6
|
* One shared `subagent/start` + `subagent/end` listener pair and one watch
|
|
7
7
|
* map (`Map<childId, { runId?, resolve }>`) serve every collector of the
|
package/lib/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import type { Context } from '@deepseek-ai/cordis';
|
|
19
19
|
import { type ResumePinsConfig } from './resume-capture.ts';
|
|
20
20
|
export { AgentRegistry } from './registry.ts';
|
|
21
|
+
export { PluginAgentIndex } from './plugin-agents.ts';
|
|
21
22
|
export { registerTaskTool, TASK_TOOL, MAX_LIVE_CONTINUABLE_CHILDREN, CLAUDE_CODE_DISABLE_BACKGROUND_TASKS, backgroundTasksDisabled, } from './tool.ts';
|
|
22
23
|
export { collectFirstEpoch, collectorFor, collectorKey, registerCollector, unregisterCollector, collectorsForSession, registeredCollectorCount, markCollectedForSuppression, releaseCollectedForSuppression, isCollectedForSuppression, } from './epoch-collector.ts';
|
|
23
24
|
export type { CollectorRegistration, EpochOutcome, EpochTerminal, } from './epoch-collector.ts';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA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xB,CAAA;AAEZ;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAU7E;AAED,4BAA4B;AAC5B,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CACvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,gBAAqB,GAAG,IAAI,CA0BvE"}
|
package/lib/index.js
CHANGED
|
@@ -19,11 +19,13 @@ import { PinStore } from '@dsh-cc/subagent-resume-pins';
|
|
|
19
19
|
import { collectorFor, collectorsForSession, registeredCollectorCount, } from "./epoch-collector.js";
|
|
20
20
|
import { SpawnPinCapture } from "./resume-capture.js";
|
|
21
21
|
import { AgentRegistry } from "./registry.js";
|
|
22
|
+
import { PluginAgentIndex } from "./plugin-agents.js";
|
|
22
23
|
import { registerTaskTool } from "./tool.js";
|
|
23
24
|
import { mountSettledNoticeSuppression } from "./suppress-settled.js";
|
|
24
25
|
import { mountAgentCatalog } from "./catalog.js";
|
|
25
26
|
import { mountStripWorkspaceInstructions } from "./strip-instructions.js";
|
|
26
27
|
export { AgentRegistry } from "./registry.js";
|
|
28
|
+
export { PluginAgentIndex } from "./plugin-agents.js";
|
|
27
29
|
export { registerTaskTool, TASK_TOOL, MAX_LIVE_CONTINUABLE_CHILDREN, CLAUDE_CODE_DISABLE_BACKGROUND_TASKS, backgroundTasksDisabled, } from "./tool.js";
|
|
28
30
|
export { collectFirstEpoch, collectorFor, collectorKey, registerCollector, unregisterCollector, collectorsForSession, registeredCollectorCount, markCollectedForSuppression, releaseCollectedForSuppression, isCollectedForSuppression, } from "./epoch-collector.js";
|
|
29
31
|
export { mountAgentCatalog } from "./catalog.js";
|
|
@@ -50,8 +52,14 @@ export const BACKGROUND_SECTION_TEXT = [
|
|
|
50
52
|
' synchronous collection. Explicit true/false always win over the pin.',
|
|
51
53
|
'- A background child\'s report — or its finish notice when it ends without reporting — arrives',
|
|
52
54
|
' as a waking message; do not poll.',
|
|
53
|
-
'-
|
|
54
|
-
'
|
|
55
|
+
'- When you delegate: one task, one instance. A new task is always a fresh `subagent_fork`',
|
|
56
|
+
' spawn call (a plain spawn — never the `fork` subagent_type, which inherits your context),',
|
|
57
|
+
' even when an idle child of the same type is listed. `send_message` continues the target\'s',
|
|
58
|
+
' current assignment only; the child resumes inside its full prior conversation with its',
|
|
59
|
+
' original definition snapshot, so never use it to hand an agent you started a new task.',
|
|
60
|
+
' (A child reporting its own result to its parent via `send_message` is always fine.)',
|
|
61
|
+
'- Control the child by that id: `list_agents` for status, `send_message` to continue its current',
|
|
62
|
+
' assignment (only the agent that started the child may continue it), `interrupt_agent` to',
|
|
55
63
|
' stop its current turn.',
|
|
56
64
|
'- A foreground wait may be user-promoted (Ctrl+B) to background while it runs: if a tool result',
|
|
57
65
|
' carries `status: \'async_launched\'` with `backgroundedByUser: true`, treat it exactly like a',
|
|
@@ -104,8 +112,11 @@ export function apply(ctx, config = {}) {
|
|
|
104
112
|
? new SpawnPinCapture(ctx, sharedStore)
|
|
105
113
|
: undefined
|
|
106
114
|
: new SpawnPinCapture(ctx, sharedStore ?? pins.store ?? new PinStore(pins.pinsRoot));
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
// One PluginAgentIndex serves both dispatch and catalog; it reads the seam
|
|
116
|
+
// lazily on every call so effect-scoped plugin mounts after apply() are seen.
|
|
117
|
+
const pluginIndex = new PluginAgentIndex(ctx);
|
|
118
|
+
registerTaskTool(ctx, registry, capture, pluginIndex);
|
|
119
|
+
mountAgentCatalog(ctx, registry, pluginIndex);
|
|
109
120
|
mountBackgroundSection(ctx);
|
|
110
121
|
mountStripWorkspaceInstructions(ctx);
|
|
111
122
|
mountSettledNoticeSuppression(ctx);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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S,wBAAwB,CAAC,GAAY;IAC5C,MAAM,IAAI,GAAG,GAAG,CAAC,IAIhB,CAAA;IACD,MAAM,eAAe,GAAG;QACtB,YAAY;QACZ,oBAAoB;QACpB,wBAAwB;KACzB,CAAA;IACD,IAAI,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,KAAK,SAAS,EAAE,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAA;IACtD,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAA;IAClD,CAAC;IACD,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,KAAK,eAAe;YAAE,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAA;IAC5G,CAAC,EAAE,8EAA8E,CAAC,CAAA;AACpF,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live enumeration of plugin agent providers over the `subagents` seam.
|
|
3
|
+
*
|
|
4
|
+
* The CC Task tool treats the seam's registered agent providers purely as a
|
|
5
|
+
* DEFINITION source: `cc-plugin-loader`'s `mountAgents` registers one
|
|
6
|
+
* `AgentProvider` per plugin agent under the scoped id
|
|
7
|
+
* `` `${pluginName}:${agentType}` `` (the `namespacePrefix` mechanism), and
|
|
8
|
+
* this index enumerates them live on every call — plugin mounts are
|
|
9
|
+
* effect-scoped Cordis contexts that may appear (or disappear) after this
|
|
10
|
+
* plugin's `apply()`, so nothing is cached.
|
|
11
|
+
*
|
|
12
|
+
* Builtin providers (`spawn`, `fork`, …) are excluded naturally: they carry
|
|
13
|
+
* no `definition`.
|
|
14
|
+
*
|
|
15
|
+
* @module @dsh-cc/subagent-task/plugin-agents
|
|
16
|
+
*/
|
|
17
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
18
|
+
import type { AgentDefinition } from '@dsh-cc/claude-code-agents';
|
|
19
|
+
import type { SubagentsLike } from './background-start.ts';
|
|
20
|
+
/** Options for the index, mostly injectable seams for tests. */
|
|
21
|
+
export interface PluginAgentIndexOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Override the seam lookup (hermetic tests). Defaults to
|
|
24
|
+
* `ctx.get('subagents')`, re-read on every call.
|
|
25
|
+
*/
|
|
26
|
+
seam?: () => SubagentsLike | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The structural guard for a plugin agent provider: a `start` function, a
|
|
30
|
+
* string `name` containing `:` (the scoped `plugin:agent` id), and a
|
|
31
|
+
* `definition` with a string `agentType` and `systemPrompt`. Builtin
|
|
32
|
+
* providers (spawn/fork/…) carry no definition and are excluded naturally.
|
|
33
|
+
*
|
|
34
|
+
* The guard additionally REQUIRES the loader brand (`Symbol.for(
|
|
35
|
+
* 'dsh-cc.plugin-agent-provider')`, plan §9.4): the structural shape alone is
|
|
36
|
+
* an accidental protocol any foreign provider could fake, so only providers
|
|
37
|
+
* the loader actually created are adopted.
|
|
38
|
+
*
|
|
39
|
+
* Precondition (load-bearing): the provider only carries a scoped name when
|
|
40
|
+
* `mountAgents` was given a `namespacePrefix` — no prefix at mount ⇒ the
|
|
41
|
+
* agent is undiscoverable: neither addressable by Task nor listed in the
|
|
42
|
+
* catalog.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isPluginAgentProvider(provider: unknown): provider is {
|
|
45
|
+
name: string;
|
|
46
|
+
start: unknown;
|
|
47
|
+
definition: AgentDefinition;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A live view over the seam's plugin agent providers. All methods read the
|
|
51
|
+
* seam lazily on EVERY call so effect-scoped plugin mounts that appear after
|
|
52
|
+
* `apply()` are still discovered.
|
|
53
|
+
*/
|
|
54
|
+
export declare class PluginAgentIndex {
|
|
55
|
+
private readonly ctx;
|
|
56
|
+
private readonly seamOverride;
|
|
57
|
+
constructor(ctx: Context, options?: PluginAgentIndexOptions);
|
|
58
|
+
/** The seam, re-read on every call (lazy: mounts may appear after apply). */
|
|
59
|
+
private getSeam;
|
|
60
|
+
/**
|
|
61
|
+
* List every plugin agent currently registered on the seam, as
|
|
62
|
+
* `{ id, definition }` pairs. The scan is synchronous and uncached.
|
|
63
|
+
*/
|
|
64
|
+
list(): {
|
|
65
|
+
id: string;
|
|
66
|
+
definition: AgentDefinition;
|
|
67
|
+
}[];
|
|
68
|
+
/**
|
|
69
|
+
* Resolve one plugin agent by its exact scoped id (`plugin:agent`).
|
|
70
|
+
* Bare plugin agent names are NOT addressable — matching CC, where plugin
|
|
71
|
+
* agents are addressed only by scoped id.
|
|
72
|
+
*/
|
|
73
|
+
resolve(type: string): AgentDefinition | undefined;
|
|
74
|
+
/** A snapshot of the currently known scoped ids (for catalog diffing). */
|
|
75
|
+
knownIds(): string[];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=plugin-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-agents.d.ts","sourceRoot":"","sources":["../src/plugin-agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAiB1D,gEAAgE;AAChE,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,aAAa,GAAG,SAAS,CAAA;CACvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,eAAe,CAAA;CAC5B,CASA;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+C;gBAEhE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE,uBAA4B;IAK/D,6EAA6E;IAC7E,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,IAAI,IAAI;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,eAAe,CAAA;KAAE,EAAE;IAerD;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIlD,0EAA0E;IAC1E,QAAQ,IAAI,MAAM,EAAE;CAGrB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live enumeration of plugin agent providers over the `subagents` seam.
|
|
3
|
+
*
|
|
4
|
+
* The CC Task tool treats the seam's registered agent providers purely as a
|
|
5
|
+
* DEFINITION source: `cc-plugin-loader`'s `mountAgents` registers one
|
|
6
|
+
* `AgentProvider` per plugin agent under the scoped id
|
|
7
|
+
* `` `${pluginName}:${agentType}` `` (the `namespacePrefix` mechanism), and
|
|
8
|
+
* this index enumerates them live on every call — plugin mounts are
|
|
9
|
+
* effect-scoped Cordis contexts that may appear (or disappear) after this
|
|
10
|
+
* plugin's `apply()`, so nothing is cached.
|
|
11
|
+
*
|
|
12
|
+
* Builtin providers (`spawn`, `fork`, …) are excluded naturally: they carry
|
|
13
|
+
* no `definition`.
|
|
14
|
+
*
|
|
15
|
+
* @module @dsh-cc/subagent-task/plugin-agents
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The loader's brand key, duplicated as a `Symbol.for` lookup instead of a
|
|
19
|
+
* runtime import of `@dsh-cc/plugin-loader` (a devDependency — a runtime
|
|
20
|
+
* import here would break published consumers). Kept in lockstep with
|
|
21
|
+
* `PLUGIN_AGENT_PROVIDER_BRAND` in the loader; both resolve to the same
|
|
22
|
+
* registry symbol.
|
|
23
|
+
*/
|
|
24
|
+
const PLUGIN_AGENT_PROVIDER_BRAND = Symbol.for('dsh-cc.plugin-agent-provider');
|
|
25
|
+
/** Whether a value was created by the loader as a plugin agent provider. */
|
|
26
|
+
function hasLoaderBrand(value) {
|
|
27
|
+
return typeof value === 'object' && value !== null
|
|
28
|
+
&& value[PLUGIN_AGENT_PROVIDER_BRAND] === true;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The structural guard for a plugin agent provider: a `start` function, a
|
|
32
|
+
* string `name` containing `:` (the scoped `plugin:agent` id), and a
|
|
33
|
+
* `definition` with a string `agentType` and `systemPrompt`. Builtin
|
|
34
|
+
* providers (spawn/fork/…) carry no definition and are excluded naturally.
|
|
35
|
+
*
|
|
36
|
+
* The guard additionally REQUIRES the loader brand (`Symbol.for(
|
|
37
|
+
* 'dsh-cc.plugin-agent-provider')`, plan §9.4): the structural shape alone is
|
|
38
|
+
* an accidental protocol any foreign provider could fake, so only providers
|
|
39
|
+
* the loader actually created are adopted.
|
|
40
|
+
*
|
|
41
|
+
* Precondition (load-bearing): the provider only carries a scoped name when
|
|
42
|
+
* `mountAgents` was given a `namespacePrefix` — no prefix at mount ⇒ the
|
|
43
|
+
* agent is undiscoverable: neither addressable by Task nor listed in the
|
|
44
|
+
* catalog.
|
|
45
|
+
*/
|
|
46
|
+
export function isPluginAgentProvider(provider) {
|
|
47
|
+
if (!hasLoaderBrand(provider))
|
|
48
|
+
return false;
|
|
49
|
+
const candidate = provider;
|
|
50
|
+
if (typeof candidate.name !== 'string' || !candidate.name.includes(':'))
|
|
51
|
+
return false;
|
|
52
|
+
if (typeof candidate.start !== 'function')
|
|
53
|
+
return false;
|
|
54
|
+
const def = candidate.definition;
|
|
55
|
+
if (typeof def !== 'object' || def === null)
|
|
56
|
+
return false;
|
|
57
|
+
const shape = def;
|
|
58
|
+
return typeof shape.agentType === 'string' && typeof shape.systemPrompt === 'string';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A live view over the seam's plugin agent providers. All methods read the
|
|
62
|
+
* seam lazily on EVERY call so effect-scoped plugin mounts that appear after
|
|
63
|
+
* `apply()` are still discovered.
|
|
64
|
+
*/
|
|
65
|
+
export class PluginAgentIndex {
|
|
66
|
+
ctx;
|
|
67
|
+
seamOverride;
|
|
68
|
+
constructor(ctx, options = {}) {
|
|
69
|
+
this.ctx = ctx;
|
|
70
|
+
this.seamOverride = options.seam;
|
|
71
|
+
}
|
|
72
|
+
/** The seam, re-read on every call (lazy: mounts may appear after apply). */
|
|
73
|
+
getSeam() {
|
|
74
|
+
if (this.seamOverride !== undefined)
|
|
75
|
+
return this.seamOverride();
|
|
76
|
+
return this.ctx.get('subagents');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* List every plugin agent currently registered on the seam, as
|
|
80
|
+
* `{ id, definition }` pairs. The scan is synchronous and uncached.
|
|
81
|
+
*/
|
|
82
|
+
list() {
|
|
83
|
+
const seam = this.getSeam();
|
|
84
|
+
// The seam is duck-typed: a host (or test harness) may expose a partial
|
|
85
|
+
// seam without `list` — treat that as "no plugin agents", not a crash.
|
|
86
|
+
if (seam === undefined || typeof seam.list !== 'function')
|
|
87
|
+
return [];
|
|
88
|
+
const entries = [];
|
|
89
|
+
for (const name of seam.list()) {
|
|
90
|
+
const provider = seam.getProvider(name);
|
|
91
|
+
if (isPluginAgentProvider(provider)) {
|
|
92
|
+
entries.push({ id: provider.name, definition: provider.definition });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return entries.sort((a, b) => a.id.localeCompare(b.id));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolve one plugin agent by its exact scoped id (`plugin:agent`).
|
|
99
|
+
* Bare plugin agent names are NOT addressable — matching CC, where plugin
|
|
100
|
+
* agents are addressed only by scoped id.
|
|
101
|
+
*/
|
|
102
|
+
resolve(type) {
|
|
103
|
+
return this.list().find(entry => entry.id === type)?.definition;
|
|
104
|
+
}
|
|
105
|
+
/** A snapshot of the currently known scoped ids (for catalog diffing). */
|
|
106
|
+
knownIds() {
|
|
107
|
+
return this.list().map(entry => entry.id);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=plugin-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-agents.js","sourceRoot":"","sources":["../src/plugin-agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAkB,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;AAE7F,4EAA4E;AAC5E,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;WAC5C,KAAiC,CAAC,2BAA2B,CAAC,KAAK,IAAI,CAAA;AAC/E,CAAC;AAWD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAiB;IAKrD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAA;IAC3C,MAAM,SAAS,GAAG,QAAqE,CAAA;IACvF,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrF,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU;QAAE,OAAO,KAAK,CAAA;IACvD,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,CAAA;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IACzD,MAAM,KAAK,GAAG,GAAsD,CAAA;IACpE,OAAO,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,YA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IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,UAAU,CAAA;IACjE,CAAC;IAED,0EAA0E;IAC1E,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Duplicate-notice suppression for inline-collected subagent epochs
|
|
3
|
-
* (`docs/plans/2026-09-
|
|
3
|
+
* (`docs/plans/2026-09-05-epoch-collector-dsh-cc.md` §5): a pre-step
|
|
4
4
|
* waterfall listener that DROPs pending `subagent-settled` messages whose
|
|
5
5
|
* `senderSessionId` is in the pop-once "collected" set, so a collected
|
|
6
6
|
* epoch's settlement account lives only in the tool result and never also
|
package/lib/suppress-settled.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Duplicate-notice suppression for inline-collected subagent epochs
|
|
3
|
-
* (`docs/plans/2026-09-
|
|
3
|
+
* (`docs/plans/2026-09-05-epoch-collector-dsh-cc.md` §5): a pre-step
|
|
4
4
|
* waterfall listener that DROPs pending `subagent-settled` messages whose
|
|
5
5
|
* `senderSessionId` is in the pop-once "collected" set, so a collected
|
|
6
6
|
* epoch's settlement account lives only in the tool result and never also
|
package/lib/tool.d.ts
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* task text as the first user message, a routes-resolved `agentOptions`
|
|
19
19
|
* override, and the definition's tool restriction (sanitized of tool names
|
|
20
20
|
* this composition no longer registers).
|
|
21
|
+
* - A type matching a plugin agent's scoped id (`plugin:agent`, from the
|
|
22
|
+
* `subagents` seam's namespaced providers) → the identical fold: the
|
|
23
|
+
* provider's `AgentDefinition` is dispatched through the same `spawn`
|
|
24
|
+
* provider mechanics; no new start path exists for plugin agents.
|
|
21
25
|
* - Any other type → an error result listing the available types.
|
|
22
26
|
*
|
|
23
27
|
* The seam's capability contract (`assertCapabilities`) is honoured
|
|
@@ -33,6 +37,7 @@
|
|
|
33
37
|
*/
|
|
34
38
|
import type { Context } from '@deepseek-ai/cordis';
|
|
35
39
|
import type { AgentRegistry } from './registry.ts';
|
|
40
|
+
import { PluginAgentIndex } from './plugin-agents.ts';
|
|
36
41
|
import { SpawnPinCapture } from './resume-capture.ts';
|
|
37
42
|
export { MAX_LIVE_CONTINUABLE_CHILDREN, CLAUDE_CODE_DISABLE_BACKGROUND_TASKS, backgroundTasksDisabled, } from './background-start.ts';
|
|
38
43
|
/** The registered tool name (the CC display mapping surfaces it as `Task`). */
|
|
@@ -45,5 +50,5 @@ export declare const TASK_TOOL = "subagent_fork";
|
|
|
45
50
|
* no `resumePins` plugin config) writes no pins and runs no preflight.
|
|
46
51
|
* @returns the registration disposer, or undefined when the tools seam is absent.
|
|
47
52
|
*/
|
|
48
|
-
export declare function registerTaskTool(ctx: Context, registry: AgentRegistry, capture?: SpawnPinCapture): (() => void) | undefined;
|
|
53
|
+
export declare function registerTaskTool(ctx: Context, registry: AgentRegistry, capture?: SpawnPinCapture, pluginIndex?: PluginAgentIndex): (() => void) | undefined;
|
|
49
54
|
//# sourceMappingURL=tool.d.ts.map
|
package/lib/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAOlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAYrD,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,uBAAuB,CAAA;AAE9B,+EAA+E;AAC/E,eAAO,MAAM,SAAS,kBAAkB,CAAA;AA8CxC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,eAAe,EACzB,WAAW,GAAE,gBAA4C,GACxD,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA8M1B"}
|
package/lib/tool.js
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* task text as the first user message, a routes-resolved `agentOptions`
|
|
19
19
|
* override, and the definition's tool restriction (sanitized of tool names
|
|
20
20
|
* this composition no longer registers).
|
|
21
|
+
* - A type matching a plugin agent's scoped id (`plugin:agent`, from the
|
|
22
|
+
* `subagents` seam's namespaced providers) → the identical fold: the
|
|
23
|
+
* provider's `AgentDefinition` is dispatched through the same `spawn`
|
|
24
|
+
* provider mechanics; no new start path exists for plugin agents.
|
|
21
25
|
* - Any other type → an error result listing the available types.
|
|
22
26
|
*
|
|
23
27
|
* The seam's capability contract (`assertCapabilities`) is honoured
|
|
@@ -34,6 +38,7 @@
|
|
|
34
38
|
import { defineTool } from '@dsh-cc/tools';
|
|
35
39
|
import { cwdOf } from '@dsh-cc/memory';
|
|
36
40
|
import { toAgentOptions } from '@dsh-cc/model-aliases';
|
|
41
|
+
import { PluginAgentIndex } from "./plugin-agents.js";
|
|
37
42
|
import { preloadDeferredFilterTools, renderPreloadLines } from "./preload-tools.js";
|
|
38
43
|
import { sanitizeToolFilter } from "./sanitize-filter.js";
|
|
39
44
|
import { backgroundTasksDisabled, collectForeground, preparedBackground, startBackground, wantsBackground, } from "./background-start.js";
|
|
@@ -72,7 +77,7 @@ const RESERVED_TOOL_NAMES = ['subagent', 'workflow'];
|
|
|
72
77
|
* no `resumePins` plugin config) writes no pins and runs no preflight.
|
|
73
78
|
* @returns the registration disposer, or undefined when the tools seam is absent.
|
|
74
79
|
*/
|
|
75
|
-
export function registerTaskTool(ctx, registry, capture) {
|
|
80
|
+
export function registerTaskTool(ctx, registry, capture, pluginIndex = new PluginAgentIndex(ctx)) {
|
|
76
81
|
const tools = ctx.get('tools');
|
|
77
82
|
if (tools === undefined)
|
|
78
83
|
return undefined;
|
|
@@ -85,7 +90,8 @@ export function registerTaskTool(ctx, registry, capture) {
|
|
|
85
90
|
name: TASK_TOOL,
|
|
86
91
|
description: 'Delegate a well-scoped task to a subagent. The child starts with a fresh conversation: '
|
|
87
92
|
+ 'write a self-contained prompt (paths, constraints, what to return). Pass `subagent_type` '
|
|
88
|
-
+ 'to run a named agent from the session workspace (`.claude/agents`)
|
|
93
|
+
+ 'to run a named agent from the session workspace (`.claude/agents`) or a plugin agent by '
|
|
94
|
+
+ 'its scoped id (`plugin:agent`) — see the "Available '
|
|
89
95
|
+ 'subagents" section of the system prompt for the current list. Omit `subagent_type` (or '
|
|
90
96
|
+ 'use "general-purpose") for a plain spawn that inherits your tools but not your history. '
|
|
91
97
|
+ 'Pass `subagent_type: "fork"` to inherit completed parent turns (and the prompt cache, '
|
|
@@ -98,6 +104,12 @@ export function registerTaskTool(ctx, registry, capture) {
|
|
|
98
104
|
+ 'are told when it finishes via a waking message; synthesize on the wake, do not poll. '
|
|
99
105
|
+ 'A definition with `background: true` backgrounds on omit; pass `run_in_background: false` '
|
|
100
106
|
+ 'when this turn needs that child\u2019s result \u2014 explicit true/false always win over the pin. '
|
|
107
|
+
+ 'One task, one instance: every new task is a fresh call to this tool (a plain spawn \u2014 '
|
|
108
|
+
+ 'never `subagent_type: "fork"`, which inherits your context), even when an idle child of '
|
|
109
|
+
+ 'the same type exists. `send_message` continues only an existing child\u2019s CURRENT '
|
|
110
|
+
+ 'assignment (steer it in flight, same-task follow-ups); a continued child resumes inside '
|
|
111
|
+
+ 'its full prior conversation with its original definition snapshot. (Reporting your own '
|
|
112
|
+
+ 'result to your parent via `send_message` is always fine.) '
|
|
101
113
|
+ 'Continue a background child later with `send_message` addressed to its id; inspect it with '
|
|
102
114
|
+ '`list_agents` and stop its current turn with `interrupt_agent`. '
|
|
103
115
|
+ 'A foreground wait may be user-promoted to background while it runs: if a tool result '
|
|
@@ -107,9 +119,11 @@ export function registerTaskTool(ctx, registry, capture) {
|
|
|
107
119
|
parameters: {
|
|
108
120
|
subagent_type: {
|
|
109
121
|
type: 'string',
|
|
110
|
-
description: 'Named agent from `.claude/agents`,
|
|
122
|
+
description: 'Named agent from `.claude/agents`, a plugin agent by its scoped id ("plugin:agent"), '
|
|
123
|
+
+ 'or the sentinels "general-purpose" (fresh spawn) '
|
|
111
124
|
+ 'and "fork" (inherit completed parent turns). "fork" is reserved and wins over a '
|
|
112
|
-
+ 'workspace file of the same name.'
|
|
125
|
+
+ 'workspace file of the same name. Bare plugin agent names are not addressable — use '
|
|
126
|
+
+ 'the full scoped id.',
|
|
113
127
|
},
|
|
114
128
|
description: {
|
|
115
129
|
type: 'string',
|
|
@@ -181,48 +195,65 @@ export function registerTaskTool(ctx, registry, capture) {
|
|
|
181
195
|
return settle(run);
|
|
182
196
|
}
|
|
183
197
|
const root = cwdOf(agent);
|
|
184
|
-
|
|
198
|
+
let definition = await registry.resolve(root, type);
|
|
185
199
|
if (definition === undefined) {
|
|
186
|
-
|
|
200
|
+
// Fall through to the seam's plugin agents (exact scoped-id match).
|
|
201
|
+
// Builtin providers are excluded by the index's structural guard.
|
|
202
|
+
definition = pluginIndex.resolve(type);
|
|
203
|
+
}
|
|
204
|
+
if (definition === undefined) {
|
|
205
|
+
const fileTypes = (await registry.list(root)).map(def => def.agentType);
|
|
206
|
+
const pluginIds = pluginIndex.knownIds();
|
|
207
|
+
const available = [...fileTypes, ...pluginIds].join(', ');
|
|
187
208
|
throw new Error(`unknown subagent_type "${type}"`
|
|
188
|
-
+ (available.length > 0
|
|
209
|
+
+ (available.length > 0
|
|
210
|
+
? `; available in this workspace: ${available}`
|
|
211
|
+
: '; this workspace defines no agents')
|
|
212
|
+
// A colon in the requested type means a scoped plugin id was
|
|
213
|
+
// intended: name the unmount/renamed causes explicitly.
|
|
214
|
+
+ (type.includes(':')
|
|
215
|
+
? ' — plugin agent not found — the plugin may be unmounted or the agent renamed'
|
|
216
|
+
: ''));
|
|
189
217
|
}
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
const dispatchDefinition = async (definition) => {
|
|
219
|
+
const routes = ctx.get('ccModelRoutes');
|
|
220
|
+
const agentOptions = toAgentOptions(routes?.resolve(definition.model));
|
|
221
|
+
// LIVE known set, read at execute time so MCP tools mounted or deferred
|
|
222
|
+
// after this plugin's apply (including hash-suffixed public names) are
|
|
223
|
+
// all restrictable candidates for the child's filter. Pass the calling
|
|
224
|
+
// agent: MCP tools live on the standing-scope layer, which the global
|
|
225
|
+
// view (no scope) does not include.
|
|
226
|
+
const knownNames = tools.view?.(agent).restrictableNames ?? new Set();
|
|
227
|
+
const toolFilter = definition.toolRestriction !== undefined
|
|
228
|
+
? sanitizeToolFilter(definition.toolRestriction, message => ctx.logger.warn(message), knownNames)
|
|
229
|
+
: undefined;
|
|
230
|
+
// Spawn-time pre-activation (named definitions only): explicit deferred
|
|
231
|
+
// MCP names in the raw `tools:` allow-list are activated through the
|
|
232
|
+
// duck-typed toolSearch seam BEFORE the child starts, on BOTH dispatch
|
|
233
|
+
// paths. Activation is process-global — every admitting agent's schema
|
|
234
|
+
// grows after the spawn.
|
|
235
|
+
const preloadText = renderPreloadLines(preloadDeferredFilterTools({
|
|
236
|
+
raw: definition.toolRestriction,
|
|
237
|
+
sanitized: toolFilter,
|
|
238
|
+
toolSearch: ctx.get('toolSearch'),
|
|
239
|
+
agent,
|
|
240
|
+
tools,
|
|
241
|
+
warn: message => ctx.logger.warn(message),
|
|
242
|
+
}));
|
|
243
|
+
const folded = {
|
|
244
|
+
...base,
|
|
245
|
+
persona: definition.systemPrompt,
|
|
246
|
+
...(toolFilter !== undefined ? { toolFilter } : {}),
|
|
247
|
+
...(agentOptions !== undefined ? { agentOptions } : {}),
|
|
248
|
+
};
|
|
249
|
+
if (wantsBackground(args, definition, disabled)) {
|
|
250
|
+
const result = await startBackground(seam, preparedBackground(folded, capture, definition, routes), capture);
|
|
251
|
+
return preloadText === '' ? result : { ...result, text: `${result.text}\n${preloadText}` };
|
|
252
|
+
}
|
|
253
|
+
const result = await collectForeground(ctx, seam, preparedBackground(folded, capture, definition, routes), capture, exec);
|
|
222
254
|
return preloadText === '' ? result : { ...result, text: `${result.text}\n${preloadText}` };
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return preloadText === '' ? result : { ...result, text: `${result.text}\n${preloadText}` };
|
|
255
|
+
};
|
|
256
|
+
return dispatchDefinition(definition);
|
|
226
257
|
},
|
|
227
258
|
}));
|
|
228
259
|
}
|
package/lib/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAA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KAAK,WAAW,EAAE,EAAE,CAAA;YAC5F,CAAC,CAAA;YACD,OAAO,kBAAkB,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC;KACF,CAAC,CAAC,CAAA;AACL,CAAC;AAED,+EAA+E;AAC/E,KAAK,UAAU,MAAM,CAAC,GAAqG;IACzH,IAAI,MAAM,CAAA;IACV,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAA;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,wBAAyB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,KAAK,WAAW,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAA;IAC5E,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;SAC/B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;SACtC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;SAC9B,IAAI,CAAC,EAAE,CAAC,CAAA;IACX,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAoB,EAAE,CAAA;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/subagent-task",
|
|
3
3
|
"description": "Claude Code-compatible Task tool: subagent_type dispatch over per-workspace .claude/agents definitions for the DeepSeek Harness",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -33,30 +33,30 @@
|
|
|
33
33
|
],
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@deepseek-ai/cordis": ">=0.1.
|
|
37
|
-
"@deepseek-ai/dsh-agent": ">=0.1.
|
|
38
|
-
"@deepseek-ai/dsh-invariants": ">=0.1.
|
|
39
|
-
"@deepseek-ai/dsh-subagent": ">=0.1.
|
|
40
|
-
"@deepseek-ai/dsh-system-prompt": ">=0.1.
|
|
36
|
+
"@deepseek-ai/cordis": ">=0.1.2-rc.1",
|
|
37
|
+
"@deepseek-ai/dsh-agent": ">=0.1.2-rc.1",
|
|
38
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.2-rc.1",
|
|
39
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.2-rc.1",
|
|
40
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.1.2-rc.1",
|
|
41
41
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@dsh-cc/claude-code-agents": "^0.
|
|
45
|
-
"@dsh-cc/
|
|
46
|
-
"@dsh-cc/
|
|
47
|
-
"@dsh-cc/
|
|
48
|
-
"@dsh-cc/tools": "^0.
|
|
44
|
+
"@dsh-cc/claude-code-agents": "^0.6.0",
|
|
45
|
+
"@dsh-cc/model-aliases": "^0.6.0",
|
|
46
|
+
"@dsh-cc/memory": "^0.6.0",
|
|
47
|
+
"@dsh-cc/subagent-resume-pins": "^0.6.0",
|
|
48
|
+
"@dsh-cc/tools": "^0.6.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@deepseek-ai/dsh-agent-loop": "link:../../../../deepseek-harness/packages/core/agent-loop",
|
|
52
52
|
"@deepseek-ai/dsh-agent-loop-testkit": "link:../../../../deepseek-harness/packages/test-support/agent-loop-testkit",
|
|
53
53
|
"@deepseek-ai/dsh-llm": "link:../../../../deepseek-harness/packages/llm/llm",
|
|
54
54
|
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
55
|
+
"@deepseek-ai/dsh-session-query": "link:../../../../deepseek-harness/packages/session-query/session-query",
|
|
55
56
|
"@deepseek-ai/dsh-session-persistence-jsonl": "link:../../../../deepseek-harness/packages/session/session-persistence-jsonl",
|
|
56
57
|
"@deepseek-ai/dsh-session-projection": "link:../../../../deepseek-harness/packages/session/session-projection",
|
|
57
58
|
"@deepseek-ai/dsh-subagent-spawn-in-process": "link:../../../../deepseek-harness/packages/subagent/subagent-spawn-in-process",
|
|
58
59
|
"@deepseek-ai/dsh-tool-subagent-control": "link:../../../../deepseek-harness/packages/subagent/tool-subagent-control",
|
|
59
|
-
"@deepseek-ai/dsh-tool-subagent-report": "link:../../../../deepseek-harness/packages/subagent/tool-subagent-report",
|
|
60
60
|
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery",
|
|
61
61
|
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
62
62
|
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
@@ -64,13 +64,14 @@
|
|
|
64
64
|
"@deepseek-ai/dsh-scope": "link:../../../../deepseek-harness/packages/core/scope",
|
|
65
65
|
"@deepseek-ai/dsh-subagent": "link:../../../../deepseek-harness/packages/subagent/subagent",
|
|
66
66
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
67
|
-
"@dsh-cc/memory": "^0.5.0",
|
|
68
|
-
"@dsh-cc/claude-code-agents": "^0.5.0",
|
|
69
|
-
"@dsh-cc/model-aliases": "^0.5.0",
|
|
70
|
-
"@dsh-cc/subagent-resume-pins": "^0.5.0",
|
|
71
67
|
"@dsh-cc/agent-loop-mock": "^0.1.0",
|
|
72
|
-
"@dsh-cc/
|
|
73
|
-
"@dsh-cc/
|
|
68
|
+
"@dsh-cc/claude-code-agents": "^0.6.0",
|
|
69
|
+
"@dsh-cc/model-aliases": "^0.6.0",
|
|
70
|
+
"@dsh-cc/subagent-resume-pins": "^0.6.0",
|
|
71
|
+
"@dsh-cc/tools": "^0.6.0",
|
|
72
|
+
"@dsh-cc/memory": "^0.6.0",
|
|
73
|
+
"@dsh-cc/tool-search": "0.6.0",
|
|
74
|
+
"@dsh-cc/plugin-loader": "^0.6.0"
|
|
74
75
|
},
|
|
75
76
|
"publishConfig": {
|
|
76
77
|
"access": "public"
|