/** * Zoe Server — WebSocket Protocol Handlers * * All handler functions, safeSend helper, and active connections registry. * Extracted from websocket.ts for single-responsibility. */ import type { WebSocket, ServerMessage, WebSocketHandlerContext, ConnectionState } from "./ws-types.js"; /** * Get the number of currently active WebSocket connections. */ export declare function getActiveConnectionCount(): number; /** * Get all connected WS clients (excluding the given one). * Used by settings broadcast to notify other connections of changes. */ export declare function getOtherClients(excludeWs?: WebSocket): Array<{ ws: WebSocket; state: ConnectionState; }>; export declare function safeSend(ws: WebSocket, message: ServerMessage): void; export declare function handleConnection(ws: WebSocket, req: import("http").IncomingMessage, ctx: WebSocketHandlerContext): void; /** * Create an `approveTool` callback for the server adapter. * Sends a `tool_approval_request` to the client and waits for a * `tool_approval_response`. Falls back to auto-deny on timeout. */ export declare function createServerApproveTool(ws: WebSocket): import("../../core/types.js").ApproveToolFn; /** * Close all active connections and clear the registry. * Used by closeWebSocket() during shutdown. */ export declare function closeAllConnections(): void;