@zhushanwen/subagent-engine-sdk 0.4.0 → 0.5.0

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EngineSdkError
3
- } from "./chunk-WS4WAZVR.js";
3
+ } from "./chunk-F5JZMK74.js";
4
4
 
5
5
  // src/node-executor.ts
6
6
  import { spawn } from "child_process";
@@ -71,7 +71,7 @@ function engineConversationUnsupportedError(engineId) {
71
71
  return new EngineSdkError(
72
72
  "engine_capability_unsupported",
73
73
  `engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
74
- `\u53BB\u6389 conversation \u53C2\u6570\uFF08\u4E00\u6B21\u6027\u4EFB\u52A1\u9ED8\u8BA4\u5F62\u6001\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
74
+ `\u53BB\u6389 conversation \u53C2\u6570\uFF08modeless \u4E0B\u65E0\u884C\u4E3A\u6548\u679C\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
75
75
  { engineId, capability: "conversation", declared: "unsupported" }
76
76
  );
77
77
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-PYO3YR7W.js";
4
4
  import {
5
5
  engineTimeoutDetail
6
- } from "./chunk-WS4WAZVR.js";
6
+ } from "./chunk-F5JZMK74.js";
7
7
  import {
8
8
  getLogger
9
9
  } from "./chunk-75QEMUGV.js";
@@ -161,13 +161,14 @@ interface EngineCapabilities {
161
161
  /** 注意区分「引擎 RPC 层有此能力」与「subagent 链路已接通」。 */
162
162
  steer: "native" | "emulated" | "unsupported";
163
163
  /**
164
- * [H1 D5 语义收窄] resume 能力位(chat 续聊 = 新 run + resume 锚点的承载前提;
164
+ * [H1 D5 语义收窄 + modeless] 「怎么续」形态轴兼 message 资格轴:
165
+ * 位非 'unsupported' = 引擎可续聊(core capability-gate 的 message 资格门消费),
166
+ * 值区分续聊形态——native(原地续写)/ cold(冷恢复重建 + 新 run + resume 锚点)。
165
167
  * 原名字沿用——conversation 位保留、语义从「interact 长驻控制面」收窄为
166
- * 「resume 续聊能力」,gate 判据与消费方不变)。
167
- * [U6 / 永久会话模型 §3.2.6 要点 4] 新值 "cold" = 冷恢复会话:resume 读通道取
168
- * 结构化历史 + 新 session 注入(无热 steering)。gate 判据仍是 `=== "unsupported"`
169
- * 拒绝——"cold" 在 gate 面与 "native" 等价放行,差异只在续聊形态(新 session
170
- * 注入 vs 原地续写)。
168
+ * 「resume 续聊能力」。[modeless 波2] 会话形态键只剩 run.params.resume(协议
169
+ * task.conversation 已删),本轴不再是 per-run 模式开关——描述各引擎的真实
170
+ * 续聊差异(gate 判据仍是 `=== "unsupported"` 拒绝,"cold" 与 "native" 等价
171
+ * 放行)。
171
172
  */
172
173
  conversation: "native" | "cold" | "unsupported";
173
174
  /** 决定 persona 路由策略(file/flag/prompt 通道)。 */
@@ -280,7 +281,7 @@ interface ModelCatalogEntry {
280
281
  *
281
282
  * 字段裁决(对照 core orchestration/models/types.ts AgentCallOpts,2026-09-09):
282
283
  * - 入选 = 引擎消费面:任务语义(prompt/schema/thinkingLevel/skill/skillPath/agent/persona 注入)、
283
- * 轮次预算(maxTurns/graceTurns/conversation/idleTimeoutMs)、隔离与权限(worktree/
284
+ * 轮次预算(maxTurns/graceTurns/idleTimeoutMs)、隔离与权限(worktree/
284
285
  * fork/forkSource/denyTools/permissionMode)、诊断(description/scene);
285
286
  * - 排除并改挂 run.params.ctx(协议层已单列,task 内双写会分叉):model(→ctx.model)、
286
287
  * schemaEnv(→ctx.schemaEnv)、cwd(→ctx.cwd)、engineFallback(→ctx.engineFallback);
@@ -327,9 +328,7 @@ interface AgentCallOpts {
327
328
  forkSource?: string;
328
329
  /** Filesystem isolation: 新建 worktree | 复用外部已创建 worktree | 不隔离。 */
329
330
  worktree?: boolean | WorktreeHandle;
330
- /** 可持续对话模式:true = 轮次完成进 idle 态等待 message 续聊。 */
331
- conversation?: boolean;
332
- /** 空闲超时毫秒数(仅 conversation 模式有意义)。显式 0/负 = 禁用 idle GC。 */
331
+ /** 空闲超时毫秒数([modeless] 全体 record 的 idle 回收节奏;显式 0/负 = 禁用 idle GC)。 */
333
332
  idleTimeoutMs?: number;
334
333
  /** 工具 denylist(各引擎做语法映射)。 */
335
334
  denyTools?: string[];
@@ -161,13 +161,14 @@ interface EngineCapabilities {
161
161
  /** 注意区分「引擎 RPC 层有此能力」与「subagent 链路已接通」。 */
162
162
  steer: "native" | "emulated" | "unsupported";
163
163
  /**
164
- * [H1 D5 语义收窄] resume 能力位(chat 续聊 = 新 run + resume 锚点的承载前提;
164
+ * [H1 D5 语义收窄 + modeless] 「怎么续」形态轴兼 message 资格轴:
165
+ * 位非 'unsupported' = 引擎可续聊(core capability-gate 的 message 资格门消费),
166
+ * 值区分续聊形态——native(原地续写)/ cold(冷恢复重建 + 新 run + resume 锚点)。
165
167
  * 原名字沿用——conversation 位保留、语义从「interact 长驻控制面」收窄为
166
- * 「resume 续聊能力」,gate 判据与消费方不变)。
167
- * [U6 / 永久会话模型 §3.2.6 要点 4] 新值 "cold" = 冷恢复会话:resume 读通道取
168
- * 结构化历史 + 新 session 注入(无热 steering)。gate 判据仍是 `=== "unsupported"`
169
- * 拒绝——"cold" 在 gate 面与 "native" 等价放行,差异只在续聊形态(新 session
170
- * 注入 vs 原地续写)。
168
+ * 「resume 续聊能力」。[modeless 波2] 会话形态键只剩 run.params.resume(协议
169
+ * task.conversation 已删),本轴不再是 per-run 模式开关——描述各引擎的真实
170
+ * 续聊差异(gate 判据仍是 `=== "unsupported"` 拒绝,"cold" 与 "native" 等价
171
+ * 放行)。
171
172
  */
172
173
  conversation: "native" | "cold" | "unsupported";
173
174
  /** 决定 persona 路由策略(file/flag/prompt 通道)。 */
@@ -280,7 +281,7 @@ interface ModelCatalogEntry {
280
281
  *
281
282
  * 字段裁决(对照 core orchestration/models/types.ts AgentCallOpts,2026-09-09):
282
283
  * - 入选 = 引擎消费面:任务语义(prompt/schema/thinkingLevel/skill/skillPath/agent/persona 注入)、
283
- * 轮次预算(maxTurns/graceTurns/conversation/idleTimeoutMs)、隔离与权限(worktree/
284
+ * 轮次预算(maxTurns/graceTurns/idleTimeoutMs)、隔离与权限(worktree/
284
285
  * fork/forkSource/denyTools/permissionMode)、诊断(description/scene);
285
286
  * - 排除并改挂 run.params.ctx(协议层已单列,task 内双写会分叉):model(→ctx.model)、
286
287
  * schemaEnv(→ctx.schemaEnv)、cwd(→ctx.cwd)、engineFallback(→ctx.engineFallback);
@@ -327,9 +328,7 @@ interface AgentCallOpts {
327
328
  forkSource?: string;
328
329
  /** Filesystem isolation: 新建 worktree | 复用外部已创建 worktree | 不隔离。 */
329
330
  worktree?: boolean | WorktreeHandle;
330
- /** 可持续对话模式:true = 轮次完成进 idle 态等待 message 续聊。 */
331
- conversation?: boolean;
332
- /** 空闲超时毫秒数(仅 conversation 模式有意义)。显式 0/负 = 禁用 idle GC。 */
331
+ /** 空闲超时毫秒数([modeless] 全体 record 的 idle 回收节奏;显式 0/负 = 禁用 idle GC)。 */
333
332
  idleTimeoutMs?: number;
334
333
  /** 工具 denylist(各引擎做语法映射)。 */
335
334
  denyTools?: string[];
package/dist/env.d.cts CHANGED
@@ -23,7 +23,14 @@ interface EngineChildEnvOptions {
23
23
  electronRunAsNode?: boolean;
24
24
  /** L0:relay 三键(宿主 relay 激活时传;三键必经 L0——L1 拒绝 XYZ_SUBAGENT_ 前缀、L2 是 manifest 面,两层都到不了) */
25
25
  relay?: EngineRelayEnv;
26
- /** L0:引擎侧身份 env(PI_SUBAGENT_ROOT_SESSION_ID 等,base-tool-enhance / 递归可见性消费) */
26
+ /**
27
+ * L0:引擎侧身份 env 透传通道(identityEnv)。现行事实(ext-simplify-17 D4,
28
+ * 20260914 真机探针证实):PI_SUBAGENT_ROOT_SESSION_ID / PI_SUBAGENT_SELF_RECORD_ID
29
+ * 两键已无写入方(本通道现无人传值),引擎链统一 subagent 标记 = XYZ_AGENT_SUBAGENT=1
30
+ * (见 injectL0InfraKeys 恒注入),base-tool-enhance 判据已重锚新标记。通道保留待
31
+ * 另行裁决,读者见 docs/architecture/ext-simplify-17-shared-extraction.md §3.1 D4
32
+ * 与探针报告 .tmp/dev-flow/ext-simplify-17-d4-probe.md。
33
+ */
27
34
  identityEnv?: Record<string, string | undefined>;
28
35
  /** L2:manifest 声明的 envPrefixes 放行清单(保留前缀拒绝 + 形态校验) */
29
36
  envPrefixes?: readonly string[];
package/dist/env.d.ts CHANGED
@@ -23,7 +23,14 @@ interface EngineChildEnvOptions {
23
23
  electronRunAsNode?: boolean;
24
24
  /** L0:relay 三键(宿主 relay 激活时传;三键必经 L0——L1 拒绝 XYZ_SUBAGENT_ 前缀、L2 是 manifest 面,两层都到不了) */
25
25
  relay?: EngineRelayEnv;
26
- /** L0:引擎侧身份 env(PI_SUBAGENT_ROOT_SESSION_ID 等,base-tool-enhance / 递归可见性消费) */
26
+ /**
27
+ * L0:引擎侧身份 env 透传通道(identityEnv)。现行事实(ext-simplify-17 D4,
28
+ * 20260914 真机探针证实):PI_SUBAGENT_ROOT_SESSION_ID / PI_SUBAGENT_SELF_RECORD_ID
29
+ * 两键已无写入方(本通道现无人传值),引擎链统一 subagent 标记 = XYZ_AGENT_SUBAGENT=1
30
+ * (见 injectL0InfraKeys 恒注入),base-tool-enhance 判据已重锚新标记。通道保留待
31
+ * 另行裁决,读者见 docs/architecture/ext-simplify-17-shared-extraction.md §3.1 D4
32
+ * 与探针报告 .tmp/dev-flow/ext-simplify-17-d4-probe.md。
33
+ */
27
34
  identityEnv?: Record<string, string | undefined>;
28
35
  /** L2:manifest 声明的 envPrefixes 放行清单(保留前缀拒绝 + 形态校验) */
29
36
  envPrefixes?: readonly string[];
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent, E as EngineCapabilities } from './contract-types-C71Sqq8d.js';
1
+ import { a as AgentEvent, E as EngineCapabilities } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
4
  interface ProtocolError {
@@ -87,20 +87,19 @@ declare class EngineSdkError extends Error {
87
87
  }
88
88
  declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
89
89
  /**
90
- * [v1.x] resume 会话形态(run.params.resume)的 gate 拒绝具名错误(chat-domain
91
- * 设计 §3.2 D1-A + 验收 A6:manifest 无 conversation gate 位的引擎收到
92
- * conversation 请求 → 同步拒;[H1] 文案随 D5 语义收窄——续聊 = resume 续聊)。
93
- * 文案契约对齐 core capability-gate.ts conversation 分支(错误码
94
- * engine_capability_unsupported + 「去掉参数 / 修 manifest / 升级引擎包」恢复指引)
95
- * ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
90
+ * 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
91
+ * 引擎,message 续聊资格被拒——manifest conversation 能力轴消费,core
92
+ * capability-gate 的 conversation 分支与 message 资格门双写点共用本构造器)。
93
+ * 文案契约:错误码 engine_capability_unsupported + 「去掉参数 / 修 manifest /
94
+ * 升级引擎包」恢复指引,两侧一致防漂移。
96
95
  */
97
96
  declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
98
97
  /**
99
- * [v1.x] resume 会话形态(run.params.resume / task.conversation=true)派发前的同步 gate:
100
- * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError——
101
- * 进程/record 创建前同步拒(A6:run 域不受影响,仅 chat 面被拦)。
102
- * 判据单源:core 侧 capability-gate.assertTaskShapeSupported 的 conversation 分支
103
- * 覆盖同一能力位,协议客户端路径(W3 接线)消费本函数,防两处判据漂移。
98
+ * resume 会话形态(run.params.resume——唯一会话形态键)派发前的同步 gate:
99
+ * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
100
+ * ——进程/record 创建前同步拒(A6 方向防御:manifest/实装漂移时引擎侧自拒,
101
+ * 与 core capability-gate 同一能力位,防两侧判据漂移)。[modeless 波2] 协议
102
+ * task 的 conversation 键已删,本 gate 只对 resume 形态键生效。
104
103
  */
105
104
  declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
106
105
  /** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent, E as EngineCapabilities } from './contract-types-C71Sqq8d.cjs';
1
+ import { a as AgentEvent, E as EngineCapabilities } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
4
  interface ProtocolError {
@@ -87,20 +87,19 @@ declare class EngineSdkError extends Error {
87
87
  }
88
88
  declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
89
89
  /**
90
- * [v1.x] resume 会话形态(run.params.resume)的 gate 拒绝具名错误(chat-domain
91
- * 设计 §3.2 D1-A + 验收 A6:manifest 无 conversation gate 位的引擎收到
92
- * conversation 请求 → 同步拒;[H1] 文案随 D5 语义收窄——续聊 = resume 续聊)。
93
- * 文案契约对齐 core capability-gate.ts conversation 分支(错误码
94
- * engine_capability_unsupported + 「去掉参数 / 修 manifest / 升级引擎包」恢复指引)
95
- * ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
90
+ * 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
91
+ * 引擎,message 续聊资格被拒——manifest conversation 能力轴消费,core
92
+ * capability-gate 的 conversation 分支与 message 资格门双写点共用本构造器)。
93
+ * 文案契约:错误码 engine_capability_unsupported + 「去掉参数 / 修 manifest /
94
+ * 升级引擎包」恢复指引,两侧一致防漂移。
96
95
  */
97
96
  declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
98
97
  /**
99
- * [v1.x] resume 会话形态(run.params.resume / task.conversation=true)派发前的同步 gate:
100
- * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError——
101
- * 进程/record 创建前同步拒(A6:run 域不受影响,仅 chat 面被拦)。
102
- * 判据单源:core 侧 capability-gate.assertTaskShapeSupported 的 conversation 分支
103
- * 覆盖同一能力位,协议客户端路径(W3 接线)消费本函数,防两处判据漂移。
98
+ * resume 会话形态(run.params.resume——唯一会话形态键)派发前的同步 gate:
99
+ * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
100
+ * ——进程/record 创建前同步拒(A6 方向防御:manifest/实装漂移时引擎侧自拒,
101
+ * 与 core capability-gate 同一能力位,防两侧判据漂移)。[modeless 波2] 协议
102
+ * task 的 conversation 键已删,本 gate 只对 resume 形态键生效。
104
103
  */
105
104
  declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
106
105
  /** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
package/dist/index.cjs CHANGED
@@ -6813,7 +6813,7 @@ function engineConversationUnsupportedError(engineId) {
6813
6813
  return new EngineSdkError(
6814
6814
  "engine_capability_unsupported",
6815
6815
  `engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
6816
- `\u53BB\u6389 conversation \u53C2\u6570\uFF08\u4E00\u6B21\u6027\u4EFB\u52A1\u9ED8\u8BA4\u5F62\u6001\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
6816
+ `\u53BB\u6389 conversation \u53C2\u6570\uFF08modeless \u4E0B\u65E0\u884C\u4E3A\u6548\u679C\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
6817
6817
  { engineId, capability: "conversation", declared: "unsupported" }
6818
6818
  );
6819
6819
  }
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, CancelParams, CancelResult, DisposeParams, DisposeResult, ENGINE_EVENT_COALESCE_DEFAULT, ENGINE_EVENT_COALESCE_ENV, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, InitializeParams, InitializeResult, ListModelsParams, ListModelsResult, PROTOCOL_METHODS, PingParams, PingResult, ProbeParams, ProtocolMethod, ProtocolParamsMap, ProtocolResultMap, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReadParams, ReverseChannel, ReverseRequestTimeoutClass, RunContextParams, RunParams, RunResult, RunResumeParams, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, ValidateModelParams, ValidateModelResult, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.cjs';
2
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-CiOO3PMg.cjs';
3
- export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-C71Sqq8d.cjs';
2
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-SA5fGtx_.cjs';
3
+ export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-Dsvy79r3.cjs';
4
4
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.cjs';
5
5
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.cjs';
6
6
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.cjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { CANCEL_SETTLE_GRACE_MS, CRASH_REBUILD_BACKOFF_MS, CRASH_REBUILD_MAX_ATTEMPTS, CancelParams, CancelResult, DisposeParams, DisposeResult, ENGINE_EVENT_COALESCE_DEFAULT, ENGINE_EVENT_COALESCE_ENV, ENGINE_PROTOCOL_SCHEMAS, ENGINE_PROTOCOL_VERSION, FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS, HANDSHAKE_TIMEOUT_MS, HostAskUserParams, HostAskUserResult, HostChildSpawnedParams, HostChildStateChangedParams, HostHandleReadyParams, HostLogParams, HostStreamDeltaParams, InitializeParams, InitializeResult, ListModelsParams, ListModelsResult, PROTOCOL_METHODS, PingParams, PingResult, ProbeParams, ProtocolMethod, ProtocolParamsMap, ProtocolResultMap, REVERSE_CHANNELS, REVERSE_CHANNEL_TIMEOUT_CLASS, REVERSE_REQUEST_TIMEOUT_MS, ReadParams, ReverseChannel, ReverseRequestTimeoutClass, RunContextParams, RunParams, RunResult, RunResumeParams, STDERR_TAIL_CHARS, SUPPORTED_PROTOCOL_RANGE, ValidateModelParams, ValidateModelResult, errorResponseFrameSchema, isProtocolVersionCompatible, notificationFrameSchema, protocolErrorSchema, requestFrameSchema, reverseRequestFrameSchema, runSessionParamsSchema, successResponseFrameSchema } from './protocol/index.js';
2
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-D5YlWaBx.js';
3
- export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-C71Sqq8d.js';
2
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from './error-codes-OvQlqiQw.js';
3
+ export { A as AgentCallOpts, a as AgentEvent, b as AgentFailureKind, c as AgentOutcome, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, E as EngineCapabilities, h as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, i as ResumeAnchor, S as SessionView, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from './contract-types-Dsvy79r3.js';
4
4
  export { SCHEMA_EMULATION_TAIL_CHARS, StructuredOutputResult, buildSchemaEmulationSegment, extractAndValidateStructuredOutput } from './schema-emulation.js';
5
5
  export { ExecutionNestingContext, ExecutionNestingState, NESTED_SPAWN_ENV, NestedSpawnRejectedError, SpawnEnv, assertNotNestedSpawn, buildNestedSpawnEnv } from './nesting-guard.js';
6
6
  export { CoreLogger, LogLevel, LoggerSink, configureLoggerSink, getLogger, resetLoggerSinkForTests } from './logger.js';
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  probeNodeExecutor,
46
46
  resetEngineNodeProbeCache,
47
47
  resolveEngineNodeLaunch
48
- } from "./chunk-LKPVN3N6.js";
48
+ } from "./chunk-3IBT7MTB.js";
49
49
  import {
50
50
  DEFAULT_STDERR_KEEP_DAYS,
51
51
  DEFAULT_STDERR_MAX_BYTES,
@@ -105,7 +105,7 @@ import {
105
105
  abortWithFallback,
106
106
  killChain,
107
107
  synthesizeTimeoutOutcome
108
- } from "./chunk-FJT23P7T.js";
108
+ } from "./chunk-WORT4PG7.js";
109
109
  import {
110
110
  toErrorMessage
111
111
  } from "./chunk-PYO3YR7W.js";
