@zhushanwen/subagent-engine-sdk 0.10.1 → 0.11.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.
Files changed (62) hide show
  1. package/dist/{chunk-AF2ETADP.js → chunk-2L3I2TWJ.js} +5 -10
  2. package/dist/{chunk-HSNDUHFH.js → chunk-3MCOZY3Z.js} +32 -4
  3. package/dist/{chunk-JZN76I3S.js → chunk-NVF3PADP.js} +29 -1
  4. package/dist/{chunk-LM7P7OTA.js → chunk-QBXDEF4N.js} +35 -3
  5. package/dist/{chunk-NTOLHLCL.js → chunk-QGXILDWB.js} +1 -1
  6. package/dist/{chunk-CNCFMPEH.js → chunk-TJMS3YOR.js} +1 -1
  7. package/dist/{chunk-SGAIDL63.js → chunk-YFSNX3N3.js} +2 -2
  8. package/dist/cli-entry.d.cts +1 -1
  9. package/dist/cli-entry.d.ts +1 -1
  10. package/dist/{contract-types-jSa1g28F.d.cts → contract-types-BUHUMF9R.d.cts} +17 -17
  11. package/dist/{contract-types-jSa1g28F.d.ts → contract-types-BUHUMF9R.d.ts} +17 -17
  12. package/dist/env.cjs +5 -10
  13. package/dist/env.d.cts +6 -17
  14. package/dist/env.d.ts +6 -17
  15. package/dist/env.js +1 -1
  16. package/dist/{error-codes-f-UO4a8D.d.cts → error-codes-D_aPibUt.d.cts} +42 -6
  17. package/dist/{error-codes-DnFru4L4.d.ts → error-codes-DrNf0gwT.d.ts} +42 -6
  18. package/dist/index.cjs +126 -97
  19. package/dist/index.d.cts +28 -40
  20. package/dist/index.d.ts +28 -40
  21. package/dist/index.js +38 -57
  22. package/dist/journal-io.d.cts +1 -1
  23. package/dist/journal-io.d.ts +1 -1
  24. package/dist/journal-replay.cjs +2 -2
  25. package/dist/journal-replay.d.cts +4 -4
  26. package/dist/journal-replay.d.ts +4 -4
  27. package/dist/journal-replay.js +1 -1
  28. package/dist/kill-chain.d.cts +5 -5
  29. package/dist/kill-chain.d.ts +5 -5
  30. package/dist/kill-chain.js +2 -2
  31. package/dist/logger.d.cts +1 -1
  32. package/dist/logger.d.ts +1 -1
  33. package/dist/logs/stderr-rotation.d.cts +4 -4
  34. package/dist/logs/stderr-rotation.d.ts +4 -4
  35. package/dist/{methods-C2zvZqhP.d.ts → methods-BdIH3FwS.d.ts} +5 -5
  36. package/dist/{methods-BLxg4ZFr.d.cts → methods-CHiDwvRK.d.cts} +5 -5
  37. package/dist/node-executor.cjs +1 -1
  38. package/dist/node-executor.d.cts +4 -4
  39. package/dist/node-executor.d.ts +4 -4
  40. package/dist/node-executor.js +2 -2
  41. package/dist/port-contract.d.cts +9 -9
  42. package/dist/port-contract.d.ts +9 -9
  43. package/dist/protocol/index.cjs +73 -4
  44. package/dist/protocol/index.d.cts +57 -14
  45. package/dist/protocol/index.d.ts +57 -14
  46. package/dist/protocol/index.js +20 -2
  47. package/dist/server/index.cjs +1 -1
  48. package/dist/server/index.d.cts +10 -10
  49. package/dist/server/index.d.ts +10 -10
  50. package/dist/server/index.js +1 -1
  51. package/dist/spawn.cjs +32 -3
  52. package/dist/spawn.d.cts +34 -8
  53. package/dist/spawn.d.ts +34 -8
  54. package/dist/spawn.js +5 -3
  55. package/dist/ui-types.d.cts +2 -2
  56. package/dist/ui-types.d.ts +2 -2
  57. package/package.json +2 -2
  58. package/dist/chunk-GSW3DMN6.js +0 -39
  59. package/dist/relay-env.cjs +0 -71
  60. package/dist/relay-env.d.cts +0 -37
  61. package/dist/relay-env.d.ts +0 -37
  62. package/dist/relay-env.js +0 -23
