import type { ChildProcessWithoutNullStreams } from 'node:child_process'; export type AcpProtocolErrorCode = 'acp_timeout' | 'acp_aborted' | 'acp_closed' | 'acp_process_exited' | 'acp_malformed_message' | 'acp_message_too_large' | 'acp_remote_error' | 'acp_write_failed'; export declare class AcpProtocolError extends Error { readonly code: AcpProtocolErrorCode; readonly exitCode?: number | null; readonly rpcCode?: number; readonly data?: unknown; constructor(code: AcpProtocolErrorCode, message: string, options?: { cause?: unknown; exitCode?: number | null; rpcCode?: number; data?: unknown; }); } export interface JsonRpcPeerOptions { requestTimeoutMs?: number; maxLineBytes?: number; maxMessageBytes?: number; skipOversizedLines?: boolean; onOversizedLine?: (bytes: number) => void; onNotification?: (method: string, params: unknown) => void | Promise; onRequest?: (method: string, params: unknown) => unknown | Promise; onStderr?: (line: string) => void; } export interface JsonRpcRequestOptions { timeoutMs?: number; signal?: AbortSignal; } export declare class JsonRpcPeer { #private; constructor(child: ChildProcessWithoutNullStreams, options?: JsonRpcPeerOptions); get process(): ChildProcessWithoutNullStreams; request(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise; notify(method: string, params?: unknown): void; close(): void; }