/** * Trae CLI backend plugin. * 通过 `traecli exec` 命令驱动 agent,JSON 事件流输出。 * 新版 traecli (v0.200+) 基于 codex 协议,stdout/session log 格式与 codex 一致。 */ import { CliAgentBackend, type BaseCliSession, type ParsedOutput } from "../agent/cli-base.js"; import type { SessionConfig, ExecHooks } from "../agent/types.js"; interface TraeCliSession extends BaseCliSession { sessionLogPath?: string; sandboxMode: string; } export default class TraeCliBackend extends CliAgentBackend { constructor(); command(): string; buildSession(config: SessionConfig): TraeCliSession; buildInput(session: TraeCliSession, message: string): { args: string[]; stdin?: string; }; parseOutput(stdout: string, session: TraeCliSession): ParsedOutput; protected loadSessionTranscript(session: TraeCliSession): Promise<{ sources: { path: string; role: string; }[]; backend: string; agentSessionId: string; events: Iterable | AsyncIterable; }>; private scanJsonl; protected getExecHooks(session: TraeCliSession): ExecHooks; protected probeSessionFileMtime(session: TraeCliSession): number | null; private getJsonlPath; private readDirectoryNames; private readFileNames; } export {};