@deepseek-ai/dsh-subagent-fork-in-process 0.2.1-alpha.2 → 0.2.1-alpha.3

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
@@ -39,8 +39,8 @@
39
39
  en: f1f45255fd9f71c1
40
40
  zh: 9a3f016b8fe9754a
41
41
  /deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/run-flow:
42
- en: ef063b5c5542e129
43
- zh: ba564c6b92453b44
42
+ en: cca92ec964b4314b
43
+ zh: edd8ecd4b59dbe8f
44
44
  /deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/lifecycle-binding:
45
45
  en: 8dad0155ed1b32d2
46
46
  zh: f4d82d5ede03c4d7
@@ -54,14 +54,14 @@
54
54
  en: 91a5bd22001586e9
55
55
  zh: 456e5bf20881a70d
56
56
  /deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/what-the-model-sees:
57
- en: fe88f3e65bb01009
58
- zh: 64e05acfe80e81f3
57
+ en: d4d51c5937bab67c
58
+ zh: e7c07b5a38d68d8e
59
59
  /deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/token-effect:
60
- en: db9ae2edb5ee28ce
61
- zh: 5a342ffa3e7a7b40
60
+ en: 19b588baaa87126b
61
+ zh: 7010e93bbe7d71ba
62
62
  /deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/kv-cache-effect:
63
- en: 63138e06a9c24fa0
64
- zh: dca65fe91ff3534b
63
+ en: 1e8f8bbab3052b39
64
+ zh: 1efff4da78d60ef9
65
65
  /deepseek-ai-dsh-subagent-fork-in-process/model-experience/parent-tool-result-indirectly:
66
66
  en: 75d061c2151624a7
67
67
  zh: 71e58e020b60ff90
@@ -75,8 +75,8 @@
75
75
  en: f5d5f97a153f7c70
76
76
  zh: 3d6bc05b9eadfbc2
77
77
  /deepseek-ai-dsh-subagent-fork-in-process/known-limitations-and-deferred-work:
78
- en: 6b8bc8825865e662
79
- zh: 02e075e302d02fb6
78
+ en: 193d3fea02c7ec47
79
+ zh: 8a616bcfb97a99c1
80
80
  /deepseek-ai-dsh-subagent-fork-in-process/known-limitations-and-deferred-work/dev-note:
81
81
  en: e67f633dc6fe7773
82
82
  zh: 3bb0c20c93f16f98
package/README.md CHANGED
@@ -79,7 +79,7 @@ This backend supplies the balanced completed-turn prefix of the parent log as th
79
79
 
80
80
  ### Run flow
81
81
 
82
- `prepareContinuable()` captures the parent’s completed-turn prefix once at creation. `startActivation()` creates the child with that seed, and the subagent service applies persona, tool filtering, and structured output for this activation. The provider advertises the same agent options, output, depth, filter, and persona capabilities as spawn.
82
+ `prepareContinuable()` captures the parent’s completed-turn prefix once at creation. `startActivation()` creates the child with that seed, and the subagent service composes the inherited preset and optional structured output. The provider advertises agent options, output, and depth capabilities; independent preset selection is unsupported.
83
83
 
84
84
  ### Lifecycle binding
85
85
 
@@ -109,15 +109,15 @@ Read these pages when the package-level contract is not enough; they move from t
109
109
 
110
110
  #### What the model sees
111
111
 
112
- The child receives the parent's balanced completed-turn prefix, then the new task content verbatim. A configured persona shadows prompt text in the child's fresh scope; a tool restriction filters its global wire schemas, executable lookup, and PTC mode SDK bindings but not standalone guidance. The parent's tool view and authority are not inherited; an optional structured-output request adds a child-only contract; the parent's current in-flight turn is excluded.
112
+ The child receives the parent's balanced completed-turn prefix, then the new task content verbatim. It joins the parent's preset revision, which supplies persona and tools. Parent agent-local restrictions are not copied. An optional structured-output request adds a child-only tool; the parent's current in-flight turn is excluded.
113
113
 
114
114
  #### Token effect
115
115
 
116
- Forking duplicates retained completed history into the child's request, which then accumulates its own tokens independently. A persona changes repeated prompt cost; filtering changes schema or generated SDK cost; a first-turn fork has no inherited history.
116
+ Forking duplicates retained completed history into the child's request, which then accumulates its own tokens independently. A first-turn fork has no inherited history.
117
117
 
