import type { InterruptibleEngine, EngineRunOpts, EngineResult, StreamDelta } from "../shared/types.js"; import { PtyLifecycleManager } from "./pty-lifecycle.js"; import type { PtyControlEvent, PtyIdleSpawnOpts, PtySnapshotSubscription, PtyViewEngine } from "./pty-view-engine.js"; import { type CodexTokenUsage } from "./codex.js"; export declare function codexTranscriptLineToDeltas(line: string): { deltas: StreamDelta[]; doneText?: string; sessionId?: string; contextTokens?: number; totalUsage?: CodexTokenUsage; /** event_msg task_started — gates the terminal markers below to THIS turn. */ taskStarted?: { turnId?: string; }; /** event_msg task_complete — the turn's deterministic end marker. */ taskComplete?: { lastAgentMessage?: string; turnId?: string; }; /** event_msg turn_aborted — the turn was interrupted CLI-side. */ turnAborted?: { turnId?: string; }; }; export declare class CodexInteractiveEngine implements InterruptibleEngine, PtyViewEngine { private lifecycle; name: "codex"; private active; private totalUsage; private streams; private lastGeom; private spawnParams; constructor(lifecycle: PtyLifecycleManager); run(opts: EngineRunOpts): Promise; private findTranscriptById; private buildEnv; /** * The prompt is user text, so the positionals go behind `--`. Without the * separator codex's parser reads a leading dash as a flag and exits 2 * (`unexpected argument '- '`) before the TUI ever starts. */ private buildArgs; private spawnParamsChanged; private updateSpawnResumeSessionId; private spawn; private wireProcToStream; ensureIdleSpawn(jinnSessionId: string, opts: PtyIdleSpawnOpts): void; subscribeWithSnapshot(sessionId: string, cb: (data: Buffer) => void, onControl?: (event: PtyControlEvent) => void): PtySnapshotSubscription; restartPty(sessionId: string, opts: PtyIdleSpawnOpts): void; writeStdin(sessionId: string, text: string): void; writeRaw(sessionId: string, data: string): void; resizePty(sessionId: string, cols: number, rows: number): void; setViewing(sessionId: string, viewing: boolean): void; hasWarmPty(sessionId: string): boolean; isTurnRunning(sessionId: string): boolean; kill(sessionId: string, reason?: string): void; killAll(): void; /** Recycle idle warm PTYs only (org-reload). Sessions with an in-flight turn * (`this.active`) are skipped so the active turn is never interrupted. */ killIdle(): void; isAlive(sessionId: string): boolean; } //# sourceMappingURL=codex-interactive.d.ts.map