@deepseek-ai/dsh-tool-subagent 0.1.2-alpha.2 → 0.1.2-alpha.4
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 +1 -2
- package/README.zh.md +1 -2
- package/lib/index.js +4 -2
- package/lib/types/index.d.ts +0 -1
- 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: 4b1f30fd14bd7c8b67e27a9d17e818b79d7f2b84
|
|
6
|
+
README.zh.md: a0e0d15f43ab8a527b61b6675e1a47d5435f2bed
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Under `continuable` policy, an omitted or `true` `run_in_background` starts a du
|
|
|
64
64
|
|
|
65
65
|
### Selecting a child LLM
|
|
66
66
|
|
|
67
|
-
Set `modelSelectionSettings: true` to sample the Host's `subagent-model-selection` preference when each top-level Session is composed. When enabled,
|
|
67
|
+
Set `modelSelectionSettings: true` to sample the Host's `subagent-model-selection` preference when each fresh top-level Session is composed. A restored Session without a recorded policy remains disabled, including an explicitly empty restore. When enabled, the non-empty exact provider/model route list is recorded in the Session, inherited by child Sessions, and unchanged by later settings edits. The tool then exposes optional `provider`, `model`, and `reasoning_effort` fields and registers the shared `list_subagent_models` tool. This mode requires a backend that advertises `agentOptions`; both in-process backends and DSH SDK support it, while ACP, Codex, and Claude Code reject it rather than ignore it.
|
|
68
68
|
|
|
69
69
|
A call supplies `provider` and `model` together, or supplies only an effort when configured, parent, or provider-owned defaults provide the route. Static `provider.agentRouteDefaults`, when present, form the provider/model baseline; tool configuration and model fields overlay it before route-aware effort merging and exact-route preflight. Providers without these defaults use compatible values from the parent's latest logged request, then the parent's creation options before its first request, while retaining the configured `maxTokens`. Changing the route without an explicit effort clears the inherited route-owned effort, so the selected model resolves its default. The live LLM adapter validates the effective route before child creation. Catalog membership remains advisory, so a model can use an unlisted id when its adapter accepts it.
|
|
70
70
|
|
|
@@ -115,7 +115,6 @@ Read these pages when the package-level contract is not enough; they move from t
|
|
|
115
115
|
|
|
116
116
|
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — providers, one-shot start requests, continuable children and activations.
|
|
117
117
|
- [dsh-tool-subagent-control](../tool-subagent-control/README.md) — messaging, interrupt, and listing tools for continuable children.
|
|
118
|
-
- [dsh-tool-subagent-report](../tool-subagent-report/README.md) — the child-to-parent report channel.
|
|
119
118
|
- [Generated tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent) — the default schema and per-mode wording.
|
|
120
119
|
- [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-tool-subagent) — every accepted config field.
|
|
121
120
|
- [Background subagent tasks](../../../.agents/notes/implemented/feature/2026-07-08-background-subagent-tasks.md) — the one-shot background route.
|
package/README.zh.md
CHANGED
|
@@ -64,7 +64,7 @@ kind: "package-reference"
|
|
|
64
64
|
|
|
65
65
|
### 选择子级 LLM
|
|
66
66
|
|
|
67
|
-
设置 `modelSelectionSettings: true
|
|
67
|
+
设置 `modelSelectionSettings: true`,即可在组合每个全新顶层 Session 时读取宿主的 `subagent-model-selection` 偏好。没有已记录策略的恢复 Session 会保持禁用,包括显式为空的恢复。启用后,非空的精确 provider/model 路由列表会记录进 Session、由子 Session 继承,后续设置编辑不会改变它。工具随后公开可选的 `provider`、`model` 与 `reasoning_effort` 字段,并注册共享的 `list_subagent_models` 工具。此模式要求后端声明 `agentOptions`;两个进程内后端和 DSH SDK 支持该能力,而 ACP、Codex 与 Claude Code 会拒绝它,而不是忽略它。
|
|
68
68
|
|
|
69
69
|
一次调用需同时提供 `provider` 与 `model`;当配置值、父 agent 值或提供方持有的默认值能提供路由时,也可只提供推理等级。静态的 `provider.agentRouteDefaults` 在存在时构成提供方/模型基线;工具配置与模型字段会在路由相关强度合并和确切路由预检前覆盖它。没有这些默认值的提供方会使用父 agent 最新已记录请求中的兼容值,再使用父级首次请求前的创建选项,并保留配置的 `maxTokens`。更改路由但未显式提供推理等级时,会清除继承的路由自有等级,使所选模型解析自己的默认值。实时 LLM 适配器在创建子 agent 前校验有效路由。目录成员资格只提供建议,因此适配器接受时,模型可以使用未列出的 id。
|
|
70
70
|
|
|
@@ -115,7 +115,6 @@ kind: "package-reference"
|
|
|
115
115
|
|
|
116
116
|
- [Subagent 子系统](../../../docs/subsystems/subagent.zh.md)——提供方、一次性启动请求、可继续子 agent 与 Activation。
|
|
117
117
|
- [dsh-tool-subagent-control](../tool-subagent-control/README.zh.md)——可继续子 agent 的消息、中断与列表工具。
|
|
118
|
-
- [dsh-tool-subagent-report](../tool-subagent-report/README.zh.md)——子到父的上报通道。
|
|
119
118
|
- [生成工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent)——默认 schema 与各模式的措辞。
|
|
120
119
|
- [生成配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-tool-subagent)——每个受支持配置字段。
|
|
121
120
|
- [后台 subagent 任务](../../../.agents/notes/implemented/feature/2026-07-08-background-subagent-tasks.zh.md)——一次性后台路由。
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { scopeChainOf, scopeOf } from "@deepseek-ai/dsh-scope";
|
|
3
3
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
|
+
import { SessionSeq } from "@deepseek-ai/dsh-session";
|
|
4
5
|
import { assertSubagentMaxDepth, parentAgentOptionsForDelegation, settleRun } from "@deepseek-ai/dsh-subagent";
|
|
5
6
|
import { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
|
|
6
7
|
import { z as z$1 } from "zod";
|
|
@@ -390,7 +391,7 @@ function apply(ctx, config) {
|
|
|
390
391
|
subagentProvider,
|
|
391
392
|
disposeTool: runtimeCtx.tools.register(defineTool({
|
|
392
393
|
name: toolName,
|
|
393
|
-
description: wording.description + (backgroundEnabled ? continuable ? " This tool runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` starts a
|
|
394
|
+
description: wording.description + (backgroundEnabled ? continuable ? " This tool runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` steers the child's nearest step while it is running and starts a turn while it is idle. Set `run_in_background: false` only when your next action depends on receiving the result." : " This call waits for the result by default. Set `run_in_background: true` to return a job id; collect with `job_output` and stop with `job_kill`." : " This call waits for the subagent and returns its result.") + choiceDescription,
|
|
394
395
|
parameters: {
|
|
395
396
|
description: {
|
|
396
397
|
type: "string",
|
|
@@ -581,13 +582,14 @@ function apply(ctx, config) {
|
|
|
581
582
|
const compositionScope = scopeOf(ctx);
|
|
582
583
|
if (compositionScope === void 0) throw new Error("tool-subagent: `modelSelectionSettings` requires an Agent or preset scope");
|
|
583
584
|
const selectForAgent = (agent) => {
|
|
585
|
+
const freshSession = agent.session.firstLiveSeq === 0 && agent.session.eventAt(SessionSeq(0))?.type !== "session/end-seed";
|
|
584
586
|
let allowedModels = subagentModelSelectionPolicy(ctx.sessionProjections, agent.session);
|
|
585
587
|
if (allowedModels === void 0) {
|
|
586
588
|
const parentId = agent.session.header.origin === "subagent" ? agent.session.header.parentSession : void 0;
|
|
587
589
|
if (parentId !== void 0) {
|
|
588
590
|
const parent = ctx.get("agents")?.get(parentId);
|
|
589
591
|
allowedModels = parent === void 0 ? void 0 : subagentModelSelectionPolicy(ctx.sessionProjections, parent.session);
|
|
590
|
-
} else if (
|
|
592
|
+
} else if (freshSession) {
|
|
591
593
|
const current = settings.current();
|
|
592
594
|
allowedModels = current.enabled ? current.allowedModels : void 0;
|
|
593
595
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import z from '@deepseek-ai/schemastery';
|
|
|
12
12
|
import type { AgentOptions } from '@deepseek-ai/dsh-agent';
|
|
13
13
|
export declare const name = "tool-subagent";
|
|
14
14
|
export declare const inject: string[];
|
|
15
|
-
/** Prompt order after bounded delegation policy and before child reporting. */
|
|
16
15
|
/** Config: which registered provider this tool delegates to, plus child defaults. */
|
|
17
16
|
export interface Config {
|
|
18
17
|
/** The `ctx.subagents` provider name to start runs on (e.g. `spawn`, `acp`). */
|
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.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
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-session": "^0.1.2-alpha.
|
|
44
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.
|
|
45
|
-
"@deepseek-ai/dsh-scope": "^0.1.2-alpha.
|
|
46
|
-
"@deepseek-ai/dsh-settings": "^0.1.2-alpha.
|
|
47
|
-
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.
|
|
40
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
41
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.4",
|
|
42
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
43
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
44
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-scope": "^0.1.2-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-alpha.4",
|
|
47
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
48
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
|
|
49
|
+
"@deepseek-ai/dsh-jobs": "^0.1.2-alpha.4",
|
|
50
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
|
|
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.2-alpha.2",
|
|
59
58
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-scope": "^0.1.2-alpha.
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
59
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
60
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
61
|
+
"@deepseek-ai/dsh-scope": "^0.1.2-alpha.4",
|
|
62
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.4",
|
|
63
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.2-alpha.4",
|
|
64
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
65
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-alpha.4",
|
|
66
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-alpha.4",
|
|
67
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
68
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.2-alpha.4",
|
|
69
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
|
|
70
|
+
"@deepseek-ai/dsh-jobs": "^0.1.2-alpha.4",
|
|
71
|
+
"@deepseek-ai/dsh-jobs-local": "^0.1.2-alpha.4",
|
|
72
|
+
"@deepseek-ai/dsh-tool-jobs": "^0.1.2-alpha.4",
|
|
73
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
|
|
74
74
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
75
|
-
"@deepseek-ai/dsh-
|
|
75
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4"
|
|
76
76
|
}
|
|
77
77
|
}
|