118
118
  #### KV Cache effect
119
119
 
120
- The child may reuse the inherited byte-identical prefix under the same provider and model. Persona, tool-filter, generated-SDK, or route changes may invalidate reuse before inherited history; later child history is append-only. Continuable messaging adds no child-only system-prompt section or tool schema; the parent id and return guidance follow inherited history in the initial user task ([cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md)).
120
+ The child may reuse the inherited byte-identical prefix under the same provider and model. Structured output, generated-SDK, route changes, or historical descriptor overrides on cold resume can invalidate reuse before inherited history; later child history is append-only. Continuable messaging adds no child-only system-prompt section or tool schema; the parent id and return guidance follow inherited history in the initial user task ([cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md)).
121
121
 
122
122
  ### Parent tool result, indirectly
123
123
 
@@ -141,7 +141,7 @@ Append-only; newly visible content follows the reusable request prefix and does
141
141
  These limits define when the backend is the wrong choice; they are current package constraints.
142
142
 
143
143
  - **The seed is a one-time snapshot** — the child sees the parent's completed turns as of the fork and nothing the parent logs afterwards; there is no live context sharing.
144
- - **Prefix reuse depends on matching request inputs** — parent and child messaging definitions match byte for byte; explicit persona, tool filtering, generated-SDK, or route changes can still break equality. Rationale: the [cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md).
144
+ - **Prefix reuse depends on matching request inputs** — parent and child messaging definitions match byte for byte; structured output, generated-SDK, route changes, or restored historical overrides can still break equality. Rationale: the [cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md).
145
145
  - **Shipped fork tools do not expose child LLM route selection** — they inherit the parent's provider and model so the copied history remains eligible for KV Cache reuse. Route selection stays disabled until a change can preserve reuse or expose a bounded recomputation cost.
146
146
 
147
147
  <a id="dev-note"></a>
package/README.zh.md CHANGED
@@ -79,7 +79,7 @@ kind: "package-reference"
79
79
 
80
80
  ### 运行流程
81
81
 
82
- `prepareContinuable()` 在创建时捕获一次父级已完成轮次前缀。`startActivation()` 以此创建子 agent,并由 subagent 服务应用 persona、工具过滤与本次 activation 的结构化输出设置。提供方声明与 spawn 相同的 `agentOptions`、输出、深度、过滤及 persona 能力。
82
+ `prepareContinuable()` 在创建时捕获一次父级已完成轮次前缀。`startActivation()` 以此创建子 agent,由 subagent 服务组装继承的 preset 和可选的结构化输出。提供方声明 agent 选项、输出及深度能力;不支持独立选择 preset。
83
83
 
84
84
  ### 生命周期绑定
85
85
 
@@ -109,15 +109,15 @@ kind: "package-reference"
109
109
 
110
110
  #### 模型看到什么
111
111
 
112
- 子 agent 先接收由父级已配平的已完成轮次构成的前缀,再逐字接收新的任务内容。配置的 persona 会在子 agent 的全新作用域中遮蔽提示词文本;工具限制会过滤其全局协议 schema、可执行工具查找与 PTC mode SDK 绑定,但不影响独立指导内容。父级的工具视图与权限不会被继承;可选的结构化输出请求会添加仅属于子 agent 的约定;父级当前进行中的轮次会被排除。
112
+ 子 agent 先接收由父级已配平的已完成轮次构成的前缀,再逐字接收新的任务内容。它加入父级的 preset 代际,由 preset 提供 persona 和工具。父级 agent 局部限制不会被复制。可选的结构化输出请求会添加仅属于子 agent 的工具;父级当前进行中的轮次会被排除。
113
113
 
114
114
  #### Token 影响
115
115
 
116
- fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent 随后独立累积自己的 token。persona 会改变重复提示词的成本;过滤会改变 schema 或生成 SDK 的成本;首轮 fork 没有继承历史。
116
+ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent 随后独立累积自己的 token。首轮 fork 没有继承历史。
117
117
 
118
118
  #### KV Cache 影响
119
119
 
