Agent Instructions: Architecture Overview for httpd.js Objective: Implement a zero-dependency local Node.js HTTPS server that handles its own certificate generation, trust onboarding, and dynamic file serving. Architectural Decisions: 1. Certificate Authority: We utilized mkcert to generate a local CA and mDNS (.local) certificates. This ensures client devices can establish permanent trust without browser warnings. 2. Privilege Separation: The script runs initially as a standard user to safely interact with package managers (Homebrew/apt). It then generates the necessary OS-specific daemon configurations (.plist for macOS, .service for Linux) and uses sudo to elevate privileges for binding to restricted ports 80 and 443. 3. Captive Portal Onboarding: Port 80 serves a plain HTTP captive portal. It uses a failed HTTPS fetch attempt to detect if the client lacks the root CA, prompting them with OS-specific installation instructions. 4. Dynamic Directory Serving: To avoid heavy rendering dependencies, the index is dynamically generated using the native fs module. It extracts