import { Hono } from 'hono'; import { type BridgeSecurityOptions } from './middleware/security.js'; import { type BridgeAuthService } from './services/setup-agents-auth.js'; export type BridgeServerOptions = { auth?: BridgeAuthService; cwd: string; port: number; hostname?: string; staticDir?: string; security?: BridgeSecurityOptions; }; export declare function createBridgeApp(cwd: string, securityOptions?: BridgeSecurityOptions, auth?: BridgeAuthService): Hono; /** Outcome of starting (or reusing) the bridge under the singleton-by-reuse policy. */ export type BridgeServerHandle = { /** Tear down the local server and remove its pidfile. No-op when the server was reused. */ close: () => void; /** Port the bridge is reachable on. */ port: number; /** Whether we started/replaced a local server (`started`) or reused an existing one (`reused`). */ mode: 'started' | 'reused'; }; /** * Start the bridge under the singleton-by-reuse policy. * * Probes the requested port for an existing bridge: * - same version → reuse (no new process; returns `mode: 'reused'`). * - other version → replace the old instance, then bind on the same port. * - nothing there → bind on the exact requested port (no silent port-walk). * * If the port is held by a non-bridge process, `serve()`'s EADDRINUSE handler * fails with a clear message asking for a different `--port`. */ export declare function startBridgeServer(opts: BridgeServerOptions): Promise;