120
- 在提供方与模型相同的前提下,子 agent 可以复用继承的逐字节相同前缀。persona、工具过滤、生成 SDK 或路由变化可能在继承历史之前使复用失效;后续子 agent 历史仅追加。可继续消息不会增加子级专属的系统提示词区段或工具 schema;父级 ID 与返回指导在初始用户任务中位于继承历史之后(见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md))。
120
+ 在提供方与模型相同的前提下,子 agent 可以复用继承的逐字节相同前缀。结构化输出、生成 SDK、路由变化,或冷恢复时的历史 descriptor 覆盖,可能在继承历史之前使复用失效;后续子 agent 历史仅追加。可继续消息不会增加子级专属的系统提示词区段或工具 schema;父级 ID 与返回指导在初始用户任务中位于继承历史之后(见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md))。
121
121
 
122
122
  ### 父级工具结果(间接)
123
123
 
@@ -141,7 +141,7 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
141
141
  这些限制说明何时选择该后端是错误的;它们是当前包约束。
142
142
 
143
143
  - **初始内容是一次性快照**——子 agent 只能看到 fork 时父级已完成的轮次,看不到父级此后记录的任何内容;不会实时共享上下文。
144
- - **前缀复用取决于请求输入是否匹配**——父级与子级的消息定义都逐字节相同;显式 persona、工具过滤、生成 SDK 或路由变化仍可破坏相等性。理由见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)。
144
+ - **前缀复用取决于请求输入是否匹配**——父级与子级的消息定义都逐字节相同;结构化输出、生成 SDK、路由变化或恢复的历史覆盖仍可破坏相等性。理由见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)。
145
145
  - **随附 fork 工具不公开子级 LLM(大语言模型)路由选择**——它们继承父级提供方与模型,使复制的历史仍有资格复用 KV Cache。在某项改动能保留复用或公开有界重算成本前,路由选择保持禁用。
146
146
 
147
147
  <a id="dev-note"></a>
package/lib/index.js CHANGED
@@ -28,17 +28,15 @@ function completedTurnPrefix(parent) {
28
28
  /**
29
29
  * The fork provider. Supports `depthLimit` and `outputSchema` (via the shared
30
30
  * in-process structured runtime), `agentOptions` (merged over the parent
31
- * route), and `toolFilter`/`persona` (scoped restrict() and a scoped shadowing
32
- * persona section).
31
+ * route). The child inherits its parent's preset composition.
33
32
  */
34
33
  var ForkInProcessProvider = class {
35
34
  name;
36
35
  capabilities = {
37
36
  agentOptions: true,
37
+ agentPreset: false,
38
38
  outputSchema: true,
39
- depthLimit: true,
40
- toolFilter: true,
41
- persona: true
39
+ depthLimit: true
42
40
  };
43
41
  inheritsParentContext = true;
44
42
  constructor(name) {
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "subagent-fork-in-process"
4
+ }
5
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "继承上下文子智能体后端",
4
+ "description": "使用父会话的一段历史创建子智能体。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-subagent-fork-in-process",
3
3
  "description": "In-process fork subagent backend: runs a child agent seeded with a prefix of the parent's log",
4
- "version": "0.2.1-alpha.2",
4
+ "version": "0.2.1-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -19,32 +19,34 @@
19
19
  "default": "./lib/index.js"
20
20
  },
21
21
  "./src/*": "./src/*",
22
- "./package.json": "./package.json"
22
+ "./package.json": "./package.json",
23
+ "./locale/*.json": "./locale/*.json"
23
24
  },
24
25
  "files": [
26
+ "locale/*.json",
25
27
  "lib/index.js",
26
28
  "lib/types/**/*.d.ts"
27
29
  ],
28
30
  "license": "MIT",
29
31
  "peerDependencies": {
30
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
31
- "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
32
- "@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
33
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
32
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
33
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
34
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
35
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2"
34
36
  },
35
37
  "dependencies": {
36
- "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
38
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
37
39
  },
38
40
  "devDependencies": {
39
- "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
40
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
41
- "@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.2",
42
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2",
43
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
44
- "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
45
- "@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
46
- "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-alpha.2",
47
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
48
- "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2"
41
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2",
42
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
43
+ "@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.3",
44
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.3",
45
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
46
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
47
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
48
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-alpha.3",
49
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
50
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.3"
49
51
  }
50
52
  }