/** * Wrapper for the Rust REPL evaluator server. * Spawns a long-lived Rust subprocess and communicates via line-delimited JSON. * * @author Gabriela Moreira * * @module */ import { Either } from '@sweet-monads/either'; import { QuintEx } from '../ir/quintIr'; import { LookupTable } from '../names/base'; import { QuintError } from '../quintError'; import { Rng } from '../rng'; import { TraceRecorder } from '../runtime/trace'; import { Trace } from '../runtime/impl/trace'; import { RuntimeValue } from '../runtime/impl/runtimeValue'; /** * Wrapper for the long-lived Rust REPL evaluator server. * Maintains a subprocess and communicates via JSON. * * Communication is synchronous: send a command, wait for response, process it. * The only async aspect is that the main process can handle Ctrl+C while waiting. */ export declare class ReplServerWrapper { private process; private stdout; private pendingResponse; private processExited; private fatalError; recorder: TraceRecorder; private verbosityLevel; private traceCache?; private out; private initializationPromise; constructor(table: LookupTable, recorder: TraceRecorder, rng: Rng, out: (text: string) => void); /** * Initialize the Rust evaluator process and wait for it to be ready */ private initialize; /** * Send a command to the Rust evaluator and wait for response */ private sendCommand; /** * Async version of evaluate (what we actually implement) */ evaluate(expr: QuintEx): Promise>; private maybePrintDiagnostics; updateTable(table: LookupTable): Promise; getSeed(): Promise; setSeed(seed: bigint): Promise; setVerbosity(verbosity: number): Promise; replShift(): Promise<[boolean, string[], RuntimeValue | undefined, RuntimeValue | undefined]>; /** * Get the trace for rendering. * Returns cached trace states or fetches it from the Rust server. */ getTrace(): Promise; /** * Reset the Rust evaluator state (interpreter, env, traces) while keeping the process alive. * Used by .load/.reload to get a clean slate without respawning the subprocess. */ reset(): Promise; /** * Wait for initialization to complete */ waitForInitialization(): Promise; /** * Shutdown the Rust evaluator process */ shutdown(): Promise; }