@deepseek-ai/dsh-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 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/subagent/README.md
5
- README.md: 5f9668fd7a14cdfca33ab72a217c07372a24502f
6
- README.zh.md: 563ed06237088c4bc250ca3c4f5a863b6ffe8239
5
+ README.md: 74cca45462f17e1de74e2fa0132c4e7dccad414b
6
+ README.zh.md: 39e598c3e88d2f82811c85357c3b82d98eec7327
package/README.md CHANGED
@@ -90,7 +90,7 @@ This section explains how the service is built and where the observable behavior
90
90
 
91
91
  ### One-shot flow
92
92
 
93
- A request is validated against the provider's advertised capabilities, a durable descriptor is snapshotted, and the provider builds the child. Both in-process providers advertise `agentOptions`: child creation merges requested fields over the provider, model, and reasoning effort in the parent's latest logged request, falls back to creation options before the first request, and retains the configured token limit. A route change without an explicit effort clears the inherited route-owned effort so the selected model resolves its default. DSH SDK also advertises this capability and publishes immutable `agentRouteDefaults`, which supply its instance provider/model defaults before exact-route preflight; `start()` still owns direct callers and the output cap. ACP, Codex, and Claude Code reject agent-route overrides rather than silently ignoring them. On success the run is published and ownership transfers to the caller; on failure the provider rolls back every unpublished resource. The result carries the child's final output, an optional structured value, a stop reason, and an optional safe diagnostic.
93
+ A request is validated against the provider's advertised capabilities, a durable descriptor is snapshotted, and the provider builds the child. Both in-process providers advertise `agentOptions`: child creation merges requested fields over the provider, model, and reasoning effort in the parent's latest logged request, falls back to creation options before the first request, and retains the configured token limit. They also snapshot delegated permission state before the first await: an Auto or Full access parent gives the child the same `permission/preset` identity, while the existing sandbox override and approval-policy pin continue to apply. Recording both identities prevents an older same-bundle fork value from winning. Auto then reviews every supported child call independently: ordinary project-local work is low risk and allowed, medium-risk work requires explicit action, exact-target and scope authorization from the existing creation prompt or an authenticated human/direct-parent message, without conflicting human limits, while high-risk work is always denied. The reviewer derives that context from `parentSession` and existing messages; delegation adds no parent call metadata, delegation records, review receipt, or Session format. A route change without an explicit effort clears the inherited route-owned effort so the selected model resolves its default. DSH SDK also advertises `agentOptions` but runs a separate child runtime, so it does not inherit Auto; ACP, Codex, and Claude Code likewise retain their own permission systems after the parent delegation call passes review. On success the run is published and ownership transfers to the caller; on failure the provider rolls back every unpublished resource. The result carries the child's final output, an optional structured value, a stop reason, and an optional safe diagnostic.
94
94
 
95
95
  ### Continuable flow
96
96
 
@@ -118,6 +118,7 @@ Read these pages when the package-level contract is not enough. They move from t
118
118
  - [Subagent capability seam](../../../.agents/notes/implemented/feature/2026-06-21-subagent-capability-seam.md) — the design record for the delegation capability family.
119
119
  - [Continuable subagents](../../../.agents/notes/implemented/feature/2026-07-28-continuable-subagent-conversations.md) — durable children that accept follow-up turns.
120
120
  - [In-process spawn backend](../subagent-spawn-in-process/README.md) — the simplest provider to compose.
121
+ - [Auto review](../../experimental/auto-review/README.md) — the current-session authorization mode inherited only by in-process DSH children.
121
122
  - [Out-of-process ACP backend](../subagent-acp/README.md) — children with their own runtime over the Agent Client Protocol.
122
123
  - [tool-subagent-control README](../tool-subagent-control/README.md) — the follow-up, interrupt, and listing surface.
123
124
 
@@ -130,11 +131,11 @@ Read these pages when the package-level contract is not enough. They move from t
130
131
 
131
132
  #### What the model sees
132
133
 
133
- One user-role parent message opening with the outcome — `Background subagent <child-id> finished and will do no further work unless you send it more.`, or the matching line for a child that was stopped, ran out of room, declined, or failed — followed by `Its closing message:` and the child's final assistant content, or `It left no closing message.` when it produced none. This runtime-owned notice is distinct from model-authored parent/child messages, which use `sendMessage()` and `AgentMessageSource`; delegation schemas and model controls belong to the Consumer packages.
134
+ One user-role parent message opening with the outcome — `Background subagent <child-id> finished and will do no further work unless you send it more.`, or the matching line for a child that was stopped, ran out of room, declined, or failed — followed by `Its closing message:` and the nonempty text blocks from the child's final assistant output, preserving their content and order. Reasoning and other nontext blocks are excluded; when no nonempty text remains, the notice says `It left no closing message.` This runtime-owned notice is distinct from model-authored parent/child messages, which use `sendMessage()` and `AgentMessageSource`; delegation schemas and model controls belong to the Consumer packages.
134
135
 
135
136
  #### Token effect
136
137
 
137
- One notice per settled Activation in the parent's request, sized by the child's final message. A child that sends its own message and then settles costs the parent both.
138
+ One notice per settled Activation in the parent's request, sized by the child's final text. A child that sends its own message and then settles costs the parent both.
138
139
 
139
140
  #### KV Cache effect
140
141
 
@@ -173,6 +174,7 @@ These limits define when the seam is a poor fit or needs special operational car
173
174
  - **Wake gap during cancellation convergence** — a follow-up accepted after an interrupt signal but before the driver becomes idle stays queued until another waking send.
174
175
  - **Pending injected context retains an Activation** — settlement conservatively treats every Inbox occurrence as unfinished. Context parked after the Agent becomes idle keeps the child and its live ancestors resident until a waking delivery claims it, a queue mutation removes it, or manager teardown discards it.
175
176
  - **Process-local residency** — the Activation inbox and ownership graph do not coordinate two harness processes; concurrent access to one persistence store needs a durable mailbox and cross-process lease protocol.
