/** * {@link ScreenModel} backed by a headless `xterm` terminal. Kept separate * from the prediction engine so the engine can be unit-tested against a * deterministic fake without spinning up a real VT emulator. * * `@xterm/headless` is CommonJS with a default export, and its `write()` is * asynchronous — buffer state only reflects the data once the write callback * fires — so {@link XtermScreenModel.write} resolves on that callback and the * engine awaits it before reading cursor/row state. */ import { type PredictiveEcho, type ScreenModel } from '@agent-relay/harness-driver'; export interface XtermScreenModelOptions { cols: number; rows: number; } declare class XtermScreenModel implements ScreenModel { private readonly term; constructor(options: XtermScreenModelOptions); write(data: string): Promise; cursor(): { row: number; col: number; }; rowText(row: number): string; isAltScreen(): boolean; cols(): number; resize(cols: number, rows: number): void; dispose(): void; } /** Construct an xterm-backed {@link ScreenModel}. */ export declare function createXtermScreenModel(options: XtermScreenModelOptions): XtermScreenModel; export type { XtermScreenModel }; export interface CreatePredictiveEchoOptions { cols: number; rows: number; /** Writes raw bytes/escape sequences to the real terminal. */ write: (data: string) => void; /** Latest input→ack SRTT (ms) from the PTY input stream, or null. */ getInputSrtt: () => number | null; } /** * Default {@link PredictiveEcho} factory used by the interactive attach * clients: an {@link PredictiveEchoEngine} backed by a headless xterm model. * Returns null for a degenerate (zero-size) terminal, where prediction makes * no sense and the caller falls back to plain pass-through. */ export declare function createPredictiveEcho(opts: CreatePredictiveEchoOptions): PredictiveEcho | null; //# sourceMappingURL=predictive-echo-screen.d.ts.map