package/dist/env.d.ts CHANGED
@@ -1,18 +1,9 @@
1
1
  /** L2 manifest 放行的保留前缀拒绝表(镜像 shared SSOT,勿单独改动)。 */
2
2
  declare const ENGINE_ENV_PREFIXES: readonly string[];
3
- /** L1 deny + 显式剥除键集(镜像 shared SSOT,勿单独改动)。
4
- * 互引(场景域分化,勿互混):dev 装配器(apps/electron/scripts/dev-instance-lib.mjs
5
- * `LEAK_ENV_KEYS`)仍剥 RELAY_STD* 三键——dev 宿主进程环境防泄漏口径独立于引擎
6
- * spawn 面;本清单(引擎侧)已退役同名三键,写入方已清零。 */
3
+ /** L1 deny + 显式剥除键集(镜像 shared SSOT,勿单独改动)。 */
7
4
  declare const ENGINE_ENV_DENY_LIST: readonly string[];
8
- /** L0 注入的全部基础设施键(守卫断言:与 ENGINE_ENV_DENY_LIST 交集 = ∅)。 */
5
+ /** L0 注入的全部基础设施键(检查断言:与 ENGINE_ENV_DENY_LIST 交集 = ∅)。 */
9
6
  declare const ENGINE_ENV_L0_INFRA_KEYS: readonly string[];
10
- /** relay 三键形态(宿主 relay 激活时三值同时非空,全有或全无)。 */
11
- interface EngineRelayEnv {
12
- socket: string;
13
- node: string;
14
- script: string;
15
- }
16
7
  /** buildEngineChildEnv 入参。 */
17
8
  interface EngineChildEnvOptions {
18
9
  /** L0:引擎数据根(隔离库/池/journal 都相对它推导;缺 env 且无注入引擎侧须显式报错) */
@@ -21,8 +12,6 @@ interface EngineChildEnvOptions {
21
12
  engineNode?: string;
22
13
  /** L0:执行器为 Electron 二进制 → 注入 ELECTRON_RUN_AS_NODE=1 */
23
14
  electronRunAsNode?: boolean;
24
- /** L0:relay 三键(宿主 relay 激活时传;三键必经 L0——L1 拒绝 TAIJI_SUBAGENT_ 前缀、L2 是 manifest 面,两层都到不了) */
25
- relay?: EngineRelayEnv;
26
15
  /**
27
16
  * L0:引擎宿主(engine-host)进程的 env 透传通道。**注意它不是子代理身份通道**:
28
17
  * 引擎宿主是长驻进程(每窗口一个),而子代理身份(recordId / depth 等)是 per-run 的
@@ -46,9 +35,9 @@ interface EngineChildEnvOptions {
46
35
  *
47
36
  * 层规格(impl-plan §2.12 三层表):
48
37
  * - L0 基础设施键:TAIJI_AGENT_DATA_DIR / TAIJI_AGENT_ENGINE_NODE / ELECTRON_RUN_AS_NODE
49
- * (条件)/ TAIJI_AGENT_SUBAGENT=1 / relay 三键 / identityEnv(injectL0InfraKeys);
38
+ * (条件)/ TAIJI_AGENT_SUBAGENT=1 / identityEnv(injectL0InfraKeys);
50
39
  * - L1 deny + 显式剥除(恒高于 manifest 放行):ENGINE_ENV_DENY_LIST
51
- * (deny 两键 + 凭证键 + 父身份键 + 防御性剥除三死名);
40
+ * (deny 两键 + 凭证键 + 预设回落两键);
52
41
  * - L2 manifest 放行:envPrefixes 声明前缀的 processEnv 键(保留前缀拒绝、
53
42
  * 形态校验、未声明前缀不放行 + warn)(applyManifestAllowlist)。
54
43
  *
@@ -70,7 +59,7 @@ interface BuildOutboundChildEnvOptions {
70
59
  * 消费生命周期标志 / WS 令牌。
71
60
  *
72
61
  * 与 @taiji/shared 版 buildOutboundChildEnv 的刻意差异:**缺省不做白名单过滤**
73
- * (prefixes 省略 = 全量继承父 env + deny 剥除)。理由:SDK 消费面(zsw 宿主 /
62
+ * (prefixes 省略 = 全量继承父 env + deny 剥除)。理由:SDK 消费方(zsw 宿主 /
74
63
  * 引擎 CLI)不可 import shared 的 ENV_WHITELIST_PREFIXES;引擎 spawn 的基座由
75
64
  * 调用方先经 buildEngineChildEnv 组装(其 baseEnv 已是 core 过滤后的),而
76
65
  * ambient 场景(git 需要 GIT_* / proxy / ssh 等)必须保留继承面——deny-by-default
@@ -80,4 +69,4 @@ interface BuildOutboundChildEnvOptions {
80
69
  */
81
70
  declare function buildOutboundChildEnv(opts: BuildOutboundChildEnvOptions): Record<string, string>;
82
71
 
83
- export { type BuildOutboundChildEnvOptions, ENGINE_ENV_DENY_LIST, ENGINE_ENV_L0_INFRA_KEYS, ENGINE_ENV_PREFIXES, type EngineChildEnvOptions, type EngineRelayEnv, buildEngineChildEnv, buildOutboundChildEnv };
72
+ export { type BuildOutboundChildEnvOptions, ENGINE_ENV_DENY_LIST, ENGINE_ENV_L0_INFRA_KEYS, ENGINE_ENV_PREFIXES, type EngineChildEnvOptions, buildEngineChildEnv, buildOutboundChildEnv };
package/dist/env.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  ENGINE_ENV_PREFIXES,
5
5
  buildEngineChildEnv,
6
6
  buildOutboundChildEnv
7
- } from "./chunk-AF2ETADP.js";
7
+ } from "./chunk-2L3I2TWJ.js";
8
8
  import "./chunk-NXNNXGTY.js";
