@botlearn-course/daemon 0.0.29-beta.3 → 0.0.29-beta.5
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/README.md +29 -89
- package/dist/auth-store.d.ts +1 -11
- package/dist/auth-store.js +2 -83
- package/dist/cli.d.ts +0 -15
- package/dist/cli.js +12 -204
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/run-dispatcher.d.ts +1 -5
- package/dist/run-dispatcher.js +41 -116
- package/dist/runtime-capabilities.js +3 -11
- package/dist/runtimes/engine.js +15 -52
- package/dist/runtimes/index.d.ts +1 -7
- package/dist/runtimes/index.js +1 -45
- package/dist/runtimes/pi-agent.js +38 -7
- package/dist/runtimes/pi-managed-launch.d.ts +5 -0
- package/dist/runtimes/pi-managed-launch.js +41 -0
- package/dist/runtimes/pi-managed-subagent-extension.d.ts +127 -0
- package/dist/runtimes/pi-managed-subagent-extension.js +300 -0
- package/dist/runtimes/pi-managed.d.ts +16 -2
- package/dist/runtimes/pi-managed.js +38 -16
- package/dist/runtimes/probe.d.ts +0 -5
- package/dist/runtimes/probe.js +0 -16
- package/dist/types.d.ts +10 -73
- package/dist/workspace.d.ts +0 -2
- package/dist/workspace.js +0 -10
- package/package.json +2 -2
- package/dist/course-client.d.ts +0 -46
- package/dist/course-client.js +0 -158
- package/dist/doctor.d.ts +0 -15
- package/dist/doctor.js +0 -85
- package/dist/runtime-profile.d.ts +0 -8
- package/dist/runtime-profile.js +0 -236
- package/dist/runtimes/acp-stream.d.ts +0 -96
- package/dist/runtimes/acp-stream.js +0 -490
- package/dist/runtimes/claude-code.d.ts +0 -41
- package/dist/runtimes/claude-code.js +0 -364
- package/dist/runtimes/codex.d.ts +0 -44
- package/dist/runtimes/codex.js +0 -348
- package/dist/runtimes/gemini.d.ts +0 -39
- package/dist/runtimes/gemini.js +0 -264
- package/dist/runtimes/hermes-agent.d.ts +0 -61
- package/dist/runtimes/hermes-agent.js +0 -191
- package/dist/runtimes/kimi.d.ts +0 -35
- package/dist/runtimes/kimi.js +0 -343
- package/dist/runtimes/native-tool-blocks.d.ts +0 -3
- package/dist/runtimes/native-tool-blocks.js +0 -98
- package/dist/runtimes/ndjson-stream.d.ts +0 -48
- package/dist/runtimes/ndjson-stream.js +0 -210
- package/dist/runtimes/openclaw-acp.d.ts +0 -52
- package/dist/runtimes/openclaw-acp.js +0 -893
- package/dist/runtimes/runtime-errors.d.ts +0 -20
- package/dist/runtimes/runtime-errors.js +0 -95
- package/dist/runtimes/text-cap.d.ts +0 -7
- package/dist/runtimes/text-cap.js +0 -25
package/dist/runtime-profile.js
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { chmodSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { runtimeProfileDir, runtimeProfileRunRootDir } from "./workspace.js";
|
|
5
|
-
const SAFE_ASSET_ID = /^[a-z0-9][a-z0-9._-]{0,159}$/;
|
|
6
|
-
const SHA256 = /^sha256:[0-9a-f]{64}$/;
|
|
7
|
-
const MAX_SKILL_PACKAGES = 32;
|
|
8
|
-
const MAX_PACKAGE_FILES = 128;
|
|
9
|
-
const MAX_PACKAGE_BYTES = 2 * 1024 * 1024;
|
|
10
|
-
const MAX_PROMPT_CHARS = 50_000;
|
|
11
|
-
export class RuntimeProfileApplyError extends Error {
|
|
12
|
-
code = "profile_apply_failed";
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super(message);
|
|
15
|
-
this.name = "RuntimeProfileApplyError";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function applyRunRuntimeProfile(payload, raw) {
|
|
19
|
-
const profile = validateRuntimeProfile(raw);
|
|
20
|
-
if (payload.context.profileHash !== profile.profileHash) {
|
|
21
|
-
throw new RuntimeProfileApplyError("run.start profileHash does not match runtime profile");
|
|
22
|
-
}
|
|
23
|
-
const runDir = runtimeProfileRunRootDir(payload.agent_run_id);
|
|
24
|
-
const target = runtimeProfileDir(payload.agent_run_id);
|
|
25
|
-
const managedReadView = Boolean(process.env.BOTLEARN_AGENT_SERVICE_PROFILE_ROOT?.trim());
|
|
26
|
-
const directoryMode = managedReadView ? 0o750 : 0o700;
|
|
27
|
-
const fileMode = managedReadView ? 0o640 : 0o600;
|
|
28
|
-
mkdirSync(runDir, { recursive: true, mode: directoryMode });
|
|
29
|
-
chmodSync(runDir, directoryMode);
|
|
30
|
-
const staging = mkdtempSync(path.join(runDir, ".runtime-profile-"));
|
|
31
|
-
chmodSync(staging, directoryMode);
|
|
32
|
-
try {
|
|
33
|
-
const skillsRoot = path.join(staging, "skills");
|
|
34
|
-
mkdirSync(skillsRoot, { recursive: true, mode: directoryMode });
|
|
35
|
-
chmodSync(skillsRoot, directoryMode);
|
|
36
|
-
const skillRefs = [];
|
|
37
|
-
const skillIds = new Set();
|
|
38
|
-
for (const skill of profile.skillPackages) {
|
|
39
|
-
if (skillIds.has(skill.id)) {
|
|
40
|
-
throw new RuntimeProfileApplyError(`duplicate runtime Skill id: ${skill.id}`);
|
|
41
|
-
}
|
|
42
|
-
skillIds.add(skill.id);
|
|
43
|
-
installSkillPackage(skillsRoot, skill, { directoryMode, fileMode });
|
|
44
|
-
skillRefs.push(`${skill.id}@${skill.version}`);
|
|
45
|
-
}
|
|
46
|
-
const promptPackPath = path.join(staging, "prompt-pack.md");
|
|
47
|
-
writeFileSync(promptPackPath, profile.promptPack.systemInstructions, { mode: fileMode });
|
|
48
|
-
chmodSync(promptPackPath, fileMode);
|
|
49
|
-
const manifestPath = path.join(staging, "profile.json");
|
|
50
|
-
writeFileSync(manifestPath, `${JSON.stringify({
|
|
51
|
-
schemaVersion: profile.schemaVersion,
|
|
52
|
-
profileId: profile.profileId,
|
|
53
|
-
profileHash: profile.profileHash,
|
|
54
|
-
courseVersionId: profile.courseVersionId,
|
|
55
|
-
promptPack: {
|
|
56
|
-
id: profile.promptPack.id,
|
|
57
|
-
version: profile.promptPack.version,
|
|
58
|
-
digest: profile.promptPack.digest,
|
|
59
|
-
},
|
|
60
|
-
skillRefs,
|
|
61
|
-
requiredCapabilities: profile.requiredCapabilities,
|
|
62
|
-
}, null, 2)}\n`, { mode: fileMode });
|
|
63
|
-
chmodSync(manifestPath, fileMode);
|
|
64
|
-
rmSync(target, { recursive: true, force: true });
|
|
65
|
-
renameSync(staging, target);
|
|
66
|
-
return {
|
|
67
|
-
profileId: profile.profileId,
|
|
68
|
-
profileHash: profile.profileHash,
|
|
69
|
-
promptPackPath: path.join(target, "prompt-pack.md"),
|
|
70
|
-
skillsRoot: path.join(target, "skills"),
|
|
71
|
-
skillRefs,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
rmSync(staging, { recursive: true, force: true });
|
|
76
|
-
if (err instanceof RuntimeProfileApplyError)
|
|
77
|
-
throw err;
|
|
78
|
-
throw new RuntimeProfileApplyError(err instanceof Error ? err.message : String(err));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export function cleanupRunRuntimeProfile(agentRunId) {
|
|
82
|
-
rmSync(runtimeProfileDir(agentRunId), { recursive: true, force: true });
|
|
83
|
-
}
|
|
84
|
-
export function runtimeProfileInstructions(payload, applied) {
|
|
85
|
-
const selected = stringValues(payload.context.skillRefs);
|
|
86
|
-
const available = new Set(applied.skillRefs);
|
|
87
|
-
const missing = selected.filter((ref) => !available.has(ref));
|
|
88
|
-
if (missing.length > 0) {
|
|
89
|
-
throw new RuntimeProfileApplyError(`runtime profile is missing Skills: ${missing.join(", ")}`);
|
|
90
|
-
}
|
|
91
|
-
const enabled = selected.length > 0 ? selected : applied.skillRefs;
|
|
92
|
-
return [
|
|
93
|
-
`[BotLearn Course Prompt Pack: ${applied.profileId}]`,
|
|
94
|
-
`Read the trusted prompt pack at ${applied.promptPackPath}.`,
|
|
95
|
-
...(enabled.length > 0
|
|
96
|
-
? [
|
|
97
|
-
"The following Skills are enabled only for this AgentRun:",
|
|
98
|
-
...enabled.map((ref) => {
|
|
99
|
-
const id = ref.split("@", 1)[0];
|
|
100
|
-
return `- ${ref}: ${path.join(applied.skillsRoot, id, "SKILL.md")}`;
|
|
101
|
-
}),
|
|
102
|
-
]
|
|
103
|
-
: []),
|
|
104
|
-
];
|
|
105
|
-
}
|
|
106
|
-
function installSkillPackage(skillsRoot, skill, modes) {
|
|
107
|
-
assertSafeAssetId(skill.id, "Skill id");
|
|
108
|
-
if (!SHA256.test(skill.digest)) {
|
|
109
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} has an invalid digest`);
|
|
110
|
-
}
|
|
111
|
-
const entries = archiveEntries(skill);
|
|
112
|
-
if (packageDigest(entries) !== skill.digest) {
|
|
113
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id}@${skill.version} digest mismatch`);
|
|
114
|
-
}
|
|
115
|
-
const skillDir = path.join(skillsRoot, skill.id);
|
|
116
|
-
mkdirSync(skillDir, { recursive: true, mode: modes.directoryMode });
|
|
117
|
-
chmodSync(skillDir, modes.directoryMode);
|
|
118
|
-
for (const entry of entries) {
|
|
119
|
-
const destination = path.join(skillDir, entry.path);
|
|
120
|
-
mkdirSync(path.dirname(destination), { recursive: true, mode: modes.directoryMode });
|
|
121
|
-
chmodSync(path.dirname(destination), modes.directoryMode);
|
|
122
|
-
writeFileSync(destination, entry.content, { mode: modes.fileMode });
|
|
123
|
-
chmodSync(destination, modes.fileMode);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function archiveEntries(skill) {
|
|
127
|
-
const archive = skill.archiveManifest;
|
|
128
|
-
if (!archive || typeof archive.skillMd !== "string" || !archive.skillMd.trim()) {
|
|
129
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} has no SKILL.md content`);
|
|
130
|
-
}
|
|
131
|
-
if (archive.name !== undefined && archive.name !== skill.id) {
|
|
132
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} archive name does not match its id`);
|
|
133
|
-
}
|
|
134
|
-
if ((archive.files?.length ?? 0) + 1 > MAX_PACKAGE_FILES) {
|
|
135
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} archive has too many files`);
|
|
136
|
-
}
|
|
137
|
-
const entries = [{ path: "SKILL.md", content: archive.skillMd }];
|
|
138
|
-
const seen = new Set(["SKILL.md"]);
|
|
139
|
-
for (const file of archive.files ?? []) {
|
|
140
|
-
validateArchiveFile(file, skill.id);
|
|
141
|
-
const relative = safeRelativePath(file.path);
|
|
142
|
-
if (seen.has(relative)) {
|
|
143
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} has duplicate file ${relative}`);
|
|
144
|
-
}
|
|
145
|
-
seen.add(relative);
|
|
146
|
-
entries.push({ path: relative, content: file.content });
|
|
147
|
-
}
|
|
148
|
-
const total = entries.reduce((sum, entry) => sum + Buffer.byteLength(entry.content), 0);
|
|
149
|
-
if (total > MAX_PACKAGE_BYTES) {
|
|
150
|
-
throw new RuntimeProfileApplyError(`Skill ${skill.id} archive is too large`);
|
|
151
|
-
}
|
|
152
|
-
return entries.sort((a, b) => compareUnicodeCodePoints(a.path, b.path));
|
|
153
|
-
}
|
|
154
|
-
function compareUnicodeCodePoints(left, right) {
|
|
155
|
-
const leftCodePoints = Array.from(left, (value) => value.codePointAt(0));
|
|
156
|
-
const rightCodePoints = Array.from(right, (value) => value.codePointAt(0));
|
|
157
|
-
const length = Math.min(leftCodePoints.length, rightCodePoints.length);
|
|
158
|
-
for (let index = 0; index < length; index += 1) {
|
|
159
|
-
const difference = leftCodePoints[index] - rightCodePoints[index];
|
|
160
|
-
if (difference !== 0)
|
|
161
|
-
return difference;
|
|
162
|
-
}
|
|
163
|
-
return leftCodePoints.length - rightCodePoints.length;
|
|
164
|
-
}
|
|
165
|
-
function validateArchiveFile(file, skillId) {
|
|
166
|
-
if (!file || typeof file.path !== "string" || typeof file.content !== "string") {
|
|
167
|
-
throw new RuntimeProfileApplyError(`Skill ${skillId} contains an invalid archive file`);
|
|
168
|
-
}
|
|
169
|
-
const bytes = Buffer.from(file.content, "utf8");
|
|
170
|
-
if (file.size !== undefined && file.size !== bytes.length) {
|
|
171
|
-
throw new RuntimeProfileApplyError(`Skill ${skillId} file ${file.path} size mismatch`);
|
|
172
|
-
}
|
|
173
|
-
if (file.sha256 !== undefined) {
|
|
174
|
-
const digest = createHash("sha256").update(bytes).digest("hex");
|
|
175
|
-
if (file.sha256 !== digest) {
|
|
176
|
-
throw new RuntimeProfileApplyError(`Skill ${skillId} file ${file.path} digest mismatch`);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function packageDigest(entries) {
|
|
181
|
-
const digest = createHash("sha256");
|
|
182
|
-
for (const entry of entries) {
|
|
183
|
-
digest.update(Buffer.from(entry.path, "utf8"));
|
|
184
|
-
digest.update(Buffer.from([0]));
|
|
185
|
-
digest.update(Buffer.from(entry.content, "utf8"));
|
|
186
|
-
digest.update(Buffer.from([0]));
|
|
187
|
-
}
|
|
188
|
-
return `sha256:${digest.digest("hex")}`;
|
|
189
|
-
}
|
|
190
|
-
function validateRuntimeProfile(raw) {
|
|
191
|
-
if (!raw || typeof raw !== "object") {
|
|
192
|
-
throw new RuntimeProfileApplyError("runtime profile must be an object");
|
|
193
|
-
}
|
|
194
|
-
const profile = raw;
|
|
195
|
-
if (profile.schemaVersion !== "botlearn-course-runtime-profile/0.1") {
|
|
196
|
-
throw new RuntimeProfileApplyError("unsupported runtime profile schemaVersion");
|
|
197
|
-
}
|
|
198
|
-
assertSafeAssetId(profile.profileId, "Profile id");
|
|
199
|
-
if (typeof profile.profileHash !== "string" || !SHA256.test(profile.profileHash)) {
|
|
200
|
-
throw new RuntimeProfileApplyError("runtime profile has an invalid profileHash");
|
|
201
|
-
}
|
|
202
|
-
if (!profile.promptPack || typeof profile.promptPack.systemInstructions !== "string") {
|
|
203
|
-
throw new RuntimeProfileApplyError("runtime profile has an invalid Prompt Pack");
|
|
204
|
-
}
|
|
205
|
-
assertSafeAssetId(profile.promptPack.id, "Prompt Pack id");
|
|
206
|
-
if (!SHA256.test(profile.promptPack.digest) ||
|
|
207
|
-
!profile.promptPack.systemInstructions.trim() ||
|
|
208
|
-
profile.promptPack.systemInstructions.length > MAX_PROMPT_CHARS) {
|
|
209
|
-
throw new RuntimeProfileApplyError("runtime profile Prompt Pack is invalid");
|
|
210
|
-
}
|
|
211
|
-
if (!Array.isArray(profile.skillPackages) || !Array.isArray(profile.requiredCapabilities)) {
|
|
212
|
-
throw new RuntimeProfileApplyError("runtime profile has invalid Skill or capability lists");
|
|
213
|
-
}
|
|
214
|
-
if (profile.skillPackages.length > MAX_SKILL_PACKAGES) {
|
|
215
|
-
throw new RuntimeProfileApplyError("runtime profile has too many Skill packages");
|
|
216
|
-
}
|
|
217
|
-
return profile;
|
|
218
|
-
}
|
|
219
|
-
function safeRelativePath(value) {
|
|
220
|
-
if (!value ||
|
|
221
|
-
value.includes("\\") ||
|
|
222
|
-
value.includes("\0") ||
|
|
223
|
-
path.posix.isAbsolute(value) ||
|
|
224
|
-
value.split("/").some((part) => part === "" || part === "." || part === "..")) {
|
|
225
|
-
throw new RuntimeProfileApplyError(`unsafe Skill archive path: ${JSON.stringify(value)}`);
|
|
226
|
-
}
|
|
227
|
-
return value;
|
|
228
|
-
}
|
|
229
|
-
function assertSafeAssetId(value, label) {
|
|
230
|
-
if (typeof value !== "string" || !SAFE_ASSET_ID.test(value)) {
|
|
231
|
-
throw new RuntimeProfileApplyError(`${label} is unsafe`);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function stringValues(raw) {
|
|
235
|
-
return Array.isArray(raw) ? raw.filter((item) => typeof item === "string") : [];
|
|
236
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { type EngineAdapter, type EngineRunOptions, type EngineRunResult, type RuntimeStatusEvent, type StreamBlock } from "./engine.js";
|
|
2
|
-
import type { Logger } from "../log.js";
|
|
3
|
-
/** 本客户端目标的 ACP 协议版本。 */
|
|
4
|
-
export declare const ACP_PROTOCOL_VERSION = 1;
|
|
5
|
-
export interface AcpInitializeResult {
|
|
6
|
-
protocolVersion?: number;
|
|
7
|
-
agentInfo?: {
|
|
8
|
-
name?: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
};
|
|
11
|
-
agentCapabilities?: Record<string, unknown>;
|
|
12
|
-
authMethods?: Array<{
|
|
13
|
-
id?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
}>;
|
|
17
|
-
[k: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface AcpPermissionOption {
|
|
20
|
-
optionId: string;
|
|
21
|
-
name?: string;
|
|
22
|
-
/**
|
|
23
|
-
* ACP option kind,常见值 allow_once / allow_always / reject_once /
|
|
24
|
-
* reject_always。基类视为不透明字符串,由子类检查决定结果。
|
|
25
|
-
*/
|
|
26
|
-
kind?: string;
|
|
27
|
-
[k: string]: unknown;
|
|
28
|
-
}
|
|
29
|
-
export interface AcpPermissionRequest {
|
|
30
|
-
sessionId: string;
|
|
31
|
-
toolCall?: {
|
|
32
|
-
name?: string;
|
|
33
|
-
rawInput?: unknown;
|
|
34
|
-
[k: string]: unknown;
|
|
35
|
-
};
|
|
36
|
-
options: AcpPermissionOption[];
|
|
37
|
-
[k: string]: unknown;
|
|
38
|
-
}
|
|
39
|
-
export type AcpPermissionResponse = {
|
|
40
|
-
outcome: {
|
|
41
|
-
outcome: "selected";
|
|
42
|
-
optionId: string;
|
|
43
|
-
};
|
|
44
|
-
} | {
|
|
45
|
-
outcome: {
|
|
46
|
-
outcome: "cancelled";
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
export interface AcpUpdateParams {
|
|
50
|
-
sessionId: string;
|
|
51
|
-
update: {
|
|
52
|
-
sessionUpdate?: string;
|
|
53
|
-
[k: string]: unknown;
|
|
54
|
-
};
|
|
55
|
-
[k: string]: unknown;
|
|
56
|
-
}
|
|
57
|
-
/** 子类在一轮执行中响应入站流量的钩子。 */
|
|
58
|
-
export interface AcpTurnHooks {
|
|
59
|
-
onUpdate(params: AcpUpdateParams, ctx: AcpUpdateCtx): void;
|
|
60
|
-
onPermissionRequest(req: AcpPermissionRequest): Promise<AcpPermissionResponse>;
|
|
61
|
-
}
|
|
62
|
-
export interface AcpUpdateCtx {
|
|
63
|
-
/** 追加本轮流式 assistant 文本(尊重字节上限)。 */
|
|
64
|
-
appendAssistantText(text: string): void;
|
|
65
|
-
emitBlock(block: StreamBlock): void;
|
|
66
|
-
/** 转发 typing/thinking 状态事件(如 thought chunk、tool 进度)。 */
|
|
67
|
-
emitStatus(event: RuntimeStatusEvent): void;
|
|
68
|
-
/** 本轮 1-based 序号。 */
|
|
69
|
-
seq: number;
|
|
70
|
-
}
|
|
71
|
-
export declare abstract class AcpRuntimeAdapter implements EngineAdapter {
|
|
72
|
-
abstract readonly id: string;
|
|
73
|
-
protected readonly log: Logger;
|
|
74
|
-
constructor(logger?: Logger);
|
|
75
|
-
protected abstract resolveBinary(opts: EngineRunOptions): string;
|
|
76
|
-
/** argv 尾部(不含二进制)。ACP server 通常不需要参数。 */
|
|
77
|
-
protected buildArgs(_opts: EngineRunOptions): string[];
|
|
78
|
-
protected abstract spawnEnv(opts: EngineRunOptions): NodeJS.ProcessEnv;
|
|
79
|
-
/** 子类钩子:响应一条 session/update 通知。 */
|
|
80
|
-
protected abstract onUpdate(params: AcpUpdateParams, ctx: AcpUpdateCtx): void;
|
|
81
|
-
/** 子类钩子:应答 session/request_permission 请求。 */
|
|
82
|
-
protected abstract onPermissionRequest(req: AcpPermissionRequest, opts: EngineRunOptions): Promise<AcpPermissionResponse>;
|
|
83
|
-
/** initialize 时发送的 clientCapabilities。 */
|
|
84
|
-
protected clientCapabilities(): Record<string, unknown>;
|
|
85
|
-
/** initialize 时发送的 clientInfo。 */
|
|
86
|
-
protected clientInfo(): {
|
|
87
|
-
name: string;
|
|
88
|
-
version: string;
|
|
89
|
-
};
|
|
90
|
-
/** spawn 之前同步调用;子类可借此把 systemContext 落盘(如 <cwd>/AGENTS.md)。 */
|
|
91
|
-
protected prepareTurn(_opts: EngineRunOptions): void;
|
|
92
|
-
/** 传给 ACP session/new / session/load 的 cwd。 */
|
|
93
|
-
protected sessionCwd(opts: EngineRunOptions): string;
|
|
94
|
-
run(opts: EngineRunOptions): Promise<EngineRunResult>;
|
|
95
|
-
private withTimeout;
|
|
96
|
-
}
|