export type ClaudeRecord = Record; export declare function claudeRecord(value: unknown): ClaudeRecord | undefined; export type ClaudeControlRequestHandler = (subtype: string, request: ClaudeRecord) => Promise; export interface ClaudeStreamClientOptions { binaryPath?: string; configDir?: string; args?: string[]; onEvent: (frame: ClaudeRecord) => void; onFailure?: (error: Error) => void; onControlRequest?: ClaudeControlRequestHandler; } /** * Bidirectional NDJSON client for `claude --print --output-format stream-json --input-format stream-json`. * Supports warm multi-turn reuse via `setHandlers()` and `isAlive()`. */ export declare class ClaudeStreamClient { private readonly child; private readonly stdout; private readonly closedPromise; private readonly pending; private readonly stderrLines; private closed; private failure?; private onEvent; private onFailure?; private onControlRequest?; constructor(cwd: string, options: ClaudeStreamClientOptions); isAlive(): boolean; setHandlers(handlers: { onEvent?: (frame: ClaudeRecord) => void; onFailure?: (error: Error) => void; onControlRequest?: ClaudeControlRequestHandler; }): void; private writeFrame; requestControl(subtype: string, payload?: ClaudeRecord, signal?: AbortSignal): Promise; sendUserMessage(content: string | Array, sessionId?: string): void; private handleLine; private handleIncomingControlRequest; private fail; close(force?: boolean): Promise; }