/** * opencli micro-daemon — HTTP + WebSocket bridge between CLI and Chrome Extension. * * Architecture: * CLI → HTTP POST /command → daemon → WebSocket → Extension * Extension → WebSocket result → daemon → HTTP response → CLI * * Security (defense-in-depth against browser-based CSRF): * 1. Origin check — reject HTTP/WS from non chrome-extension:// origins * 2. Custom header — require X-OpenCLI header (browsers can't send it * without CORS preflight, which we deny) * 3. No CORS headers on command endpoints — only /ping is readable from the * Browser Bridge extension origin so the extension can probe daemon reachability * 4. Body size limit — 1 MB max to prevent OOM * 5. WebSocket verifyClient — reject upgrade before connection is established * * Lifecycle: * - Auto-spawned by opencli on first browser command * - Persistent — stays alive until explicit shutdown, SIGTERM, or uninstall * - Listens on localhost:19825 */ export {};