export type AcpRecord = Record; export declare function asRecord(value: unknown): AcpRecord | undefined; export declare function deferred(): { promise: Promise; resolve: (value: T) => void; reject: (reason: unknown) => void; }; export declare class AcpRpcError extends Error { readonly code: number; readonly data?: unknown | undefined; constructor(code: number, message: string, data?: unknown | undefined); } export interface AcpClientOptions { command: string; args: ReadonlyArray; cwd: string; env?: NodeJS.ProcessEnv; label: string; notFoundMessage: string; onNotification: (method: string, params: AcpRecord) => void; onRequest?: (method: string, params: AcpRecord) => Promise | AcpRecord; onNonJsonLine?: (line: string) => Error | undefined; onStderrLine?: (line: string) => Error | undefined; onFailure?: (error: Error) => void; } /** Bidirectional JSON-RPC 2.0 NDJSON transport over stdio for ACP-compatible agents. */ export declare class AcpJsonRpcClient { private readonly child; private readonly pending; private readonly closed; private readonly label; private onNotification?; private onRequest?; private readonly onNonJsonLine?; private onFailure?; private failure; private closing; private exitTimer?; private closingProcess?; private stdoutBuffer; private stderrLineBuffer; private stderrTail; private nextId; constructor(options: AcpClientOptions); request(method: string, params: AcpRecord, signal?: AbortSignal, timeoutMs?: number | null): Promise; isAlive(): boolean; setHandlers(handlers: { onNotification?: (method: string, params: AcpRecord) => void; onRequest?: (method: string, params: AcpRecord) => Promise | AcpRecord; onFailure?: (error: Error) => void; }): void; notify(method: string, params?: AcpRecord): void; private fail; private send; private receive; private handleIncomingRequest; close(force?: boolean): Promise; }