177
+ - **Saved settlement notices are not rewritten** — a saved user-role notice containing reasoning still fails DeepSeek Messages serialization while it remains in the parent's request history.
176
178
  - **No replay of accepted-but-unlogged messages** — a crash can lose an accepted prompt that never reached the child's session log; the lost message is not replayed automatically.
177
179
  - **No durable parent mailbox** — child-to-parent messages require a resident continuable child and live direct parent, and provide acceptance identity rather than exactly-once delivery.
178
180
  - **Lifecycle events are observe-only** — a run-affecting `subagent/end` continuation or decision API waits for a concrete consumer.
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "面向用户与维护者的 subagent 委派 seam,用于选择提供方后端、组装委派工具或排查子 agent 运行问题。"
2
+ description: "面向用户与维护者的 subagent 委派 seam,用于选择提供方后端、组装委派工具或排查子 agent(智能体)运行问题。"
3
3
  kind: "package-reference"
4
4
  ---
5
5
 
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 使用 `dsh-subagent` 把工作委派给具名子 agent、收集结果,并跨轮次继续受支持的子级对话。一个组合可以并排提供进程内、ACP、SDK、Codex 或 Claude Code 子级。需要单个结果时选择一次性子级;需要后续消息与中断能力时选择可继续子级。你还可以检查可用子级及其模式、活动状态与血缘,而无需加载或恢复它们。启用时需要至少一个受支持的子级后端和一个委派工具。
12
+ 使用 `dsh-subagent` 把工作委派给具名子 agent、收集结果,并跨轮次继续受支持的子级对话。一个组合可以并排提供进程内、ACP(Agent Client Protocol)、SDK、Codex 或 Claude Code 子级。需要单个结果时选择一次性子级;需要后续消息与中断能力时选择可继续子级。你还可以检查可用子级及其模式、活动状态与谱系,而无需加载或恢复它们。启用时需要至少一个受支持的子级后端和一个委派工具。
13
13
 
14
14
  ## 目录
15
15
 
@@ -44,15 +44,15 @@ kind: "package-reference"
44
44
 
45
45
  ### 一次性与可继续子级
46
46
 
47
- 一次性子 agent 只运行一次,并以单个结果结算,可附带可选的结构化输出与失败时的安全诊断。启动请求可以通过 `agentOptions` 覆盖子 Agent 的提供方、模型、推理等级与输出 token 上限;每个请求的选项都要求提供方声明对应能力。可继续子 agent 保留持久会话并按顺序接受后续消息:调用方收到稳定的子 agent id、发送相邻 Agent 消息,并可中断当前轮次而不销毁子 agent。工具行的 `backgroundMode` 选择形态(默认 `one-shot`,或在支持的提供方上使用 `continuable`)。
47
+ 一次性子 agent 只运行一次,并以单个结果结算,可附带可选的结构化输出与失败时的安全诊断。启动请求可以通过 `agentOptions` 覆盖子 Agent 的提供方、模型、推理强度与输出 token 上限;每个请求的选项都要求提供方声明对应能力。可继续子 agent 保留持久会话并按顺序接受后续消息:调用方收到稳定的子 agent id、发送相邻 Agent 消息,并可中断当前轮次而不销毁子 agent。工具行的 `backgroundMode` 选择形态(默认 `one-shot`,或在支持的提供方上使用 `continuable`)。
48
48
 
49
49
  ### 消息、中断与发现
50
50
 
51
- 每个确切在线 Agent 都可以对直接可继续 child 使用 `sendMessage()`;驻留的可继续 child 还可以对自己的直接 parent 使用它。正在工作的目标通过 Steer 在最近 step 接收 Agent 消息;空闲目标启动轮次,且只有直接 child 可以冷恢复。parent 也可以随时中断正在运行的后代或列举自己的子级。浏览器发出的继续执行 prompt 会独立选择 Queue 或 Steer,并且可以携带图片部分:Host 先通过附件存储完成整批图片的准入与持久化,子级 inbox 才接受这条消息;当子级声明的模型不接受图片输入时拒绝投递。发现覆盖两种形态:服务列举直接子级与完整后代树——模式、活动状态与血缘——直接读取在线会话状态与可选持久化,不加载任何子 agent。
51
+ 每个确切在线 Agent 都可以对直接可继续 child 使用 `sendMessage()`;驻留的可继续 child 还可以对自己的直接 parent 使用它。正在工作的目标通过 Steer 在最近 step 接收 Agent 消息;空闲目标启动轮次,且只有直接 child 可以冷恢复。parent 也可以随时中断正在运行的后代或列举自己的子级。浏览器发出的继续执行提示词会独立选择 Queue 或 Steer,并且可以携带图片部分:Host 先通过附件存储完成整批图片的准入与持久化,子级 inbox 才接受这条消息;当子级声明的模型不接受图片输入时拒绝投递。发现覆盖两种形态:服务列举直接子级与完整后代树——模式、活动状态与谱系——直接读取在线会话状态与可选持久化,不加载任何子 agent。
52
52
 
53
53
  ### 失败与恢复
54
54
 
55
- 需要所选提供方不具备的能力的请求会在启动时响亮失败,而不会被静默忽略。失败的子 agent 运行会返回停止原因,提供方后端还会附加安全诊断;被取消的请求以 `aborted` 结算。子 agent 相互隔离:崩溃或行为异常的子 agent 无法破坏父级会话。
55
+ 需要所选提供方不具备的能力的请求会在启动时明确报错,而不会被静默忽略。失败的子 agent 运行会返回停止原因,提供方后端还会附加安全诊断;被取消的请求以 `aborted` 结算。子 agent 相互隔离:崩溃或行为异常的子 agent 无法破坏父级会话。
56
56
 
57
57
  -----
58
58
 
@@ -90,20 +90,20 @@ kind: "package-reference"
90
90
 
91
91
  ### 一次性流程
92
92
 