@@ -133,7 +133,7 @@ import {
133
133
  isEngineProtocolErrorCode,
134
134
  isProtocolVersionCompatible,
135
135
  schemaEmulationFailedDetail
136
- } from "./chunk-WS4WAZVR.js";
136
+ } from "./chunk-F5JZMK74.js";
137
137
  import {
138
138
  aggregateUsage,
139
139
  createReplayRecord,
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent } from './contract-types-C71Sqq8d.cjs';
1
+ import { a as AgentEvent } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { a as AgentEvent } from './contract-types-C71Sqq8d.js';
1
+ import { a as AgentEvent } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /**
4
4
  * 重放 journal:读取路径下全部事件,重放即得 AgentEvent 流(read 第②级)。
@@ -1,4 +1,4 @@
1
- import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-C71Sqq8d.cjs';
1
+ import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -1,4 +1,4 @@
1
- import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-C71Sqq8d.js';
1
+ import { l as Turn, f as AgentUsageTotal, a as AgentEvent, S as SessionView, h as EngineHandleData, R as ReplayedTurn } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /**
4
4
  * reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
@@ -1,5 +1,5 @@
1
- export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-CiOO3PMg.cjs';
2
- import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-C71Sqq8d.cjs';
1
+ export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-SA5fGtx_.cjs';
2
+ import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-Dsvy79r3.cjs';
3
3
 
4
4
  /**
5
5
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -1,5 +1,5 @@
1
- export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-D5YlWaBx.js';
2
- import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-C71Sqq8d.js';
1
+ export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-OvQlqiQw.js';
2
+ import { A as AgentCallOpts, c as AgentOutcome } from './contract-types-Dsvy79r3.js';
3
3
 
4
4
  /**
5
5
  * 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
@@ -5,11 +5,11 @@ import {
5
5
  abortWithFallback,
6
6
  killChain,
7
7
  synthesizeTimeoutOutcome
8
- } from "./chunk-FJT23P7T.js";
8
+ } from "./chunk-WORT4PG7.js";
9
9
  import "./chunk-PYO3YR7W.js";
10
10
  import {
11
11
  STDOUT_TAIL_ECHO_CHARS
12
- } from "./chunk-WS4WAZVR.js";
12
+ } from "./chunk-F5JZMK74.js";
13
13
  import "./chunk-75QEMUGV.js";
14
14
  import "./chunk-JSBRDJBE.js";
15
15
  export {
@@ -4,8 +4,8 @@ import {
4
4
  probeNodeExecutor,
5
5
  resetEngineNodeProbeCache,
6
6
  resolveEngineNodeLaunch
7
- } from "./chunk-LKPVN3N6.js";
8
- import "./chunk-WS4WAZVR.js";
7
+ } from "./chunk-3IBT7MTB.js";
8
+ import "./chunk-F5JZMK74.js";
9
9
  import "./chunk-JSBRDJBE.js";
10
10
  export {
11
11
  ENGINE_NODE_ENV,
@@ -1,4 +1,4 @@
1
- import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent, i as ResumeAnchor, c as AgentOutcome, S as SessionView } from './contract-types-C71Sqq8d.cjs';
1
+ import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent, i as ResumeAnchor, c as AgentOutcome, S as SessionView } from './contract-types-Dsvy79r3.cjs';
2
2
 
3
3
  /**
4
4
  * 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
@@ -1,4 +1,4 @@
1
- import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent, i as ResumeAnchor, c as AgentOutcome, S as SessionView } from './contract-types-C71Sqq8d.js';
1
+ import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent, i as ResumeAnchor, c as AgentOutcome, S as SessionView } from './contract-types-Dsvy79r3.js';
2
2
 
3
3
  /**
4
4
  * 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
@@ -188,7 +188,7 @@ function engineConversationUnsupportedError(engineId) {
188
188
  return new EngineSdkError(
189
189
  "engine_capability_unsupported",
190
190
  `engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
191
- `\u53BB\u6389 conversation \u53C2\u6570\uFF08\u4E00\u6B21\u6027\u4EFB\u52A1\u9ED8\u8BA4\u5F62\u6001\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
191
+ `\u53BB\u6389 conversation \u53C2\u6570\uFF08modeless \u4E0B\u65E0\u884C\u4E3A\u6548\u679C\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
192
192
  { engineId, capability: "conversation", declared: "unsupported" }
193
193
  );
194
194
  }
@@ -1,6 +1,6 @@
1
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from '../error-codes-CiOO3PMg.cjs';
2
- import { E as EngineCapabilities, M as ModelCatalogEntry, A as AgentCallOpts, i as ResumeAnchor, h as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from '../contract-types-C71Sqq8d.cjs';
3
- export { a as AgentEvent, b as AgentFailureKind, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from '../contract-types-C71Sqq8d.cjs';
1
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from '../error-codes-SA5fGtx_.cjs';
2
+ import { E as EngineCapabilities, M as ModelCatalogEntry, A as AgentCallOpts, i as ResumeAnchor, h as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from '../contract-types-Dsvy79r3.cjs';
3
+ export { a as AgentEvent, b as AgentFailureKind, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from '../contract-types-Dsvy79r3.cjs';
4
4
  import { UiRequest, UiResponse } from '../ui-types.cjs';
5
5
 
6
6
  /** 协议版本(引擎包 manifest `xyz-agent.subagentEngine.protocol` 与 initialize 应答同值)。 */
