import type { ManagedSession, PTYManagerOptions, SessionRunner, StartFreshSessionOptions, StartSessionOptions, UserMessage } from "./types"; export declare class PTYManager implements SessionRunner { private sessions; private onOutput; private onStatusChange; private onReady; private onPermissionChange; private onPhaseChange; private onPromptSuggestionChange; private onLiveQuestion; private onLiveQuestionGone; private onUserMessage; private permissionOpen; private oscTail; private turnOpen; private progressSeen; private progressTail; private lastDetectAt; private lastScreenQuestionKey; private shellPromptOpen; private closedGateKey; private pendingReady; private queuedInputs; private log; private firstChunkAt; private chunkIndex; private lastChunkAt; private quietCheckers; private readyFallbackTimers; private startPromises; constructor(options?: PTYManagerOptions); start(sessionId: string, options: StartSessionOptions): Promise; private doStart; startFresh(options: StartFreshSessionOptions): Promise; sendKeys(sessionId: string, keys: string): void; sendRawKeys(sessionId: string, keys: string): void; sendInput(sessionId: string, input: string): number; private writeSubmit; private flushQueuedInputs; /** * Resize a live PTY. Silent when the session is unknown or has no process: * a terminal emitting SIGWINCH races session exit by nature, and throwing * would turn an ordinary window drag into an error the caller must catch. */ resize(sessionId: string, cols: number, rows: number): void; cancel(sessionId: string): void; killPid(pid: number): void; putOnHold(sessionId: string, signal?: NodeJS.Signals): void; getOutput(sessionId: string): string; getOutputLines(sessionId: string, maxLines: number): Promise; getInputHistory(sessionId: string): UserMessage[]; getPid(sessionId: string): number | null; private recordUserMessage; getSession(sessionId: string): ManagedSession | null; hasSession(sessionId: string): boolean; listSessions(): ManagedSession[]; dispose(): void; private handleOutput; private detectLivePrompts; private handleQuiet; /** Update the open turn from OSC 9;4 in this chunk; true when it just closed. */ private trackProgress; private openTurnOnSubmit; private recheckReadyLogged; private recheckReadyFromScreen; private armReadyFallback; private clearReadyFallback; /** * Record the agent's phase and notify only on a real change. * * The change guard is load-bearing, not an optimisation: the scrape pass runs * on every chunk, so an unguarded setter would fire the callback — and the * WS frame behind it — several times a second for the entire duration of a * turn while reporting the same value. */ private setPhase; /** Record the composer suggestion and notify only on a real change. */ private setPromptSuggestion; private markReady; private handleExit; } //# sourceMappingURL=pty-manager.d.ts.map