93
- 请求先对照提供方声明的能力进行校验,随后对持久化描述符做快照,再由提供方构建子 agent。两个进程内提供方都声明 `agentOptions`:创建子级时把请求字段叠加到父级最新已记录请求的提供方、模型与推理等级之上;父级还没有请求时回退到创建选项,并保留配置的 token 上限。更改路由而不显式指定推理等级时,会清除继承的路由自有等级,使所选模型解析自己的默认值。DSH SDK 也声明该能力并公开不可变的 `agentRouteDefaults`,使其实例持有的提供方/模型默认值在确切路由预检前成为基线;`start()` 仍负责直接调用方与输出上限。ACP、Codex 与 Claude Code 会拒绝 agent 路由覆盖,而不是静默忽略。成功时运行被发布、所有权转移给调用方;失败时提供方回滚每个尚未发布的资源。结果携带子 agent 的最终输出、可选的结构化值、停止原因与可选的安全诊断。
93
+ 请求先对照提供方声明的能力进行校验,随后对持久化描述符做快照,再由提供方构建子 agent。两个进程内提供方都声明 `agentOptions`:创建子级时把请求字段叠加到父级最新已记录请求的提供方、模型与推理强度之上;父级还没有请求时回退到创建选项,并保留配置的 token 上限。它们还会在第一次 await 前快照委派权限状态:Auto 或 Full access 父级让子级获得相同的 `permission/preset` 身份,而既有沙箱覆盖与审批策略固定仍然生效;同时记录这两个身份可防止 fork 中更早的同旋钮组合身份胜出。Auto 随后会独立审查 child 的每个受支持调用:普通项目内工作为低风险并直接允许;中风险工作必须在既有创建 prompt 或已核验的 human/直接父级消息中获得动作、准确目标和范围的明确授权,且不与 human 限制冲突;高风险工作始终拒绝。reviewer 从 `parentSession` 与既有消息派生这份上下文;委派不会新增父 call metadata、委派记录、review receipt 或 Session format。更改路由而不显式指定推理强度时,会清除继承的路由自有强度,使所选模型解析自己的默认值。DSH SDK 也声明 `agentOptions`,但会运行独立子运行时,因此不继承 Auto;ACP、Codex 与 Claude Code 同样在父级委派调用通过审查后保留各自的权限系统。成功时运行被发布、所有权转移给调用方;失败时提供方回滚每个尚未发布的资源。结果携带子 agent 的最终输出、可选的结构化值、停止原因与可选的安全诊断。
94
94
 
95
95
  ### 可继续流程
96
96
 
97
- 管理器预留 child 身份、解析持久化描述符、创建(或冷恢复)child、把它安装进 Activation 并提交提示词。模型编写的消息通过固定 Steer 调度跨一条 parent/child 边;浏览器人类 prompt 通过内部适配器选择 Queue 或 best-effort Steer,其他 host 协议仍可保留 Queue 以创建独立轮次。Session queue command 仅根据 child 自身的 continuable descriptor 准入在线 subagent-owned Agent。Settlement 会等待 Agent 活动结束、Inbox 为空且没有所拥有子级,再在准入开放时 flush 最终 Session 状态。管理器随后在 child lock 内重新验证 wake generation、Session 序号、Inbox 与所拥有子级;`Agent.runMaintenance()` 的同步 task 入口会占用 idle 阶段,并在同一个 JavaScript turn 内关闭私有 subagent Inbox,然后才 dispose handle。直接 child 不存在 Activation 时会从持久化会话冷恢复。当驻留 Activation 结算时,管理器会在 parent 自身的轮次流中告知该 child 的直接 parent。
97
+ 管理器预留 child 身份、解析持久化描述符、创建(或冷恢复)child、把它安装进 Activation 并提交提示词。模型编写的消息通过固定 Steer 调度跨一条 parent/child 边;浏览器人类 prompt 通过内部适配器选择 Queue 或 best-effort Steer,其他 host 协议仍可保留 Queue 以创建独立轮次。Session queue command 仅根据 child 自身的 continuable descriptor 准入在线 subagent-owned Agent。Settlement 会等待 Agent 活动结束、Inbox 为空且没有所拥有子级,再在准入开放时 flush 最终 Session 状态。管理器随后在 child lock 内重新验证 wake generation、Session 序号、Inbox 与所拥有子级;`Agent.runMaintenance()` 的同步 task 入口会占用 idle 阶段,并在同一个 JavaScript turn 内关闭私有 subagent Inbox,然后才释放句柄。直接 child 不存在 Activation 时会从持久化会话冷恢复。当驻留 Activation 结算时,管理器会在 parent 自身的轮次流中告知该 child 的直接 parent。
98
98
 
99
- 本地子级创建成功时,父 Session 追加一条 `subagent/catalog` 事实。一次性创建在 provider 返回后记录;可继续创建在初始 inbox 准入后、返回子级 id 前记录。失败会释放子级,不发布补偿性目录事件。一次性目录追加失败时会处理 run 的结果拒绝,并保留目录错误;资源释放失败会单独记录。`subagentCatalog` projection 排除 fork 继承的事实,通过 Session 观察和客户端快照中的 `projections.values.subagentCatalog` 暴露直接子级列表。无效的自身 catalog payload(包括不支持的版本)会使 projection 恢复失败。其不可变存储和检查点校验使用 [`dsh-chunked-list`](../../util/chunked-list/README.zh.md)。其视图对 D 条事实以 O(D) 时间保留父目录事件顺序。[父目录决策](../../../.agents/notes/implemented/architecture/2026-09-01-parent-owned-subagent-catalog.zh.md) 说明排序、持久化成本和替代方案。
99
+ 本地子级创建成功时,父 Session 追加一条 `subagent/catalog` 事实。一次性创建在提供方返回后记录;可继续创建在初始 inbox 准入后、返回子级 id 前记录。失败会释放子级,不发布补偿性目录事件。一次性目录追加失败时会处理 run 的结果拒绝,并保留目录错误;资源释放失败会单独记录。`subagentCatalog` projection 排除 fork 继承的事实,通过 Session 观察和客户端快照中的 `projections.values.subagentCatalog` 暴露直接子级列表。无效的自身 catalog payload(包括不支持的版本)会使 projection 恢复失败。其不可变存储和检查点校验使用 [`dsh-chunked-list`](../../util/chunked-list/README.zh.md)。其视图对 D 条事实以 O(D) 时间保留父目录事件顺序。[父目录决策](../../../.agents/notes/implemented/architecture/2026-09-01-parent-owned-subagent-catalog.zh.md) 说明排序、持久化成本和替代方案。
100
100
 
