feat(baoyu-danger-gemini-web): WSL auto-detection and debug port env var

Add GEMINI_WEB_DEBUG_PORT env var for fixed port in WSL.
Auto-detect WSL and resolve Chrome profile to Windows-native path.
This commit is contained in:
Jim Liu 宝玉
2026-03-02 12:07:12 -06:00
parent a501202ab6
commit e3f00c103e
2 changed files with 16 additions and 0 deletions
@@ -91,6 +91,8 @@ class CdpConnection {
}
async function get_free_port(): Promise<number> {
const fixed = parseInt(process.env.GEMINI_WEB_DEBUG_PORT || '', 10);
if (fixed > 0) return fixed;
return await new Promise((resolve, reject) => {
const srv = net.createServer();
srv.unref();