@zhushanwen/subagent-engine-sdk 0.2.1 → 0.4.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-A75XDJIC.js → chunk-AIG5LSGK.js} +3 -0
- package/dist/{chunk-ZXEAW25V.js → chunk-BBVZK5DL.js} +1 -4
- package/dist/chunk-EUSM6ZX4.js +10 -0
- package/dist/{chunk-LEOBWKRM.js → chunk-FJT23P7T.js} +1 -1
- package/dist/{chunk-N3RL6OVM.js → chunk-J4G2MXDS.js} +3 -1
- package/dist/{chunk-ZOFFJNJD.js → chunk-LKPVN3N6.js} +1 -1
- package/dist/{chunk-RULLX6C6.js → chunk-LQR73V67.js} +2 -0
- package/dist/{chunk-YFSN3D5N.js → chunk-TW2FAMAJ.js} +24 -32
- package/dist/{chunk-PPEPBVCC.js → chunk-WS4WAZVR.js} +1 -1
- package/dist/cli-entry.cjs +3 -1
- package/dist/cli-entry.js +1 -1
- package/dist/{contract-types-sSlgppBC.d.cts → contract-types-C71Sqq8d.d.cts} +31 -43
- package/dist/{contract-types-sSlgppBC.d.ts → contract-types-C71Sqq8d.d.ts} +31 -43
- package/dist/env.cjs +1 -4
- package/dist/env.d.cts +4 -1
- package/dist/env.d.ts +4 -1
- package/dist/env.js +1 -1
- package/dist/{error-codes-Dhss2Kmk.d.ts → error-codes-CiOO3PMg.d.cts} +7 -7
- package/dist/{error-codes-DHco5-i_.d.cts → error-codes-D5YlWaBx.d.ts} +7 -7
- package/dist/index.cjs +45 -41
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +16 -15
- package/dist/journal-io.d.cts +1 -1
- package/dist/journal-io.d.ts +1 -1
- package/dist/journal-replay.cjs +3 -0
- package/dist/journal-replay.d.cts +1 -1
- package/dist/journal-replay.d.ts +1 -1
- package/dist/journal-replay.js +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.cjs +3 -0
- package/dist/port-contract.d.cts +45 -11
- package/dist/port-contract.d.ts +45 -11
- package/dist/port-contract.js +3 -1
- package/dist/protocol/index.cjs +26 -36
- package/dist/protocol/index.d.cts +95 -172
- package/dist/protocol/index.d.ts +95 -172
- package/dist/protocol/index.js +4 -8
- package/dist/ui-types.cjs +16 -0
- package/dist/ui-types.d.cts +13 -6
- package/dist/ui-types.d.ts +13 -6
- package/dist/ui-types.js +7 -1
- package/package.json +1 -1
- package/src/cli-entry.ts +6 -1
- package/src/data-dir.ts +3 -2
- package/src/env.ts +4 -4
- package/src/journal-replay.ts +4 -0
- package/src/nesting-guard.ts +1 -1
- package/src/paths.ts +1 -1
- package/src/port-contract.ts +44 -11
- package/src/protocol/contract-types.ts +36 -35
- package/src/protocol/engine-protocol.ts +22 -12
- package/src/protocol/error-codes.ts +7 -6
- package/src/protocol/frames.ts +1 -3
- package/src/protocol/methods.ts +38 -30
- package/src/protocol/reverse-channels.ts +21 -172
- package/src/protocol/schema.ts +34 -3
- package/src/ui-types.ts +22 -5
- package/dist/chunk-2DIMPZCQ.js +0 -0
package/dist/port-contract.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent,
|
|
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';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
|
|
@@ -26,10 +26,21 @@ interface EngineCtxModel {
|
|
|
26
26
|
interface EngineStream {
|
|
27
27
|
onDelta(delta: string): void;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* journal 固定分组 key(值锚定,**只承载、不透传**):journal 落盘路径
|
|
31
|
+
* `<dataDir>/engines/<engineId>/<本值>/journal-<taskId>.jsonl` 的第二段,两引擎恒
|
|
32
|
+
* 本值(pi / zcode 均无池化实现——pi = PI_CODING_AGENT_DIR 全局一份,zcode = 共享
|
|
33
|
+
* 宿主 HOME)。[池抽象降级 2026-09-13] poolKey 协议面(RunContext/run.params.ctx/
|
|
34
|
+
* host/poolResolved 通道/EngineHandleData)已整体退役,本常量不再跨进程透传,仅
|
|
35
|
+
* 三类消费:① journal 落盘路径构造(core journal-wiring);② 存量 record 兼容
|
|
36
|
+
* (zcode read 旧相对 dbPath 的锚定分支 + 持久化 engineHandle.poolKey 字段——
|
|
37
|
+
* record-store 读侧守卫要求非空,值恒本常量);③ 引擎数据目录布局 SSOT paths.ts
|
|
38
|
+
* 的签名参数。**值逐字不变**(存量 journal 落盘路径与记录含该值分段,改名不改值)。
|
|
39
|
+
*/
|
|
40
|
+
declare const SHARED_POOL_KEY = "shared";
|
|
41
|
+
/** run 的运行期上下文(core RunContext 结构等价镜像;resume? = 会话形态参数,缺省一次性任务)。 */
|
|
30
42
|
interface RunContext {
|
|
31
43
|
taskId: string;
|
|
32
|
-
poolKey: string;
|
|
33
44
|
signal?: AbortSignal;
|
|
34
45
|
onEvent?: (event: AgentEvent) => void;
|
|
35
46
|
ctxModel?: EngineCtxModel;
|
|
@@ -39,19 +50,43 @@ interface RunContext {
|
|
|
39
50
|
from: string;
|
|
40
51
|
reason: string;
|
|
41
52
|
};
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
/**
|
|
54
|
+
* [F6] 根 session id(协议 run.params.ctx.sessionRootId 的进程内还原)——pi 引擎
|
|
55
|
+
* relay 归属键 SESSION_ID 的权威来源。additive 可选:宿主缺省不传。
|
|
56
|
+
*/
|
|
57
|
+
sessionRootId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* [Option C 协议化] 权威 subagent session 目录(协议 run.params.ctx.sessionDir 的
|
|
60
|
+
* 进程内还原)——pi 引擎组装 `--session-dir` 的唯一权威值(宿主
|
|
61
|
+
* getSubagentSessionDir 推导,引擎不自推导)。additive 可选:缺省走引擎内
|
|
62
|
+
* [LEGACY] fallback(独立运行/测试形态)。
|
|
63
|
+
*/
|
|
64
|
+
sessionDir?: string;
|
|
65
|
+
onHandleReady?: (partial: Pick<EngineHandleData, "sessionRef">) => void;
|
|
44
66
|
/** 一次性子进程 pid 上报(host/childSpawned 载荷形态;ChildProcess 句柄不跨协议面)。 */
|
|
45
67
|
onChildSpawned?: (child: {
|
|
46
68
|
pid: number | undefined;
|
|
47
69
|
killed: boolean;
|
|
48
70
|
}) => void;
|
|
49
71
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
72
|
+
* 子进程退出态上报(host/childStateChanged 载荷形态;SR-4 接线:宿主镜像据此取消
|
|
73
|
+
* 该 pid 的挂起 dialog)。引擎侧只在 exited 相位上报——running 由 onChildSpawned 覆盖。
|
|
74
|
+
*/
|
|
75
|
+
onChildStateChanged?: (p: {
|
|
76
|
+
pid: number;
|
|
77
|
+
recordId: string;
|
|
78
|
+
state: "running" | "exited";
|
|
79
|
+
killed: boolean;
|
|
80
|
+
exitCode?: number;
|
|
81
|
+
signal?: string;
|
|
82
|
+
}) => void;
|
|
83
|
+
/**
|
|
84
|
+
* [H1 U6 终态] resume 续聊参数(协议 run.params.resume 的进程内还原;唯一会话形态
|
|
85
|
+
* 键——原 v1.x `chat` 字段已随键切换退役)。recordId = 轮次关联键与镜像帧锚定键;
|
|
86
|
+
* resume 锚点存在 = 冷续(--session 续写原文件),不存在 = 首轮新建。缺省 =
|
|
87
|
+
* 一次性任务形态。
|
|
53
88
|
*/
|
|
54
|
-
|
|
89
|
+
resume?: {
|
|
55
90
|
recordId: string;
|
|
56
91
|
resume?: ResumeAnchor;
|
|
57
92
|
};
|
|
@@ -71,7 +106,6 @@ interface EnginePort {
|
|
|
71
106
|
force?: boolean;
|
|
72
107
|
}): Promise<ProbeReport>;
|
|
73
108
|
run(task: EngineAgentCallOpts, ctx: RunContext): Promise<EngineRunResult>;
|
|
74
|
-
interact(handle: EngineHandle, action: InteractAction): Promise<InteractResult>;
|
|
75
109
|
read(handle: EngineHandle): Promise<SessionView>;
|
|
76
110
|
listModels?(): Array<{
|
|
77
111
|
id: string;
|
|
@@ -85,4 +119,4 @@ interface EnginePort {
|
|
|
85
119
|
/** ctx.ctxModel("provider/id" canonical 词形)→ EngineCtxModel。 */
|
|
86
120
|
declare function parseCtxModel(ref: string | undefined): EngineCtxModel | undefined;
|
|
87
121
|
|
|
88
|
-
export { type EngineAgentCallOpts, type EngineCtxModel, type EngineHandle, type EnginePort, type EngineRunResult, type EngineStream, type RunContext, parseCtxModel };
|
|
122
|
+
export { type EngineAgentCallOpts, type EngineCtxModel, type EngineHandle, type EnginePort, type EngineRunResult, type EngineStream, type RunContext, SHARED_POOL_KEY, parseCtxModel };
|
package/dist/port-contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCallOpts, h as EngineHandleData, E as EngineCapabilities, P as ProbeReport, a as AgentEvent,
|
|
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';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
|
|
@@ -26,10 +26,21 @@ interface EngineCtxModel {
|
|
|
26
26
|
interface EngineStream {
|
|
27
27
|
onDelta(delta: string): void;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* journal 固定分组 key(值锚定,**只承载、不透传**):journal 落盘路径
|
|
31
|
+
* `<dataDir>/engines/<engineId>/<本值>/journal-<taskId>.jsonl` 的第二段,两引擎恒
|
|
32
|
+
* 本值(pi / zcode 均无池化实现——pi = PI_CODING_AGENT_DIR 全局一份,zcode = 共享
|
|
33
|
+
* 宿主 HOME)。[池抽象降级 2026-09-13] poolKey 协议面(RunContext/run.params.ctx/
|
|
34
|
+
* host/poolResolved 通道/EngineHandleData)已整体退役,本常量不再跨进程透传,仅
|
|
35
|
+
* 三类消费:① journal 落盘路径构造(core journal-wiring);② 存量 record 兼容
|
|
36
|
+
* (zcode read 旧相对 dbPath 的锚定分支 + 持久化 engineHandle.poolKey 字段——
|
|
37
|
+
* record-store 读侧守卫要求非空,值恒本常量);③ 引擎数据目录布局 SSOT paths.ts
|
|
38
|
+
* 的签名参数。**值逐字不变**(存量 journal 落盘路径与记录含该值分段,改名不改值)。
|
|
39
|
+
*/
|
|
40
|
+
declare const SHARED_POOL_KEY = "shared";
|
|
41
|
+
/** run 的运行期上下文(core RunContext 结构等价镜像;resume? = 会话形态参数,缺省一次性任务)。 */
|
|
30
42
|
interface RunContext {
|
|
31
43
|
taskId: string;
|
|
32
|
-
poolKey: string;
|
|
33
44
|
signal?: AbortSignal;
|
|
34
45
|
onEvent?: (event: AgentEvent) => void;
|
|
35
46
|
ctxModel?: EngineCtxModel;
|
|
@@ -39,19 +50,43 @@ interface RunContext {
|
|
|
39
50
|
from: string;
|
|
40
51
|
reason: string;
|
|
41
52
|
};
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
/**
|
|
54
|
+
* [F6] 根 session id(协议 run.params.ctx.sessionRootId 的进程内还原)——pi 引擎
|
|
55
|
+
* relay 归属键 SESSION_ID 的权威来源。additive 可选:宿主缺省不传。
|
|
56
|
+
*/
|
|
57
|
+
sessionRootId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* [Option C 协议化] 权威 subagent session 目录(协议 run.params.ctx.sessionDir 的
|
|
60
|
+
* 进程内还原)——pi 引擎组装 `--session-dir` 的唯一权威值(宿主
|
|
61
|
+
* getSubagentSessionDir 推导,引擎不自推导)。additive 可选:缺省走引擎内
|
|
62
|
+
* [LEGACY] fallback(独立运行/测试形态)。
|
|
63
|
+
*/
|
|
64
|
+
sessionDir?: string;
|
|
65
|
+
onHandleReady?: (partial: Pick<EngineHandleData, "sessionRef">) => void;
|
|
44
66
|
/** 一次性子进程 pid 上报(host/childSpawned 载荷形态;ChildProcess 句柄不跨协议面)。 */
|
|
45
67
|
onChildSpawned?: (child: {
|
|
46
68
|
pid: number | undefined;
|
|
47
69
|
killed: boolean;
|
|
48
70
|
}) => void;
|
|
49
71
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
72
|
+
* 子进程退出态上报(host/childStateChanged 载荷形态;SR-4 接线:宿主镜像据此取消
|
|
73
|
+
* 该 pid 的挂起 dialog)。引擎侧只在 exited 相位上报——running 由 onChildSpawned 覆盖。
|
|
74
|
+
*/
|
|
75
|
+
onChildStateChanged?: (p: {
|
|
76
|
+
pid: number;
|
|
77
|
+
recordId: string;
|
|
78
|
+
state: "running" | "exited";
|
|
79
|
+
killed: boolean;
|
|
80
|
+
exitCode?: number;
|
|
81
|
+
signal?: string;
|
|
82
|
+
}) => void;
|
|
83
|
+
/**
|
|
84
|
+
* [H1 U6 终态] resume 续聊参数(协议 run.params.resume 的进程内还原;唯一会话形态
|
|
85
|
+
* 键——原 v1.x `chat` 字段已随键切换退役)。recordId = 轮次关联键与镜像帧锚定键;
|
|
86
|
+
* resume 锚点存在 = 冷续(--session 续写原文件),不存在 = 首轮新建。缺省 =
|
|
87
|
+
* 一次性任务形态。
|
|
53
88
|
*/
|
|
54
|
-
|
|
89
|
+
resume?: {
|
|
55
90
|
recordId: string;
|
|
56
91
|
resume?: ResumeAnchor;
|
|
57
92
|
};
|
|
@@ -71,7 +106,6 @@ interface EnginePort {
|
|
|
71
106
|
force?: boolean;
|
|
72
107
|
}): Promise<ProbeReport>;
|
|
73
108
|
run(task: EngineAgentCallOpts, ctx: RunContext): Promise<EngineRunResult>;
|
|
74
|
-
interact(handle: EngineHandle, action: InteractAction): Promise<InteractResult>;
|
|
75
109
|
read(handle: EngineHandle): Promise<SessionView>;
|
|
76
110
|
listModels?(): Array<{
|
|
77
111
|
id: string;
|
|
@@ -85,4 +119,4 @@ interface EnginePort {
|
|
|
85
119
|
/** ctx.ctxModel("provider/id" canonical 词形)→ EngineCtxModel。 */
|
|
86
120
|
declare function parseCtxModel(ref: string | undefined): EngineCtxModel | undefined;
|
|
87
121
|
|
|
88
|
-
export { type EngineAgentCallOpts, type EngineCtxModel, type EngineHandle, type EnginePort, type EngineRunResult, type EngineStream, type RunContext, parseCtxModel };
|
|
122
|
+
export { type EngineAgentCallOpts, type EngineCtxModel, type EngineHandle, type EnginePort, type EngineRunResult, type EngineStream, type RunContext, SHARED_POOL_KEY, parseCtxModel };
|
package/dist/port-contract.js
CHANGED
package/dist/protocol/index.cjs
CHANGED
|
@@ -35,7 +35,6 @@ __export(protocol_exports, {
|
|
|
35
35
|
HANDSHAKE_TIMEOUT_MS: () => HANDSHAKE_TIMEOUT_MS,
|
|
36
36
|
PROTOCOL_METHODS: () => PROTOCOL_METHODS,
|
|
37
37
|
REVERSE_CHANNELS: () => REVERSE_CHANNELS,
|
|
38
|
-
REVERSE_CHANNEL_NAMES: () => REVERSE_CHANNEL_NAMES,
|
|
39
38
|
REVERSE_CHANNEL_TIMEOUT_CLASS: () => REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
40
39
|
REVERSE_REQUEST_TIMEOUT_MS: () => REVERSE_REQUEST_TIMEOUT_MS,
|
|
41
40
|
STDERR_TAIL_CHARS: () => STDERR_TAIL_CHARS,
|
|
@@ -48,8 +47,6 @@ __export(protocol_exports, {
|
|
|
48
47
|
errorResponseFrameSchema: () => errorResponseFrameSchema,
|
|
49
48
|
isEngineErrorPassthroughCode: () => isEngineErrorPassthroughCode,
|
|
50
49
|
isEngineProtocolErrorCode: () => isEngineProtocolErrorCode,
|
|
51
|
-
isHostRoundLifecycleParams: () => isHostRoundLifecycleParams,
|
|
52
|
-
isHostStreamDeltaParams: () => isHostStreamDeltaParams,
|
|
53
50
|
isNotificationFrame: () => isNotificationFrame,
|
|
54
51
|
isProtocolVersionCompatible: () => isProtocolVersionCompatible,
|
|
55
52
|
isRequestFrame: () => isRequestFrame,
|
|
@@ -59,6 +56,7 @@ __export(protocol_exports, {
|
|
|
59
56
|
protocolErrorSchema: () => protocolErrorSchema,
|
|
60
57
|
requestFrameSchema: () => requestFrameSchema,
|
|
61
58
|
reverseRequestFrameSchema: () => reverseRequestFrameSchema,
|
|
59
|
+
runSessionParamsSchema: () => runSessionParamsSchema,
|
|
62
60
|
schemaEmulationFailedDetail: () => schemaEmulationFailedDetail,
|
|
63
61
|
successResponseFrameSchema: () => successResponseFrameSchema
|
|
64
62
|
});
|
|
@@ -114,7 +112,6 @@ var PROTOCOL_METHODS = [
|
|
|
114
112
|
"probe",
|
|
115
113
|
"run",
|
|
116
114
|
"cancel",
|
|
117
|
-
"interact",
|
|
118
115
|
"read",
|
|
119
116
|
"listModels",
|
|
120
117
|
"validateModel",
|
|
@@ -126,44 +123,19 @@ var PROTOCOL_METHODS = [
|
|
|
126
123
|
var REVERSE_CHANNELS = [
|
|
127
124
|
"host/log",
|
|
128
125
|
"host/askUser",
|
|
129
|
-
"host/permission",
|
|
130
126
|
"host/streamDelta",
|
|
131
|
-
"host/poolResolved",
|
|
132
127
|
"host/handleReady",
|
|
133
128
|
"host/childSpawned",
|
|
134
|
-
"host/childStateChanged"
|
|
135
|
-
"host/roundLifecycle"
|
|
129
|
+
"host/childStateChanged"
|
|
136
130
|
];
|
|
137
131
|
var REVERSE_CHANNEL_TIMEOUT_CLASS = {
|
|
138
132
|
"host/log": "data-plane",
|
|
139
133
|
"host/streamDelta": "data-plane",
|
|
140
|
-
"host/poolResolved": "data-plane",
|
|
141
134
|
"host/handleReady": "data-plane",
|
|
142
135
|
"host/childSpawned": "data-plane",
|
|
143
136
|
"host/childStateChanged": "data-plane",
|
|
144
|
-
"host/
|
|
145
|
-
"host/askUser": "interaction",
|
|
146
|
-
"host/permission": "interaction"
|
|
137
|
+
"host/askUser": "interaction"
|
|
147
138
|
};
|
|
148
|
-
function isHostStreamDeltaParams(value) {
|
|
149
|
-
if (typeof value !== "object" || value === null) return false;
|
|
150
|
-
const v = value;
|
|
151
|
-
const hasRunId = typeof v.runId === "string";
|
|
152
|
-
const hasRecordId = typeof v.recordId === "string";
|
|
153
|
-
if (hasRunId === hasRecordId) return false;
|
|
154
|
-
return typeof v.delta === "string";
|
|
155
|
-
}
|
|
156
|
-
function isHostRoundLifecycleParams(value) {
|
|
157
|
-
if (typeof value !== "object" || value === null) return false;
|
|
158
|
-
const v = value;
|
|
159
|
-
const hasRunId = typeof v.runId === "string";
|
|
160
|
-
const hasRecordId = typeof v.recordId === "string";
|
|
161
|
-
if (hasRunId === hasRecordId) return false;
|
|
162
|
-
if (v.phase === "settled" || v.phase === "idle") return true;
|
|
163
|
-
if (v.phase !== "failed") return false;
|
|
164
|
-
const err = v.error;
|
|
165
|
-
return typeof err === "object" && err !== null && typeof err.code === "string" && typeof err.message === "string";
|
|
166
|
-
}
|
|
167
139
|
|
|
168
140
|
// src/protocol/error-codes.ts
|
|
169
141
|
var ENGINE_PROTOCOL_ERROR_CODES = [
|
|
@@ -215,7 +187,7 @@ function engineProtocolMismatchError(engineVersion) {
|
|
|
215
187
|
function engineConversationUnsupportedError(engineId) {
|
|
216
188
|
return new EngineSdkError(
|
|
217
189
|
"engine_capability_unsupported",
|
|
218
|
-
`engine '${engineId}' \u4E0D\u652F\u6301
|
|
190
|
+
`engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
|
|
219
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`,
|
|
220
192
|
{ engineId, capability: "conversation", declared: "unsupported" }
|
|
221
193
|
);
|
|
@@ -316,6 +288,7 @@ var notificationFrameSchema = {
|
|
|
316
288
|
"turn_end",
|
|
317
289
|
"message_end",
|
|
318
290
|
"compaction",
|
|
291
|
+
"activity",
|
|
319
292
|
"error"
|
|
320
293
|
]
|
|
321
294
|
}
|
|
@@ -353,7 +326,26 @@ var FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS = [
|
|
|
353
326
|
"password",
|
|
354
327
|
"secret"
|
|
355
328
|
];
|
|
356
|
-
var
|
|
329
|
+
var runSessionParamsSchema = {
|
|
330
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
331
|
+
title: "EngineRunSessionParams",
|
|
332
|
+
type: "object",
|
|
333
|
+
additionalProperties: false,
|
|
334
|
+
required: ["recordId"],
|
|
335
|
+
properties: {
|
|
336
|
+
recordId: { type: "string" },
|
|
337
|
+
resume: {
|
|
338
|
+
type: "object",
|
|
339
|
+
additionalProperties: false,
|
|
340
|
+
required: ["sessionRef"],
|
|
341
|
+
properties: {
|
|
342
|
+
// ResumeAnchor.sessionRef = Record<string, string>(引擎定位键值对)
|
|
343
|
+
sessionRef: { type: "object", additionalProperties: { type: "string" } },
|
|
344
|
+
journalPath: { type: "string" }
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
};
|
|
357
349
|
// Annotate the CommonJS export names for ESM import in node:
|
|
358
350
|
0 && (module.exports = {
|
|
359
351
|
CANCEL_SETTLE_GRACE_MS,
|
|
@@ -371,7 +363,6 @@ var REVERSE_CHANNEL_NAMES = REVERSE_CHANNELS;
|
|
|
371
363
|
HANDSHAKE_TIMEOUT_MS,
|
|
372
364
|
PROTOCOL_METHODS,
|
|
373
365
|
REVERSE_CHANNELS,
|
|
374
|
-
REVERSE_CHANNEL_NAMES,
|
|
375
366
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
376
367
|
REVERSE_REQUEST_TIMEOUT_MS,
|
|
377
368
|
STDERR_TAIL_CHARS,
|
|
@@ -384,8 +375,6 @@ var REVERSE_CHANNEL_NAMES = REVERSE_CHANNELS;
|
|
|
384
375
|
errorResponseFrameSchema,
|
|
385
376
|
isEngineErrorPassthroughCode,
|
|
386
377
|
isEngineProtocolErrorCode,
|
|
387
|
-
isHostRoundLifecycleParams,
|
|
388
|
-
isHostStreamDeltaParams,
|
|
389
378
|
isNotificationFrame,
|
|
390
379
|
isProtocolVersionCompatible,
|
|
391
380
|
isRequestFrame,
|
|
@@ -395,6 +384,7 @@ var REVERSE_CHANNEL_NAMES = REVERSE_CHANNELS;
|
|
|
395
384
|
protocolErrorSchema,
|
|
396
385
|
requestFrameSchema,
|
|
397
386
|
reverseRequestFrameSchema,
|
|
387
|
+
runSessionParamsSchema,
|
|
398
388
|
schemaEmulationFailedDetail,
|
|
399
389
|
successResponseFrameSchema
|
|
400
390
|
});
|