9
9
  import "./chunk-JSBRDJBE.js";
10
10
  export {
@@ -1,4 +1,4 @@
1
- import { A as AgentEvent, d as EngineCapabilities } from './contract-types-jSa1g28F.cjs';
1
+ import { A as AgentEvent, d as EngineCapabilities } from './contract-types-BUHUMF9R.cjs';
2
2
 
3
3
  /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
4
  interface ProtocolError {
@@ -42,7 +42,7 @@ interface ReverseRequestFrame {
42
42
  }
43
43
  /** 反向请求的应答(core → 引擎,沿 ResponseFrame 通道回传;id = 反向请求 id 原样)。 */
44
44
  type ReverseResponseResult =
45
- /** 数据面类:处理确认。 */
45
+ /** 数据范围类:处理确认。 */
46
46
  {
47
47
  ok: true;
48
48
  }
@@ -63,6 +63,42 @@ declare function isNotificationFrame(frame: unknown): frame is NotificationFrame
63
63
  /** ④ 反向请求:有字符串 id + host/* method + params(与①的区别 = id 形态与 method 前缀)。 */
64
64
  declare function isReverseRequestFrame(frame: unknown): frame is ReverseRequestFrame;
65
65
 
66
+ /**
67
+ * 引擎进程侧 spawn/送达窗口错误码(M1/M2 送达回执,设计 D10「engine 侧」)。
68
+ * 消费方 = pi-subagent-cli(u-m2-engine-ack 接线):
69
+ * - prompt_not_delivered:prompt 写入后零 stdout(零输出判定)/ stdin 不可用 / EPIPE——
70
+ * 任务从未被真实 pi 受理,静默丢失的显式失败形态;
71
+ * - prompt_rejected:pi 对 prompt 命令回 success:false(已送达但被拒绝)——带 pi 的
72
+ * error 文本,与 not_delivered 分型防误诊(D3 不采用合并条目);
73
+ * - spawn_handshake_timeout:引擎 spawn 握手窗口超时——runtime/引擎停在
74
+ * spawn/handshake 的显式失败(control 侧同类失败码 = engine_open_timeout)。
75
+ */
76
+ declare const ENGINE_SPAWN_DELIVERY_ERROR_CODES: readonly ["engine_prompt_not_delivered", "engine_prompt_rejected", "engine_spawn_handshake_timeout"];
77
+ type EngineSpawnDeliveryErrorCode = (typeof ENGINE_SPAWN_DELIVERY_ERROR_CODES)[number];
78
+ /**
79
+ * runtime 控制面传输错误码(M3 control 通道,设计 D8/D10「runtime 侧」)。
80
+ * 消费方 = EngineClient.connectOnce preserve 白名单(u-m3-local:来自
81
+ * RuntimeEngineTransport 的 EngineSdkError 原样保留 code 与 recovery,不再包装成
82
+ * engine_crashed——UC-20 的显式失败不被吞掉)。语义(设计 D5/D8):
83
+ * - transport_unavailable:control socket connect / hello 失败——托管态 runtime 故障
84
+ * 显式可见,不静默回退 local spawn;
85
+ * - transport_lost:control 连接中途丢失(与 engine 自身 crash 区分)——标记不可用、
86
+ * fan-out 该连接全部 in-flight,不在同一连接重试;
87
+ * - open_timeout:engine_open 超时(runtime spawn/归属卡住);
88
+ * - frame_too_large:单帧(含 partial-line 缓冲)超 32MB 上限——不截断、按 channel
89
+ * 归因关闭;
90
+ * - backpressure_overflow:channel(32MB/4096 帧)或连接聚合(256MB)待写队列溢出——
91
+ * 不丢帧、不静默,溢出面(channel/connection)标注在 detail。
92
+ */
93
+ declare const ENGINE_TRANSPORT_ERROR_CODES: readonly ["engine_transport_unavailable", "engine_transport_lost", "engine_open_timeout", "engine_frame_too_large", "engine_backpressure_overflow"];
94
+ type EngineTransportErrorCode = (typeof ENGINE_TRANSPORT_ERROR_CODES)[number];
95
+ /**
96
+ * 引擎侧 spawn/送达错误码的 recovery 文案(键完整性由类型 Record + 测试锁定)。
97
+ * detail 由消费方拼装(诊断五元组 / pi error 文本),文案只给恢复动作。
98
+ */
99
+ declare const ENGINE_SPAWN_DELIVERY_ERROR_RECOVERY: Record<EngineSpawnDeliveryErrorCode, string>;
100
+ /** runtime 控制面传输错误码的 recovery 文案(键完整性由类型 Record + 测试锁定)。 */
101
+ declare const ENGINE_TRANSPORT_ERROR_RECOVERY: Record<EngineTransportErrorCode, string>;
66
102
  /**
67
103
  * setModel 正向方法的错误码三型(引擎 error 帧给出;宿主消费分型)。
68
104
  * 追加进 ENGINE_PROTOCOL_ERROR_CODES 主词表(成员清单单源 = 本数组,主词表 spread)。
@@ -82,7 +118,7 @@ type SetModelErrorCode = (typeof SET_MODEL_ERROR_CODES)[number];
82
118
  * 四个竞态窗口内发现子进程已退出——**同一处置**按无活进程形态应答,引擎回本码
83
119
  * error 帧)。进主词表的依据与 SET_MODEL_ERROR_CODES 三型相同:宿主消费分型
84
120
  * (chat 域转已记账型应答 / run 级聚合落 not-active 成员态,§7.2 处置表),不是
85
- * 「core 不解释文案」的纯透传面。刻意**不进** SET_MODEL_ERROR_CODES:聚合失败
121
+ * 「core 不解释文案」的纯透传逻辑。刻意**不进** SET_MODEL_ERROR_CODES:聚合失败
86
122
  * 名单的分型值域只收「转发失败」三型,无活进程是成员三态之一(not-active),
87
123
  * 不是失败——两值域语义正交。
88
124
  */
@@ -92,7 +128,7 @@ declare const ENGINE_PROTOCOL_ERROR_CODES: readonly ["engine_not_found", "engine
92
128
  type EngineProtocolErrorCode = (typeof ENGINE_PROTOCOL_ERROR_CODES)[number];
93
129
  /** unknown → 协议错误码收窄(外部输入携带错误码时的运行时 guard;其余 engine_* 走透传)。 */
94
130
  declare function isEngineProtocolErrorCode(value: unknown): value is EngineProtocolErrorCode;
95
- /** 其余引擎自报错误码的前缀契约(透传面;core 不解释文案)。 */
131
+ /** 其余引擎自报错误码的前缀契约(透传侧;core 不解释文案)。 */
96
132
  declare const ENGINE_ERROR_CODE_PREFIX = "engine_";
97
133
  declare function isEngineErrorPassthroughCode(value: string): boolean;
98
134
 
@@ -106,7 +142,7 @@ declare class EngineSdkError extends Error {
106
142
  readonly recovery: string;
107
143
  readonly data?: Record<string, unknown>;
108
144
  constructor(code: string, detail: string, recovery: string, data?: Record<string, unknown>);
109
- /** 协议 error 帧载荷投影。 */
145
+ /** 协议 error 帧载荷派生视图。 */
110
146
  toStructured(): ProtocolError;
111
147
  }
112
148
  declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
@@ -147,4 +183,4 @@ declare function engineTimeoutDetail(stdoutTail: string): string;
147
183
  /** schema_emulation_failed 的终报文案(宿主编排层「重试一次仍失败」后消费)。 */
148
184
  declare function schemaEmulationFailedDetail(error: string, tail: string): string;
149
185
 
150
- export { EngineSdkError as E, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, SET_MODEL_ERROR_CODES as S, ENGINE_ERROR_CODE_PREFIX as a, ENGINE_PROTOCOL_ERROR_CODES as b, ENGINE_TIMEOUT_RECOVERY as c, type EngineProtocolErrorCode as d, type ErrorResponseFrame as e, type EventNotificationParams as f, type ResponseFrame as g, type ReverseRequestFrame as h, type ReverseResponseResult as i, SET_MODEL_NOT_ACTIVE_CODE as j, STDOUT_TAIL_ECHO_CHARS as k, type SetModelErrorCode as l, type SuccessResponseFrame as m, assertChatConversationSupported as n, engineConversationUnsupportedError as o, engineProtocolMismatchError as p, engineSetModelUnsupportedError as q, engineTimeoutDetail as r, isEngineErrorPassthroughCode as s, isEngineProtocolErrorCode as t, isNotificationFrame as u, isRequestFrame as v, isResponseFrame as w, isReverseRequestFrame as x, schemaEmulationFailedDetail as y };
186
+ export { isNotificationFrame as A, isRequestFrame as B, isResponseFrame as C, isReverseRequestFrame as D, EngineSdkError as E, schemaEmulationFailedDetail as F, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, SET_MODEL_ERROR_CODES as S, ENGINE_ERROR_CODE_PREFIX as a, ENGINE_PROTOCOL_ERROR_CODES as b, ENGINE_SPAWN_DELIVERY_ERROR_CODES as c, ENGINE_SPAWN_DELIVERY_ERROR_RECOVERY as d, ENGINE_TIMEOUT_RECOVERY as e, ENGINE_TRANSPORT_ERROR_CODES as f, ENGINE_TRANSPORT_ERROR_RECOVERY as g, type EngineProtocolErrorCode as h, type EngineSpawnDeliveryErrorCode as i, type EngineTransportErrorCode as j, type ErrorResponseFrame as k, type EventNotificationParams as l, type ResponseFrame as m, type ReverseRequestFrame as n, type ReverseResponseResult as o, SET_MODEL_NOT_ACTIVE_CODE as p, STDOUT_TAIL_ECHO_CHARS as q, type SetModelErrorCode as r, type SuccessResponseFrame as s, assertChatConversationSupported as t, engineConversationUnsupportedError as u, engineProtocolMismatchError as v, engineSetModelUnsupportedError as w, engineTimeoutDetail as x, isEngineErrorPassthroughCode as y, isEngineProtocolErrorCode as z };
@@ -1,4 +1,4 @@
1
- import { A as AgentEvent, d as EngineCapabilities } from './contract-types-jSa1g28F.js';
1
+ import { A as AgentEvent, d as EngineCapabilities } from './contract-types-BUHUMF9R.js';
2
2
 
3
3
  /** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
4
4
  interface ProtocolError {
@@ -42,7 +42,7 @@ interface ReverseRequestFrame {
42
42
  }
43
43
  /** 反向请求的应答(core → 引擎,沿 ResponseFrame 通道回传;id = 反向请求 id 原样)。 */
44
44
  type ReverseResponseResult =
45
- /** 数据面类:处理确认。 */
45
+ /** 数据范围类:处理确认。 */
46
46
  {
47
47
  ok: true;
48
48
  }
@@ -63,6 +63,42 @@ declare function isNotificationFrame(frame: unknown): frame is NotificationFrame
63
63
  /** ④ 反向请求:有字符串 id + host/* method + params(与①的区别 = id 形态与 method 前缀)。 */
64
64
  declare function isReverseRequestFrame(frame: unknown): frame is ReverseRequestFrame;
65
65
 
66
+ /**
67
+ * 引擎进程侧 spawn/送达窗口错误码(M1/M2 送达回执,设计 D10「engine 侧」)。
68
+ * 消费方 = pi-subagent-cli(u-m2-engine-ack 接线):
69
+ * - prompt_not_delivered:prompt 写入后零 stdout(零输出判定)/ stdin 不可用 / EPIPE——
70
+ * 任务从未被真实 pi 受理,静默丢失的显式失败形态;
71
+ * - prompt_rejected:pi 对 prompt 命令回 success:false(已送达但被拒绝)——带 pi 的
72
+ * error 文本,与 not_delivered 分型防误诊(D3 不采用合并条目);
73
+ * - spawn_handshake_timeout:引擎 spawn 握手窗口超时——runtime/引擎停在
74
+ * spawn/handshake 的显式失败(control 侧同类失败码 = engine_open_timeout)。
75
+ */
76
+ declare const ENGINE_SPAWN_DELIVERY_ERROR_CODES: readonly ["engine_prompt_not_delivered", "engine_prompt_rejected", "engine_spawn_handshake_timeout"];
77
+ type EngineSpawnDeliveryErrorCode = (typeof ENGINE_SPAWN_DELIVERY_ERROR_CODES)[number];
78
+ /**
79
+ * runtime 控制面传输错误码(M3 control 通道,设计 D8/D10「runtime 侧」)。
80
+ * 消费方 = EngineClient.connectOnce preserve 白名单(u-m3-local:来自
81
+ * RuntimeEngineTransport 的 EngineSdkError 原样保留 code 与 recovery,不再包装成
82
+ * engine_crashed——UC-20 的显式失败不被吞掉)。语义(设计 D5/D8):
83
+ * - transport_unavailable:control socket connect / hello 失败——托管态 runtime 故障
84
+ * 显式可见,不静默回退 local spawn;
85
+ * - transport_lost:control 连接中途丢失(与 engine 自身 crash 区分)——标记不可用、
86
+ * fan-out 该连接全部 in-flight,不在同一连接重试;
87
+ * - open_timeout:engine_open 超时(runtime spawn/归属卡住);
88
+ * - frame_too_large:单帧(含 partial-line 缓冲)超 32MB 上限——不截断、按 channel
89
+ * 归因关闭;
90
+ * - backpressure_overflow:channel(32MB/4096 帧)或连接聚合(256MB)待写队列溢出——
91
+ * 不丢帧、不静默,溢出面(channel/connection)标注在 detail。
92
+ */
93
+ declare const ENGINE_TRANSPORT_ERROR_CODES: readonly ["engine_transport_unavailable", "engine_transport_lost", "engine_open_timeout", "engine_frame_too_large", "engine_backpressure_overflow"];
94
+ type EngineTransportErrorCode = (typeof ENGINE_TRANSPORT_ERROR_CODES)[number];
95
+ /**
96
+ * 引擎侧 spawn/送达错误码的 recovery 文案(键完整性由类型 Record + 测试锁定)。
97
+ * detail 由消费方拼装(诊断五元组 / pi error 文本),文案只给恢复动作。
98
+ */
99
+ declare const ENGINE_SPAWN_DELIVERY_ERROR_RECOVERY: Record<EngineSpawnDeliveryErrorCode, string>;
100
+ /** runtime 控制面传输错误码的 recovery 文案(键完整性由类型 Record + 测试锁定)。 */
101
+ declare const ENGINE_TRANSPORT_ERROR_RECOVERY: Record<EngineTransportErrorCode, string>;
66
102
  /**
67
103
  * setModel 正向方法的错误码三型(引擎 error 帧给出;宿主消费分型)。
68
104
  * 追加进 ENGINE_PROTOCOL_ERROR_CODES 主词表(成员清单单源 = 本数组,主词表 spread)。
@@ -82,7 +118,7 @@ type SetModelErrorCode = (typeof SET_MODEL_ERROR_CODES)[number];
82
118
  * 四个竞态窗口内发现子进程已退出——**同一处置**按无活进程形态应答,引擎回本码
83
119
  * error 帧)。进主词表的依据与 SET_MODEL_ERROR_CODES 三型相同:宿主消费分型
84
120
  * (chat 域转已记账型应答 / run 级聚合落 not-active 成员态,§7.2 处置表),不是
85
- * 「core 不解释文案」的纯透传面。刻意**不进** SET_MODEL_ERROR_CODES:聚合失败
121
+ * 「core 不解释文案」的纯透传逻辑。刻意**不进** SET_MODEL_ERROR_CODES:聚合失败
86
122
  * 名单的分型值域只收「转发失败」三型,无活进程是成员三态之一(not-active),
87
123
  * 不是失败——两值域语义正交。
88
124
  */
@@ -92,7 +128,7 @@ declare const ENGINE_PROTOCOL_ERROR_CODES: readonly ["engine_not_found", "engine
92
128
  type EngineProtocolErrorCode = (typeof ENGINE_PROTOCOL_ERROR_CODES)[number];
93
129
  /** unknown → 协议错误码收窄(外部输入携带错误码时的运行时 guard;其余 engine_* 走透传)。 */
94
130
  declare function isEngineProtocolErrorCode(value: unknown): value is EngineProtocolErrorCode;
95
- /** 其余引擎自报错误码的前缀契约(透传面;core 不解释文案)。 */
131
+ /** 其余引擎自报错误码的前缀契约(透传侧;core 不解释文案)。 */
96
132
  declare const ENGINE_ERROR_CODE_PREFIX = "engine_";
97
133
  declare function isEngineErrorPassthroughCode(value: string): boolean;
98
134
 
@@ -106,7 +142,7 @@ declare class EngineSdkError extends Error {
106
142
  readonly recovery: string;
107
143
  readonly data?: Record<string, unknown>;
108
144
  constructor(code: string, detail: string, recovery: string, data?: Record<string, unknown>);
109
- /** 协议 error 帧载荷投影。 */
145
+ /** 协议 error 帧载荷派生视图。 */
110
146
  toStructured(): ProtocolError;
111
147
  }
112
148
  declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
@@ -147,4 +183,4 @@ declare function engineTimeoutDetail(stdoutTail: string): string;
147
183
  /** schema_emulation_failed 的终报文案(宿主编排层「重试一次仍失败」后消费)。 */
148
184
  declare function schemaEmulationFailedDetail(error: string, tail: string): string;
149
185
 
150
- export { EngineSdkError as E, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, SET_MODEL_ERROR_CODES as S, ENGINE_ERROR_CODE_PREFIX as a, ENGINE_PROTOCOL_ERROR_CODES as b, ENGINE_TIMEOUT_RECOVERY as c, type EngineProtocolErrorCode as d, type ErrorResponseFrame as e, type EventNotificationParams as f, type ResponseFrame as g, type ReverseRequestFrame as h, type ReverseResponseResult as i, SET_MODEL_NOT_ACTIVE_CODE as j, STDOUT_TAIL_ECHO_CHARS as k, type SetModelErrorCode as l, type SuccessResponseFrame as m, assertChatConversationSupported as n, engineConversationUnsupportedError as o, engineProtocolMismatchError as p, engineSetModelUnsupportedError as q, engineTimeoutDetail as r, isEngineErrorPassthroughCode as s, isEngineProtocolErrorCode as t, isNotificationFrame as u, isRequestFrame as v, isResponseFrame as w, isReverseRequestFrame as x, schemaEmulationFailedDetail as y };
186
+ export { isNotificationFrame as A, isRequestFrame as B, isResponseFrame as C, isReverseRequestFrame as D, EngineSdkError as E, schemaEmulationFailedDetail as F, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, SET_MODEL_ERROR_CODES as S, ENGINE_ERROR_CODE_PREFIX as a, ENGINE_PROTOCOL_ERROR_CODES as b, ENGINE_SPAWN_DELIVERY_ERROR_CODES as c, ENGINE_SPAWN_DELIVERY_ERROR_RECOVERY as d, ENGINE_TIMEOUT_RECOVERY as e, ENGINE_TRANSPORT_ERROR_CODES as f, ENGINE_TRANSPORT_ERROR_RECOVERY as g, type EngineProtocolErrorCode as h, type EngineSpawnDeliveryErrorCode as i, type EngineTransportErrorCode as j, type ErrorResponseFrame as k, type EventNotificationParams as l, type ResponseFrame as m, type ReverseRequestFrame as n, type ReverseResponseResult as o, SET_MODEL_NOT_ACTIVE_CODE as p, STDOUT_TAIL_ECHO_CHARS as q, type SetModelErrorCode as r, type SuccessResponseFrame as s, assertChatConversationSupported as t, engineConversationUnsupportedError as u, engineProtocolMismatchError as v, engineSetModelUnsupportedError as w, engineTimeoutDetail as x, isEngineErrorPassthroughCode as y, isEngineProtocolErrorCode as z };