/** * Base dir for the daemon socket/pid/log and stored sessions. Defaults to `~/.browserplex`; * override with `BROWSERPLEX_DIR` (used to relocate the runtime dir and to isolate tests). */ export declare const BASE_DIR: string; export declare const SOCKET_PATH: string; export declare const PID_PATH: string; export declare const LOG_PATH: string; /** Restrictive perms — the daemon exposes full browser control. */ export declare const SOCKET_MODE = 384; /** Max bytes for a single newline-delimited message (OOM guard). */ export declare const MAX_LINE_BYTES: number; export interface DaemonRequest { id: number; tool: string; args?: Record; } export interface DaemonResponse { /** Echoes the request id; null only when the request id could not be parsed. */ id: number | null; ok: boolean; text?: string; data?: unknown; imageBase64?: string; mimeType?: string; error?: string; } /** Serialize a message as a single newline-terminated JSON line. */ export declare function encodeMessage(msg: DaemonRequest | DaemonResponse): string; /** * Buffers socket chunks and yields complete non-empty lines split on "\n". * Yields raw strings (not parsed) so the caller can isolate parse/shape errors * per message and turn them into error replies instead of crashing. * - Tolerates messages split across chunks and multiple messages per chunk. * - Skips empty lines. * - Throws on a single line exceeding MAX_LINE_BYTES (caller closes the socket). */ export declare class LineDecoder { private buffer; private sd; /** Push a chunk; returns the complete lines it finished. */ push(chunk: Buffer | string): string[]; } //# sourceMappingURL=protocol.d.ts.map