@@ -1,6 +1,6 @@
1
- export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from '../error-codes-D5YlWaBx.js';
2
- import { E as EngineCapabilities, M as ModelCatalogEntry, A as AgentCallOpts, i as ResumeAnchor, h as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from '../contract-types-C71Sqq8d.js';
3
- export { a as AgentEvent, b as AgentFailureKind, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from '../contract-types-C71Sqq8d.js';
1
+ export { E as ENGINE_ERROR_CODE_PREFIX, a as ENGINE_PROTOCOL_ERROR_CODES, b as ENGINE_TIMEOUT_RECOVERY, c as EngineProtocolErrorCode, d as EngineSdkError, e as ErrorResponseFrame, f as EventNotificationParams, N as NotificationFrame, P as ProtocolError, R as RequestFrame, g as ResponseFrame, h as ReverseRequestFrame, i as ReverseResponseResult, S as STDOUT_TAIL_ECHO_CHARS, j as SuccessResponseFrame, k as assertChatConversationSupported, l as engineConversationUnsupportedError, m as engineProtocolMismatchError, n as engineTimeoutDetail, o as isEngineErrorPassthroughCode, p as isEngineProtocolErrorCode, q as isNotificationFrame, r as isRequestFrame, s as isResponseFrame, t as isReverseRequestFrame, u as schemaEmulationFailedDetail } from '../error-codes-OvQlqiQw.js';
2
+ import { E as EngineCapabilities, M as ModelCatalogEntry, A as AgentCallOpts, i as ResumeAnchor, h as EngineHandleData, P as ProbeReport, c as AgentOutcome, S as SessionView } from '../contract-types-Dsvy79r3.js';
3
+ export { a as AgentEvent, b as AgentFailureKind, d as AgentOutcomeUsage, e as AgentUsage, f as AgentUsageTotal, g as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, j as ToolCallEntry, k as ToolCallResult, l as Turn, W as WorktreeHandle } from '../contract-types-Dsvy79r3.js';
4
4
  import { UiRequest, UiResponse } from '../ui-types.js';
5
5
 
6
6
  /** 协议版本(引擎包 manifest `xyz-agent.subagentEngine.protocol` 与 initialize 应答同值)。 */
@@ -40,7 +40,7 @@ import {
40
40
  isEngineProtocolErrorCode,
41
41
  isProtocolVersionCompatible,
42
42
  schemaEmulationFailedDetail
43
- } from "../chunk-WS4WAZVR.js";
43
+ } from "../chunk-F5JZMK74.js";
44
44
  import "../chunk-JSBRDJBE.js";
45
45
  export {
46
46
  CANCEL_SETTLE_GRACE_MS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhushanwen/subagent-engine-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Engine-side SDK for the subagent engine protocol: NDJSON stdio contract types, engine primitives (schema emulation, nesting guard, kill chain, journal replay projection, data-dir/paths resolution) — the shared contract root between subagent-core and engine CLI packages (engines import SDK only, never core)",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/env.ts CHANGED
@@ -67,7 +67,14 @@ export interface EngineChildEnvOptions {
67
67
  electronRunAsNode?: boolean;
68
68
  /** L0:relay 三键(宿主 relay 激活时传;三键必经 L0——L1 拒绝 XYZ_SUBAGENT_ 前缀、L2 是 manifest 面,两层都到不了) */
69
69
  relay?: EngineRelayEnv;
70
- /** L0:引擎侧身份 env(PI_SUBAGENT_ROOT_SESSION_ID 等,base-tool-enhance / 递归可见性消费) */
70
+ /**
71
+ * L0:引擎侧身份 env 透传通道(identityEnv)。现行事实(ext-simplify-17 D4,
72
+ * 20260914 真机探针证实):PI_SUBAGENT_ROOT_SESSION_ID / PI_SUBAGENT_SELF_RECORD_ID
73
+ * 两键已无写入方(本通道现无人传值),引擎链统一 subagent 标记 = XYZ_AGENT_SUBAGENT=1
74
+ * (见 injectL0InfraKeys 恒注入),base-tool-enhance 判据已重锚新标记。通道保留待
75
+ * 另行裁决,读者见 docs/architecture/ext-simplify-17-shared-extraction.md §3.1 D4
76
+ * 与探针报告 .tmp/dev-flow/ext-simplify-17-d4-probe.md。
77
+ */
71
78
  identityEnv?: Record<string, string | undefined>;
72
79
  /** L2:manifest 声明的 envPrefixes 放行清单(保留前缀拒绝 + 形态校验) */
73
80
  envPrefixes?: readonly string[];
@@ -196,13 +196,14 @@ export interface EngineCapabilities {
196
196
  /** 注意区分「引擎 RPC 层有此能力」与「subagent 链路已接通」。 */
197
197
  steer: "native" | "emulated" | "unsupported";
198
198
  /**
199
- * [H1 D5 语义收窄] resume 能力位(chat 续聊 = 新 run + resume 锚点的承载前提;
199
+ * [H1 D5 语义收窄 + modeless] 「怎么续」形态轴兼 message 资格轴:
200
+ * 位非 'unsupported' = 引擎可续聊(core capability-gate 的 message 资格门消费),
201
+ * 值区分续聊形态——native(原地续写)/ cold(冷恢复重建 + 新 run + resume 锚点)。
200
202
  * 原名字沿用——conversation 位保留、语义从「interact 长驻控制面」收窄为
201
- * 「resume 续聊能力」,gate 判据与消费方不变)。
202
- * [U6 / 永久会话模型 §3.2.6 要点 4] 新值 "cold" = 冷恢复会话:resume 读通道取
203
- * 结构化历史 + 新 session 注入(无热 steering)。gate 判据仍是 `=== "unsupported"`
204
- * 拒绝——"cold" 在 gate 面与 "native" 等价放行,差异只在续聊形态(新 session
205
- * 注入 vs 原地续写)。
203
+ * 「resume 续聊能力」。[modeless 波2] 会话形态键只剩 run.params.resume(协议
204
+ * task.conversation 已删),本轴不再是 per-run 模式开关——描述各引擎的真实
205
+ * 续聊差异(gate 判据仍是 `=== "unsupported"` 拒绝,"cold" 与 "native" 等价
206
+ * 放行)。
206
207
  */
207
208
  conversation: "native" | "cold" | "unsupported";
208
209
  /** 决定 persona 路由策略(file/flag/prompt 通道)。 */
@@ -321,7 +322,7 @@ export interface ModelCatalogEntry {
321
322
  *
322
323
  * 字段裁决(对照 core orchestration/models/types.ts AgentCallOpts,2026-09-09):
323
324
  * - 入选 = 引擎消费面:任务语义(prompt/schema/thinkingLevel/skill/skillPath/agent/persona 注入)、
324
- * 轮次预算(maxTurns/graceTurns/conversation/idleTimeoutMs)、隔离与权限(worktree/
325
+ * 轮次预算(maxTurns/graceTurns/idleTimeoutMs)、隔离与权限(worktree/
325
326
  * fork/forkSource/denyTools/permissionMode)、诊断(description/scene);
326
327
  * - 排除并改挂 run.params.ctx(协议层已单列,task 内双写会分叉):model(→ctx.model)、
327
328
  * schemaEnv(→ctx.schemaEnv)、cwd(→ctx.cwd)、engineFallback(→ctx.engineFallback);
@@ -368,9 +369,7 @@ export interface AgentCallOpts {
368
369
  forkSource?: string;
369
370
  /** Filesystem isolation: 新建 worktree | 复用外部已创建 worktree | 不隔离。 */
370
371
  worktree?: boolean | WorktreeHandle;
371
- /** 可持续对话模式:true = 轮次完成进 idle 态等待 message 续聊。 */
372
- conversation?: boolean;
373
- /** 空闲超时毫秒数(仅 conversation 模式有意义)。显式 0/负 = 禁用 idle GC。 */
372
+ /** 空闲超时毫秒数([modeless] 全体 record 的 idle 回收节奏;显式 0/负 = 禁用 idle GC)。 */
374
373
  idleTimeoutMs?: number;
375
374
  /** 工具 denylist(各引擎做语法映射)。 */
376
375
  denyTools?: string[];
@@ -11,10 +11,11 @@
11
11
  // 不影响其他引擎与宿主。
12
12
  //
13
13
  // [v1.x 增量语义(chat-domain 设计 §3.2 D1-A/§3.3)][H1 后历史叙述——run.params.chat
14
- // 已随 U6 删除,现唯一会话形态键 = run.params.resume]:chat 域增量(原 run.params.chat
15
- // 可选参数、host/streamDelta 的 recordId 关联形态)曾以**可选载荷/可选参数**形态向后
16
- // 兼容,major 不 bump、不引入 minor 协商位:
17
- // - 新 core × 旧引擎:conversation 请求(resume 续聊形态)被 conversation gate
14
+ // 已随 U6 删除,现唯一会话形态键 = run.params.resume;[modeless 波2] 协议 task 的
15
+ // conversation 键已删(core 侧 deprecated 参数不再上 wire,resume 键携带全部会话
16
+ // 形态)]:chat 域增量曾以**可选载荷/可选参数**形态向后兼容,major 不 bump、不引入
17
+ // minor 协商位:
18
+ // - 新 core × 旧引擎:会话形态请求(resume 续聊)被 conversation gate
18
19
  // 同步拒(manifest 无 gate 位,
19
20
  // A6 方向——engine_capability_unsupported + 升级引擎包指引);run 域零影响;
20
21
  // 事件变体增量同政策(例:activity 活性信号变体):新变体以可选载荷形态进
@@ -101,33 +101,32 @@ export function engineProtocolMismatchError(engineVersion: number): EngineSdkErr
101
101
  }
102
102
 
103
103
  // ============================================================
104
- // [v1.x] conversation gate 位负向:conversation 请求(resume 续聊会话形态)同步拒
104
+ // conversation gate 位负向:manifest 能力轴(message 资格 / 「怎么续」形态轴)
105
105
  // ============================================================
106
106
 
107
107
  /**
108
- * [v1.x] resume 会话形态(run.params.resume)的 gate 拒绝具名错误(chat-domain
109
- * 设计 §3.2 D1-A + 验收 A6:manifest 无 conversation gate 位的引擎收到
110
- * conversation 请求 → 同步拒;[H1] 文案随 D5 语义收窄——续聊 = resume 续聊)。
111
- * 文案契约对齐 core capability-gate.ts conversation 分支(错误码
112
- * engine_capability_unsupported + 「去掉参数 / 修 manifest / 升级引擎包」恢复指引)
113
- * ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
108
+ * 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
109
+ * 引擎,message 续聊资格被拒——manifest conversation 能力轴消费,core
110
+ * capability-gate 的 conversation 分支与 message 资格门双写点共用本构造器)。
111
+ * 文案契约:错误码 engine_capability_unsupported + 「去掉参数 / 修 manifest /
112
+ * 升级引擎包」恢复指引,两侧一致防漂移。
114
113
  */
115
114
  export function engineConversationUnsupportedError(engineId: string): EngineSdkError {
116
115
  return new EngineSdkError(
117
116
  "engine_capability_unsupported",
118
117
  `engine '${engineId}' 不支持 resume 续聊(capabilities.conversation = 'unsupported',` +
119
118
  `manifest 无 conversation gate 位)`,
120
- `去掉 conversation 参数(一次性任务默认形态),或修 manifest capabilities / 升级引擎包(若引擎实际支持该能力)`,
119
+ `去掉 conversation 参数(modeless 下无行为效果),或修 manifest capabilities / 升级引擎包(若引擎实际支持该能力)`,
121
120
  { engineId, capability: "conversation", declared: "unsupported" },
122
121
  );
123
122
  }
124
123
 
125
124
  /**
126
- * [v1.x] resume 会话形态(run.params.resume / task.conversation=true)派发前的同步 gate:
127
- * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError——
128
- * 进程/record 创建前同步拒(A6:run 域不受影响,仅 chat 面被拦)。
129
- * 判据单源:core 侧 capability-gate.assertTaskShapeSupported 的 conversation 分支
130
- * 覆盖同一能力位,协议客户端路径(W3 接线)消费本函数,防两处判据漂移。
125
+ * resume 会话形态(run.params.resume——唯一会话形态键)派发前的同步 gate:
126
+ * manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
127
+ * ——进程/record 创建前同步拒(A6 方向防御:manifest/实装漂移时引擎侧自拒,
128
+ * 与 core capability-gate 同一能力位,防两侧判据漂移)。[modeless 波2] 协议
129
+ * task 的 conversation 键已删,本 gate 只对 resume 形态键生效。
131
130
  */
132
131
  export function assertChatConversationSupported(
133
132
  engineId: string,