@deepseek-ai/dsh-tool-subagent 0.1.6-alpha.2 → 0.1.7-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: a84e6c1ed62ccf15f7477a121c4fbae4d45276f6
6
- README.zh.md: 4345efbcecf845193231c7faebb992938e550abc
5
+ README.md: 2d5ace8de9c640784aaae6bf525db61941c9f724
6
+ README.zh.md: d4181caf32dd56ad849cd12b6461d440987c15b4
package/README.md CHANGED
@@ -129,7 +129,7 @@ Read these pages when the package-level contract is not enough; they move from t
129
129
 
130
130
  #### What the model sees
131
131
 
132
- The generated default [`subagent` schema](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent) under this instance's configured name while its provider exists. An enabled Session policy adds `provider`, `model`, and `reasoning_effort` plus inheritance and selection guidance; the provider must support `agentOptions`. Provider context inheritance changes the tool and prompt descriptions. Enabled background mode adds `run_in_background`: continuable mode documents its `true` default, runtime settlement notice, and explicit foreground override, while one-shot mode documents its `false` default and the job id collected with `job_output` or stopped with `job_kill`. While the tool is visible in an assembly's scope, a `tool:<toolName>` system-prompt section tells the model to start independent continuable delegations together, keep working while they run, and choose foreground only when its next action depends on the result; a tool restriction removes both its schema and this guidance.
132
+ The delegation description uses `running` and `inactive` for follow-up availability; `inactive` does not imply a task result. The generated default [`subagent` schema](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent) under this instance's configured name while its provider exists. An enabled Session policy adds `provider`, `model`, and `reasoning_effort` plus inheritance and selection guidance; the provider must support `agentOptions`. Provider context inheritance changes the tool and prompt descriptions. Enabled background mode adds `run_in_background`: continuable mode documents its `true` default, runtime settlement notice, and explicit foreground override, while one-shot mode documents its `false` default and the job id collected with `job_output` or stopped with `job_kill`. While the tool is visible in an assembly's scope, a `tool:<toolName>` system-prompt section tells the model to start independent continuable delegations together, keep working while they run, and choose foreground only when its next action depends on the result; a tool restriction removes both its schema and this guidance.
133
133
 
134
134
  #### Token effect
135
135
 
package/README.zh.md CHANGED
@@ -129,7 +129,7 @@ kind: "package-reference"
129
129
 
130
130
  #### 模型看到什么
131
131
 
132
- 当提供方存在时,以当前实例配置的名称公开已生成的默认 [`subagent` schema](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent)。启用的 Session 策略会添加 `provider`、`model` 与 `reasoning_effort`,以及继承和选择指引;提供方必须支持 `agentOptions`。提供方是否继承上下文会改变工具描述和提示词描述。启用后台模式会添加 `run_in_background`:可继续模式会记录其默认值为 `true`、运行时结算通知与显式前台覆盖;一次性模式会记录其默认值为 `false`,以及用 `job_output` 收集或用 `job_kill` 停止的 job id。当工具在本次组装的作用域中可见时,一个 `tool:<toolName>` 系统提示词 section 会指示模型同时启动相互独立的可继续委派、在它们运行时继续工作,并且仅当下一步动作依赖结果时选择前台;工具限制会同时移除其 schema 和这段指引。
132
+ 委派工具的描述使用 `running` 与 `inactive` 表达后续投递的可用状态;`inactive` 不表示任务结果。当提供方存在时,以当前实例配置的名称公开已生成的默认 [`subagent` schema](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent)。启用的 Session 策略会添加 `provider`、`model` 与 `reasoning_effort`,以及继承和选择指引;提供方必须支持 `agentOptions`。提供方是否继承上下文会改变工具描述和提示词描述。启用后台模式会添加 `run_in_background`:可继续模式会记录其默认值为 `true`、运行时结算通知与显式前台覆盖;一次性模式会记录其默认值为 `false`,以及用 `job_output` 收集或用 `job_kill` 停止的 job id。当工具在本次组装的作用域中可见时,一个 `tool:<toolName>` 系统提示词 section 会指示模型同时启动相互独立的可继续委派、在它们运行时继续工作,并且仅当下一步动作依赖结果时选择前台;工具限制会同时移除其 schema 和这段指引。
133
133
 
134
134
  #### Token 影响
135
135
 
