/**
 * web-ipc-client.ts
 *
 * IPC client used by the web chat API server to route messages through the
 * running gateway daemon.  Falls back gracefully when the gateway is not up.
 *
 * Usage:
 *   const client = new WebIPCClient(agentDir);
 *   const available = await client.probe();   // false → use standalone
 *   if (available) {
 *     const session = await client.createSession(conversationId, onEvent);
 *   }
 */
export type WebIPCEvent = {
    type: "delta";
    text: string;
} | {
    type: "done";
    text?: string;
    sessionId?: string;
} | {
    type: "error";
    message: string;
} | {
    type: "typing";
    active: boolean;
} | {
    type: "pong";
};
export interface WebIPCSessionOptions {
    conversationId: string;
    text: string;
    userId?: string;
    model?: string;
    onEvent: (event: WebIPCEvent) => void;
    signal?: AbortSignal;
}
export declare class WebIPCClient {
    private readonly socketPath;
    constructor(agentDir: string);
    /**
     * Quick non-destructive probe: returns true if the gateway IPC socket is
     * reachable, false otherwise.  Never throws.
     */
    probe(): Promise<boolean>;
    /**
     * Send one chat message, streaming events back via onEvent.
     * Resolves when the server sends "done" or "error".
     * Rejects if the socket disconnects unexpectedly.
     */
    sendMessage(opts: WebIPCSessionOptions): Promise<void>;
}
//# sourceMappingURL=web-ipc-client.d.ts.map