@zhushanwen/subagent-engine-sdk 0.5.1 → 0.6.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-TW2FAMAJ.js → chunk-63ZNJHM5.js} +26 -11
- package/dist/chunk-CT3FEBDO.js +8 -0
- package/dist/{chunk-M3SZTDNQ.js → chunk-YL5W5EMV.js} +5 -1
- package/dist/{contract-types-Dsvy79r3.d.cts → contract-types-DaULkdpG.d.cts} +44 -11
- package/dist/{contract-types-Dsvy79r3.d.ts → contract-types-DaULkdpG.d.ts} +44 -11
- package/dist/env.cjs +5 -1
- package/dist/env.js +1 -1
- package/dist/{error-codes-DMGeUUUm.d.ts → error-codes-C9BOUI5H.d.ts} +2 -2
- package/dist/{error-codes-pT7RYTqQ.d.cts → error-codes-CFTOAxva.d.cts} +2 -2
- package/dist/index.cjs +40 -12
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +10 -2
- 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/port-contract.d.cts +1 -1
- package/dist/port-contract.d.ts +1 -1
- package/dist/protocol/index.cjs +27 -11
- package/dist/protocol/index.d.cts +6 -5
- package/dist/protocol/index.d.ts +6 -5
- package/dist/protocol/index.js +3 -1
- package/dist/zcode-db-paths.cjs +33 -0
- package/dist/zcode-db-paths.d.cts +15 -0
- package/dist/zcode-db-paths.d.ts +15 -0
- package/dist/zcode-db-paths.js +9 -0
- package/package.json +1 -1
|
@@ -51,6 +51,28 @@ var REVERSE_CHANNEL_TIMEOUT_CLASS = {
|
|
|
51
51
|
"host/askUser": "interaction"
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
// src/protocol/contract-types.ts
|
|
55
|
+
var AGENT_EVENT_TYPE_NAMES = [
|
|
56
|
+
"tool_start",
|
|
57
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 tool 起始占位(显示降级),turn 结构不受损
|
|
58
|
+
"tool_end",
|
|
59
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 result,turn 收口由 turn_end/message_end 承担
|
|
60
|
+
"text_delta",
|
|
61
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺正文增量,不产生半解析状态
|
|
62
|
+
"thinking_delta",
|
|
63
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺推理增量,不产生半解析状态
|
|
64
|
+
"turn_end",
|
|
65
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃则该 turn 滞留进行态,journal 重放仍按序重建
|
|
66
|
+
"message_end",
|
|
67
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 usage 聚合与闭合计量,已累积内容不回滚
|
|
68
|
+
"compaction",
|
|
69
|
+
// noop-safe: 事件无载荷且现行 reducer 即直接 return——丢弃与处理零差异
|
|
70
|
+
"activity",
|
|
71
|
+
// noop-safe: 纯活性信号,双侧 reducer 恒 no-op(协议语义见 AgentEvent 头注),丢弃零差异
|
|
72
|
+
"error"
|
|
73
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 lastError 诊断留痕,已写状态不回滚
|
|
74
|
+
];
|
|
75
|
+
|
|
54
76
|
// src/protocol/schema.ts
|
|
55
77
|
var ANY_JSON = {};
|
|
56
78
|
var protocolErrorSchema = {
|
|
@@ -121,17 +143,9 @@ var notificationFrameSchema = {
|
|
|
121
143
|
properties: {
|
|
122
144
|
type: {
|
|
123
145
|
type: "string",
|
|
124
|
-
enum
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"text_delta",
|
|
128
|
-
"thinking_delta",
|
|
129
|
-
"turn_end",
|
|
130
|
-
"message_end",
|
|
131
|
-
"compaction",
|
|
132
|
-
"activity",
|
|
133
|
-
"error"
|
|
134
|
-
]
|
|
146
|
+
// 事件 enum 从词表 SSOT 派生(U2 词表锁:union⟷词表互证后,此处不再
|
|
147
|
+
// 手写字面量集合——手写即漂移面,病灶 1 的第三处同步点)
|
|
148
|
+
enum: [...AGENT_EVENT_TYPE_NAMES]
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
151
|
}
|
|
@@ -196,6 +210,7 @@ export {
|
|
|
196
210
|
PROTOCOL_METHODS,
|
|
197
211
|
REVERSE_CHANNELS,
|
|
198
212
|
REVERSE_CHANNEL_TIMEOUT_CLASS,
|
|
213
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
199
214
|
protocolErrorSchema,
|
|
200
215
|
requestFrameSchema,
|
|
201
216
|
successResponseFrameSchema,
|
|
@@ -14,7 +14,11 @@ var ENGINE_ENV_DENY_LIST = [
|
|
|
14
14
|
"TAIJI_RUNTIME_TOKEN",
|
|
15
15
|
"TAIJI_AGENT_API_KEY",
|
|
16
16
|
"TAIJI_SUBAGENT_RELAY_SESSION_ID",
|
|
17
|
-
"TAIJI_SUBAGENT_RELAY_RECORD_ID"
|
|
17
|
+
"TAIJI_SUBAGENT_RELAY_RECORD_ID",
|
|
18
|
+
// 预设回落事实(env 名 SSOT = shared PRESET_FALLBACK_ENV_KEYS):「本进程本次运行」
|
|
19
|
+
// 事实只对 runtime 直接 spawn 的 pi 成立,引擎一跳继承会造成子 agent pi 假披露
|
|
20
|
+
"TAIJI_PRESET_FALLBACK_FROM",
|
|
21
|
+
"TAIJI_PRESET_FALLBACK_TO"
|
|
18
22
|
];
|
|
19
23
|
var ENGINE_ENV_L0_INFRA_KEYS = [
|
|
20
24
|
"TAIJI_AGENT_DATA_DIR",
|
|
@@ -62,38 +62,71 @@ interface Turn {
|
|
|
62
62
|
* activity = 纯活性信号:双侧 reducer no-op、不开 turn、不写状态、不落 journal
|
|
63
63
|
* (core journal-wiring 对其豁免 append),只承诺「引擎活跃时周期性出现」——供宿主
|
|
64
64
|
* 无进展守护刷新判活(长工具执行期)。节流属生产者实现细节,不进协议承诺。
|
|
65
|
+
*
|
|
66
|
+
* 每个成员的 type 经 `EventName<"…">` 受词表约束(编译锁①,见下方词表节)。
|
|
65
67
|
*/
|
|
66
68
|
type AgentEvent = {
|
|
67
|
-
type: "tool_start"
|
|
69
|
+
type: EventName<"tool_start">;
|
|
68
70
|
toolName: string;
|
|
69
71
|
args?: unknown;
|
|
70
72
|
} | {
|
|
71
|
-
type: "tool_end"
|
|
73
|
+
type: EventName<"tool_end">;
|
|
72
74
|
toolName: string;
|
|
73
75
|
args?: unknown;
|
|
74
76
|
result?: ToolCallResult;
|
|
75
77
|
isError?: boolean;
|
|
76
78
|
} | {
|
|
77
|
-
type: "text_delta"
|
|
79
|
+
type: EventName<"text_delta">;
|
|
78
80
|
delta: string;
|
|
79
81
|
} | {
|
|
80
|
-
type: "thinking_delta"
|
|
82
|
+
type: EventName<"thinking_delta">;
|
|
81
83
|
delta: string;
|
|
82
84
|
} | {
|
|
83
|
-
type: "turn_end"
|
|
85
|
+
type: EventName<"turn_end">;
|
|
84
86
|
summary?: string;
|
|
85
87
|
} | {
|
|
86
|
-
type: "message_end"
|
|
88
|
+
type: EventName<"message_end">;
|
|
87
89
|
usage?: AgentUsage;
|
|
88
90
|
error?: string;
|
|
89
91
|
} | {
|
|
90
|
-
type: "compaction"
|
|
92
|
+
type: EventName<"compaction">;
|
|
91
93
|
} | {
|
|
92
|
-
type: "activity"
|
|
94
|
+
type: EventName<"activity">;
|
|
93
95
|
} | {
|
|
94
|
-
type: "error"
|
|
96
|
+
type: EventName<"error">;
|
|
95
97
|
message: string;
|
|
96
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* 事件类型词表(协议事件全集 9 种,运行时 SSOT):schema 事件 `type.enum` 从本表
|
|
101
|
+
* 派生(schema.ts),测试取值遍历本表(protocol-schema.test.ts / contract-closure.test.ts)
|
|
102
|
+
* ——新增事件变体不再手写第三处。
|
|
103
|
+
*
|
|
104
|
+
* 每个成员必须带一行 `// noop-safe: <论证>`:未知成员宽容语义四行①(ADR-0071)的
|
|
105
|
+
* 逐变体登记——旧宿主 reducer 遇未知 event.type 走 default 分支零写入,标记后写
|
|
106
|
+
* 「本变体被丢弃时状态无损」的一行论证(no-op 安全性属运行时消费语义,不可静态
|
|
107
|
+
* 判定——守卫只查标记存在不查内容,落点 contract-closure.test.ts「noop-safe 标记守卫」)。
|
|
108
|
+
*
|
|
109
|
+
* 编译锁(漏改任一侧 typecheck 红,且错误指向漏点):
|
|
110
|
+
* ① union 侧——成员 type 必须经 `EventName<"x">` 取名(约束 = 本词表):union 加
|
|
111
|
+
* 成员不登词表 → TS2344 直接落在漏改的成员行;
|
|
112
|
+
* ② 词表侧——`satisfies readonly AgentEvent["type"][]`:词表加成员不加 union
|
|
113
|
+
* → 错误直接落在词表漏改的成员行;
|
|
114
|
+
* ③ 兜底——成员绕过 EventName 约束裸加字面量 → _EventVocabSyncLock 爆红。
|
|
115
|
+
* 新增事件变体的同步面分两层,漏改任一处 typecheck 均红且精确指路(验收 A1 演练
|
|
116
|
+
* 实证):协议面两笔(词表 + union)即协议面全同步——schema enum 与遍历型测试断言
|
|
117
|
+
* 自动跟随;同仓消费面另有两处编译期同步点——journal-replay reducer case(穷尽
|
|
118
|
+
* switch never 检查)与 contract-closure 构造冒烟(Record<AgentEventTypeName,…>
|
|
119
|
+
* 漏键爆红)。不 bump 版本、不改任何引擎(演进政策 additive 面,判据全文见头注)。
|
|
120
|
+
*/
|
|
121
|
+
declare const AGENT_EVENT_TYPE_NAMES: readonly ["tool_start", "tool_end", "text_delta", "thinking_delta", "turn_end", "message_end", "compaction", "activity", "error"];
|
|
122
|
+
/** 词表派生的事件名联合(编译锁②/③的词表侧源;schema enum 与测试取值同源)。 */
|
|
123
|
+
type AgentEventTypeName = (typeof AGENT_EVENT_TYPE_NAMES)[number];
|
|
124
|
+
/**
|
|
125
|
+
* 词表约束的事件 type 字面量(编译锁①):union 成员经 `EventName<"x">` 取名,
|
|
126
|
+
* 词表漏登时 typecheck 错误落在该成员行。类型恒等(解析为同一字面量),
|
|
127
|
+
* 结构与运行时语义零变化。
|
|
128
|
+
*/
|
|
129
|
+
type EventName<T extends AgentEventTypeName> = T;
|
|
97
130
|
/**
|
|
98
131
|
* EngineHandle 的持久化形态(JSON v1)。协议 run 终态应答 / read 的
|
|
99
132
|
* handle 载荷(引擎不持有宿主运行时引用,data 即全部)。
|
|
@@ -173,7 +206,7 @@ interface EngineCapabilities {
|
|
|
173
206
|
conversation: "native" | "cold" | "unsupported";
|
|
174
207
|
/** 决定 persona 路由策略(file/flag/prompt 通道)。 */
|
|
175
208
|
personaInjection: "file" | "flag" | "prompt";
|
|
176
|
-
/** 粗粒度引擎:GUI
|
|
209
|
+
/** 粗粒度引擎:GUI 显示降级为阶段态。判据 5 回指:被 streamMode 键消费(degradable 先例)。 */
|
|
177
210
|
eventGranularity: "stream" | "coarse";
|
|
178
211
|
/** emulated = worktree 隔离(无 OS sandbox 的引擎用文件写维度隔离补齐)。 */
|
|
179
212
|
sandbox: "native" | "emulated" | "none";
|
|
@@ -336,4 +369,4 @@ interface AgentCallOpts {
|
|
|
336
369
|
permissionMode?: string;
|
|
337
370
|
}
|
|
338
371
|
|
|
339
|
-
export
|
|
372
|
+
export { AGENT_EVENT_TYPE_NAMES as A, type EngineCapabilities as E, type InternalToolCall as I, type ModelCatalogEntry as M, type ProbeReport as P, type ReplayedTurn as R, type SessionView as S, type ToolCall as T, type WorktreeHandle as W, type AgentCallOpts as a, type AgentEvent as b, type AgentEventTypeName as c, type AgentFailureKind as d, type AgentOutcome as e, type AgentOutcomeUsage as f, type AgentUsage as g, type AgentUsageTotal as h, type AssertMutuallyAssignable as i, type EngineHandleData as j, type ResumeAnchor as k, type ToolCallEntry as l, type ToolCallResult as m, type Turn as n };
|
|
@@ -62,38 +62,71 @@ interface Turn {
|
|
|
62
62
|
* activity = 纯活性信号:双侧 reducer no-op、不开 turn、不写状态、不落 journal
|
|
63
63
|
* (core journal-wiring 对其豁免 append),只承诺「引擎活跃时周期性出现」——供宿主
|
|
64
64
|
* 无进展守护刷新判活(长工具执行期)。节流属生产者实现细节,不进协议承诺。
|
|
65
|
+
*
|
|
66
|
+
* 每个成员的 type 经 `EventName<"…">` 受词表约束(编译锁①,见下方词表节)。
|
|
65
67
|
*/
|
|
66
68
|
type AgentEvent = {
|
|
67
|
-
type: "tool_start"
|
|
69
|
+
type: EventName<"tool_start">;
|
|
68
70
|
toolName: string;
|
|
69
71
|
args?: unknown;
|
|
70
72
|
} | {
|
|
71
|
-
type: "tool_end"
|
|
73
|
+
type: EventName<"tool_end">;
|
|
72
74
|
toolName: string;
|
|
73
75
|
args?: unknown;
|
|
74
76
|
result?: ToolCallResult;
|
|
75
77
|
isError?: boolean;
|
|
76
78
|
} | {
|
|
77
|
-
type: "text_delta"
|
|
79
|
+
type: EventName<"text_delta">;
|
|
78
80
|
delta: string;
|
|
79
81
|
} | {
|
|
80
|
-
type: "thinking_delta"
|
|
82
|
+
type: EventName<"thinking_delta">;
|
|
81
83
|
delta: string;
|
|
82
84
|
} | {
|
|
83
|
-
type: "turn_end"
|
|
85
|
+
type: EventName<"turn_end">;
|
|
84
86
|
summary?: string;
|
|
85
87
|
} | {
|
|
86
|
-
type: "message_end"
|
|
88
|
+
type: EventName<"message_end">;
|
|
87
89
|
usage?: AgentUsage;
|
|
88
90
|
error?: string;
|
|
89
91
|
} | {
|
|
90
|
-
type: "compaction"
|
|
92
|
+
type: EventName<"compaction">;
|
|
91
93
|
} | {
|
|
92
|
-
type: "activity"
|
|
94
|
+
type: EventName<"activity">;
|
|
93
95
|
} | {
|
|
94
|
-
type: "error"
|
|
96
|
+
type: EventName<"error">;
|
|
95
97
|
message: string;
|
|
96
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* 事件类型词表(协议事件全集 9 种,运行时 SSOT):schema 事件 `type.enum` 从本表
|
|
101
|
+
* 派生(schema.ts),测试取值遍历本表(protocol-schema.test.ts / contract-closure.test.ts)
|
|
102
|
+
* ——新增事件变体不再手写第三处。
|
|
103
|
+
*
|
|
104
|
+
* 每个成员必须带一行 `// noop-safe: <论证>`:未知成员宽容语义四行①(ADR-0071)的
|
|
105
|
+
* 逐变体登记——旧宿主 reducer 遇未知 event.type 走 default 分支零写入,标记后写
|
|
106
|
+
* 「本变体被丢弃时状态无损」的一行论证(no-op 安全性属运行时消费语义,不可静态
|
|
107
|
+
* 判定——守卫只查标记存在不查内容,落点 contract-closure.test.ts「noop-safe 标记守卫」)。
|
|
108
|
+
*
|
|
109
|
+
* 编译锁(漏改任一侧 typecheck 红,且错误指向漏点):
|
|
110
|
+
* ① union 侧——成员 type 必须经 `EventName<"x">` 取名(约束 = 本词表):union 加
|
|
111
|
+
* 成员不登词表 → TS2344 直接落在漏改的成员行;
|
|
112
|
+
* ② 词表侧——`satisfies readonly AgentEvent["type"][]`:词表加成员不加 union
|
|
113
|
+
* → 错误直接落在词表漏改的成员行;
|
|
114
|
+
* ③ 兜底——成员绕过 EventName 约束裸加字面量 → _EventVocabSyncLock 爆红。
|
|
115
|
+
* 新增事件变体的同步面分两层,漏改任一处 typecheck 均红且精确指路(验收 A1 演练
|
|
116
|
+
* 实证):协议面两笔(词表 + union)即协议面全同步——schema enum 与遍历型测试断言
|
|
117
|
+
* 自动跟随;同仓消费面另有两处编译期同步点——journal-replay reducer case(穷尽
|
|
118
|
+
* switch never 检查)与 contract-closure 构造冒烟(Record<AgentEventTypeName,…>
|
|
119
|
+
* 漏键爆红)。不 bump 版本、不改任何引擎(演进政策 additive 面,判据全文见头注)。
|
|
120
|
+
*/
|
|
121
|
+
declare const AGENT_EVENT_TYPE_NAMES: readonly ["tool_start", "tool_end", "text_delta", "thinking_delta", "turn_end", "message_end", "compaction", "activity", "error"];
|
|
122
|
+
/** 词表派生的事件名联合(编译锁②/③的词表侧源;schema enum 与测试取值同源)。 */
|
|
123
|
+
type AgentEventTypeName = (typeof AGENT_EVENT_TYPE_NAMES)[number];
|
|
124
|
+
/**
|
|
125
|
+
* 词表约束的事件 type 字面量(编译锁①):union 成员经 `EventName<"x">` 取名,
|
|
126
|
+
* 词表漏登时 typecheck 错误落在该成员行。类型恒等(解析为同一字面量),
|
|
127
|
+
* 结构与运行时语义零变化。
|
|
128
|
+
*/
|
|
129
|
+
type EventName<T extends AgentEventTypeName> = T;
|
|
97
130
|
/**
|
|
98
131
|
* EngineHandle 的持久化形态(JSON v1)。协议 run 终态应答 / read 的
|
|
99
132
|
* handle 载荷(引擎不持有宿主运行时引用,data 即全部)。
|
|
@@ -173,7 +206,7 @@ interface EngineCapabilities {
|
|
|
173
206
|
conversation: "native" | "cold" | "unsupported";
|
|
174
207
|
/** 决定 persona 路由策略(file/flag/prompt 通道)。 */
|
|
175
208
|
personaInjection: "file" | "flag" | "prompt";
|
|
176
|
-
/** 粗粒度引擎:GUI
|
|
209
|
+
/** 粗粒度引擎:GUI 显示降级为阶段态。判据 5 回指:被 streamMode 键消费(degradable 先例)。 */
|
|
177
210
|
eventGranularity: "stream" | "coarse";
|
|
178
211
|
/** emulated = worktree 隔离(无 OS sandbox 的引擎用文件写维度隔离补齐)。 */
|
|
179
212
|
sandbox: "native" | "emulated" | "none";
|
|
@@ -336,4 +369,4 @@ interface AgentCallOpts {
|
|
|
336
369
|
permissionMode?: string;
|
|
337
370
|
}
|
|
338
371
|
|
|
339
|
-
export
|
|
372
|
+
export { AGENT_EVENT_TYPE_NAMES as A, type EngineCapabilities as E, type InternalToolCall as I, type ModelCatalogEntry as M, type ProbeReport as P, type ReplayedTurn as R, type SessionView as S, type ToolCall as T, type WorktreeHandle as W, type AgentCallOpts as a, type AgentEvent as b, type AgentEventTypeName as c, type AgentFailureKind as d, type AgentOutcome as e, type AgentOutcomeUsage as f, type AgentUsage as g, type AgentUsageTotal as h, type AssertMutuallyAssignable as i, type EngineHandleData as j, type ResumeAnchor as k, type ToolCallEntry as l, type ToolCallResult as m, type Turn as n };
|
package/dist/env.cjs
CHANGED
|
@@ -87,7 +87,11 @@ var ENGINE_ENV_DENY_LIST = [
|
|
|
87
87
|
"TAIJI_RUNTIME_TOKEN",
|
|
88
88
|
"TAIJI_AGENT_API_KEY",
|
|
89
89
|
"TAIJI_SUBAGENT_RELAY_SESSION_ID",
|
|
90
|
-
"TAIJI_SUBAGENT_RELAY_RECORD_ID"
|
|
90
|
+
"TAIJI_SUBAGENT_RELAY_RECORD_ID",
|
|
91
|
+
// 预设回落事实(env 名 SSOT = shared PRESET_FALLBACK_ENV_KEYS):「本进程本次运行」
|
|
92
|
+
// 事实只对 runtime 直接 spawn 的 pi 成立,引擎一跳继承会造成子 agent pi 假披露
|
|
93
|
+
"TAIJI_PRESET_FALLBACK_FROM",
|
|
94
|
+
"TAIJI_PRESET_FALLBACK_TO"
|
|
91
95
|
];
|
|
92
96
|
var ENGINE_ENV_L0_INFRA_KEYS = [
|
|
93
97
|
"TAIJI_AGENT_DATA_DIR",
|
package/dist/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AgentEvent, E as EngineCapabilities } from './contract-types-DaULkdpG.js';
|
|
2
2
|
|
|
3
3
|
/** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
|
|
4
4
|
interface ProtocolError {
|
|
@@ -50,7 +50,7 @@ type ReverseResponseResult =
|
|
|
50
50
|
| {
|
|
51
51
|
ack: true;
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
53
|
+
/** 未实现或宿主未知的通道(宽容语义③:由 askUser 语境泛化到全通道——宿主对未知 host/* 通道回 unsupported,引擎自行降级)。 */
|
|
54
54
|
| {
|
|
55
55
|
unsupported: true;
|
|
56
56
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AgentEvent, E as EngineCapabilities } from './contract-types-DaULkdpG.cjs';
|
|
2
2
|
|
|
3
3
|
/** 协议错误对象(error 帧载荷与反向请求错误应答共用形态)。 */
|
|
4
4
|
interface ProtocolError {
|
|
@@ -50,7 +50,7 @@ type ReverseResponseResult =
|
|
|
50
50
|
| {
|
|
51
51
|
ack: true;
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
53
|
+
/** 未实现或宿主未知的通道(宽容语义③:由 askUser 语境泛化到全通道——宿主对未知 host/* 通道回 unsupported,引擎自行降级)。 */
|
|
54
54
|
| {
|
|
55
55
|
unsupported: true;
|
|
56
56
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -6572,6 +6572,7 @@ var require_ajv = __commonJS({
|
|
|
6572
6572
|
// src/index.ts
|
|
6573
6573
|
var src_exports = {};
|
|
6574
6574
|
__export(src_exports, {
|
|
6575
|
+
AGENT_EVENT_TYPE_NAMES: () => AGENT_EVENT_TYPE_NAMES,
|
|
6575
6576
|
CANCEL_SETTLE_GRACE_MS: () => CANCEL_SETTLE_GRACE_MS,
|
|
6576
6577
|
CRASH_REBUILD_BACKOFF_MS: () => CRASH_REBUILD_BACKOFF_MS,
|
|
6577
6578
|
CRASH_REBUILD_MAX_ATTEMPTS: () => CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -6616,6 +6617,8 @@ __export(src_exports, {
|
|
|
6616
6617
|
STDOUT_TAIL_ECHO_CHARS: () => STDOUT_TAIL_ECHO_CHARS,
|
|
6617
6618
|
SUPPORTED_PROTOCOL_RANGE: () => SUPPORTED_PROTOCOL_RANGE,
|
|
6618
6619
|
TAIJI_DATA_DIR_ENV: () => TAIJI_DATA_DIR_ENV,
|
|
6620
|
+
ZCODE_HOST_DB_SUFFIX: () => ZCODE_HOST_DB_SUFFIX,
|
|
6621
|
+
ZCODE_ISOLATED_DB_SEGMENTS: () => ZCODE_ISOLATED_DB_SEGMENTS,
|
|
6619
6622
|
abortWithFallback: () => abortWithFallback,
|
|
6620
6623
|
aggregateUsage: () => aggregateUsage,
|
|
6621
6624
|
armEngineSelfDestruct: () => armEngineSelfDestruct,
|
|
@@ -6835,6 +6838,28 @@ function schemaEmulationFailedDetail(error, tail) {
|
|
|
6835
6838
|
return `structured output emulation failed after tolerant extraction and one host-side retry: ${error}. Raw output tail: ${truncate(tail, DETAIL_ECHO_MAX_CHARS)}. Recovery: retry with a strengthened prompt or relax the schema; if it still fails switch to a schema-native engine (engine: pi).`;
|
|
6836
6839
|
}
|
|
6837
6840
|
|
|
6841
|
+
// src/protocol/contract-types.ts
|
|
6842
|
+
var AGENT_EVENT_TYPE_NAMES = [
|
|
6843
|
+
"tool_start",
|
|
6844
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 tool 起始占位(显示降级),turn 结构不受损
|
|
6845
|
+
"tool_end",
|
|
6846
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 result,turn 收口由 turn_end/message_end 承担
|
|
6847
|
+
"text_delta",
|
|
6848
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺正文增量,不产生半解析状态
|
|
6849
|
+
"thinking_delta",
|
|
6850
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺推理增量,不产生半解析状态
|
|
6851
|
+
"turn_end",
|
|
6852
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃则该 turn 滞留进行态,journal 重放仍按序重建
|
|
6853
|
+
"message_end",
|
|
6854
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 usage 聚合与闭合计量,已累积内容不回滚
|
|
6855
|
+
"compaction",
|
|
6856
|
+
// noop-safe: 事件无载荷且现行 reducer 即直接 return——丢弃与处理零差异
|
|
6857
|
+
"activity",
|
|
6858
|
+
// noop-safe: 纯活性信号,双侧 reducer 恒 no-op(协议语义见 AgentEvent 头注),丢弃零差异
|
|
6859
|
+
"error"
|
|
6860
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 lastError 诊断留痕,已写状态不回滚
|
|
6861
|
+
];
|
|
6862
|
+
|
|
6838
6863
|
// src/protocol/schema.ts
|
|
6839
6864
|
var ANY_JSON = {};
|
|
6840
6865
|
var protocolErrorSchema = {
|
|
@@ -6905,17 +6930,9 @@ var notificationFrameSchema = {
|
|
|
6905
6930
|
properties: {
|
|
6906
6931
|
type: {
|
|
6907
6932
|
type: "string",
|
|
6908
|
-
enum
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
"text_delta",
|
|
6912
|
-
"thinking_delta",
|
|
6913
|
-
"turn_end",
|
|
6914
|
-
"message_end",
|
|
6915
|
-
"compaction",
|
|
6916
|
-
"activity",
|
|
6917
|
-
"error"
|
|
6918
|
-
]
|
|
6933
|
+
// 事件 enum 从词表 SSOT 派生(U2 词表锁:union⟷词表互证后,此处不再
|
|
6934
|
+
// 手写字面量集合——手写即漂移面,病灶 1 的第三处同步点)
|
|
6935
|
+
enum: [...AGENT_EVENT_TYPE_NAMES]
|
|
6919
6936
|
}
|
|
6920
6937
|
}
|
|
6921
6938
|
}
|
|
@@ -7694,7 +7711,11 @@ var ENGINE_ENV_DENY_LIST = [
|
|
|
7694
7711
|
"TAIJI_RUNTIME_TOKEN",
|
|
7695
7712
|
"TAIJI_AGENT_API_KEY",
|
|
7696
7713
|
"TAIJI_SUBAGENT_RELAY_SESSION_ID",
|
|
7697
|
-
"TAIJI_SUBAGENT_RELAY_RECORD_ID"
|
|
7714
|
+
"TAIJI_SUBAGENT_RELAY_RECORD_ID",
|
|
7715
|
+
// 预设回落事实(env 名 SSOT = shared PRESET_FALLBACK_ENV_KEYS):「本进程本次运行」
|
|
7716
|
+
// 事实只对 runtime 直接 spawn 的 pi 成立,引擎一跳继承会造成子 agent pi 假披露
|
|
7717
|
+
"TAIJI_PRESET_FALLBACK_FROM",
|
|
7718
|
+
"TAIJI_PRESET_FALLBACK_TO"
|
|
7698
7719
|
];
|
|
7699
7720
|
var ENGINE_ENV_L0_INFRA_KEYS = [
|
|
7700
7721
|
"TAIJI_AGENT_DATA_DIR",
|
|
@@ -8139,6 +8160,10 @@ function cleanupSiblingStderrLogs(logPath, env, prefix, now) {
|
|
|
8139
8160
|
return cleanupStaleStderrLogs((0, import_node_path2.dirname)(logPath), env, prefix, now);
|
|
8140
8161
|
}
|
|
8141
8162
|
|
|
8163
|
+
// src/zcode-db-paths.ts
|
|
8164
|
+
var ZCODE_HOST_DB_SUFFIX = [".zcode", "cli", "db", "db.sqlite"];
|
|
8165
|
+
var ZCODE_ISOLATED_DB_SEGMENTS = ["engines", "zcode", "session-db", "db.sqlite"];
|
|
8166
|
+
|
|
8142
8167
|
// src/relay-env.ts
|
|
8143
8168
|
var RELAY_ENV_SOCKET = "TAIJI_SUBAGENT_RELAY_SOCKET";
|
|
8144
8169
|
var RELAY_ENV_NODE = "TAIJI_SUBAGENT_RELAY_NODE";
|
|
@@ -8264,6 +8289,7 @@ function runEngineCliEntry(opts) {
|
|
|
8264
8289
|
}
|
|
8265
8290
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8266
8291
|
0 && (module.exports = {
|
|
8292
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
8267
8293
|
CANCEL_SETTLE_GRACE_MS,
|
|
8268
8294
|
CRASH_REBUILD_BACKOFF_MS,
|
|
8269
8295
|
CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -8308,6 +8334,8 @@ function runEngineCliEntry(opts) {
|
|
|
8308
8334
|
STDOUT_TAIL_ECHO_CHARS,
|
|
8309
8335
|
SUPPORTED_PROTOCOL_RANGE,
|
|
8310
8336
|
TAIJI_DATA_DIR_ENV,
|
|
8337
|
+
ZCODE_HOST_DB_SUFFIX,
|
|
8338
|
+
ZCODE_ISOLATED_DB_SEGMENTS,
|
|
8311
8339
|
abortWithFallback,
|
|
8312
8340
|
aggregateUsage,
|
|
8313
8341
|
armEngineSelfDestruct,
|
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-
|
|
3
|
-
export { A as
|
|
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-CFTOAxva.cjs';
|
|
3
|
+
export { A as AGENT_EVENT_TYPE_NAMES, a as AgentCallOpts, b as AgentEvent, c as AgentEventTypeName, d as AgentFailureKind, e as AgentOutcome, f as AgentOutcomeUsage, g as AgentUsage, h as AgentUsageTotal, i as AssertMutuallyAssignable, E as EngineCapabilities, j as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, k as ResumeAnchor, S as SessionView, T as ToolCall, l as ToolCallEntry, m as ToolCallResult, n as Turn, W as WorktreeHandle } from './contract-types-DaULkdpG.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';
|
|
@@ -14,6 +14,7 @@ export { BuildOutboundChildEnvOptions, ENGINE_ENV_DENY_LIST, ENGINE_ENV_L0_INFRA
|
|
|
14
14
|
export { DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS, ENGINE_HOST_REQUEST_TIMEOUT_ENV, EngineChildEnv, EngineSelfDestructOptions, ReverseRequestClock, SpawnEngineChildOptions, armEngineSelfDestruct, pumpNdjsonLines, spawnEngineChild } from './spawn.cjs';
|
|
15
15
|
export { ENGINE_NODE_ENV, EngineNodeHostKind, EngineNodeLaunch, EngineNodeLaunchOptions, hostKindOf, probeNodeExecutor, resetEngineNodeProbeCache, resolveEngineNodeLaunch } from './node-executor.cjs';
|
|
16
16
|
export { CleanupResult, DEFAULT_STDERR_KEEP_DAYS, DEFAULT_STDERR_MAX_BYTES, StderrRotationParams, cleanupSiblingStderrLogs, cleanupStaleStderrLogs, isPidAlive, rotateStderrLogIfNeeded, stderrLogPathFor, stderrLogPidOf, stderrRotationParams } from './logs/stderr-rotation.cjs';
|
|
17
|
+
export { ZCODE_HOST_DB_SUFFIX, ZCODE_ISOLATED_DB_SEGMENTS } from './zcode-db-paths.cjs';
|
|
17
18
|
export { RELAY_ENV_NODE, RELAY_ENV_RECORD_ID, RELAY_ENV_SCRIPT, RELAY_ENV_SESSION_ID, RELAY_ENV_SOCKET, RELAY_EXIT_CODES, RELAY_PROTOCOL_VERSION, isRelayActive, readRelayForwardEnv } from './relay-env.cjs';
|
|
18
19
|
export { toErrorMessage } from './error-message.cjs';
|
|
19
20
|
export { BestEffortLevel, bestEffort } from './best-effort.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-
|
|
3
|
-
export { A as
|
|
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-C9BOUI5H.js';
|
|
3
|
+
export { A as AGENT_EVENT_TYPE_NAMES, a as AgentCallOpts, b as AgentEvent, c as AgentEventTypeName, d as AgentFailureKind, e as AgentOutcome, f as AgentOutcomeUsage, g as AgentUsage, h as AgentUsageTotal, i as AssertMutuallyAssignable, E as EngineCapabilities, j as EngineHandleData, I as InternalToolCall, M as ModelCatalogEntry, P as ProbeReport, R as ReplayedTurn, k as ResumeAnchor, S as SessionView, T as ToolCall, l as ToolCallEntry, m as ToolCallResult, n as Turn, W as WorktreeHandle } from './contract-types-DaULkdpG.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';
|
|
@@ -14,6 +14,7 @@ export { BuildOutboundChildEnvOptions, ENGINE_ENV_DENY_LIST, ENGINE_ENV_L0_INFRA
|
|
|
14
14
|
export { DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS, ENGINE_HOST_REQUEST_TIMEOUT_ENV, EngineChildEnv, EngineSelfDestructOptions, ReverseRequestClock, SpawnEngineChildOptions, armEngineSelfDestruct, pumpNdjsonLines, spawnEngineChild } from './spawn.js';
|
|
15
15
|
export { ENGINE_NODE_ENV, EngineNodeHostKind, EngineNodeLaunch, EngineNodeLaunchOptions, hostKindOf, probeNodeExecutor, resetEngineNodeProbeCache, resolveEngineNodeLaunch } from './node-executor.js';
|
|
16
16
|
export { CleanupResult, DEFAULT_STDERR_KEEP_DAYS, DEFAULT_STDERR_MAX_BYTES, StderrRotationParams, cleanupSiblingStderrLogs, cleanupStaleStderrLogs, isPidAlive, rotateStderrLogIfNeeded, stderrLogPathFor, stderrLogPidOf, stderrRotationParams } from './logs/stderr-rotation.js';
|
|
17
|
+
export { ZCODE_HOST_DB_SUFFIX, ZCODE_ISOLATED_DB_SEGMENTS } from './zcode-db-paths.js';
|
|
17
18
|
export { RELAY_ENV_NODE, RELAY_ENV_RECORD_ID, RELAY_ENV_SCRIPT, RELAY_ENV_SESSION_ID, RELAY_ENV_SOCKET, RELAY_EXIT_CODES, RELAY_PROTOCOL_VERSION, isRelayActive, readRelayForwardEnv } from './relay-env.js';
|
|
18
19
|
export { toErrorMessage } from './error-message.js';
|
|
19
20
|
export { BestEffortLevel, bestEffort } from './best-effort.js';
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,10 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
runEngineCliEntry
|
|
13
13
|
} from "./chunk-J4G2MXDS.js";
|
|
14
|
+
import {
|
|
15
|
+
ZCODE_HOST_DB_SUFFIX,
|
|
16
|
+
ZCODE_ISOLATED_DB_SEGMENTS
|
|
17
|
+
} from "./chunk-CT3FEBDO.js";
|
|
14
18
|
import {
|
|
15
19
|
resolveEngineDir,
|
|
16
20
|
resolveEnginesRoot,
|
|
@@ -31,7 +35,7 @@ import {
|
|
|
31
35
|
ENGINE_ENV_PREFIXES,
|
|
32
36
|
buildEngineChildEnv,
|
|
33
37
|
buildOutboundChildEnv
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-YL5W5EMV.js";
|
|
35
39
|
import {
|
|
36
40
|
DEFAULT_ENGINE_HOST_REQUEST_TIMEOUT_MS,
|
|
37
41
|
ENGINE_HOST_REQUEST_TIMEOUT_ENV,
|
|
@@ -69,6 +73,7 @@ import {
|
|
|
69
73
|
readRelayForwardEnv
|
|
70
74
|
} from "./chunk-GSW3DMN6.js";
|
|
71
75
|
import {
|
|
76
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
72
77
|
ENGINE_PROTOCOL_SCHEMAS,
|
|
73
78
|
FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS,
|
|
74
79
|
PROTOCOL_METHODS,
|
|
@@ -85,7 +90,7 @@ import {
|
|
|
85
90
|
reverseRequestFrameSchema,
|
|
86
91
|
runSessionParamsSchema,
|
|
87
92
|
successResponseFrameSchema
|
|
88
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-63ZNJHM5.js";
|
|
89
94
|
import {
|
|
90
95
|
SCHEMA_EMULATION_TAIL_CHARS,
|
|
91
96
|
buildSchemaEmulationSegment,
|
|
@@ -154,6 +159,7 @@ import {
|
|
|
154
159
|
} from "./chunk-75QEMUGV.js";
|
|
155
160
|
import "./chunk-JSBRDJBE.js";
|
|
156
161
|
export {
|
|
162
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
157
163
|
CANCEL_SETTLE_GRACE_MS,
|
|
158
164
|
CRASH_REBUILD_BACKOFF_MS,
|
|
159
165
|
CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -198,6 +204,8 @@ export {
|
|
|
198
204
|
STDOUT_TAIL_ECHO_CHARS,
|
|
199
205
|
SUPPORTED_PROTOCOL_RANGE,
|
|
200
206
|
TAIJI_DATA_DIR_ENV,
|
|
207
|
+
ZCODE_HOST_DB_SUFFIX,
|
|
208
|
+
ZCODE_ISOLATED_DB_SEGMENTS,
|
|
201
209
|
abortWithFallback,
|
|
202
210
|
aggregateUsage,
|
|
203
211
|
armEngineSelfDestruct,
|
package/dist/journal-io.d.cts
CHANGED
package/dist/journal-io.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as Turn, h as AgentUsageTotal, b as AgentEvent, S as SessionView, j as EngineHandleData, R as ReplayedTurn } from './contract-types-DaULkdpG.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
|
package/dist/journal-replay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as Turn, h as AgentUsageTotal, b as AgentEvent, S as SessionView, j as EngineHandleData, R as ReplayedTurn } from './contract-types-DaULkdpG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* reducer 的 record 视图(core ExecutionRecord 的结构子集:reducer 只触碰这四个字段)。
|
package/dist/kill-chain.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-
|
|
2
|
-
import {
|
|
1
|
+
export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-CFTOAxva.cjs';
|
|
2
|
+
import { a as AgentCallOpts, e as AgentOutcome } from './contract-types-DaULkdpG.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
|
package/dist/kill-chain.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-
|
|
2
|
-
import {
|
|
1
|
+
export { S as STDOUT_TAIL_ECHO_CHARS } from './error-codes-C9BOUI5H.js';
|
|
2
|
+
import { a as AgentCallOpts, e as AgentOutcome } from './contract-types-DaULkdpG.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 可杀子进程的结构形状(Node ChildProcess 的结构子集)。
|
package/dist/port-contract.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as AgentCallOpts, j as EngineHandleData, E as EngineCapabilities, P as ProbeReport, b as AgentEvent, k as ResumeAnchor, e as AgentOutcome, S as SessionView } from './contract-types-DaULkdpG.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
|
package/dist/port-contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as AgentCallOpts, j as EngineHandleData, E as EngineCapabilities, P as ProbeReport, b as AgentEvent, k as ResumeAnchor, e as AgentOutcome, S as SessionView } from './contract-types-DaULkdpG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 引擎进程内全量任务声明 = SDK AgentCallOpts 引擎面子集 + 协议 ctx 还原字段(model/
|
package/dist/protocol/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/protocol/index.ts
|
|
21
21
|
var protocol_exports = {};
|
|
22
22
|
__export(protocol_exports, {
|
|
23
|
+
AGENT_EVENT_TYPE_NAMES: () => AGENT_EVENT_TYPE_NAMES,
|
|
23
24
|
CANCEL_SETTLE_GRACE_MS: () => CANCEL_SETTLE_GRACE_MS,
|
|
24
25
|
CRASH_REBUILD_BACKOFF_MS: () => CRASH_REBUILD_BACKOFF_MS,
|
|
25
26
|
CRASH_REBUILD_MAX_ATTEMPTS: () => CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -210,6 +211,28 @@ function schemaEmulationFailedDetail(error, tail) {
|
|
|
210
211
|
return `structured output emulation failed after tolerant extraction and one host-side retry: ${error}. Raw output tail: ${truncate(tail, DETAIL_ECHO_MAX_CHARS)}. Recovery: retry with a strengthened prompt or relax the schema; if it still fails switch to a schema-native engine (engine: pi).`;
|
|
211
212
|
}
|
|
212
213
|
|
|
214
|
+
// src/protocol/contract-types.ts
|
|
215
|
+
var AGENT_EVENT_TYPE_NAMES = [
|
|
216
|
+
"tool_start",
|
|
217
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 tool 起始占位(显示降级),turn 结构不受损
|
|
218
|
+
"tool_end",
|
|
219
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 result,turn 收口由 turn_end/message_end 承担
|
|
220
|
+
"text_delta",
|
|
221
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺正文增量,不产生半解析状态
|
|
222
|
+
"thinking_delta",
|
|
223
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺推理增量,不产生半解析状态
|
|
224
|
+
"turn_end",
|
|
225
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃则该 turn 滞留进行态,journal 重放仍按序重建
|
|
226
|
+
"message_end",
|
|
227
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 usage 聚合与闭合计量,已累积内容不回滚
|
|
228
|
+
"compaction",
|
|
229
|
+
// noop-safe: 事件无载荷且现行 reducer 即直接 return——丢弃与处理零差异
|
|
230
|
+
"activity",
|
|
231
|
+
// noop-safe: 纯活性信号,双侧 reducer 恒 no-op(协议语义见 AgentEvent 头注),丢弃零差异
|
|
232
|
+
"error"
|
|
233
|
+
// noop-safe: 旧宿主 default 分支零写入——丢弃仅缺 lastError 诊断留痕,已写状态不回滚
|
|
234
|
+
];
|
|
235
|
+
|
|
213
236
|
// src/protocol/schema.ts
|
|
214
237
|
var ANY_JSON = {};
|
|
215
238
|
var protocolErrorSchema = {
|
|
@@ -280,17 +303,9 @@ var notificationFrameSchema = {
|
|
|
280
303
|
properties: {
|
|
281
304
|
type: {
|
|
282
305
|
type: "string",
|
|
283
|
-
enum
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"text_delta",
|
|
287
|
-
"thinking_delta",
|
|
288
|
-
"turn_end",
|
|
289
|
-
"message_end",
|
|
290
|
-
"compaction",
|
|
291
|
-
"activity",
|
|
292
|
-
"error"
|
|
293
|
-
]
|
|
306
|
+
// 事件 enum 从词表 SSOT 派生(U2 词表锁:union⟷词表互证后,此处不再
|
|
307
|
+
// 手写字面量集合——手写即漂移面,病灶 1 的第三处同步点)
|
|
308
|
+
enum: [...AGENT_EVENT_TYPE_NAMES]
|
|
294
309
|
}
|
|
295
310
|
}
|
|
296
311
|
}
|
|
@@ -348,6 +363,7 @@ var runSessionParamsSchema = {
|
|
|
348
363
|
};
|
|
349
364
|
// Annotate the CommonJS export names for ESM import in node:
|
|
350
365
|
0 && (module.exports = {
|
|
366
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
351
367
|
CANCEL_SETTLE_GRACE_MS,
|
|
352
368
|
CRASH_REBUILD_BACKOFF_MS,
|
|
353
369
|
CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -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-
|
|
2
|
-
import { E as EngineCapabilities, M as ModelCatalogEntry,
|
|
3
|
-
export {
|
|
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-CFTOAxva.cjs';
|
|
2
|
+
import { E as EngineCapabilities, M as ModelCatalogEntry, a as AgentCallOpts, k as ResumeAnchor, j as EngineHandleData, P as ProbeReport, e as AgentOutcome, S as SessionView } from '../contract-types-DaULkdpG.cjs';
|
|
3
|
+
export { A as AGENT_EVENT_TYPE_NAMES, b as AgentEvent, c as AgentEventTypeName, d as AgentFailureKind, f as AgentOutcomeUsage, g as AgentUsage, h as AgentUsageTotal, i as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, l as ToolCallEntry, m as ToolCallResult, n as Turn, W as WorktreeHandle } from '../contract-types-DaULkdpG.cjs';
|
|
4
4
|
import { UiRequest, UiResponse } from '../ui-types.cjs';
|
|
5
5
|
|
|
6
6
|
/** 协议版本(引擎包 manifest `taiji.subagentEngine.protocol` 与 initialize 应答同值)。 */
|
|
@@ -50,8 +50,9 @@ declare const PROTOCOL_METHODS: readonly ["initialize", "probe", "run", "cancel"
|
|
|
50
50
|
* run 上下文(RunContext 字段映射的协议承载,设计 §3.3 RunContext 映射表)。
|
|
51
51
|
*/
|
|
52
52
|
interface RunContextParams {
|
|
53
|
-
/** 任务工作目录(worktree 隔离时 = worktree
|
|
54
|
-
|
|
53
|
+
/** 任务工作目录(worktree 隔离时 = worktree 路径)。缺省不上 wire——引擎侧
|
|
54
|
+
* 回退自身进程 cwd(spawn 继承语义)。 */
|
|
55
|
+
cwd?: string;
|
|
55
56
|
/** 请求模型 ref(未传 = 引擎缺省模型)。 */
|
|
56
57
|
model?: string;
|
|
57
58
|
/** 结构化输出 schema 的 env 注入形态(schemaEnv 降级通道)。 */
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
import { E as EngineCapabilities, M as ModelCatalogEntry,
|
|
3
|
-
export {
|
|
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-C9BOUI5H.js';
|
|
2
|
+
import { E as EngineCapabilities, M as ModelCatalogEntry, a as AgentCallOpts, k as ResumeAnchor, j as EngineHandleData, P as ProbeReport, e as AgentOutcome, S as SessionView } from '../contract-types-DaULkdpG.js';
|
|
3
|
+
export { A as AGENT_EVENT_TYPE_NAMES, b as AgentEvent, c as AgentEventTypeName, d as AgentFailureKind, f as AgentOutcomeUsage, g as AgentUsage, h as AgentUsageTotal, i as AssertMutuallyAssignable, I as InternalToolCall, R as ReplayedTurn, T as ToolCall, l as ToolCallEntry, m as ToolCallResult, n as Turn, W as WorktreeHandle } from '../contract-types-DaULkdpG.js';
|
|
4
4
|
import { UiRequest, UiResponse } from '../ui-types.js';
|
|
5
5
|
|
|
6
6
|
/** 协议版本(引擎包 manifest `taiji.subagentEngine.protocol` 与 initialize 应答同值)。 */
|
|
@@ -50,8 +50,9 @@ declare const PROTOCOL_METHODS: readonly ["initialize", "probe", "run", "cancel"
|
|
|
50
50
|
* run 上下文(RunContext 字段映射的协议承载,设计 §3.3 RunContext 映射表)。
|
|
51
51
|
*/
|
|
52
52
|
interface RunContextParams {
|
|
53
|
-
/** 任务工作目录(worktree 隔离时 = worktree
|
|
54
|
-
|
|
53
|
+
/** 任务工作目录(worktree 隔离时 = worktree 路径)。缺省不上 wire——引擎侧
|
|
54
|
+
* 回退自身进程 cwd(spawn 继承语义)。 */
|
|
55
|
+
cwd?: string;
|
|
55
56
|
/** 请求模型 ref(未传 = 引擎缺省模型)。 */
|
|
56
57
|
model?: string;
|
|
57
58
|
/** 结构化输出 schema 的 env 注入形态(schemaEnv 降级通道)。 */
|
package/dist/protocol/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
2
3
|
ENGINE_PROTOCOL_SCHEMAS,
|
|
3
4
|
FORBIDDEN_CREDENTIAL_KEY_FRAGMENTS,
|
|
4
5
|
PROTOCOL_METHODS,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
reverseRequestFrameSchema,
|
|
16
17
|
runSessionParamsSchema,
|
|
17
18
|
successResponseFrameSchema
|
|
18
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-63ZNJHM5.js";
|
|
19
20
|
import {
|
|
20
21
|
CANCEL_SETTLE_GRACE_MS,
|
|
21
22
|
CRASH_REBUILD_BACKOFF_MS,
|
|
@@ -43,6 +44,7 @@ import {
|
|
|
43
44
|
} from "../chunk-WMDMXP2F.js";
|
|
44
45
|
import "../chunk-JSBRDJBE.js";
|
|
45
46
|
export {
|
|
47
|
+
AGENT_EVENT_TYPE_NAMES,
|
|
46
48
|
CANCEL_SETTLE_GRACE_MS,
|
|
47
49
|
CRASH_REBUILD_BACKOFF_MS,
|
|
48
50
|
CRASH_REBUILD_MAX_ATTEMPTS,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/zcode-db-paths.ts
|
|
21
|
+
var zcode_db_paths_exports = {};
|
|
22
|
+
__export(zcode_db_paths_exports, {
|
|
23
|
+
ZCODE_HOST_DB_SUFFIX: () => ZCODE_HOST_DB_SUFFIX,
|
|
24
|
+
ZCODE_ISOLATED_DB_SEGMENTS: () => ZCODE_ISOLATED_DB_SEGMENTS
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(zcode_db_paths_exports);
|
|
27
|
+
var ZCODE_HOST_DB_SUFFIX = [".zcode", "cli", "db", "db.sqlite"];
|
|
28
|
+
var ZCODE_ISOLATED_DB_SEGMENTS = ["engines", "zcode", "session-db", "db.sqlite"];
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
ZCODE_HOST_DB_SUFFIX,
|
|
32
|
+
ZCODE_ISOLATED_DB_SEGMENTS
|
|
33
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主 HOME 下 zcode 会话库相对段(`~/.zcode/cli/db/db.sqlite`,绝对路径 =
|
|
3
|
+
* join(os.homedir(), ...suffix))。2026-09 会话库隔离后定位为「存量兼容锚点」:
|
|
4
|
+
* 新 handle.dbPath 恒为隔离库路径(ZCODE_ISOLATED_DB_SEGMENTS),本段仅用于
|
|
5
|
+
* 白名单集合第二项放行「共享 HOME 时代」record 已落盘的宿主绝对路径。
|
|
6
|
+
*/
|
|
7
|
+
declare const ZCODE_HOST_DB_SUFFIX: readonly [".zcode", "cli", "db", "db.sqlite"];
|
|
8
|
+
/**
|
|
9
|
+
* 隔离会话库相对段(`<dataDir>/engines/zcode/session-db/db.sqlite`,绝对路径 =
|
|
10
|
+
* join(dataDir, ...segments))。选址在 journal 池目录(`engines/zcode/shared/`)
|
|
11
|
+
* 之外——池 TTL 清理不得触及会话库(设计 D1/F11)。
|
|
12
|
+
*/
|
|
13
|
+
declare const ZCODE_ISOLATED_DB_SEGMENTS: readonly ["engines", "zcode", "session-db", "db.sqlite"];
|
|
14
|
+
|
|
15
|
+
export { ZCODE_HOST_DB_SUFFIX, ZCODE_ISOLATED_DB_SEGMENTS };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主 HOME 下 zcode 会话库相对段(`~/.zcode/cli/db/db.sqlite`,绝对路径 =
|
|
3
|
+
* join(os.homedir(), ...suffix))。2026-09 会话库隔离后定位为「存量兼容锚点」:
|
|
4
|
+
* 新 handle.dbPath 恒为隔离库路径(ZCODE_ISOLATED_DB_SEGMENTS),本段仅用于
|
|
5
|
+
* 白名单集合第二项放行「共享 HOME 时代」record 已落盘的宿主绝对路径。
|
|
6
|
+
*/
|
|
7
|
+
declare const ZCODE_HOST_DB_SUFFIX: readonly [".zcode", "cli", "db", "db.sqlite"];
|
|
8
|
+
/**
|
|
9
|
+
* 隔离会话库相对段(`<dataDir>/engines/zcode/session-db/db.sqlite`,绝对路径 =
|
|
10
|
+
* join(dataDir, ...segments))。选址在 journal 池目录(`engines/zcode/shared/`)
|
|
11
|
+
* 之外——池 TTL 清理不得触及会话库(设计 D1/F11)。
|
|
12
|
+
*/
|
|
13
|
+
declare const ZCODE_ISOLATED_DB_SEGMENTS: readonly ["engines", "zcode", "session-db", "db.sqlite"];
|
|
14
|
+
|
|
15
|
+
export { ZCODE_HOST_DB_SUFFIX, ZCODE_ISOLATED_DB_SEGMENTS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/subagent-engine-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|