/** * Codex CLI backend plugin. * 通过 `codex exec` 命令驱动 agent,JSON 事件流输出。 */ import { CliAgentBackend, type BaseCliSession, type ParsedOutput } from "../agent/cli-base.js"; import type { SessionConfig, ExecHooks } from "../agent/types.js"; interface CodexSession extends BaseCliSession { sessionLogPath?: string; sandboxMode: string; } export interface CodexBackendOptions { sandboxMode?: string; } export default class CodexBackend extends CliAgentBackend { private sandboxMode; constructor(options?: CodexBackendOptions); command(): string; buildSession(config: SessionConfig): CodexSession; buildInput(session: CodexSession, message: string): { args: string[]; stdin?: string; }; parseOutput(stdout: string, session: CodexSession): ParsedOutput; protected loadSessionTranscript(session: CodexSession): Promise<{ sources: { path: string; role: string; }[]; backend: string; agentSessionId: string; events: Iterable | AsyncIterable; }>; private scanJsonl; protected getExecHooks(session: CodexSession): ExecHooks; protected probeSessionFileMtime(session: CodexSession): number | null; private getJsonlPath; private readDirectoryNames; private readFileNames; } export {};