@deepseek-ai/dsh-tool-subagent 0.1.6-alpha.1 → 0.1.6-alpha.2

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 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: f2d9eb3a44d84130caca8e29bbe0546e24a76b34
6
- README.zh.md: 312856983f0e25cd6eb8e508f4c7b9e9db361044
5
+ README.md: a84e6c1ed62ccf15f7477a121c4fbae4d45276f6
6
+ README.zh.md: 4345efbcecf845193231c7faebb992938e550abc
package/README.md CHANGED
@@ -50,7 +50,7 @@ Load the subagent service, an in-process or remote backend, and this tool; then
50
50
  | `agentOptions` | — | Configured child `provider`, `model`, adapter-owned `reasoningEffort`, and positive `maxTokens` defaults; requires provider `agentOptions` support and overlays any provider-owned route defaults |
51
51
  | `persona` | — | Per-child persona; requires the provider's `persona` capability |
52
52
  | `toolFilter` | — | Per-child global-tool restriction; requires the `toolFilter` capability |
53
- | `maxDepth` | `3` | Absolute delegation-depth cap (`0` forbids delegation); `'provider-managed'` sends no cap to an out-of-process provider |
53
+ | `maxDepth` | Host setting (`1`) | Absolute delegation-depth cap (`0` forbids delegation); `'provider-managed'` sends no cap to an out-of-process provider |
54
54
 
55
55
  The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-tool-subagent) is the exhaustive source for every accepted field and its JSDoc.
56
56
 
@@ -60,7 +60,7 @@ Under `one-shot` policy, an omitted `run_in_background` waits in the foreground
60
60
 
61
61
  Under `continuable` policy, an omitted or `true` `run_in_background` starts a durable child and returns `started subagent <childId>` without waiting for a result; the runtime delivers one settlement notice when the child's Activation ends, and the optional `send_message` tool sends it more work. Set `run_in_background: false` to wait for the result in the foreground.
62
62
 
63
- `maxDepth` caps recursion (default `3`; `0` forbids delegation) and requires a provider with the `depthLimit` capability; `'provider-managed'` leaves the budget to an out-of-process provider. `persona` and `toolFilter` configure every child when the provider supports them, and the tool stays visible at the cap — each attempted start checks the calling agent's current depth and rejects with an errored result.
63
+ `maxDepth` caps recursion (`0` forbids delegation); omission reads the current Host `subagent.maxDepth` setting, initially `1`, at each delegation. A numeric depth requires a provider with the `depthLimit` capability; `'provider-managed'` leaves the budget to an out-of-process provider. `persona` and `toolFilter` configure every child when the provider supports them, and the tool stays visible at the cap — each attempted start checks the calling agent's current depth and rejects with an errored result.
64
64
 
65
65
  ### Selecting a child LLM
66
66
 
package/README.zh.md CHANGED
@@ -50,7 +50,7 @@ kind: "package-reference"
50
50
  | `agentOptions` | — | 配置的子级 `provider`、`model`、适配器所有的 `reasoningEffort` 与正整数 `maxTokens` 默认值;要求提供方支持 `agentOptions`,并会覆盖提供方持有的路由默认值 |
51
51
  | `persona` | — | 每个子 agent 独立的 persona;要求提供方具备 `persona` 能力 |
52
52
  | `toolFilter` | — | 每个子 agent 独立的全局工具限制;要求提供方具备 `toolFilter` 能力 |
53
- | `maxDepth` | `3` | 绝对委派深度上限(`0` 禁止委派);`'provider-managed'` 不向进程外提供方发送上限 |
53
+ | `maxDepth` | Host 设置(`1`) | 绝对委派深度上限(`0` 禁止委派);`'provider-managed'` 不向进程外提供方发送上限 |
54
54
 
55
55
  生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-tool-subagent)是每个受支持字段及其 JSDoc 的穷尽式真源。
56
56
 
@@ -60,7 +60,7 @@ kind: "package-reference"
60
60
 
61
61
  `continuable` 策略下,省略或为 `true` 的 `run_in_background` 会启动一个持久化子 agent,并返回 `started subagent <childId>`,不等待结果;子 agent 的 Activation 结束时,运行时投递一条结算通知,可选的 `send_message` 工具会向它发送更多工作。把 `run_in_background` 设为 `false` 可在前台等待结果。
62
62
 
63
- `maxDepth` 限制递归深度(默认 `3`;`0` 禁止委派),并要求提供方具备 `depthLimit` 能力;`'provider-managed'` 把预算留给进程外提供方。当提供方支持时,`persona` 与 `toolFilter` 会配置每个子 agent;工具在达到上限时仍然可见——每次尝试启动都会检查调用 agent 的当前深度,被拒绝时返回出错的工具结果。
63
+ `maxDepth` 限制递归深度(`0` 禁止委派);省略时,每次委派读取 Host 当前的 `subagent.maxDepth` 设置,初始值为 `1`。数值深度要求提供方具备 `depthLimit` 能力;`'provider-managed'` 把预算留给进程外提供方。当提供方支持时,`persona` 与 `toolFilter` 会配置每个子 agent;工具在达到上限时仍然可见——每次尝试启动都会检查调用 agent 的当前深度,被拒绝时返回出错的工具结果。
64
64
 
65
65
  ### 选择子级 LLM
