import type { AgentSession } from "../../core/runtime/agent-session.js"; export interface RemoteServerOptions { session: AgentSession; /** Pairing token (plaintext; generated per run by remote-mode). */ token: string; /** Listen port. Default 8787. */ port?: number; /** Bind address. Default 0.0.0.0. */ host?: string; /** Invoked when an extension requests process shutdown via the RPC command surface. */ onShutdownRequested?: () => void; } export interface RemoteServerHandle { /** Actual listening port (useful when port 0 was requested). */ port: number; /** Actual bind host. */ host: string; /** Number of connected clients. */ readonly clientCount: number; /** Stop the server and disconnect all clients. Never throws. */ close(): Promise; } /** * Create the remote server: one node:http instance serving * - static mobile web UI (/, /assets/*) from the packaged public dir * - /healthz unauthenticated liveness probe * - /ws token-authenticated WebSocket carrying the RPC protocol * * A single shared RpcCommandHandler fans session events/extension UI out to all * clients; command replies are routed back to the requesting socket only. */ export declare function createRemoteServer(options: RemoteServerOptions): Promise;