101
101
  ### 所有权与不变式
102
102
 
103
103
  - **发布即边界**——发布前提供方拥有设置并须在失败时回滚;发布后调用方拥有运行并须 dispose(资源释放)它。
104
104
  - **注册受 effect 作用域约束**——移除提供方会阻止新启动,但绝不撤销已接受的运行。
105
105
  - **Agent 消息权限基于确切相邻关系**——`sendMessage()` 要求确切在线 sender;每个 sender 都可以指定直接可继续 child,只有具备驻留可继续 Activation 的 sender 可以指定自己的直接 parent。
106
- - **描述符仅进日志**——它是会话事件,不进入模型历史,并跨压缩(compaction)保留;可继续描述符会显式记录解析后的子级提供方、模型与推理等级,用于冷恢复。
106
+ - **描述符仅进日志**——它是会话事件,不进入模型历史,并跨压缩(compaction)保留;可继续描述符会显式记录解析后的子级提供方、模型与推理强度,用于冷恢复。
107
107
 
108
108
  </details>
109
109
 
@@ -118,6 +118,7 @@ kind: "package-reference"
118
118
  - [Subagent 能力 seam](../../../.agents/notes/implemented/feature/2026-06-21-subagent-capability-seam.zh.md)——委派能力家族的设计记录。
119
119
  - [可继续的 subagent](../../../.agents/notes/implemented/feature/2026-07-28-continuable-subagent-conversations.zh.md)——接受后续轮次的持久子级。
120
120
  - [进程内 spawn 后端](../subagent-spawn-in-process/README.zh.md)——最容易组合的提供方。
121
+ - [Auto review](../../experimental/auto-review/README.zh.md)——只有进程内 DSH 子级继承的当前会话授权模式。
121
122
  - [进程外 ACP 后端](../subagent-acp/README.zh.md)——经 Agent Client Protocol 拥有自有运行时的子级。
122
123
  - [tool-subagent-control README](../tool-subagent-control/README.zh.md)——后续消息、中断与列举面。
123
124
 
@@ -130,11 +131,11 @@ kind: "package-reference"
130
131
 
131
132
  #### 模型看到什么
132
133
 
133
- 一条用户角色的父级消息,开头是结果本身——`Background subagent <child-id> finished and will do no further work unless you send it more.`,或子级被停止、耗尽额度、拒绝任务或失败时的对应句子——随后是 `Its closing message:` 与子级的最终 assistant 内容;若子级没有产出内容,则是 `It left no closing message.`。这条由 runtime 生成的通知与模型编写的父子消息相互独立;后者使用 `sendMessage()` 与 `AgentMessageSource`。委派 schema 与模型控制工具归 Consumer 包所有。
134
+ 一条用户角色的父级消息,开头是结果本身——`Background subagent <child-id> finished and will do no further work unless you send it more.`,或子级被停止、耗尽额度、拒绝任务或失败时的对应句子——随后是 `Its closing message:` 与子级最终 assistant 输出中的非空文本块,保留原始内容与顺序。推理与其他非文本块不会进入通知;若没有剩余的非空文本,通知会写明 `It left no closing message.`。这条由运行时生成的通知与模型编写的父子消息相互独立;后者使用 `sendMessage()` 与 `AgentMessageSource`。委派 schema 与模型控制工具归消费方包所有。
134
135
 
135
136
  #### Token 影响
136
137
 
137
- 父级请求中,每个已结算的 Activation 一条通知,长度取决于子级的最终消息。如果子级先发送自己的消息再结算,父级请求会同时承担两者。
138
+ 父级请求中,每个已结算的 Activation 一条通知,长度取决于子级的最终文本。如果子级先发送自己的消息再结算,父级请求会同时承担两者。
138
139
 
139
140
  #### KV Cache 影响
140
141
 
@@ -171,8 +172,9 @@ You are a delegated subagent: your permission scope was fixed when you were star
171
172
  - **仅允许相邻模型消息**——`sendMessage()` 要求确切在线 sender;每个 sender 都可以指定直接可继续 child,只有具备驻留可继续 Activation 的 sender 可以指定自己的直接 parent。浏览器提示使用独立的人类 Queue 或 Steer 控制路径。
172
173
  - **child 到 parent 的投递要求直接 parent 保持在线**——服务没有持久 parent mailbox;parent 缺失时会拒绝消息,而非接受无法唤醒的工作。
173
174
  - **取消收敛期间存在唤醒缺口**——中断信号发出后、driver 进入 idle 前被接受的后续消息会保持排队,直到另一条唤醒发送到达。
174
- - **待处理的注入 context 会保留 Activation**——settlement 会保守地把每个 Inbox occurrence 都视为未完成。Agent 进入 idle 后停放的 context 会让 child 及其在线祖先继续驻留,直到唤醒投递将其 claim、queue 变更将其移除,或 manager teardown 将其丢弃。
175
+ - **待处理的注入上下文会保留 Activation**——settlement 会保守地把每个 Inbox occurrence 都视为未完成。Agent 进入 idle 后停放的上下文会让 child 及其在线祖先继续驻留,直到唤醒投递将其 claim、queue 变更将其移除,或 manager teardown 将其丢弃。
175
176
  - **驻留仅限进程内**——Activation inbox 与所有权图不会在两个 harness 进程之间协调;对单个持久化存储的并发访问需要持久化邮箱与跨进程租约协议。
177
+ - **已保存的结算通知不会被改写**——若用户角色的已保存通知含有推理块,只要它仍在父级请求历史中,DeepSeek Messages 序列化就会失败。
176
178
  - **不回放已接受但未记录的消息**——崩溃可能丢失从未写入子会话日志、已被接受的提示词;丢失的消息不会自动回放。
