@deepseek-ai/dsh-tool-subagent 0.1.5-rc.1 → 0.1.6-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +3 -3
- package/lib/index.js +6 -3
- package/package.json +28 -28
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/subagent/tool-subagent/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: f2d9eb3a44d84130caca8e29bbe0546e24a76b34
|
|
6
|
+
README.zh.md: 312856983f0e25cd6eb8e508f4c7b9e9db361044
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ This section explains how the tool mirrors provider lifecycle and settles runs;
|
|
|
80
80
|
|
|
81
81
|
### Design concept
|
|
82
82
|
|
|
83
|
-
One instance is one provider plus one tool name. The plugin mirrors provider lifecycle: it registers the tool when the named provider appears and disposes it when the provider leaves, so sibling load order and HMR replacement cannot strand a dangling tool. Direct Agent setup passes its unpublished Session explicitly and awaits installation before publication. A settings-backed standing preset receives each matching Agent
|
|
83
|
+
One instance is one provider plus one tool name. The plugin mirrors provider lifecycle: it registers the tool when the named provider appears and disposes it when the provider leaves, so sibling load order and HMR replacement cannot strand a dangling tool. Direct Agent setup passes its unpublished Session explicitly and awaits installation before publication. A settings-backed standing preset receives each matching Agent through `agent/created`, selects policy from its Session, and awaits installation through its Context; installation failure rejects creation. A numeric `maxDepth` or configured LLM selection the provider cannot enforce fails the mount instead of the first delegation. At most one instance in a tool scope may own model selection because `list_subagent_models` has a global name.
|
|
84
84
|
|
|
85
85
|
### Foreground settlement
|
|
86
86
|
|
|
@@ -208,7 +208,7 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
208
208
|
|
|
209
209
|
These limits define what this tool does not return or enforce; they are current package constraints.
|
|
210
210
|
|
|
211
|
-
- **Background runs expose no result through this tool** — a one-shot task's final output is collected through the generic task surface, and a continuable child's output stays in its own session, read by its subagent id. The settlement notice states how that child ended and carries
|
|
211
|
+
- **Background runs expose no result through this tool** — a one-shot task's final output is collected through the generic task surface, and a continuable child's output stays in its own session, read by its subagent id. The settlement notice states how that child ended and carries nonempty text from its final assistant output, but it is not this call's return value and cannot be awaited here.
|
|
212
212
|
- **Duplicate names across waiting one-shot instances are detected late** (`TODO(subagent-dup-toolname)`) — continuable instances reserve their prompt-section name during plugin application, but preventing provider-registration rollback for waiting one-shot instances requires a registry of intended names.
|
|
213
213
|
- **Shipped fork tools cannot select a child LLM route** — they inherit the parent's provider and model to keep the copied conversation prefix eligible for KV Cache reuse. Re-enable selection only when route changes preserve reuse or expose a bounded recomputation cost.
|
|
214
214
|
- **Non-routing child policy is fixed per instance** — another persona, tool filter, or depth cap requires another distinctly named tool. LLM selection requires an enabled per-Session preference and a provider that advertises `agentOptions`; both in-process providers and DSH SDK advertise it, while ACP, Codex, and Claude Code reject it rather than ignore it.
|
package/README.zh.md
CHANGED
|
@@ -80,7 +80,7 @@ kind: "package-reference"
|
|
|
80
80
|
|
|
81
81
|
### 设计理念
|
|
82
82
|
|
|
83
|
-
一个实例就是一个提供方加一个工具名称。插件镜像提供方生命周期:具名提供方出现时注册工具,提供方离开时释放工具,因此同级加载顺序与 HMR 替换不会让工具悬空。直接 Agent setup 显式传入尚未发布的 Session,并在发布前等待安装完成。由设置控制的常驻 preset
|
|
83
|
+
一个实例就是一个提供方加一个工具名称。插件镜像提供方生命周期:具名提供方出现时注册工具,提供方离开时释放工具,因此同级加载顺序与 HMR 替换不会让工具悬空。直接 Agent setup 显式传入尚未发布的 Session,并在发布前等待安装完成。由设置控制的常驻 preset 通过 `agent/created` 接收每个匹配 Agent,从其 Session 选择策略,并等待通过其 Context 发起的安装;安装失败会拒绝创建。提供方无法执行的数值型 `maxDepth` 或已配置 LLM 选择会在挂载时失败,而不是在首次委派时失败。每个工具作用域内最多一个实例可以拥有模型选择,因为 `list_subagent_models` 使用全局名称。
|
|
84
84
|
|
|
85
85
|
### 前台结算
|
|
86
86
|
|
|
@@ -177,7 +177,7 @@ Use subagent in the background by default. Start independent delegations togethe
|
|
|
177
177
|
|
|
178
178
|
#### 模型看到什么
|
|
179
179
|
|
|
180
|
-
调用会保留描述与提示词。成功时只包含子 agent 的最终文本;其他结果变为 `Error:
|
|
180
|
+
调用会保留描述与提示词。成功时只包含子 agent 的最终文本;其他结果变为 `Error: <stop reason>`,随后在存在时附上安全的提供方诊断,再附上任何部分 assistant 文本。子 agent 中间步骤不会进入父级。
|
|
181
181
|
|
|
182
182
|
#### Token 影响
|
|
183
183
|
|
|
@@ -208,7 +208,7 @@ Use subagent in the background by default. Start independent delegations togethe
|
|
|
208
208
|
|
|
209
209
|
这些限制说明本工具不返回或不强制执行什么;它们是当前包约束。
|
|
210
210
|
|
|
211
|
-
- **后台运行不通过本工具公开结果**——一次性任务的最终输出通过通用 Task 接口收集,可继续子 agent 的输出留在其自身会话中,按其 subagent id 读取。结算通知会说明该子 agent
|
|
211
|
+
- **后台运行不通过本工具公开结果**——一次性任务的最终输出通过通用 Task 接口收集,可继续子 agent 的输出留在其自身会话中,按其 subagent id 读取。结算通知会说明该子 agent 如何结束,并携带其最终 assistant 输出中的非空文本,但它不是本次调用的返回值,也无法在此等待。
|
|
212
212
|
- **等待中的一次性实例较晚才发现重复名称**(`TODO(subagent-dup-toolname)`)——可继续实例会在插件应用期间预留提示词 section 名称,但若要阻止等待中的一次性实例回滚提供方注册,仍需要一份预期名称注册表。
|
|
213
213
|
- **随附 fork 工具不能选择子级 LLM 路由**——它们继承父级提供方与模型,使复制的对话前缀仍有资格复用 KV Cache。仅当路由变更能保留复用或公开有界重算成本时,才重新启用选择。
|
|
214
214
|
- **非路由子 agent 策略按实例固定**——另一个 persona、工具过滤器或深度上限需要另一个名称不同的工具。LLM 选择要求启用逐 Session 偏好,且提供方必须声明 `agentOptions`;两个进程内提供方和 DSH SDK 会声明该能力,而 ACP、Codex 与 Claude Code 会拒绝它,而不是忽略它。
|
package/lib/index.js
CHANGED
|
@@ -616,7 +616,9 @@ function apply(ctx, config, session) {
|
|
|
616
616
|
const installing = /* @__PURE__ */ new WeakSet();
|
|
617
617
|
const belongsToComposition = (candidate) => scopeChainOf(scopeOf(candidate.ctx)).includes(compositionScope);
|
|
618
618
|
const installScoped = (candidate) => {
|
|
619
|
-
|
|
619
|
+
const existing = scopedInstalls.get(candidate);
|
|
620
|
+
if (existing !== void 0) return existing;
|
|
621
|
+
if (installing.has(candidate)) return;
|
|
620
622
|
installing.add(candidate);
|
|
621
623
|
let fiber;
|
|
622
624
|
try {
|
|
@@ -632,6 +634,7 @@ function apply(ctx, config, session) {
|
|
|
632
634
|
installing.delete(candidate);
|
|
633
635
|
}
|
|
634
636
|
scopedInstalls.set(candidate, fiber);
|
|
637
|
+
return fiber;
|
|
635
638
|
};
|
|
636
639
|
const removeScoped = (candidate) => {
|
|
637
640
|
const fiber = scopedInstalls.get(candidate);
|
|
@@ -646,8 +649,8 @@ function apply(ctx, config, session) {
|
|
|
646
649
|
for (const candidate of agents.list()) if (belongsToComposition(candidate)) installScoped(candidate);
|
|
647
650
|
else removeScoped(candidate);
|
|
648
651
|
};
|
|
649
|
-
ctx.on("agent/created", ({ agent: created }) => {
|
|
650
|
-
installScoped(created);
|
|
652
|
+
ctx.on("agent/created", async ({ agent: created }) => {
|
|
653
|
+
await installScoped(created);
|
|
651
654
|
});
|
|
652
655
|
ctx.on("agent/disposed", ({ agent: disposed }) => {
|
|
653
656
|
removeScoped(disposed);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-subagent",
|
|
3
3
|
"description": "Model-facing subagent delegation tool over the ctx.subagents seam",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
],
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
40
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
44
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-jobs": "^0.1.6-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-settings": "^0.1.6-alpha.1",
|
|
51
51
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
58
59
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-scope": "^0.1.
|
|
64
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.
|
|
65
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
66
|
-
"@deepseek-ai/dsh-subagent
|
|
67
|
-
"@deepseek-ai/dsh-subagent": "^0.1.
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/dsh-jobs-local": "^0.1.
|
|
70
|
-
"@deepseek-ai/dsh-tool-jobs": "^0.1.
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
60
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
|
|
64
|
+
"@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
|
|
65
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.1",
|
|
66
|
+
"@deepseek-ai/dsh-settings": "^0.1.6-alpha.1",
|
|
67
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.1",
|
|
68
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.6-alpha.1",
|
|
69
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.1",
|
|
70
|
+
"@deepseek-ai/dsh-jobs-local": "^0.1.6-alpha.1",
|
|
71
|
+
"@deepseek-ai/dsh-tool-jobs": "^0.1.6-alpha.1",
|
|
72
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
|
|
73
|
+
"@deepseek-ai/dsh-jobs": "^0.1.6-alpha.1",
|
|
73
74
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
74
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
75
|
-
"@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.1"
|
|
75
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1"
|
|
76
76
|
}
|
|
77
77
|
}
|