@zhushanwen/subagent-engine-sdk 0.5.0 → 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-7I4XGL5J.js → chunk-BBWUC2EE.js} +2 -2
- package/dist/{chunk-3K2P2CM2.js → chunk-CNQTJJF5.js} +1 -1
- package/dist/chunk-CT3FEBDO.js +8 -0
- package/dist/{chunk-DSQ7JQKM.js → chunk-GSW3DMN6.js} +5 -5
- package/dist/{chunk-HYES77BR.js → chunk-MSAJXIP4.js} +2 -2
- package/dist/{chunk-WORT4PG7.js → chunk-QOEXD2FT.js} +1 -1
- package/dist/{chunk-3IBT7MTB.js → chunk-W3BKI2BP.js} +3 -3
- package/dist/{chunk-F5JZMK74.js → chunk-WMDMXP2F.js} +2 -2
- package/dist/{chunk-GT6YLLN4.js → chunk-X24IVQKJ.js} +5 -5
- package/dist/{chunk-365AUV6N.js → chunk-YE472JOO.js} +2 -2
- package/dist/{chunk-BBVZK5DL.js → chunk-YL5W5EMV.js} +24 -20
- 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/data-dir.cjs +6 -6
- package/dist/data-dir.d.cts +4 -4
- package/dist/data-dir.d.ts +4 -4
- package/dist/data-dir.js +3 -3
- package/dist/env.cjs +24 -20
- package/dist/env.d.cts +5 -5
- package/dist/env.d.ts +5 -5
- package/dist/env.js +1 -1
- package/dist/{error-codes-SA5fGtx_.d.cts → error-codes-C9BOUI5H.d.ts} +6 -5
- package/dist/{error-codes-OvQlqiQw.d.ts → error-codes-CFTOAxva.d.cts} +6 -5
- package/dist/index.cjs +81 -53
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +21 -13
- 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/logs/stderr-rotation.cjs +2 -2
- package/dist/logs/stderr-rotation.d.cts +1 -1
- package/dist/logs/stderr-rotation.d.ts +1 -1
- package/dist/logs/stderr-rotation.js +1 -1
- package/dist/nesting-guard.cjs +2 -2
- package/dist/nesting-guard.d.cts +2 -2
- package/dist/nesting-guard.d.ts +2 -2
- package/dist/nesting-guard.js +1 -1
- package/dist/node-executor.cjs +2 -2
- package/dist/node-executor.d.cts +5 -5
- package/dist/node-executor.d.ts +5 -5
- package/dist/node-executor.js +2 -2
- package/dist/port-contract.d.cts +1 -1
- package/dist/port-contract.d.ts +1 -1
- package/dist/protocol/index.cjs +29 -13
- package/dist/protocol/index.d.cts +8 -7
- package/dist/protocol/index.d.ts +8 -7
- package/dist/protocol/index.js +4 -2
- package/dist/relay-env.cjs +5 -5
- package/dist/relay-env.d.cts +5 -5
- package/dist/relay-env.d.ts +5 -5
- package/dist/relay-env.js +1 -1
- package/dist/spawn.cjs +1 -1
- package/dist/spawn.d.cts +2 -2
- package/dist/spawn.d.ts +2 -2
- package/dist/spawn.js +1 -1
- package/dist/ui-channels.cjs +2 -2
- package/dist/ui-channels.js +1 -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 +2 -4
- package/src/best-effort.ts +0 -37
- package/src/cli-entry.ts +0 -82
- package/src/data-dir.ts +0 -89
- package/src/env.ts +0 -272
- package/src/error-message.ts +0 -22
- package/src/index.ts +0 -63
- package/src/journal-io.ts +0 -82
- package/src/journal-replay.ts +0 -436
- package/src/kill-chain.ts +0 -265
- package/src/logger.ts +0 -105
- package/src/logs/stderr-rotation.ts +0 -166
- package/src/nesting-guard.ts +0 -140
- package/src/node-executor.ts +0 -272
- package/src/paths.ts +0 -48
- package/src/port-contract.ts +0 -150
- package/src/protocol/contract-types.ts +0 -378
- package/src/protocol/engine-protocol.ts +0 -92
- package/src/protocol/error-codes.ts +0 -179
- package/src/protocol/frames.ts +0 -143
- package/src/protocol/index.ts +0 -12
- package/src/protocol/methods.ts +0 -237
- package/src/protocol/reverse-channels.ts +0 -123
- package/src/protocol/schema.ts +0 -185
- package/src/relay-env.ts +0 -60
- package/src/schema-emulation.ts +0 -192
- package/src/spawn.ts +0 -246
- package/src/ui-channels.ts +0 -219
- package/src/ui-types.ts +0 -101
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,
|
|
@@ -24,28 +28,28 @@ import {
|
|
|
24
28
|
import {
|
|
25
29
|
createUiChannelRegistry,
|
|
26
30
|
parseChannel
|
|
27
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BBWUC2EE.js";
|
|
28
32
|
import {
|
|
29
33
|
ENGINE_ENV_DENY_LIST,
|
|
30
34
|
ENGINE_ENV_L0_INFRA_KEYS,
|
|
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,
|
|
38
42
|
armEngineSelfDestruct,
|
|
39
43
|
pumpNdjsonLines,
|
|
40
44
|
spawnEngineChild
|
|
41
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-CNQTJJF5.js";
|
|
42
46
|
import {
|
|
43
47
|
ENGINE_NODE_ENV,
|
|
44
48
|
hostKindOf,
|
|
45
49
|
probeNodeExecutor,
|
|
46
50
|
resetEngineNodeProbeCache,
|
|
47
51
|
resolveEngineNodeLaunch
|
|
48
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-W3BKI2BP.js";
|
|
49
53
|
import {
|
|
50
54
|
DEFAULT_STDERR_KEEP_DAYS,
|
|
51
55
|
DEFAULT_STDERR_MAX_BYTES,
|
|
@@ -56,7 +60,7 @@ import {
|
|
|
56
60
|
stderrLogPathFor,
|
|
57
61
|
stderrLogPidOf,
|
|
58
62
|
stderrRotationParams
|
|
59
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-MSAJXIP4.js";
|
|
60
64
|
import {
|
|
61
65
|
RELAY_ENV_NODE,
|
|
62
66
|
RELAY_ENV_RECORD_ID,
|
|
@@ -67,8 +71,9 @@ import {
|
|
|
67
71
|
RELAY_PROTOCOL_VERSION,
|
|
68
72
|
isRelayActive,
|
|
69
73
|
readRelayForwardEnv
|
|
70
|
-
} from "./chunk-
|
|
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,
|
|
@@ -97,7 +102,7 @@ import {
|
|
|
97
102
|
NestedSpawnRejectedError,
|
|
98
103
|
assertNotNestedSpawn,
|
|
99
104
|
buildNestedSpawnEnv
|
|
100
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-YE472JOO.js";
|
|
101
106
|
import {
|
|
102
107
|
DEFAULT_KILL_GRACE_MS,
|
|
103
108
|
DEFAULT_NATIVE_INTERRUPT_GRACE_MS,
|
|
@@ -105,7 +110,7 @@ import {
|
|
|
105
110
|
abortWithFallback,
|
|
106
111
|
killChain,
|
|
107
112
|
synthesizeTimeoutOutcome
|
|
108
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-QOEXD2FT.js";
|
|
109
114
|
import {
|
|
110
115
|
toErrorMessage
|
|
111
116
|
} from "./chunk-PYO3YR7W.js";
|
|
@@ -133,7 +138,7 @@ import {
|
|
|
133
138
|
isEngineProtocolErrorCode,
|
|
134
139
|
isProtocolVersionCompatible,
|
|
135
140
|
schemaEmulationFailedDetail
|
|
136
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-WMDMXP2F.js";
|
|
137
142
|
import {
|
|
138
143
|
aggregateUsage,
|
|
139
144
|
createReplayRecord,
|
|
@@ -143,10 +148,10 @@ import {
|
|
|
143
148
|
updateFromEvent
|
|
144
149
|
} from "./chunk-AIG5LSGK.js";
|
|
145
150
|
import {
|
|
146
|
-
|
|
151
|
+
TAIJI_DATA_DIR_ENV,
|
|
147
152
|
resetDataDirWarnForTests,
|
|
148
153
|
resolveEngineDataDir
|
|
149
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-X24IVQKJ.js";
|
|
150
155
|
import {
|
|
151
156
|
configureLoggerSink,
|
|
152
157
|
getLogger,
|
|
@@ -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,
|
|
@@ -197,7 +203,9 @@ export {
|
|
|
197
203
|
STDERR_TAIL_CHARS,
|
|
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/kill-chain.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
abortWithFallback,
|
|
6
6
|
killChain,
|
|
7
7
|
synthesizeTimeoutOutcome
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QOEXD2FT.js";
|
|
9
9
|
import "./chunk-PYO3YR7W.js";
|
|
10
10
|
import {
|
|
11
11
|
STDOUT_TAIL_ECHO_CHARS
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WMDMXP2F.js";
|
|
13
13
|
import "./chunk-75QEMUGV.js";
|
|
14
14
|
import "./chunk-JSBRDJBE.js";
|
|
15
15
|
export {
|
|
@@ -60,8 +60,8 @@ function positiveIntEnv(env, key) {
|
|
|
60
60
|
}
|
|
61
61
|
function stderrRotationParams(env) {
|
|
62
62
|
return {
|
|
63
|
-
maxBytes: positiveIntEnv(env, "
|
|
64
|
-
keepDays: positiveIntEnv(env, "
|
|
63
|
+
maxBytes: positiveIntEnv(env, "TAIJI_LOG_MAX_BYTES") ?? DEFAULT_STDERR_MAX_BYTES,
|
|
64
|
+
keepDays: positiveIntEnv(env, "TAIJI_LOG_KEEP_DAYS") ?? DEFAULT_STDERR_KEEP_DAYS
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
function stderrLogPathFor(engineDataDir, pid, prefix) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const DEFAULT_STDERR_MAX_BYTES: number;
|
|
2
2
|
/** 缺省保留天数(与宿主 logger 同源缺省:7 天)。 */
|
|
3
3
|
declare const DEFAULT_STDERR_KEEP_DAYS = 7;
|
|
4
|
-
/** 轮转参数(env 覆盖面 = 宿主 logger 同款
|
|
4
|
+
/** 轮转参数(env 覆盖面 = 宿主 logger 同款 TAIJI_LOG_* 两键)。 */
|
|
5
5
|
interface StderrRotationParams {
|
|
6
6
|
maxBytes: number;
|
|
7
7
|
keepDays: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const DEFAULT_STDERR_MAX_BYTES: number;
|
|
2
2
|
/** 缺省保留天数(与宿主 logger 同源缺省:7 天)。 */
|
|
3
3
|
declare const DEFAULT_STDERR_KEEP_DAYS = 7;
|
|
4
|
-
/** 轮转参数(env 覆盖面 = 宿主 logger 同款
|
|
4
|
+
/** 轮转参数(env 覆盖面 = 宿主 logger 同款 TAIJI_LOG_* 两键)。 */
|
|
5
5
|
interface StderrRotationParams {
|
|
6
6
|
maxBytes: number;
|
|
7
7
|
keepDays: number;
|
package/dist/nesting-guard.cjs
CHANGED
|
@@ -28,7 +28,7 @@ __export(nesting_guard_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(nesting_guard_exports);
|
|
30
30
|
var import_node_async_hooks = require("async_hooks");
|
|
31
|
-
var NESTED_SPAWN_ENV = "
|
|
31
|
+
var NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
|
|
32
32
|
var NATIVE_NESTED_KEYS = ["CLAUDECODE", "ZSW_NESTED"];
|
|
33
33
|
var NATIVE_NESTED_PREFIXES = ["PI_SUBAGENT_"];
|
|
34
34
|
var NestedSpawnRejectedError = class extends Error {
|
|
@@ -37,7 +37,7 @@ var NestedSpawnRejectedError = class extends Error {
|
|
|
37
37
|
recovery;
|
|
38
38
|
constructor() {
|
|
39
39
|
super(
|
|
40
|
-
"nested_spawn_rejected: this process is already a subagent (
|
|
40
|
+
"nested_spawn_rejected: this process is already a subagent (TAIJI_AGENT_SUBAGENT=1)"
|
|
41
41
|
);
|
|
42
42
|
this.name = "NestedSpawnRejectedError";
|
|
43
43
|
this.recovery = "Subagents must not spawn further subagents (unbounded recursion guard). Do the work directly inside the current task instead of delegating.";
|
package/dist/nesting-guard.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 统一嵌套标记 env 名(D8)。值恒 '1'。 */
|
|
2
|
-
declare const NESTED_SPAWN_ENV = "
|
|
2
|
+
declare const NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
|
|
3
3
|
/** env 对象形状(NodeJS.ProcessEnv 的结构子集,测试可传普通对象)。 */
|
|
4
4
|
type SpawnEnv = Record<string, string | undefined>;
|
|
5
5
|
/**
|
|
@@ -13,7 +13,7 @@ declare class NestedSpawnRejectedError extends Error {
|
|
|
13
13
|
constructor();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* 构造子代理 spawn env:注入
|
|
16
|
+
* 构造子代理 spawn env:注入 TAIJI_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
|
|
17
17
|
* 返回新对象,不改入参(spawn env 组装链中的多层 spread 安全)。
|
|
18
18
|
*/
|
|
19
19
|
declare function buildNestedSpawnEnv(baseEnv: SpawnEnv): SpawnEnv;
|
package/dist/nesting-guard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 统一嵌套标记 env 名(D8)。值恒 '1'。 */
|
|
2
|
-
declare const NESTED_SPAWN_ENV = "
|
|
2
|
+
declare const NESTED_SPAWN_ENV = "TAIJI_AGENT_SUBAGENT";
|
|
3
3
|
/** env 对象形状(NodeJS.ProcessEnv 的结构子集,测试可传普通对象)。 */
|
|
4
4
|
type SpawnEnv = Record<string, string | undefined>;
|
|
5
5
|
/**
|
|
@@ -13,7 +13,7 @@ declare class NestedSpawnRejectedError extends Error {
|
|
|
13
13
|
constructor();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* 构造子代理 spawn env:注入
|
|
16
|
+
* 构造子代理 spawn env:注入 TAIJI_AGENT_SUBAGENT=1 + 剥离引擎原生嵌套标记。
|
|
17
17
|
* 返回新对象,不改入参(spawn env 组装链中的多层 spread 安全)。
|
|
18
18
|
*/
|
|
19
19
|
declare function buildNestedSpawnEnv(baseEnv: SpawnEnv): SpawnEnv;
|
package/dist/nesting-guard.js
CHANGED
package/dist/node-executor.cjs
CHANGED
|
@@ -48,7 +48,7 @@ var EngineSdkError = class extends Error {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// src/node-executor.ts
|
|
51
|
-
var ENGINE_NODE_ENV = "
|
|
51
|
+
var ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
|
|
52
52
|
var PROBE_TIMEOUT_MS = 5e3;
|
|
53
53
|
function probeNodeExecutor(execPath, isElectron) {
|
|
54
54
|
return new Promise((resolve) => {
|
|
@@ -108,7 +108,7 @@ async function resolvePiExtensionLaunch(entryPath, entryArgs, env) {
|
|
|
108
108
|
if (engineNode === void 0 || engineNode === "") {
|
|
109
109
|
throw engineNotFound(
|
|
110
110
|
`pi extension host must spawn engines via injected executor ${ENGINE_NODE_ENV}, but it is not set (host process.execPath is the pi binary, not a node executor)`,
|
|
111
|
-
`The
|
|
111
|
+
`The taiji runtime injects ${ENGINE_NODE_ENV} when spawning the pi host. If you are running the extension inside a packaged app, report this as a packaging regression; standalone pi installs do not use the pi-extension host kind.`
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
const isElectron = env.ELECTRON_RUN_AS_NODE === "1";
|
package/dist/node-executor.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** L0 注入的引擎执行器路径 env(与 relay 的
|
|
2
|
-
declare const ENGINE_NODE_ENV = "
|
|
1
|
+
/** L0 注入的引擎执行器路径 env(与 relay 的 TAIJI_SUBAGENT_RELAY_NODE 不复用)。 */
|
|
2
|
+
declare const ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
|
|
3
3
|
/**
|
|
4
4
|
* 探针:验证执行器能以纯 node 语义执行 JS(先例 = runtime relay-env.ts:47-90)。
|
|
5
5
|
*
|
|
@@ -20,7 +20,7 @@ interface EngineNodeLaunchOptions {
|
|
|
20
20
|
args?: readonly string[];
|
|
21
21
|
/** 宿主形态。 */
|
|
22
22
|
hostKind: EngineNodeHostKind;
|
|
23
|
-
/** 读取
|
|
23
|
+
/** 读取 TAIJI_AGENT_ENGINE_NODE 的 env 快照(矩阵① 的注入通道)。 */
|
|
24
24
|
env?: Record<string, string | undefined>;
|
|
25
25
|
/** 宿主 process.execPath(缺省 process.execPath)。 */
|
|
26
26
|
execPath?: string;
|
|
@@ -42,7 +42,7 @@ interface EngineNodeLaunch {
|
|
|
42
42
|
*
|
|
43
43
|
* 判定序(与规格逐行对应):
|
|
44
44
|
* Windows + entry .cmd → cmd.exe /c 显式形态(禁 shell:true 的注入面);
|
|
45
|
-
* pi-extension → 注入执行器(env
|
|
45
|
+
* pi-extension → 注入执行器(env TAIJI_AGENT_ENGINE_NODE),缺失/探针失败 =
|
|
46
46
|
* engine_not_found + 指引;
|
|
47
47
|
* runtime-sidecar → process.execPath(Electron 时 electronRunAsNode,探针先行);
|
|
48
48
|
* standalone → PATH node(探针失败 = engine_not_found + 安装指引);
|
|
@@ -54,7 +54,7 @@ declare function resolveEngineNodeLaunch(opts: EngineNodeLaunchOptions): Promise
|
|
|
54
54
|
/**
|
|
55
55
|
* EngineClient 的自由字符串 hostKind('pi' / 'runtime' / …)→ 矩阵行归一:
|
|
56
56
|
* 'runtime*' → runtime-sidecar(②:sidecar execPath 权威);
|
|
57
|
-
* env 已注入
|
|
57
|
+
* env 已注入 TAIJI_AGENT_ENGINE_NODE(打包态 runtime 注入主 pi 进程的通道)→
|
|
58
58
|
* pi-extension(①:必须用注入执行器——pi 宿主自身 execPath 是 pi binary);
|
|
59
59
|
* 其余 → standalone(③:PATH node)。
|
|
60
60
|
*/
|
package/dist/node-executor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** L0 注入的引擎执行器路径 env(与 relay 的
|
|
2
|
-
declare const ENGINE_NODE_ENV = "
|
|
1
|
+
/** L0 注入的引擎执行器路径 env(与 relay 的 TAIJI_SUBAGENT_RELAY_NODE 不复用)。 */
|
|
2
|
+
declare const ENGINE_NODE_ENV = "TAIJI_AGENT_ENGINE_NODE";
|
|
3
3
|
/**
|
|
4
4
|
* 探针:验证执行器能以纯 node 语义执行 JS(先例 = runtime relay-env.ts:47-90)。
|
|
5
5
|
*
|
|
@@ -20,7 +20,7 @@ interface EngineNodeLaunchOptions {
|
|
|
20
20
|
args?: readonly string[];
|
|
21
21
|
/** 宿主形态。 */
|
|
22
22
|
hostKind: EngineNodeHostKind;
|
|
23
|
-
/** 读取
|
|
23
|
+
/** 读取 TAIJI_AGENT_ENGINE_NODE 的 env 快照(矩阵① 的注入通道)。 */
|
|
24
24
|
env?: Record<string, string | undefined>;
|
|
25
25
|
/** 宿主 process.execPath(缺省 process.execPath)。 */
|
|
26
26
|
execPath?: string;
|
|
@@ -42,7 +42,7 @@ interface EngineNodeLaunch {
|
|
|
42
42
|
*
|
|
43
43
|
* 判定序(与规格逐行对应):
|
|
44
44
|
* Windows + entry .cmd → cmd.exe /c 显式形态(禁 shell:true 的注入面);
|
|
45
|
-
* pi-extension → 注入执行器(env
|
|
45
|
+
* pi-extension → 注入执行器(env TAIJI_AGENT_ENGINE_NODE),缺失/探针失败 =
|
|
46
46
|
* engine_not_found + 指引;
|
|
47
47
|
* runtime-sidecar → process.execPath(Electron 时 electronRunAsNode,探针先行);
|
|
48
48
|
* standalone → PATH node(探针失败 = engine_not_found + 安装指引);
|
|
@@ -54,7 +54,7 @@ declare function resolveEngineNodeLaunch(opts: EngineNodeLaunchOptions): Promise
|
|
|
54
54
|
/**
|
|
55
55
|
* EngineClient 的自由字符串 hostKind('pi' / 'runtime' / …)→ 矩阵行归一:
|
|
56
56
|
* 'runtime*' → runtime-sidecar(②:sidecar execPath 权威);
|
|
57
|
-
* env 已注入
|
|
57
|
+
* env 已注入 TAIJI_AGENT_ENGINE_NODE(打包态 runtime 注入主 pi 进程的通道)→
|
|
58
58
|
* pi-extension(①:必须用注入执行器——pi 宿主自身 execPath 是 pi binary);
|
|
59
59
|
* 其余 → standalone(③:PATH node)。
|
|
60
60
|
*/
|
package/dist/node-executor.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
probeNodeExecutor,
|
|
5
5
|
resetEngineNodeProbeCache,
|
|
6
6
|
resolveEngineNodeLaunch
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-W3BKI2BP.js";
|
|
8
|
+
import "./chunk-WMDMXP2F.js";
|
|
9
9
|
import "./chunk-JSBRDJBE.js";
|
|
10
10
|
export {
|
|
11
11
|
ENGINE_NODE_ENV,
|
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,
|
|
@@ -81,7 +82,7 @@ var CRASH_REBUILD_BACKOFF_MS = [
|
|
|
81
82
|
CRASH_REBUILD_BACKOFF_STEP_3_MS
|
|
82
83
|
];
|
|
83
84
|
var STDERR_TAIL_CHARS = 400;
|
|
84
|
-
var ENGINE_EVENT_COALESCE_ENV = "
|
|
85
|
+
var ENGINE_EVENT_COALESCE_ENV = "TAIJI_ENGINE_EVENT_COALESCE";
|
|
85
86
|
var ENGINE_EVENT_COALESCE_DEFAULT = "0";
|
|
86
87
|
|
|
87
88
|
// src/protocol/frames.ts
|
|
@@ -188,7 +189,7 @@ function engineConversationUnsupportedError(engineId) {
|
|
|
188
189
|
return new EngineSdkError(
|
|
189
190
|
"engine_capability_unsupported",
|
|
190
191
|
`engine '${engineId}' \u4E0D\u652F\u6301 resume \u7EED\u804A\uFF08capabilities.conversation = 'unsupported'\uFF0Cmanifest \u65E0 conversation gate \u4F4D\uFF09`,
|
|
191
|
-
`\
|
|
192
|
+
`\u6539\u7528\u58F0\u660E conversation \u80FD\u529B\u7684\u5F15\u64CE\u7EED\u804A\uFF08\u6216\u4EE5\u65B0\u4EFB\u52A1\u91CD\u6D3E\uFF09\uFF0C\u6216\u4FEE manifest capabilities / \u5347\u7EA7\u5F15\u64CE\u5305\uFF08\u82E5\u5F15\u64CE\u5B9E\u9645\u652F\u6301\u8BE5\u80FD\u529B\uFF09`,
|
|
192
193
|
{ engineId, capability: "conversation", declared: "unsupported" }
|
|
193
194
|
);
|
|
194
195
|
}
|
|
@@ -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,9 +1,9 @@
|
|
|
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
|
-
/** 协议版本(引擎包 manifest `
|
|
6
|
+
/** 协议版本(引擎包 manifest `taiji.subagentEngine.protocol` 与 initialize 应答同值)。 */
|
|
7
7
|
declare const ENGINE_PROTOCOL_VERSION = 1;
|
|
8
8
|
/**
|
|
9
9
|
* core 侧支持的协议版本区间(半开区间 [min, max)):当前 = [1, 2)。
|
|
@@ -27,7 +27,7 @@ declare const CRASH_REBUILD_BACKOFF_MS: readonly [1000, 2000, 4000];
|
|
|
27
27
|
/** stderr 内存环形缓冲保留的尾部字符数(engine_crashed 帧携带崩溃现场)。 */
|
|
28
28
|
declare const STDERR_TAIL_CHARS = 400;
|
|
29
29
|
/** 事件合并开关 env 名(设计级默认关闭 = 值 "0";A1 要求事件逐字段等价,合并不可开)。 */
|
|
30
|
-
declare const ENGINE_EVENT_COALESCE_ENV = "
|
|
30
|
+
declare const ENGINE_EVENT_COALESCE_ENV = "TAIJI_ENGINE_EVENT_COALESCE";
|
|
31
31
|
declare const ENGINE_EVENT_COALESCE_DEFAULT = "0";
|
|
32
32
|
/**
|
|
33
33
|
* 反向请求超时二分(帧④注释,R9-2):
|
|
@@ -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,9 +1,9 @@
|
|
|
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
|
-
/** 协议版本(引擎包 manifest `
|
|
6
|
+
/** 协议版本(引擎包 manifest `taiji.subagentEngine.protocol` 与 initialize 应答同值)。 */
|
|
7
7
|
declare const ENGINE_PROTOCOL_VERSION = 1;
|
|
8
8
|
/**
|
|
9
9
|
* core 侧支持的协议版本区间(半开区间 [min, max)):当前 = [1, 2)。
|
|
@@ -27,7 +27,7 @@ declare const CRASH_REBUILD_BACKOFF_MS: readonly [1000, 2000, 4000];
|
|
|
27
27
|
/** stderr 内存环形缓冲保留的尾部字符数(engine_crashed 帧携带崩溃现场)。 */
|
|
28
28
|
declare const STDERR_TAIL_CHARS = 400;
|
|
29
29
|
/** 事件合并开关 env 名(设计级默认关闭 = 值 "0";A1 要求事件逐字段等价,合并不可开)。 */
|
|
30
|
-
declare const ENGINE_EVENT_COALESCE_ENV = "
|
|
30
|
+
declare const ENGINE_EVENT_COALESCE_ENV = "TAIJI_ENGINE_EVENT_COALESCE";
|
|
31
31
|
declare const ENGINE_EVENT_COALESCE_DEFAULT = "0";
|
|
32
32
|
/**
|
|
33
33
|
* 反向请求超时二分(帧④注释,R9-2):
|
|
@@ -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,
|
|
@@ -40,9 +41,10 @@ import {
|
|
|
40
41
|
isEngineProtocolErrorCode,
|
|
41
42
|
isProtocolVersionCompatible,
|
|
42
43
|
schemaEmulationFailedDetail
|
|
43
|
-
} from "../chunk-
|
|
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,
|
package/dist/relay-env.cjs
CHANGED
|
@@ -31,11 +31,11 @@ __export(relay_env_exports, {
|
|
|
31
31
|
readRelayForwardEnv: () => readRelayForwardEnv
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(relay_env_exports);
|
|
34
|
-
var RELAY_ENV_SOCKET = "
|
|
35
|
-
var RELAY_ENV_NODE = "
|
|
36
|
-
var RELAY_ENV_SCRIPT = "
|
|
37
|
-
var RELAY_ENV_SESSION_ID = "
|
|
38
|
-
var RELAY_ENV_RECORD_ID = "
|
|
34
|
+
var RELAY_ENV_SOCKET = "TAIJI_SUBAGENT_RELAY_SOCKET";
|
|
35
|
+
var RELAY_ENV_NODE = "TAIJI_SUBAGENT_RELAY_NODE";
|
|
36
|
+
var RELAY_ENV_SCRIPT = "TAIJI_SUBAGENT_RELAY_SCRIPT";
|
|
37
|
+
var RELAY_ENV_SESSION_ID = "TAIJI_SUBAGENT_RELAY_SESSION_ID";
|
|
38
|
+
var RELAY_ENV_RECORD_ID = "TAIJI_SUBAGENT_RELAY_RECORD_ID";
|
|
39
39
|
var RELAY_PROTOCOL_VERSION = 1;
|
|
40
40
|
var RELAY_EXIT_CODES = {
|
|
41
41
|
/** 握手被拒:协议版本不匹配(安装损坏,重装应用)。 */
|
package/dist/relay-env.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const RELAY_ENV_SOCKET = "
|
|
2
|
-
declare const RELAY_ENV_NODE = "
|
|
3
|
-
declare const RELAY_ENV_SCRIPT = "
|
|
4
|
-
declare const RELAY_ENV_SESSION_ID = "
|
|
5
|
-
declare const RELAY_ENV_RECORD_ID = "
|
|
1
|
+
declare const RELAY_ENV_SOCKET = "TAIJI_SUBAGENT_RELAY_SOCKET";
|
|
2
|
+
declare const RELAY_ENV_NODE = "TAIJI_SUBAGENT_RELAY_NODE";
|
|
3
|
+
declare const RELAY_ENV_SCRIPT = "TAIJI_SUBAGENT_RELAY_SCRIPT";
|
|
4
|
+
declare const RELAY_ENV_SESSION_ID = "TAIJI_SUBAGENT_RELAY_SESSION_ID";
|
|
5
|
+
declare const RELAY_ENV_RECORD_ID = "TAIJI_SUBAGENT_RELAY_RECORD_ID";
|
|
6
6
|
/** relay 协议版本(握手帧 v 字段;runtime 与代理同包分发,不匹配=安装损坏)。 */
|
|
7
7
|
declare const RELAY_PROTOCOL_VERSION = 1;
|
|
8
8
|
/** 代理专用退出码(extension/引擎侧表现为「子进程非零退出」→ engine_run_failed 语义)。 */
|