import { DebuggerDriver } from "./driver.js"; import type { BusyEntry, DebuggerCommand, DebuggerIO, DebuggerMode } from "./types.js"; import type { PendingPreview } from "./edits/rows.js"; import { Checkpoint } from "../runtime/state/checkpointStore.js"; import type { FunctionParameter } from "../types.js"; import type { LLMMock } from "../runtime/deterministicClient.js"; import type { DebugStopData } from "../runtime/debugger.js"; import type { GuardTripData } from "./guardAnswer.js"; import type { InterruptResponse } from "../runtime/interrupts.js"; export declare const fixtureDir: string; export declare class TestDebuggerIO implements DebuggerIO { /** Every line the driver logged, in order. */ logLines: string[]; mode: DebuggerMode; pending: PendingPreview; /** Every list `setBusy` received, in order. */ busyCalls: BusyEntry[][]; private pauseListeners; private commands; private commandIndex; renderCalls: Checkpoint[]; rewindSelector: ((checkpoints: Checkpoint[]) => number | null) | null; constructor(commands: DebuggerCommand[]); log(line: string): void; setMode(mode: DebuggerMode): void; setPending(preview: PendingPreview): void; setBusy(entries: BusyEntry[]): void; onPause(listener: () => void): void; /** The person pressed the pause key. */ pause(): void; render(_checkpoint?: Checkpoint, _stop?: DebugStopData, _interruptId?: string): Promise; waitForCommand(): Promise; showRewindSelector(checkpoints: Checkpoint[]): Promise; promptForNodeArgs(_parameters: FunctionParameter[]): Promise; promptForInput(_prompt: string): Promise; answerGuardTrip(_data: GuardTripData): Promise; showCheckpointsPanel(_checkpoints: Checkpoint[]): Promise; appendStdout(_text: string): void; renderActivityOnly(): void; /** Whether the driver has the UI spinning: the program is running. */ spinning: boolean; startSpinner(): void; stopSpinner(): void; destroy(): void; } export declare function freshImport(compiledFile: string): Promise; export declare function makeDriver(mod: any, ui: DebuggerIO, opts?: { checkpoints?: Checkpoint[]; }): DebuggerDriver; export declare function getInitialResult(mod: any, driver: DebuggerDriver, ...args: any[]): Promise; /** Run `fn` with every `llm()` call answered from `mocks`, in order, by * the deterministic client. `fn` must import the module itself: the * client is built from `AGENCY_LLM_MOCKS` when the module is imported, * and one queue then serves the whole session, resumes and rewinds * included. */ /** One resume the driver sent: how many interrupts it answered, and the * responses in the batch's order. */ export type RecordedResume = { interrupts: number; responses: unknown[]; }; /** A copy of a compiled module whose `respondToInterrupts` records every * resume into `resumes` before forwarding it. */ export declare function recordingResumes(mod: any, resumes: RecordedResume[]): any; export declare function withLLMMocks(mocks: LLMMock[], fn: () => Promise): Promise;