package/lib/index.js CHANGED
@@ -397,7 +397,7 @@ function apply(ctx, config, session) {
397
397
  subagentProvider,
398
398
  disposeTool: runtimeCtx.tools.register(defineTool({
399
399
  name: toolName,
400
- 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,
400
+ 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 or resumes a turn while it is inactive. 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,
401
401
  parameters: {
402
402
  description: {
403
403
  type: "string",
@@ -538,7 +538,7 @@ function apply(ctx, config, session) {
538
538
  jobId: jobs.start({
539
539
  kind: "subagent",
540
540
  label: args.description,
541
- owner: parent,
541
+ owner: parent.id,
542
542
  run: () => {
543
543
  const controller = new AbortController();
544
544
  return {
@@ -37,58 +37,32 @@ function assertAllowedModelRoutes(routes) {
37
37
  }
38
38
  //#endregion
39
39
  //#region lib/types/model-selection-settings.js
40
- /** Host-owned opt-in setting for model-selectable subagent delegation. */
41
- /** User-settings section for model-selectable subagent delegation. */
42
- const SUBAGENT_MODEL_SELECTION_SETTINGS_NAMESPACE = "subagent-model-selection";
43
- /** Schema served to settings clients for the opt-in preference. */
44
- const SUBAGENT_MODEL_SELECTION_SETTINGS_SCHEMA = z.object({
45
- enabled: z.boolean().default(false),
46
- allowedModels: z.array(AllowedModelRouteSchema).default([])
47
- });
48
40
  /** Singleton settings owner read when delegation tools are composed for a Session. */
49
41
  var SubagentModelSelectionConfig = class extends Service {
42
+ config;
50
43
  static Config = z.object({
51
- enabled: z.boolean().default(false),
52
- allowedModels: z.array(AllowedModelRouteSchema).default([])
44
+ enabled: z.boolean().default(false).volatile(),
45
+ allowedModels: z.array(AllowedModelRouteSchema).default([]).volatile()
53
46
  });
54
- source;
55
- constructor(ctx, config = {}) {
47
+ constructor(ctx, config) {
56
48
  super(ctx, "subagentModelSelection");
57
- /* v8 ignore next */
58
- const entry = {
59
- enabled: config.enabled ?? false,
60
- allowedModels: config.allowedModels ?? []
61
- };
62
- this.validate(entry);
63
- this.source = () => entry;
64
- ctx.inject(["settings"], (settingsCtx) => {
65
- settingsCtx.settings.installSection(ctx, SUBAGENT_MODEL_SELECTION_SETTINGS_NAMESPACE, SUBAGENT_MODEL_SELECTION_SETTINGS_SCHEMA, entry, {
66
- setSource: (source) => {
67
- this.source = source;
68
- },
69
- validate: (value) => {
70
- this.validate(value);
71
- },
72
- onChange: () => {}
73
- });
74
- });
49
+ this.config = config;
75
50
  }
76
51
  /**
77
52
  * Read a detached selection preference for the next eligible Session composition.
78
53
  * @returns the enabled state and exact allowed routes.
79
54
  */
80
55
  current() {
81
- const current = this.source();
56
+ const enabled = this.config.enabled.get();
57
+ const allowedModels = this.config.allowedModels.get();
58
+ assertAllowedModelRoutes(allowedModels);
59
+ if (enabled && allowedModels.length === 0) throw new Error("enabled subagent model selection requires at least one allowed model");
82
60
  return {
83
- enabled: current.enabled,
84
- allowedModels: current.allowedModels.map((route) => ({ ...route }))
61
+ enabled,
62
+ allowedModels: allowedModels.map((route) => ({ ...route }))
85
63
  };
86
64
  }
87
- validate(value) {
88
- assertAllowedModelRoutes(value.allowedModels);
89
- if (value.enabled && value.allowedModels.length === 0) throw new Error("enabled subagent model selection requires at least one allowed model");
90
- }
91
65
  };
92
66
  const name = "subagent-model-selection-settings";
93
67
  //#endregion
94
- export { SUBAGENT_MODEL_SELECTION_SETTINGS_NAMESPACE, SUBAGENT_MODEL_SELECTION_SETTINGS_SCHEMA, SubagentModelSelectionConfig, SubagentModelSelectionConfig as default, name };
68
+ export { SubagentModelSelectionConfig, SubagentModelSelectionConfig as default, name };
@@ -1,4 +1,5 @@
1
1
  /** Host-owned opt-in setting for model-selectable subagent delegation. */
2
+ import type { Volatile } from '@deepseek-ai/cordis';
2
3
  import { Context, Service } from '@deepseek-ai/cordis';
3
4
  import z from '@deepseek-ai/schemastery';
4
5
  import { type AllowedModelRoute } from './model-selection.ts';
@@ -8,8 +9,6 @@ declare module '@deepseek-ai/cordis' {
8
9
  subagentModelSelection: SubagentModelSelectionConfig;
9
10
  }
10
11
  }
11
- /** User-settings section for model-selectable subagent delegation. */
12
- export declare const SUBAGENT_MODEL_SELECTION_SETTINGS_NAMESPACE = "subagent-model-selection";
13
12
  /** Stored user preference; the shipped composition defaults it off. */
14
13
  export interface SubagentModelSelectionSettings {
15
14
  /** Whether newly composed top-level Sessions receive model selection. */
@@ -17,26 +16,29 @@ export interface SubagentModelSelectionSettings {
17
16
  /** Exact child LLM routes offered to newly composed top-level Sessions. */
18
17
  allowedModels: AllowedModelRoute[];
19
18
  }
20
- /** Schema served to settings clients for the opt-in preference. */
21
- export declare const SUBAGENT_MODEL_SELECTION_SETTINGS_SCHEMA: z<SubagentModelSelectionSettings>;
22
19
  /** Optional deployment base for the preference. */
23
20
  export interface Config {
24
21
  /** Initial enabled state inherited when the user document does not override it. */
25
- enabled?: boolean;
22
+ enabled: Volatile<boolean>;
26
23
  /** Initial route list inherited when the user document does not override it. */
27
- allowedModels?: AllowedModelRoute[];
24
+ allowedModels: Volatile<AllowedModelRoute[]>;
28
25
  }
29
26
  /** Singleton settings owner read when delegation tools are composed for a Session. */
30
27
  export declare class SubagentModelSelectionConfig extends Service {
31
- static Config: z<Config>;
32
- private source;
33
- constructor(ctx: Context, config?: Config);
28
+ private config;
29
+ static Config: z<Schemastery.ObjectS<NoInfer<{
30
+ enabled: z<boolean, boolean, "volatile-defined">;
31
+ allowedModels: z<NoInfer<AllowedModelRoute[]>, NoInfer<AllowedModelRoute[]>, "volatile-defined">;
32
+ }>>, Schemastery.ObjectT<NoInfer<{
33
+ enabled: z<boolean, boolean, "volatile-defined">;
34
+ allowedModels: z<NoInfer<AllowedModelRoute[]>, NoInfer<AllowedModelRoute[]>, "volatile-defined">;
35
+ }>>, "plain">;
36
+ constructor(ctx: Context, config: Config);
34
37
  /**
35
38
  * Read a detached selection preference for the next eligible Session composition.
36
39
  * @returns the enabled state and exact allowed routes.
37
40
  */
38
41
  current(): SubagentModelSelectionSettings;
39
- private validate;
40
42
  }
41
43
  export declare const name = "subagent-model-selection-settings";
42
44
  export default SubagentModelSelectionConfig;
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.2",
4
+ "version": "0.1.7-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,41 +37,39 @@
37
37
  ],
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
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"
40
+ "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
41
+ "@deepseek-ai/dsh-invariants": "0.1.7-alpha.2",
42
+ "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
43
+ "@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
44
+ "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
45
+ "@deepseek-ai/dsh-subagent": "0.1.7-alpha.2",
46
+ "@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.2",
47
+ "@deepseek-ai/dsh-jobs": "0.1.7-alpha.2",
48
+ "@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
49
+ "@deepseek-ai/cordis": "~4.0.4",
50
+ "@deepseek-ai/dsh-scope": "0.1.7-alpha.2"
52
51
  },
53
52
  "dependencies": {
54
53
  "zod": "^4.4.3",
55
- "@deepseek-ai/schemastery": "^3.18.2"
54
+ "@deepseek-ai/schemastery": "~3.18.4"
56
55
  },
57
56
  "devDependencies": {
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",
62
- "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
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
- "@deepseek-ai/cordis": "^4.0.2",
75
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2"
57
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.5",
58
+ "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
59
+ "@deepseek-ai/dsh-invariants": "0.1.7-alpha.2",
60
+ "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
61
+ "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
62
+ "@deepseek-ai/dsh-session-persistence": "0.1.7-alpha.2",
63
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.7-alpha.2",
64
+ "@deepseek-ai/dsh-scope": "0.1.7-alpha.2",
65
+ "@deepseek-ai/dsh-subagent": "0.1.7-alpha.2",
66
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.7-alpha.2",
67
+ "@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.2",
68
+ "@deepseek-ai/dsh-jobs-local": "0.1.7-alpha.2",
69
+ "@deepseek-ai/dsh-jobs": "0.1.7-alpha.2",
70
+ "@deepseek-ai/dsh-tool-jobs": "0.1.7-alpha.2",
71
+ "@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
72
+ "@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
73
+ "@deepseek-ai/cordis": "~4.0.4"
76
74
  }
77
75
  }