/**
 * web-ipc-server.ts
 *
 * Unix-socket IPC server embedded in the gateway daemon.
 * Allows the web chat API to route conversations through the same
 * GatewayConversationWorker pool as Telegram and Discord — the web
 * becomes a first-class gateway channel.
 *
 * Socket path: <agentDir>/gateway-web.sock
 *
 * Protocol (newline-delimited JSON, one connection per request):
 *   Client → Server: {"type":"chat","conversationId":"web_xxx","text":"Hello","userId":"web-user"}
 *   Client → Server: {"type":"abort","conversationId":"web_xxx"}
 *   Client → Server: {"type":"ping"}
 *   Server → Client: {"type":"pong"}
 *   Server → Client: {"type":"typing","active":true}
 *   Server → Client: {"type":"delta","text":"Hi"}
 *   Server → Client: {"type":"done","text":"full response"}
 *   Server → Client: {"type":"error","message":"..."}
 */
import type { GatewayConversationEndpoint } from "./adapters.ts";
import type { ResolvedConversation } from "./chat/types.ts";
export declare const WEB_IPC_SOCKET_NAME = "gateway-web.sock";
export declare function getWebIpcSocketPath(agentDir: string): string;
export declare function buildWebConversation(agentDir: string, conversationId: string): ResolvedConversation;
export interface WebIPCLogger {
    info(msg: string): void;
    warn(msg: string): void;
    error(msg: string): void;
}
/**
 * Factory provided by runner.ts to create per-conversation workers without
 * introducing a circular dependency (web-ipc-server ↔ runner).
 */
export type WebWorkerFactory = (conversationId: string) => Promise<GatewayConversationEndpoint & {
    disconnect(): Promise<void>;
}>;
export interface WebIPCServerOptions {
    agentDir: string;
    logger: WebIPCLogger;
    createWorker: WebWorkerFactory;
}
export declare class WebIPCServer {
    private readonly opts;
    private server;
    private workers;
    private abortControllers;
    constructor(opts: WebIPCServerOptions);
    start(): Promise<void>;
    private handleMessage;
    private getOrCreateWorker;
    stop(): Promise<void>;
}
//# sourceMappingURL=web-ipc-server.d.ts.map