/**
 * PTY Client
 *
 * Thin client that connects to the PTY sidecar server over unix socket.
 * Each call opens a connection, sends a JSON request, reads the JSON response, and closes.
 */
export interface ServerSpawnArgs {
    bin: string;
    args: string[];
}
export interface ServerExit {
    code: number | null;
    signal: NodeJS.Signals | null;
}
/** JSON response envelope from the PTY server. */
export interface PtyResponse {
    ok: boolean;
    error?: string;
    [key: string]: any;
}
/**
 * Send a request to the PTY server and return the response.
 * Auto-starts the server if not running.
 */
export declare function ptyRequest(action: string, id?: string, params?: Record<string, any>): Promise<PtyResponse>;
export declare function getServerSpawnArgs(options?: {
    isStandaloneExecutable?: boolean;
    /** Physical binary path (test seam). Defaults to `process.execPath`. */
    execPath?: string;
    /** Locate a real `node` (test seam). Defaults to `which/where node`. */
    resolveNode?: () => string | undefined;
    /** File-existence check (test seam). Defaults to `fs.existsSync`. */
    fileExists?: (p: string) => boolean;
}): ServerSpawnArgs;
export declare function isBunStandaloneExecutable(moduleUrl?: string): boolean;
export declare function readRecentLogLines(logPath: string, maxLines?: number): string[];
export declare function buildPtyStartFailureMessage(details: {
    timeoutMs: number;
    spawn: ServerSpawnArgs;
    exit?: ServerExit;
    spawnError?: Error;
    lastReadinessError?: Error;
    logPath: string;
}): string;
/**
 * Parse escape sequences in user input strings.
 * Handles: \n \r \t \e \xHH \\
 */
export declare function unescapeInput(input: string): string;
