import { type IpcRequest, type IpcResponse } from "./ipc.js"; /** How this copy of beagle got onto disk — decides what "update" can do. * npx cache paths contain _npx AND node_modules, so test _npx first. */ export declare function installMode(): "global" | "npx" | "dev" | "unknown"; export interface BeagleServerOptions { /** Call the running daemon over IPC (injected so this module stays * decoupled from the CLI's ipc client). */ call: (req: IpcRequest) => Promise; /** Path to ~/.agentnet/routes.yaml — the exit-routing table the UI edits. */ routesPath: string; /** If this node also runs a dora server, the path to its roster.yaml — the * UI shows the allocation table (userid → IP → name). Undefined = no dora. */ doraRosterPath?: string; /** Version/wire strings for the desktop "my node" panel — the daemon's diag * doesn't carry them, so the CLI reads them off the installed packages and * passes them in. */ meExtra?: { lanVer?: string; peerVer?: string; webrtcVer?: string; wire?: string; channel?: string; }; /** Directory where the daemon saves received files (/downloads). * Used to serve GET /api/file-download. Undefined disables downloads. */ downloadsDir?: string; /** The swappable backend, so the UI can show which one is live and drive the * LAN handoff. Optional: a caller that pins one backend just omits it and * the network panel falls back to "no virtual LAN here". */ lanHost?: { readonly kind: string; readonly hasVirtualLan: boolean; readonly state: string; readonly releaseSecondsLeft: number; /** The daemon's socket/pidfile dir, so "Update lan" can wait for a new pid. */ readonly dataDir?: string; armForDaemon: () => Promise<{ state: string; command: string; }>; cancelArm: () => Promise; }; /** Called instead of process.exit(0) on /api/update-restart, so the * process that owns the peer can shut it down and relaunch itself when * no supervisor will (see relaunch.ts). */ onRestart?: () => void | Promise; listenHost?: string; listenPort?: number; log?: (msg: string) => void; /** Carrier identity keyfile + bootstrap fleet — used to mint TURN creds for * browser WebRTC so online calls use the same relays as Android * CarrierExtension.getTurnServerInfo(). */ callIce?: { keyFile: string; bootstrapNodes: Array<{ host: string; port: number; pk: string; }>; }; /** Bridge whose roster the "Here" tab shows. The desktop does not route * traffic through it — it only completes the handshake to prove its key * and read who else is there. */ bridgeWs?: string; } export declare function startBeagleServer(opts: BeagleServerOptions): { stop: () => void; };