@zhushanwen/subagent-engine-sdk 0.3.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.
- package/dist/{chunk-LKPVN3N6.js → chunk-3IBT7MTB.js} +1 -1
- package/dist/{chunk-WS4WAZVR.js → chunk-F5JZMK74.js} +1 -1
- package/dist/{chunk-TGDMOLZU.js → chunk-TW2FAMAJ.js} +2 -18
- package/dist/{chunk-FJT23P7T.js → chunk-WORT4PG7.js} +1 -1
- package/dist/{contract-types-ByIFoLrY.d.cts → contract-types-Dsvy79r3.d.cts} +18 -15
- package/dist/{contract-types-ByIFoLrY.d.ts → contract-types-Dsvy79r3.d.ts} +18 -15
- package/dist/env.d.cts +8 -1
- package/dist/env.d.ts +8 -1
- package/dist/{error-codes-BUx92qYi.d.ts → error-codes-OvQlqiQw.d.ts} +13 -15
- package/dist/{error-codes-DCiilt_8.d.cts → error-codes-SA5fGtx_.d.cts} +13 -15
- package/dist/index.cjs +3 -21
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -8
- package/dist/journal-io.d.cts +1 -1
- package/dist/journal-io.d.ts +1 -1
- package/dist/journal-replay.d.cts +1 -1
- package/dist/journal-replay.d.ts +1 -1
- package/dist/kill-chain.d.cts +2 -2
- package/dist/kill-chain.d.ts +2 -2
- package/dist/kill-chain.js +2 -2
- package/dist/node-executor.js +2 -2
- package/dist/port-contract.d.cts +11 -10
- package/dist/port-contract.d.ts +11 -10
- package/dist/protocol/index.cjs +3 -21
- package/dist/protocol/index.d.cts +19 -95
- package/dist/protocol/index.d.ts +19 -95
- package/dist/protocol/index.js +2 -6
- package/package.json +1 -1
- package/src/env.ts +8 -1
- package/src/nesting-guard.ts +1 -1
- package/src/paths.ts +1 -1
- package/src/port-contract.ts +10 -9
- package/src/protocol/contract-types.ts +22 -19
- package/src/protocol/engine-protocol.ts +9 -8
- package/src/protocol/error-codes.ts +12 -13
- package/src/protocol/frames.ts +1 -3
- package/src/protocol/methods.ts +3 -5
- package/src/protocol/reverse-channels.ts +13 -76
- package/src/protocol/schema.ts +2 -7
|
@@ -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\
|
|
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
|
}
|
|
@@ -37,9 +37,7 @@ var PROTOCOL_METHODS = [
|
|
|
37
37
|
var REVERSE_CHANNELS = [
|
|
38
38
|
"host/log",
|
|
39
39
|
"host/askUser",
|
|
40
|
-
"host/permission",
|
|
41
40
|
"host/streamDelta",
|
|
42
|
-
"host/poolResolved",
|
|
43
41
|
"host/handleReady",
|
|
44
42
|
"host/childSpawned",
|
|
45
43
|
"host/childStateChanged"
|
|
@@ -47,21 +45,11 @@ var REVERSE_CHANNELS = [
|
|
|
47
45
|
var REVERSE_CHANNEL_TIMEOUT_CLASS = {
|
|
48
46
|
"host/log": "data-plane",
|
|
49
47
|
"host/streamDelta": "data-plane",
|
|
50
|
-
"host/poolResolved": "data-plane",
|
|
51
48
|
"host/handleReady": "data-plane",
|
|
52
49
|
"host/childSpawned": "data-plane",
|
|
53
50
|
"host/childStateChanged": "data-plane",
|
|
54
|
-
"host/askUser": "interaction"
|
|
55
|
-
"host/permission": "interaction"
|
|
51
|
+
"host/askUser": "interaction"
|
|
56
52
|
};
|
|
57
|
-
function isHostStreamDeltaParams(value) {
|
|
58
|
-
if (typeof value !== "object" || value === null) return false;
|
|
59
|
-
const v = value;
|
|
60
|
-
const hasRunId = typeof v.runId === "string";
|
|
61
|
-
const hasRecordId = typeof v.recordId === "string";
|
|
62
|
-
if (hasRunId === hasRecordId) return false;
|
|
63
|
-
return typeof v.delta === "string";
|
|
64
|
-
}
|
|
65
53
|
|
|
66
54
|
// src/protocol/schema.ts
|
|
67
55
|
var ANY_JSON = {};
|
|
@@ -179,7 +167,6 @@ var FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS = [
|
|
|
179
167
|
"password",
|
|
180
168
|
"secret"
|
|
181
169
|
];
|
|
182
|
-
var REVERSE_CHANNEL_NAMES = REVERSE_CHANNELS;
|
|
183
170
|
var runSessionParamsSchema = {
|
|
184
171
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
185
172
|
title: "EngineRunSessionParams",
|
|
@@ -191,11 +178,10 @@ var runSessionParamsSchema = {
|
|
|
191
178
|
resume: {
|
|
192
179
|
type: "object",
|
|
193
180
|
additionalProperties: false,
|
|
194
|
-
required: ["sessionRef"
|
|
181
|
+
required: ["sessionRef"],
|
|
195
182
|
properties: {
|
|
196
183
|
// ResumeAnchor.sessionRef = Record<string, string>(引擎定位键值对)
|
|
197
184
|
sessionRef: { type: "object", additionalProperties: { type: "string" } },
|
|
198
|
-
poolKey: { type: "string" },
|
|
199
185
|
journalPath: { type: "string" }
|
|
200
186
|
}
|
|
201
187
|
}
|
|
@@ -210,7 +196,6 @@ export {
|
|
|
210
196
|
PROTOCOL_METHODS,
|
|
211
197
|
REVERSE_CHANNELS,
|
|
212
198
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
213
|
-
isHostStreamDeltaParams,
|
|
214
199
|
protocolErrorSchema,
|
|
215
200
|
requestFrameSchema,
|
|
216
201
|
successResponseFrameSchema,
|
|
@@ -219,6 +204,5 @@ export {
|
|
|
219
204
|
reverseRequestFrameSchema,
|
|
220
205
|
ENGINE_PROTOCOL_SCHEMAS,
|
|
221
206
|
FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS,
|
|
222
|
-
REVERSE_CHANNEL_NAMES,
|
|
223
207
|
runSessionParamsSchema
|
|
224
208
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* const _assert: _CoreSdkAgentEvent = true;
|
|
8
8
|
*/
|
|
9
9
|
type AssertMutuallyAssignable<A, B> = [A] extends [B] ? [B] extends [A] ? true : never : never;
|
|
10
|
-
/** token 用量(message_end 单条消息增量)。← core execution/types.ts AgentUsage。 */
|
|
10
|
+
/** token 用量(message_end 单条消息增量)。← core execution/assembly/types.ts AgentUsage。 */
|
|
11
11
|
interface AgentUsage {
|
|
12
12
|
input: number;
|
|
13
13
|
output: number;
|
|
@@ -57,7 +57,7 @@ interface Turn {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* 引擎事件(9 种,协议 event.params.event 逐字序列化——「事件与 handle 序列化逐字
|
|
60
|
-
* 兼容」不变量 3 的类型面)。语义锚点 = pi(ACP 词汇对照见 core execution/types.ts 注释)。
|
|
60
|
+
* 兼容」不变量 3 的类型面)。语义锚点 = pi(ACP 词汇对照见 core execution/assembly/types.ts 注释)。
|
|
61
61
|
*
|
|
62
62
|
* activity = 纯活性信号:双侧 reducer no-op、不开 turn、不写状态、不落 journal
|
|
63
63
|
* (core journal-wiring 对其豁免 append),只承诺「引擎活跃时周期性出现」——供宿主
|
|
@@ -104,9 +104,11 @@ interface EngineHandleData {
|
|
|
104
104
|
engineId: string;
|
|
105
105
|
/** 引擎自定义定位键值。pi = { recordId?, sessionFile? };zcode = { sessionId, dbPath }。 */
|
|
106
106
|
sessionRef: Record<string, string>;
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
/**
|
|
108
|
+
* journal 绝对路径(read 第②级数据源;宿主读前校验前缀白名单)。缺省 = 无 journal。
|
|
109
|
+
* [池抽象降级 2026-09-13] 原 poolKey 字段已删除——两引擎 poolKey 恒 'shared'
|
|
110
|
+
* (SDK SHARED_POOL_KEY),journal 固定落 engines/<engineId>/shared/,字段零信息量。
|
|
111
|
+
*/
|
|
110
112
|
journalPath?: string;
|
|
111
113
|
/** probe 实测版本(漂移排查锚点)。 */
|
|
112
114
|
engineVersion?: string;
|
|
@@ -124,8 +126,6 @@ interface EngineHandleData {
|
|
|
124
126
|
interface ResumeAnchor {
|
|
125
127
|
/** 引擎定位键(pi = { recordId?, sessionFile? };zcode = { sessionId, dbPath })。 */
|
|
126
128
|
sessionRef: Record<string, string>;
|
|
127
|
-
/** 隔离池定位(锚点补全 handle 重建所需;pi 无池化恒 'shared')。 */
|
|
128
|
-
poolKey: string;
|
|
129
129
|
/** journal 绝对路径(read 降级链第②级数据源;无 journal 缺省)。 */
|
|
130
130
|
journalPath?: string;
|
|
131
131
|
}
|
|
@@ -161,11 +161,16 @@ interface EngineCapabilities {
|
|
|
161
161
|
/** 注意区分「引擎 RPC 层有此能力」与「subagent 链路已接通」。 */
|
|
162
162
|
steer: "native" | "emulated" | "unsupported";
|
|
163
163
|
/**
|
|
164
|
-
* [H1 D5 语义收窄
|
|
164
|
+
* [H1 D5 语义收窄 + modeless] 「怎么续」形态轴兼 message 资格轴:
|
|
165
|
+
* 位非 'unsupported' = 引擎可续聊(core capability-gate 的 message 资格门消费),
|
|
166
|
+
* 值区分续聊形态——native(原地续写)/ cold(冷恢复重建 + 新 run + resume 锚点)。
|
|
165
167
|
* 原名字沿用——conversation 位保留、语义从「interact 长驻控制面」收窄为
|
|
166
|
-
* 「resume
|
|
168
|
+
* 「resume 续聊能力」。[modeless 波2] 会话形态键只剩 run.params.resume(协议
|
|
169
|
+
* task.conversation 已删),本轴不再是 per-run 模式开关——描述各引擎的真实
|
|
170
|
+
* 续聊差异(gate 判据仍是 `=== "unsupported"` 拒绝,"cold" 与 "native" 等价
|
|
171
|
+
* 放行)。
|
|
167
172
|
*/
|
|
168
|
-
conversation: "native" | "unsupported";
|
|
173
|
+
conversation: "native" | "cold" | "unsupported";
|
|
169
174
|
/** 决定 persona 路由策略(file/flag/prompt 通道)。 */
|
|
170
175
|
personaInjection: "file" | "flag" | "prompt";
|
|
171
176
|
/** 粗粒度引擎:GUI 显示降级为阶段态。 */
|
|
@@ -221,7 +226,7 @@ interface ToolCallEntry {
|
|
|
221
226
|
/** Args preview string. */
|
|
222
227
|
input: string;
|
|
223
228
|
}
|
|
224
|
-
/** worktree 句柄(结构等价副本;core 权威定义在 execution/types.ts:349)。 */
|
|
229
|
+
/** worktree 句柄(结构等价副本;core 权威定义在 execution/assembly/types.ts:349)。 */
|
|
225
230
|
interface WorktreeHandle {
|
|
226
231
|
/** checkout 目录(子 agent 工作目录)。 */
|
|
227
232
|
readonly path: string;
|
|
@@ -276,7 +281,7 @@ interface ModelCatalogEntry {
|
|
|
276
281
|
*
|
|
277
282
|
* 字段裁决(对照 core orchestration/models/types.ts AgentCallOpts,2026-09-09):
|
|
278
283
|
* - 入选 = 引擎消费面:任务语义(prompt/schema/thinkingLevel/skill/skillPath/agent/persona 注入)、
|
|
279
|
-
* 轮次预算(maxTurns/graceTurns/
|
|
284
|
+
* 轮次预算(maxTurns/graceTurns/idleTimeoutMs)、隔离与权限(worktree/
|
|
280
285
|
* fork/forkSource/denyTools/permissionMode)、诊断(description/scene);
|
|
281
286
|
* - 排除并改挂 run.params.ctx(协议层已单列,task 内双写会分叉):model(→ctx.model)、
|
|
282
287
|
* schemaEnv(→ctx.schemaEnv)、cwd(→ctx.cwd)、engineFallback(→ctx.engineFallback);
|
|
@@ -323,9 +328,7 @@ interface AgentCallOpts {
|
|
|
323
328
|
forkSource?: string;
|
|
324
329
|
/** Filesystem isolation: 新建 worktree | 复用外部已创建 worktree | 不隔离。 */
|
|
325
330
|
worktree?: boolean | WorktreeHandle;
|
|
326
|
-
/**
|
|
327
|
-
conversation?: boolean;
|
|
328
|
-
/** 空闲超时毫秒数(仅 conversation 模式有意义)。显式 0/负 = 禁用 idle GC。 */
|
|
331
|
+
/** 空闲超时毫秒数([modeless] 全体 record 的 idle 回收节奏;显式 0/负 = 禁用 idle GC)。 */
|
|
329
332
|
idleTimeoutMs?: number;
|
|
330
333
|
/** 工具 denylist(各引擎做语法映射)。 */
|
|
331
334
|
denyTools?: string[];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* const _assert: _CoreSdkAgentEvent = true;
|
|
8
8
|
*/
|
|
9
9
|
type AssertMutuallyAssignable<A, B> = [A] extends [B] ? [B] extends [A] ? true : never : never;
|
|
10
|
-
/** token 用量(message_end 单条消息增量)。← core execution/types.ts AgentUsage。 */
|
|
10
|
+
/** token 用量(message_end 单条消息增量)。← core execution/assembly/types.ts AgentUsage。 */
|
|
11
11
|
interface AgentUsage {
|
|
12
12
|
input: number;
|
|
13
13
|
output: number;
|
|
@@ -57,7 +57,7 @@ interface Turn {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* 引擎事件(9 种,协议 event.params.event 逐字序列化——「事件与 handle 序列化逐字
|
|
60
|
-
* 兼容」不变量 3 的类型面)。语义锚点 = pi(ACP 词汇对照见 core execution/types.ts 注释)。
|
|
60
|
+
* 兼容」不变量 3 的类型面)。语义锚点 = pi(ACP 词汇对照见 core execution/assembly/types.ts 注释)。
|
|
61
61
|
*
|
|
62
62
|
* activity = 纯活性信号:双侧 reducer no-op、不开 turn、不写状态、不落 journal
|
|
63
63
|
* (core journal-wiring 对其豁免 append),只承诺「引擎活跃时周期性出现」——供宿主
|
|
@@ -104,9 +104,11 @@ interface EngineHandleData {
|
|
|
104
104
|
engineId: string;
|
|
105
105
|
/** 引擎自定义定位键值。pi = { recordId?, sessionFile? };zcode = { sessionId, dbPath }。 */
|
|
106
106
|
sessionRef: Record<string, string>;
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
/**
|
|
108
|
+
* journal 绝对路径(read 第②级数据源;宿主读前校验前缀白名单)。缺省 = 无 journal。
|
|
109
|
+
* [池抽象降级 2026-09-13] 原 poolKey 字段已删除——两引擎 poolKey 恒 'shared'
|
|
110
|
+
* (SDK SHARED_POOL_KEY),journal 固定落 engines/<engineId>/shared/,字段零信息量。
|
|
111
|
+
*/
|
|
110
112
|
journalPath?: string;
|
|
111
113
|
/** probe 实测版本(漂移排查锚点)。 */
|
|
112
114
|
engineVersion?: string;
|
|
@@ -124,8 +126,6 @@ interface EngineHandleData {
|
|
|
124
126
|
interface ResumeAnchor {
|
|
125
127
|
/** 引擎定位键(pi = { recordId?, sessionFile? };zcode = { sessionId, dbPath })。 */
|
|
126
128
|
sessionRef: Record<string, string>;
|
|
127
|
-
/** 隔离池定位(锚点补全 handle 重建所需;pi 无池化恒 'shared')。 */
|
|
128
|
-
poolKey: string;
|
|
129
129
|
/** journal 绝对路径(read 降级链第②级数据源;无 journal 缺省)。 */
|
|
130
130
|
journalPath?: string;
|
|
131
131
|
}
|
|
@@ -161,11 +161,16 @@ interface EngineCapabilities {
|
|
|
161
161
|
/** 注意区分「引擎 RPC 层有此能力」与「subagent 链路已接通」。 */
|
|
162
162
|
steer: "native" | "emulated" | "unsupported";
|
|
163
163
|
/**
|
|
164
|
-
* [H1 D5 语义收窄
|
|
164
|
+
* [H1 D5 语义收窄 + modeless] 「怎么续」形态轴兼 message 资格轴:
|
|
165
|
+
* 位非 'unsupported' = 引擎可续聊(core capability-gate 的 message 资格门消费),
|
|
166
|
+
* 值区分续聊形态——native(原地续写)/ cold(冷恢复重建 + 新 run + resume 锚点)。
|
|
165
167
|
* 原名字沿用——conversation 位保留、语义从「interact 长驻控制面」收窄为
|
|
166
|
-
* 「resume
|
|
168
|
+
* 「resume 续聊能力」。[modeless 波2] 会话形态键只剩 run.params.resume(协议
|
|
169
|
+
* task.conversation 已删),本轴不再是 per-run 模式开关——描述各引擎的真实
|
|
170
|
+
* 续聊差异(gate 判据仍是 `=== "unsupported"` 拒绝,"cold" 与 "native" 等价
|
|
171
|
+
* 放行)。
|
|
167
172
|
*/
|
|
168
|
-
conversation: "native" | "unsupported";
|
|
173
|
+
conversation: "native" | "cold" | "unsupported";
|
|
169
174
|
/** 决定 persona 路由策略(file/flag/prompt 通道)。 */
|
|
170
175
|
personaInjection: "file" | "flag" | "prompt";
|
|
171
176
|
/** 粗粒度引擎:GUI 显示降级为阶段态。 */
|
|
@@ -221,7 +226,7 @@ interface ToolCallEntry {
|
|
|
221
226
|
/** Args preview string. */
|
|
222
227
|
input: string;
|
|
223
228
|
}
|
|
224
|
-
/** worktree 句柄(结构等价副本;core 权威定义在 execution/types.ts:349)。 */
|
|
229
|
+
/** worktree 句柄(结构等价副本;core 权威定义在 execution/assembly/types.ts:349)。 */
|
|
225
230
|
interface WorktreeHandle {
|
|
226
231
|
/** checkout 目录(子 agent 工作目录)。 */
|
|
227
232
|
readonly path: string;
|
|
@@ -276,7 +281,7 @@ interface ModelCatalogEntry {
|
|
|
276
281
|
*
|
|
277
282
|
* 字段裁决(对照 core orchestration/models/types.ts AgentCallOpts,2026-09-09):
|
|
278
283
|
* - 入选 = 引擎消费面:任务语义(prompt/schema/thinkingLevel/skill/skillPath/agent/persona 注入)、
|
|
279
|
-
* 轮次预算(maxTurns/graceTurns/
|
|
284
|
+
* 轮次预算(maxTurns/graceTurns/idleTimeoutMs)、隔离与权限(worktree/
|
|
280
285
|
* fork/forkSource/denyTools/permissionMode)、诊断(description/scene);
|
|
281
286
|
* - 排除并改挂 run.params.ctx(协议层已单列,task 内双写会分叉):model(→ctx.model)、
|
|
282
287
|
* schemaEnv(→ctx.schemaEnv)、cwd(→ctx.cwd)、engineFallback(→ctx.engineFallback);
|
|
@@ -323,9 +328,7 @@ interface AgentCallOpts {
|
|
|
323
328
|
forkSource?: string;
|
|
324
329
|
/** Filesystem isolation: 新建 worktree | 复用外部已创建 worktree | 不隔离。 */
|
|
325
330
|
worktree?: boolean | WorktreeHandle;
|
|
326
|
-
/**
|
|
327
|
-
conversation?: boolean;
|
|
328
|
-
/** 空闲超时毫秒数(仅 conversation 模式有意义)。显式 0/负 = 禁用 idle GC。 */
|
|
331
|
+
/** 空闲超时毫秒数([modeless] 全体 record 的 idle 回收节奏;显式 0/负 = 禁用 idle GC)。 */
|
|
329
332
|
idleTimeoutMs?: number;
|
|
330
333
|
/** 工具 denylist(各引擎做语法映射)。 */
|
|
331
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
|
-
/**
|
|
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
|
-
/**
|
|
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-
|
|
1
|
+
import { a as AgentEvent, E as EngineCapabilities } from './contract-types-Dsvy79r3.js';
|
|
2
2
|
|
|
3
3
|
/** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
|
|
4
4
|
interface ProtocolError {
|
|
@@ -46,7 +46,7 @@ type ReverseResponseResult =
|
|
|
46
46
|
{
|
|
47
47
|
ok: true;
|
|
48
48
|
}
|
|
49
|
-
/** 人机交互类(askUser
|
|
49
|
+
/** 人机交互类(askUser)两阶段第一阶段:已受理,结果异步到达(R9-2)。 */
|
|
50
50
|
| {
|
|
51
51
|
ack: true;
|
|
52
52
|
}
|
|
@@ -54,7 +54,6 @@ type ReverseResponseResult =
|
|
|
54
54
|
| {
|
|
55
55
|
unsupported: true;
|
|
56
56
|
};
|
|
57
|
-
type AnyFrame = RequestFrame | ResponseFrame | NotificationFrame | ReverseRequestFrame;
|
|
58
57
|
/** ① 请求:有数字 id + method + params,且无 result/error(与②应答区分)。 */
|
|
59
58
|
declare function isRequestFrame(frame: unknown): frame is RequestFrame;
|
|
60
59
|
/** ② 应答:有 id(number|string)且 result/error 二选一。 */
|
|
@@ -88,20 +87,19 @@ declare class EngineSdkError extends Error {
|
|
|
88
87
|
}
|
|
89
88
|
declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
|
|
90
89
|
/**
|
|
91
|
-
* [
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
|
|
90
|
+
* 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
|
|
91
|
+
* 引擎,message 续聊资格被拒——manifest conversation 能力轴消费,core
|
|
92
|
+
* capability-gate 的 conversation 分支与 message 资格门双写点共用本构造器)。
|
|
93
|
+
* 文案契约:错误码 engine_capability_unsupported + 「去掉参数 / 修 manifest /
|
|
94
|
+
* 升级引擎包」恢复指引,两侧一致防漂移。
|
|
97
95
|
*/
|
|
98
96
|
declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
|
|
99
97
|
/**
|
|
100
|
-
*
|
|
101
|
-
* manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
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 形态键生效。
|
|
105
103
|
*/
|
|
106
104
|
declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
|
|
107
105
|
/** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
|
|
@@ -116,4 +114,4 @@ declare function engineTimeoutDetail(stdoutTail: string): string;
|
|
|
116
114
|
/** schema_emulation_failed 的终报文案(宿主编排层「重试一次仍失败」后消费)。 */
|
|
117
115
|
declare function schemaEmulationFailedDetail(error: string, tail: string): string;
|
|
118
116
|
|
|
119
|
-
export {
|
|
117
|
+
export { ENGINE_ERROR_CODE_PREFIX as E, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, STDOUT_TAIL_ECHO_CHARS as S, ENGINE_PROTOCOL_ERROR_CODES as a, ENGINE_TIMEOUT_RECOVERY as b, type EngineProtocolErrorCode as c, EngineSdkError as d, type ErrorResponseFrame as e, type EventNotificationParams as f, type ResponseFrame as g, type ReverseRequestFrame as h, type ReverseResponseResult as i, type SuccessResponseFrame as j, assertChatConversationSupported as k, engineConversationUnsupportedError as l, engineProtocolMismatchError as m, engineTimeoutDetail as n, isEngineErrorPassthroughCode as o, isEngineProtocolErrorCode as p, isNotificationFrame as q, isRequestFrame as r, isResponseFrame as s, isReverseRequestFrame as t, schemaEmulationFailedDetail as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AgentEvent, E as EngineCapabilities } from './contract-types-
|
|
1
|
+
import { a as AgentEvent, E as EngineCapabilities } from './contract-types-Dsvy79r3.cjs';
|
|
2
2
|
|
|
3
3
|
/** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
|
|
4
4
|
interface ProtocolError {
|
|
@@ -46,7 +46,7 @@ type ReverseResponseResult =
|
|
|
46
46
|
{
|
|
47
47
|
ok: true;
|
|
48
48
|
}
|
|
49
|
-
/** 人机交互类(askUser
|
|
49
|
+
/** 人机交互类(askUser)两阶段第一阶段:已受理,结果异步到达(R9-2)。 */
|
|
50
50
|
| {
|
|
51
51
|
ack: true;
|
|
52
52
|
}
|
|
@@ -54,7 +54,6 @@ type ReverseResponseResult =
|
|
|
54
54
|
| {
|
|
55
55
|
unsupported: true;
|
|
56
56
|
};
|
|
57
|
-
type AnyFrame = RequestFrame | ResponseFrame | NotificationFrame | ReverseRequestFrame;
|
|
58
57
|
/** ① 请求:有数字 id + method + params,且无 result/error(与②应答区分)。 */
|
|
59
58
|
declare function isRequestFrame(frame: unknown): frame is RequestFrame;
|
|
60
59
|
/** ② 应答:有 id(number|string)且 result/error 二选一。 */
|
|
@@ -88,20 +87,19 @@ declare class EngineSdkError extends Error {
|
|
|
88
87
|
}
|
|
89
88
|
declare function engineProtocolMismatchError(engineVersion: number): EngineSdkError;
|
|
90
89
|
/**
|
|
91
|
-
* [
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* ——W3 chat 路由切协议客户端时以本构造器替换 core 内联文案,保持两侧一致。
|
|
90
|
+
* 引擎 conversation 位拒绝的具名错误([modeless 波2] 语义:无 resume 续聊通道的
|
|
91
|
+
* 引擎,message 续聊资格被拒——manifest conversation 能力轴消费,core
|
|
92
|
+
* capability-gate 的 conversation 分支与 message 资格门双写点共用本构造器)。
|
|
93
|
+
* 文案契约:错误码 engine_capability_unsupported + 「去掉参数 / 修 manifest /
|
|
94
|
+
* 升级引擎包」恢复指引,两侧一致防漂移。
|
|
97
95
|
*/
|
|
98
96
|
declare function engineConversationUnsupportedError(engineId: string): EngineSdkError;
|
|
99
97
|
/**
|
|
100
|
-
*
|
|
101
|
-
* manifest conversation 位 unsupported 即抛 engineConversationUnsupportedError
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
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 形态键生效。
|
|
105
103
|
*/
|
|
106
104
|
declare function assertChatConversationSupported(engineId: string, capabilities: Pick<EngineCapabilities, "conversation">): void;
|
|
107
105
|
/** stdout 尾部回显上限(engine_timeout / engine_run_failed 的错误规格载体系数)。 */
|
|
@@ -116,4 +114,4 @@ declare function engineTimeoutDetail(stdoutTail: string): string;
|
|
|
116
114
|
/** schema_emulation_failed 的终报文案(宿主编排层「重试一次仍失败」后消费)。 */
|
|
117
115
|
declare function schemaEmulationFailedDetail(error: string, tail: string): string;
|
|
118
116
|
|
|
119
|
-
export {
|
|
117
|
+
export { ENGINE_ERROR_CODE_PREFIX as E, type NotificationFrame as N, type ProtocolError as P, type RequestFrame as R, STDOUT_TAIL_ECHO_CHARS as S, ENGINE_PROTOCOL_ERROR_CODES as a, ENGINE_TIMEOUT_RECOVERY as b, type EngineProtocolErrorCode as c, EngineSdkError as d, type ErrorResponseFrame as e, type EventNotificationParams as f, type ResponseFrame as g, type ReverseRequestFrame as h, type ReverseResponseResult as i, type SuccessResponseFrame as j, assertChatConversationSupported as k, engineConversationUnsupportedError as l, engineProtocolMismatchError as m, engineTimeoutDetail as n, isEngineErrorPassthroughCode as o, isEngineProtocolErrorCode as p, isNotificationFrame as q, isRequestFrame as r, isResponseFrame as s, isReverseRequestFrame as t, schemaEmulationFailedDetail as u };
|
package/dist/index.cjs
CHANGED
|
@@ -6608,7 +6608,6 @@ __export(src_exports, {
|
|
|
6608
6608
|
RELAY_EXIT_CODES: () => RELAY_EXIT_CODES,
|
|
6609
6609
|
RELAY_PROTOCOL_VERSION: () => RELAY_PROTOCOL_VERSION,
|
|
6610
6610
|
REVERSE_CHANNELS: () => REVERSE_CHANNELS,
|
|
6611
|
-
REVERSE_CHANNEL_NAMES: () => REVERSE_CHANNEL_NAMES,
|
|
6612
6611
|
REVERSE_CHANNEL_TIMEOUT_CLASS: () => REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
6613
6612
|
REVERSE_REQUEST_TIMEOUT_MS: () => REVERSE_REQUEST_TIMEOUT_MS,
|
|
6614
6613
|
SCHEMA_EMULATION_TAIL_CHARS: () => SCHEMA_EMULATION_TAIL_CHARS,
|
|
@@ -6642,7 +6641,6 @@ __export(src_exports, {
|
|
|
6642
6641
|
hostKindOf: () => hostKindOf,
|
|
6643
6642
|
isEngineErrorPassthroughCode: () => isEngineErrorPassthroughCode,
|
|
6644
6643
|
isEngineProtocolErrorCode: () => isEngineProtocolErrorCode,
|
|
6645
|
-
isHostStreamDeltaParams: () => isHostStreamDeltaParams,
|
|
6646
6644
|
isNotificationFrame: () => isNotificationFrame,
|
|
6647
6645
|
isPidAlive: () => isPidAlive,
|
|
6648
6646
|
isProtocolVersionCompatible: () => isProtocolVersionCompatible,
|
|
@@ -6750,9 +6748,7 @@ var PROTOCOL_METHODS = [
|
|
|
6750
6748
|
var REVERSE_CHANNELS = [
|
|
6751
6749
|
"host/log",
|
|
6752
6750
|
"host/askUser",
|
|
6753
|
-
"host/permission",
|
|
6754
6751
|
"host/streamDelta",
|
|
6755
|
-
"host/poolResolved",
|
|
6756
6752
|
"host/handleReady",
|
|
6757
6753
|
"host/childSpawned",
|
|
6758
6754
|
"host/childStateChanged"
|
|
@@ -6760,21 +6756,11 @@ var REVERSE_CHANNELS = [
|
|
|
6760
6756
|
var REVERSE_CHANNEL_TIMEOUT_CLASS = {
|
|
6761
6757
|
"host/log": "data-plane",
|
|
6762
6758
|
"host/streamDelta": "data-plane",
|
|
6763
|
-
"host/poolResolved": "data-plane",
|
|
6764
6759
|
"host/handleReady": "data-plane",
|
|
6765
6760
|
"host/childSpawned": "data-plane",
|
|
6766
6761
|
"host/childStateChanged": "data-plane",
|
|
6767
|
-
"host/askUser": "interaction"
|
|
6768
|
-
"host/permission": "interaction"
|
|
6762
|
+
"host/askUser": "interaction"
|
|
6769
6763
|
};
|
|
6770
|
-
function isHostStreamDeltaParams(value) {
|
|
6771
|
-
if (typeof value !== "object" || value === null) return false;
|
|
6772
|
-
const v = value;
|
|
6773
|
-
const hasRunId = typeof v.runId === "string";
|
|
6774
|
-
const hasRecordId = typeof v.recordId === "string";
|
|
6775
|
-
if (hasRunId === hasRecordId) return false;
|
|
6776
|
-
return typeof v.delta === "string";
|
|
6777
|
-
}
|
|
6778
6764
|
|
|
6779
6765
|
// src/protocol/error-codes.ts
|
|
6780
6766
|
var ENGINE_PROTOCOL_ERROR_CODES = [
|
|
@@ -6827,7 +6813,7 @@ function engineConversationUnsupportedError(engineId) {
|
|
|
6827
6813
|
return new EngineSdkError(
|
|
6828
6814
|
"engine_capability_unsupported",
|
|
6829
6815
|
`engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
|
|
6830
|
-
`\u53BB\u6389 conversation \u53C2\u6570\
|
|
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`,
|
|
6831
6817
|
{ engineId, capability: "conversation", declared: "unsupported" }
|
|
6832
6818
|
);
|
|
6833
6819
|
}
|
|
@@ -6965,7 +6951,6 @@ var FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS = [
|
|
|
6965
6951
|
"password",
|
|
6966
6952
|
"secret"
|
|
6967
6953
|
];
|
|
6968
|
-
var REVERSE_CHANNEL_NAMES = REVERSE_CHANNELS;
|
|
6969
6954
|
var runSessionParamsSchema = {
|
|
6970
6955
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
6971
6956
|
title: "EngineRunSessionParams",
|
|
@@ -6977,11 +6962,10 @@ var runSessionParamsSchema = {
|
|
|
6977
6962
|
resume: {
|
|
6978
6963
|
type: "object",
|
|
6979
6964
|
additionalProperties: false,
|
|
6980
|
-
required: ["sessionRef"
|
|
6965
|
+
required: ["sessionRef"],
|
|
6981
6966
|
properties: {
|
|
6982
6967
|
// ResumeAnchor.sessionRef = Record<string, string>(引擎定位键值对)
|
|
6983
6968
|
sessionRef: { type: "object", additionalProperties: { type: "string" } },
|
|
6984
|
-
poolKey: { type: "string" },
|
|
6985
6969
|
journalPath: { type: "string" }
|
|
6986
6970
|
}
|
|
6987
6971
|
}
|
|
@@ -8316,7 +8300,6 @@ function runEngineCliEntry(opts) {
|
|
|
8316
8300
|
RELAY_EXIT_CODES,
|
|
8317
8301
|
RELAY_PROTOCOL_VERSION,
|
|
8318
8302
|
REVERSE_CHANNELS,
|
|
8319
|
-
REVERSE_CHANNEL_NAMES,
|
|
8320
8303
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
8321
8304
|
REVERSE_REQUEST_TIMEOUT_MS,
|
|
8322
8305
|
SCHEMA_EMULATION_TAIL_CHARS,
|
|
@@ -8350,7 +8333,6 @@ function runEngineCliEntry(opts) {
|
|
|
8350
8333
|
hostKindOf,
|
|
8351
8334
|
isEngineErrorPassthroughCode,
|
|
8352
8335
|
isEngineProtocolErrorCode,
|
|
8353
|
-
isHostStreamDeltaParams,
|
|
8354
8336
|
isNotificationFrame,
|
|
8355
8337
|
isPidAlive,
|
|
8356
8338
|
isProtocolVersionCompatible,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
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-
|
|
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-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
|
-
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,
|
|
2
|
-
export {
|
|
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-
|
|
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-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-
|
|
48
|
+
} from "./chunk-3IBT7MTB.js";
|
|
49
49
|
import {
|
|
50
50
|
DEFAULT_STDERR_KEEP_DAYS,
|
|
51
51
|
DEFAULT_STDERR_MAX_BYTES,
|
|
@@ -73,10 +73,8 @@ import {
|
|
|
73
73
|
FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS,
|
|
74
74
|
PROTOCOL_METHODS,
|
|
75
75
|
REVERSE_CHANNELS,
|
|
76
|
-
REVERSE_CHANNEL_NAMES,
|
|
77
76
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
78
77
|
errorResponseFrameSchema,
|
|
79
|
-
isHostStreamDeltaParams,
|
|
80
78
|
isNotificationFrame,
|
|
81
79
|
isRequestFrame,
|
|
82
80
|
isResponseFrame,
|
|
@@ -87,7 +85,7 @@ import {
|
|
|
87
85
|
reverseRequestFrameSchema,
|
|
88
86
|
runSessionParamsSchema,
|
|
89
87
|
successResponseFrameSchema
|
|
90
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-TW2FAMAJ.js";
|
|
91
89
|
import {
|
|
92
90
|
SCHEMA_EMULATION_TAIL_CHARS,
|
|
93
91
|
buildSchemaEmulationSegment,
|
|
@@ -107,7 +105,7 @@ import {
|
|
|
107
105
|
abortWithFallback,
|
|
108
106
|
killChain,
|
|
109
107
|
synthesizeTimeoutOutcome
|
|
110
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-WORT4PG7.js";
|
|
111
109
|
import {
|
|
112
110
|
toErrorMessage
|
|
113
111
|
} from "./chunk-PYO3YR7W.js";
|
|
@@ -135,7 +133,7 @@ import {
|
|
|
135
133
|
isEngineProtocolErrorCode,
|
|
136
134
|
isProtocolVersionCompatible,
|
|
137
135
|
schemaEmulationFailedDetail
|
|
138
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-F5JZMK74.js";
|
|
139
137
|
import {
|
|
140
138
|
aggregateUsage,
|
|
141
139
|
createReplayRecord,
|
|
@@ -192,7 +190,6 @@ export {
|
|
|
192
190
|
RELAY_EXIT_CODES,
|
|
193
191
|
RELAY_PROTOCOL_VERSION,
|
|
194
192
|
REVERSE_CHANNELS,
|
|
195
|
-
REVERSE_CHANNEL_NAMES,
|
|
196
193
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
197
194
|
REVERSE_REQUEST_TIMEOUT_MS,
|
|
198
195
|
SCHEMA_EMULATION_TAIL_CHARS,
|
|
@@ -226,7 +223,6 @@ export {
|
|
|
226
223
|
hostKindOf,
|
|
227
224
|
isEngineErrorPassthroughCode,
|
|
228
225
|
isEngineProtocolErrorCode,
|
|
229
|
-
isHostStreamDeltaParams,
|
|
230
226
|
isNotificationFrame,
|
|
231
227
|
isPidAlive,
|
|
232
228
|
isProtocolVersionCompatible,
|