177
179
  - **没有持久化 parent mailbox**——child 到 parent 的消息要求驻留的可继续 child 与在线直接 parent,提供的是接受标识,不保证恰好一次投递。
178
180
  - **生命周期事件只供观察**——影响运行的 `subagent/end` 延续或决策接口仍需等待具体消费方。
package/lib/index.js CHANGED
@@ -554,17 +554,20 @@ function applyChildComposition(childCtx, parent, composition) {
554
554
  if (composition.toolFilter !== void 0) childCtx.tools.restrict(composition.toolFilter);
555
555
  }
556
556
  /**
557
- * Capture the policy to seed into one delegation. Call synchronously before
557
+ * Capture the permission state to seed into one delegation. Call synchronously before
558
558
  * the child start's first await: a later parent switch belongs to the
559
- * parent's future, not to this child. Only the parent session's explicit
560
- * sandbox override is captured — never deployment defaults or one-shot
561
- * grants — and the approval policy is pinned to `'never'` regardless of the
562
- * parent's own policy.
559
+ * parent's future, not to this child. Auto and Full access identities are
560
+ * inherited only through the in-process DSH path so either can replace a stale
561
+ * same-bundle fork value. Only the parent session's explicit sandbox override
562
+ * is captured — never deployment defaults or one-shot grants — and the approval
563
+ * policy is pinned to `'never'` regardless of the parent's own policy.
563
564
  * @param parent - the delegating parent agent.
564
565
  * @returns the sandbox override (or `undefined` without one) and the approval pin.
565
566
  */
566
567
  function captureDelegatedPolicyOverrides(parent) {
568
+ const preset = parent.ctx.get("permissionPresets")?.current(parent.session);
567
569
  return {
570
+ permissionPreset: preset === "auto" || preset === "danger-full-access" ? preset : void 0,
568
571
  sandboxMode: parent.ctx.get("sandboxPolicy")?.overrideOf(parent.session),
569
572
  approvalPolicy: parent.ctx.get("approval") === void 0 ? void 0 : "never"
570
573
  };
@@ -587,6 +590,7 @@ function appendDelegatedPolicyOverrides(childSession, overrides) {
587
590
  policy: overrides.approvalPolicy,
588
591
  source: "delegation"
589
592
  });
593
+ if (overrides.permissionPreset !== void 0) childSession.append("permission/preset", { preset: overrides.permissionPreset });
590
594
  }
591
595
  //#endregion
592
596
  //#region lib/types/continuation-messages.js
@@ -653,24 +657,25 @@ function settlementSummary(childId, stopReason) {
653
657
  }
654
658
  }
655
659
  /**
656
- * Build the runtime-owned settlement notice delivered to a child's parent.
660
+ * Build the runtime-owned settlement notice from the child's nonempty closing text.
657
661
  * @param childId - durable child session id named in the notice.
658
662
  * @param terminal - recorded terminal state for the settled Activation.
659
663
  * @returns the durable user-message representation delivered to the parent.
660
664
  */