66
66
 
package/lib/index.js CHANGED
@@ -266,7 +266,7 @@ const Config = z.object({
266
266
  allow: z.array(z.string()).default(void 0),
267
267
  deny: z.array(z.string()).default(void 0)
268
268
  }).default(void 0),
269
- maxDepth: z.union([z.natural().max(Number.MAX_SAFE_INTEGER), z.const("provider-managed")]).default(3)
269
+ maxDepth: z.union([z.natural().max(Number.MAX_SAFE_INTEGER), z.const("provider-managed")])
270
270
  });
271
271
  /** Render text blocks from the canonical JSON block array without trusting arbitrary values. */
272
272
  function outputValueText(values) {
@@ -374,7 +374,7 @@ function apply(ctx, config, session) {
374
374
  const modelSelectionCapable = config.modelSelectionSettings === true;
375
375
  ctx.sessionProjections.register(subagentModelSelectionProjectionDefinition);
376
376
  const assertSubagentProviderConfiguration = (subagentProvider) => {
377
- if (typeof config.maxDepth === "number" && !subagentProvider.capabilities.depthLimit) throw new Error(`tool-subagent: provider "${subagentProvider.name}" cannot enforce maxDepth (no depthLimit capability) — set maxDepth: 'provider-managed' to leave the recursion budget to the provider`);
377
+ if (ctx.subagents.resolveMaxDepth(config.maxDepth) !== void 0 && !subagentProvider.capabilities.depthLimit) throw new Error(`tool-subagent: provider "${subagentProvider.name}" cannot enforce maxDepth (no depthLimit capability) — set maxDepth: 'provider-managed' to leave the recursion budget to the provider`);
378
378
  if (config.agentOptions !== void 0 && !subagentProvider.capabilities.agentOptions) throw new Error(`tool-subagent: provider "${subagentProvider.name}" does not support child agentOptions`);
379
379
  if (modelSelectionCapable && !subagentProvider.capabilities.agentOptions) throw new Error(`tool-subagent: provider "${subagentProvider.name}" does not support child model selection`);
380
380
  if (continuable && subagentProvider.prepareContinuable === void 0) throw new Error(`tool-subagent: provider "${subagentProvider.name}" does not support \`backgroundMode: continuable\``);
@@ -505,7 +505,7 @@ function apply(ctx, config, session) {
505
505
  if (runtimeCtx.subagents.getProvider(config.provider) !== subagentProvider) throw new Error(`subagent provider "${config.provider}" changed while resolving the child LLM route; retry the delegation`);
506
506
  }
507
507
  exec.signal.throwIfAborted();
508
- const maxDepth = typeof config.maxDepth === "number" ? config.maxDepth : void 0;
508
+ const maxDepth = runtimeCtx.subagents.resolveMaxDepth(config.maxDepth);
509
509
  const request = {
510
510
  label: args.description,
511
511
  prompt: [{
@@ -60,13 +60,14 @@ export interface Config {
60
60
  deny?: string[];
61
61
  };
62
62
  /**
63
- * Maximum child depth: a non-negative safe integer (default `3`; `0` forbids
64
- * delegation entirely), or `'provider-managed'` to send no cap. A numeric cap
63
+ * Maximum child depth: a non-negative safe integer (`0` forbids delegation),
64
+ * or `'provider-managed'` to send no cap. A numeric cap
65
65
  * requires the provider's `depthLimit` capability (mount fails loud
66
66
  * otherwise). The provider checks the calling agent's current depth at every
67
67
  * start; the tool remains model-visible so runtime policy owns rejection.
68
68
  * `'provider-managed'` is for an out-of-process provider whose recursion
69
- * budget belongs to the child runtime or its own deployment.
69
+ * budget belongs to the child runtime or its own deployment. Omission reads
70
+ * the current Host subagent depth setting (default `1`) at each delegation.
70
71
  */
71
72
  maxDepth?: number | 'provider-managed';
72
73
  }
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.6-alpha.1",
4
+ "version": "0.1.6-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,41 +37,41 @@
37
37
  ],
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
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
- "@deepseek-ai/cordis": "^4.0.2"
40
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
41
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
42
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
43
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
44
+ "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
45
+ "@deepseek-ai/dsh-settings": "^0.1.6-alpha.2",
46
+ "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
47
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
48
+ "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.2",
49
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
50
+ "@deepseek-ai/cordis": "^4.0.2",
51
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.2"
52
52
  },
53
53
  "dependencies": {
54
54
  "zod": "^4.4.3",
55
55
  "@deepseek-ai/schemastery": "^3.18.2"
56
56
  },
57
57
  "devDependencies": {
58
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
58
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
59
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
60
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
61
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
59
62
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
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",
63
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.2",
64
+ "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.2",
65
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
66
+ "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
67
+ "@deepseek-ai/dsh-settings": "^0.1.6-alpha.2",
68
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.6-alpha.2",
69
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
70
+ "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.2",
71
+ "@deepseek-ai/dsh-jobs-local": "^0.1.6-alpha.2",
72
+ "@deepseek-ai/dsh-tool-jobs": "^0.1.6-alpha.2",
73
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
74
74
  "@deepseek-ai/cordis": "^4.0.2",
75
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1"
75
+ "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2"
76
76
  }
77
77
  }