661
665
  function createSettlementMessage(childId, terminal) {
662
666
  const summary = settlementSummary(childId, terminal.stopReason);
667
+ const closingText = (terminal.output ?? []).flatMap((block) => block.type === "text" && block.text.length > 0 ? [block] : []);
663
668
  return createUserMessage({
664
669
  content: [{
665
670
  type: "text",
666
671
  text: summary
667
- }, ...terminal.output === void 0 ? [{
672
+ }, ...closingText.length === 0 ? [{
668
673
  type: "text",
669
674
  text: "It left no closing message."
670
675
  }] : [{
671
676
  type: "text",
672
677
  text: "Its closing message:"
673
- }, ...terminal.output]],
678
+ }, ...closingText]],
674
679
  source: {
675
680
  kind: "subagent-settled",
676
681
  form: "notice",
@@ -2900,12 +2905,12 @@ let SubagentRuntime = (() => {
2900
2905
  }
2901
2906
  /**
2902
2907
  * Deliver one host-protocol message to a direct continuable child.
2903
- * Symbol-keyed so host adapters can preserve their own provenance without
2908
+ * Symbol-keyed so host adapters can preserve their own source descriptors without
2904
2909
  * widening the public Service Definition or impersonating an Agent sender.
2905
2910
  * @param parent - exact live direct parent authorizing delivery.
2906
2911
  * @param childId - durable direct-child session id.
2907
2912
  * @param content - host-authored content to deliver.
2908
- * @param source - durable host-protocol provenance.
2913
+ * @param source - durable host-protocol source descriptor.
2909
2914
  * @param signal - caller cancellation before inbox acceptance.
2910
2915
  * @param delivery - Queue as a distinct turn or Steer at the nearest step.
2911
2916
  * @returns the accepted message's inbox id.
@@ -305,8 +305,8 @@ export const TYPERT = {
305
305
  "declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
306
306
  },
307
307
  {
308
- "name": "AssistantProvenance",
309
- "declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
308
+ "name": "AssistantProviderMetadata",
309
+ "declaration": "export interface AssistantProviderMetadata {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
310
310
  },
311
311
  {
312
312
  "name": "AssistantStreamRecord",
@@ -458,12 +458,16 @@ export const TYPERT = {
458
458
  },
459
459
  {
460
460
  "name": "ImageBlock",
461
- "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
461
+ "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n offloaded?: true;\n}"
462
462
  },
463
463
  {
464
464
  "name": "ImageMediaType",
465
465
  "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
466
466
  },
467
+ {
468
+ "name": "ImageOffloadTarget",
469
+ "declaration": "export interface ImageOffloadTarget {\n seq: SessionSeq;\n imageIndexes: number[];\n}"
470
+ },
467
471
  {
468
472
  "name": "Inbox",
469
473
  "declaration": "export interface Inbox {\n readonly nextTurn: readonly UserMessage[];\n readonly nextStep: readonly UserMessage[];\n clear(): void;\n append(target: InboxTarget, message: UserMessage): void;\n prepend(target: InboxTarget, message: UserMessage): void;\n replace(messageId: MessageId, newMessage: UserMessage): boolean;\n remove(messageId: MessageId): boolean;\n splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
@@ -498,7 +502,7 @@ export const TYPERT = {
498
502
  },
499
503
  {
500
504
  "name": "LlmFailure",
501
- "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n}"
505
+ "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n readonly offloadImages?: number;\n}"
502
506
  },
503
507
  {
504
508
  "name": "Message",
@@ -538,7 +542,7 @@ export const TYPERT = {
538
542
  },
539
543
  {
540
544
  "name": "ModelMessageSource",
541
- "declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
545
+ "declaration": "export interface ModelMessageSource extends AssistantProviderMetadata {\n kind: 'model';\n}"
542
546
  },
543
547
  {
544
548
  "name": "ModelSelection",
@@ -566,7 +570,7 @@ export const TYPERT = {
566
570
  },
567
571
  {
568
572
  "name": "PtcDispatchEventData",
569
- "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
573
+ "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n error?: { name: string; code: string; reason?: string; };\n}"
570
574
  },
571
575
  {
572
576
  "name": "PtcDispatchStartEventData",
@@ -610,7 +614,7 @@ export const TYPERT = {
610
614
  },
611
615
  {
612
616
  "name": "SessionEventMap",
613
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
617
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
614
618
  },
615
619
  {
616
620
  "name": "SessionEventType",
@@ -642,15 +646,15 @@ export const TYPERT = {
642
646
  },
643
647
  {
644
648
  "name": "SessionSurface",
645
- "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n}"
649
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
646
650
  },
647
651
  {
648
652
  "name": "SessionTitleEventData",
649
653
  "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
650
654
  },
651
655
  {
652
- "name": "SessionTitleModelProvenance",
653
- "declaration": "export interface SessionTitleModelProvenance {\n readonly provider: string;\n readonly model: string;\n}"
656
+ "name": "SessionTitleModelIdentity",
657
+ "declaration": "export interface SessionTitleModelIdentity {\n readonly provider: string;\n readonly model: string;\n}"
654
658
  },
655
659
  {
656
660
  "name": "SessionTitleProviderId",
@@ -658,7 +662,7 @@ export const TYPERT = {
658
662
  },
659
663
  {
660
664
  "name": "SessionTitleSource",
661
- "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelProvenance; } | { readonly kind: 'user'; };"
665
+ "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelIdentity; } | { readonly kind: 'user'; };"
662
666
  },
663
667
  {
664
668
  "name": "SkillInvocationSource",
@@ -106,6 +106,8 @@ export declare const SUBAGENT_DELEGATION_CONTEXT: string;
106
106
  export declare function applyChildComposition(childCtx: Context, parent: Agent, composition: ChildComposition): void;
107
107
  /** Policy seeded onto a child session's log at the delegation boundary. */
108
108
  export interface DelegatedPolicyOverrides {
109
+ /** The shared-bundle preset identity when the parent currently runs in Auto or Full access. */
110
+ readonly permissionPreset: 'auto' | 'danger-full-access' | undefined;
109
111
  /** The parent session's explicit sandbox-mode override, or `undefined` without one. */
110
112
  readonly sandboxMode: SandboxMode | undefined;
111
113
  /**
@@ -116,12 +118,13 @@ export interface DelegatedPolicyOverrides {
116
118
  readonly approvalPolicy: 'never' | undefined;
117
119
  }
118
120
  /**
119
- * Capture the policy to seed into one delegation. Call synchronously before
121
+ * Capture the permission state to seed into one delegation. Call synchronously before
120
122
  * the child start's first await: a later parent switch belongs to the
121
- * parent's future, not to this child. Only the parent session's explicit
122
- * sandbox override is captured — never deployment defaults or one-shot
123
- * grants — and the approval policy is pinned to `'never'` regardless of the
124
- * parent's own policy.
123
+ * parent's future, not to this child. Auto and Full access identities are
124
+ * inherited only through the in-process DSH path so either can replace a stale
125
+ * same-bundle fork value. Only the parent session's explicit sandbox override
126
+ * is captured — never deployment defaults or one-shot grants — and the approval
127
+ * policy is pinned to `'never'` regardless of the parent's own policy.
125
128
  * @param parent - the delegating parent agent.
126
129
  * @returns the sandbox override (or `undefined` without one) and the approval pin.
127
130
  */
@@ -172,17 +172,20 @@ export function applyChildComposition(childCtx, parent, composition) {
172
172
  childCtx.tools.restrict(composition.toolFilter);
173
173
  }
174
174
  /**
175
- * Capture the policy to seed into one delegation. Call synchronously before
175
+ * Capture the permission state to seed into one delegation. Call synchronously before
176
176
  * the child start's first await: a later parent switch belongs to the
177
- * parent's future, not to this child. Only the parent session's explicit
178
- * sandbox override is captured — never deployment defaults or one-shot
179
- * grants — and the approval policy is pinned to `'never'` regardless of the
180
- * parent's own policy.
177
+ * parent's future, not to this child. Auto and Full access identities are
178
+ * inherited only through the in-process DSH path so either can replace a stale
179
+ * same-bundle fork value. Only the parent session's explicit sandbox override
180
+ * is captured — never deployment defaults or one-shot grants — and the approval
181
+ * policy is pinned to `'never'` regardless of the parent's own policy.
181
182
  * @param parent - the delegating parent agent.
182
183
  * @returns the sandbox override (or `undefined` without one) and the approval pin.
183
184
  */
184
185
  export function captureDelegatedPolicyOverrides(parent) {
186
+ const preset = parent.ctx.get('permissionPresets')?.current(parent.session);
185
187
  return {
188
+ permissionPreset: preset === 'auto' || preset === 'danger-full-access' ? preset : undefined,
186
189
  sandboxMode: parent.ctx.get('sandboxPolicy')?.overrideOf(parent.session),
187
190
  approvalPolicy: parent.ctx.get('approval') === undefined ? undefined : 'never',
188
191
  };
@@ -203,5 +206,8 @@ export function appendDelegatedPolicyOverrides(childSession, overrides) {
203
206
  if (overrides.approvalPolicy !== undefined) {
204
207
  childSession.append('approval/policy', { policy: overrides.approvalPolicy, source: 'delegation' });
205
208
  }
209
+ if (overrides.permissionPreset !== undefined) {
210
+ childSession.append('permission/preset', { preset: overrides.permissionPreset });
211
+ }
206
212
  }
207
213
  //# sourceMappingURL=child-agent.js.map
@@ -53,7 +53,7 @@ export declare function createAgentMessage(sender: Agent, content: ContentBlock[
53
53
  */
54
54
  export declare function withContinuableReturnGuidance(parentId: SessionId, prompt: ContentBlock[]): ContentBlock[];
55
55
  /**
56
- * Build the runtime-owned settlement notice delivered to a child's parent.
56
+ * Build the runtime-owned settlement notice from the child's nonempty closing text.
57
57
  * @param childId - durable child session id named in the notice.
58
58
  * @param terminal - recorded terminal state for the settled Activation.
59
59
  * @returns the durable user-message representation delivered to the parent.
@@ -77,19 +77,23 @@ function settlementSummary(childId, stopReason) {
77
77
  }
78
78
  }
79
79
  /**
80
- * Build the runtime-owned settlement notice delivered to a child's parent.
80
+ * Build the runtime-owned settlement notice from the child's nonempty closing text.
81
81
  * @param childId - durable child session id named in the notice.
82
82
  * @param terminal - recorded terminal state for the settled Activation.
83
83
  * @returns the durable user-message representation delivered to the parent.
84
84
  */
85
85
  export function createSettlementMessage(childId, terminal) {
86
86
  const summary = settlementSummary(childId, terminal.stopReason);
87
+ // Parent providers receive this notice as a user message and may reject
88
+ // nontext assistant blocks. Keep this conversion local so SDK/UI consumers
89
+ // retain the complete child output.
90
+ const closingText = (terminal.output ?? []).flatMap(block => block.type === 'text' && block.text.length > 0 ? [block] : []);
87
91
  return createUserMessage({
88
92
  content: [
89
93
  { type: 'text', text: summary },
90
- ...terminal.output === undefined
94
+ ...closingText.length === 0
91
95
  ? [{ type: 'text', text: 'It left no closing message.' }]
92
- : [{ type: 'text', text: 'Its closing message:' }, ...terminal.output],
96
+ : [{ type: 'text', text: 'Its closing message:' }, ...closingText],
93
97
  ],
94
98
  source: {
95
99
  kind: 'subagent-settled',
@@ -132,12 +132,12 @@ export declare class SubagentRuntime extends TypertRemoteService {
132
132
  sendMessage(sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions): Promise<MessageId>;
133
133
  /**
134
134
  * Deliver one host-protocol message to a direct continuable child.
135
- * Symbol-keyed so host adapters can preserve their own provenance without
135
+ * Symbol-keyed so host adapters can preserve their own source descriptors without
136
136
  * widening the public Service Definition or impersonating an Agent sender.
137
137
  * @param parent - exact live direct parent authorizing delivery.
138
138
  * @param childId - durable direct-child session id.
139
139
  * @param content - host-authored content to deliver.
140
- * @param source - durable host-protocol provenance.
140
+ * @param source - durable host-protocol source descriptor.
141
141
  * @param signal - caller cancellation before inbox acceptance.
142
142
  * @param delivery - Queue as a distinct turn or Steer at the nearest step.
143
143
  * @returns the accepted message's inbox id.
@@ -162,12 +162,12 @@ let SubagentRuntime = (() => {
162
162
  }
163
163
  /**
164
164
  * Deliver one host-protocol message to a direct continuable child.
165
- * Symbol-keyed so host adapters can preserve their own provenance without
165
+ * Symbol-keyed so host adapters can preserve their own source descriptors without
166
166
  * widening the public Service Definition or impersonating an Agent sender.
167
167
  * @param parent - exact live direct parent authorizing delivery.
168
168
  * @param childId - durable direct-child session id.
169
169
  * @param content - host-authored content to deliver.
170
- * @param source - durable host-protocol provenance.
170
+ * @param source - durable host-protocol source descriptor.
171
171
  * @param signal - caller cancellation before inbox acceptance.
172
172
  * @param delivery - Queue as a distinct turn or Steer at the nearest step.
173
173
  * @returns the accepted message's inbox id.
@@ -39,7 +39,7 @@ export interface HostPromptDeliverer {
39
39
  * @param parent - exact live direct parent authorizing delivery.
40
40
  * @param childId - durable direct-child session id.
41
41
  * @param content - host-authored content to deliver.
42
- * @param source - durable host-protocol provenance.
42
+ * @param source - durable host-protocol source descriptor.
43
43
  * @param signal - caller cancellation before inbox acceptance.
44
44
  * @returns the accepted message's inbox id.
45
45
  */
@@ -50,7 +50,7 @@ export declare function queueHostSubagentPrompt(runtime: SubagentRuntime, parent
50
50
  * @param parent - exact live direct parent authorizing delivery.
51
51
  * @param childId - durable direct-child session id.
52
52
  * @param content - host-authored content to deliver.
53
- * @param source - durable host-protocol provenance.
53
+ * @param source - durable host-protocol source descriptor.
54
54
  * @param signal - caller cancellation before inbox acceptance.
55
55
  * @returns the accepted message's inbox id.
56
56
  */
@@ -35,7 +35,7 @@ export const deliverSubagentPrompt = Symbol.for('dsh.subagent.deliverPrompt');
35
35
  * @param parent - exact live direct parent authorizing delivery.
36
36
  * @param childId - durable direct-child session id.
37
37
  * @param content - host-authored content to deliver.
38
- * @param source - durable host-protocol provenance.
38
+ * @param source - durable host-protocol source descriptor.
39
39
  * @param signal - caller cancellation before inbox acceptance.
40
40
  * @returns the accepted message's inbox id.
41
41
  */
@@ -48,7 +48,7 @@ export function queueHostSubagentPrompt(runtime, parent, childId, content, sourc
48
48
  * @param parent - exact live direct parent authorizing delivery.
49
49
  * @param childId - durable direct-child session id.
50
50
  * @param content - host-authored content to deliver.
51
- * @param source - durable host-protocol provenance.
51
+ * @param source - durable host-protocol source descriptor.
52
52
  * @param signal - caller cancellation before inbox acceptance.
53
53
  * @returns the accepted message's inbox id.
54
54
  */
@@ -106,6 +106,7 @@ export function createActivationObserver(emit, provider, childId, parent) {
106
106
  emit('subagent/start', identity, parent);
107
107
  },
108
108
  capture: (child) => {
109
+ // oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
109
110
  const own = child.session.snapshotEvents(boundary);
110
111
  const output = finalAssistantOutput(own);
111
112
  captured = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-subagent",
3
3
  "description": "Abstract subagent seam (ctx.subagents): named-provider registry for delegating to child agents",
4
- "version": "0.1.5-rc.1",
4
+ "version": "0.1.6-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -54,36 +54,40 @@
54
54
  "license": "MIT",
55
55
  "dependencies": {
56
56
  "zod": "^4.4.3",
57
- "@deepseek-ai/dsh-brand": "^0.1.5-rc.1",
58
- "@deepseek-ai/dsh-chunked-list": "^0.1.5-rc.1",
59
- "@deepseek-ai/dsh-util-values": "^0.1.5-rc.1"
57
+ "@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
58
+ "@deepseek-ai/dsh-chunked-list": "^0.1.6-alpha.1",
59
+ "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.1"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@deepseek-ai/cordis": "^4.0.2",
63
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
64
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.1",
65
- "@deepseek-ai/dsh-attachment": "^0.1.5-rc.1",
66
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
67
- "@deepseek-ai/dsh-jobs": "^0.1.5-rc.1",
68
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
69
- "@deepseek-ai/dsh-sandbox": "^0.1.5-rc.1",
70
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.5-rc.1",
71
- "@deepseek-ai/dsh-scope": "^0.1.5-rc.1",
72
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
73
- "@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.1",
74
- "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.1",
75
- "@deepseek-ai/dsh-session-projection-cache": "^0.1.5-rc.1",
76
- "@deepseek-ai/dsh-session-query": "^0.1.5-rc.1",
77
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.1",
78
- "@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.1",
79
- "@deepseek-ai/dsh-user-approval": "^0.1.5-rc.1",
80
- "@deepseek-ai/dsh-util-time": "^0.1.5-rc.1",
81
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.1"
63
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
64
+ "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.1",
65
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
66
+ "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.1",
67
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.1",
68
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
69
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
70
+ "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1",
71
+ "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
72
+ "@deepseek-ai/dsh-session-projection-cache": "^0.1.6-alpha.1",
73
+ "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.1",
74
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.1",
75
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
76
+ "@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.1",
77
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.1",
78
+ "@deepseek-ai/dsh-util-time": "^0.1.6-alpha.1",
79
+ "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.1",
80
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
81
+ "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.1",
82
+ "@deepseek-ai/dsh-attachment": "^0.1.6-alpha.1"
82
83
  },
83
84
  "peerDependenciesMeta": {
84
85
  "@deepseek-ai/dsh-agent-presets": {
85
86
  "optional": true
86
87
  },
88
+ "@deepseek-ai/dsh-permission-presets": {
89
+ "optional": true
90
+ },
87
91
  "@deepseek-ai/dsh-sandbox": {
88
92
  "optional": true
89
93
  },
@@ -111,28 +115,29 @@
111
115
  },
112
116
  "devDependencies": {
113
117
  "@deepseek-ai/cordis": "^4.0.2",
114
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
115
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.1",
116
- "@deepseek-ai/dsh-attachment": "^0.1.5-rc.1",
117
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
118
- "@deepseek-ai/dsh-jobs": "^0.1.5-rc.1",
119
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
120
- "@deepseek-ai/dsh-sandbox": "^0.1.5-rc.1",
121
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.5-rc.1",
122
- "@deepseek-ai/dsh-schedule": "^0.1.5-rc.1",
123
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
124
- "@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.1",
125
- "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.1",
126
- "@deepseek-ai/dsh-session-projection-cache": "^0.1.5-rc.1",
127
- "@deepseek-ai/dsh-session-query": "^0.1.5-rc.1",
128
- "@deepseek-ai/dsh-scope": "^0.1.5-rc.1",
129
- "@deepseek-ai/dsh-storage": "^0.1.5-rc.1",
130
- "@deepseek-ai/dsh-storage-domain": "^0.1.5-rc.1",
131
- "@deepseek-ai/dsh-storage-json": "^0.1.5-rc.1",
132
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.1",
133
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.1",
134
- "@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.1",
135
- "@deepseek-ai/dsh-user-approval": "^0.1.5-rc.1",
136
- "@deepseek-ai/dsh-util-time": "^0.1.5-rc.1"
118
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
119
+ "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.1",
120
+ "@deepseek-ai/dsh-attachment": "^0.1.6-alpha.1",
121
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
122
+ "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.1",
123
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
124
+ "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.1",
125
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.1",
126
+ "@deepseek-ai/dsh-schedule": "^0.1.6-alpha.1",
127
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
128
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
129
+ "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1",
130
+ "@deepseek-ai/dsh-session-projection-cache": "^0.1.6-alpha.1",
131
+ "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.1",
132
+ "@deepseek-ai/dsh-storage": "^0.1.6-alpha.1",
133
+ "@deepseek-ai/dsh-storage-domain": "^0.1.6-alpha.1",
134
+ "@deepseek-ai/dsh-storage-json": "^0.1.6-alpha.1",
135
+ "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.1",
136
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
137
+ "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
138
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.1",
139
+ "@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.1",
140
+ "@deepseek-ai/dsh-util-time": "^0.1.6-alpha.1",
141
+ "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.1"
137
142
  }
138
143
  }