app
Pup - the AI's own browser
Public Made by Adomby adom
pup gives your AI a real browser on your desktop that it drives completely, in the background, signed in as you: windows that never jump in front of your work, one shared profile that learns your logins, and every window labeled on the taskbar with its AI thread's name.
← Commit history
1.8.60: launch park bottoms unconditionally, no user-click escape hatch; foreground-at-park is not a user signal (OS foreground reassignment after window destruction)
4 files changed
+25−23
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.8.59",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.59/adom-bridge-puppeteer-v1.8.59.zip",- "sha256": "3553a6acad7ecdc5558ecc678e998a6d3076dda19dff7b4338b7b64965af3718",- "size": 170911,+ "version": "1.8.60",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.60/adom-bridge-puppeteer-v1.8.60.zip",+ "sha256": "be04223c0af71985dccf7d2d9cc2ee2a7e279d41f2a6446f69204750b00414db",+ "size": 171087, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.8.59+1.8.60
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.8.59",+ "version": "1.8.60", "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. browser_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. browser_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job.", "homepage": "https://wiki.adom.inc/adom/adom-desktop", "author": "Adom Inc.",
src/server.js+19−17@@ -1948,7 +1948,7 @@ function osMinimizeToBackground(pid, cdpPort, respectUser) { // no direct API (CDP has no z-order; AD has no send-to-back verb yet — issue filed). Minimal // PS: one P/Invoke signature, no window-finding, no pid guessing, hwnd comes from AD's native // desktop_find_window. Everything else in the park is CDP/AD direct.-function osBottomUnlessForeground(hwnd) {+function osBottomUnlessForeground(hwnd, force) { if (process.platform !== 'win32' || !hwnd) return 'error'; try { const scriptPath = path.join(require('os').tmpdir(), `_adom_zbot_${hwnd}.ps1`);@@ -1965,7 +1965,8 @@ function osBottomUnlessForeground(hwnd) { // false-fired 'user-foreground' on every open in the first 1.8.53 build.) With // --no-startup-window, OS-foreground == the user clicked; then do NOT bottom it. `$h = [IntPtr]${Number(hwnd)}`,- 'if ([ZBot]::GetForegroundWindow() -eq $h) { Write-Output "foreground"; exit }',+ `$force = ${force ? 1 : 0}`,+ 'if ($force -eq 0 -and [ZBot]::GetForegroundWindow() -eq $h) { Write-Output "foreground"; exit }', '[ZBot]::SetWindowPos($h, [IntPtr]1, 0, 0, 0, 0, 0x13) | Out-Null', // HWND_BOTTOM; SWP_NOSIZE|NOMOVE|NOACTIVATE 'Write-Output "bottomed"', ].join('\r\n');@@ -2006,13 +2007,20 @@ async function parkSessionWindowDirect(page, sessionId) { await cdp.send('Browser.setWindowBounds', { windowId, bounds: { windowState: 'maximized' } }); }; // hwnd via AD (native) — the title suffix "(session: <id>" is set by the welcome page.- // Z-bottom while still off-screen — UNLESS the OS says the user has it foreground- // (GetForegroundWindow, the only honest signal; document.hasFocus() lies for CDP windows).- // v1.8.59 HARD RULE: the window is NEVER moved on-screen until z-bottom is CONFIRMED- // ('bottomed'). Under parallel-open load the hwnd lookup can lag; the old code fell- // through and placed an UN-BOTTOMED window on-screen — which lands on TOP of the user's- // work (the nxp.com pop). Better to stay invisible off-screen ('park-failed', self-heal- // retries on the next touchpoint) than to cover the user's screen.+ // v1.8.59 HARD RULES, learned the expensive way:+ // 1. The window is NEVER moved on-screen until z-bottom is CONFIRMED ('bottomed'). A+ // lagged hwnd lookup once fell through and placed an un-bottomed window ON TOP of the+ // user's work (the nxp.com pop). Invisible off-screen ('park-failed' + self-heal)+ // beats covering the user's screen.+ // 2. The launch park bottoms UNCONDITIONALLY (force=true) — there is NO user-click escape+ // hatch here. "Pup window is foreground at park time" has too many non-user causes:+ // Windows re-assigns the foreground to a brand-new window when the previous foreground+ // window was just destroyed (e.g. a bridge-update restart killing pup windows — that+ // forced another thread's fresh window onto John's screen), plus creation blips. The+ // false-positive cost is a forced window on the user's screen (the #1 forbidden+ // behavior); the false-negative cost is a user who clicked during the ~2s launch gap+ // clicking ONCE more after the park — after which the window stays, since nothing+ // ever re-parks. Cheap. Do NOT reintroduce a foreground check here. let hwnd = null, z = 'error'; for (let attempt = 0; attempt < 8; attempt++) { if (!hwnd) {@@ -2023,18 +2031,12 @@ async function parkSessionWindowDirect(page, sessionId) { } catch (e) {} } if (hwnd) {- z = osBottomUnlessForeground(hwnd);- if (z === 'bottomed' || z === 'foreground') break;+ z = osBottomUnlessForeground(hwnd, true); // force — always bottom at launch+ if (z === 'bottomed') break; hwnd = null; // stale hwnd (window recreated?) — re-resolve } await new Promise(r2 => setTimeout(r2, 300)); }- if (z === 'foreground') {- // User clicked during the launch gap — give them the window on-screen, foregrounded.- await placeOnScreen();- if (hwnd) { try { await chrome.adCommand('desktop_bring_to_front', { hwnd }, { timeoutMs: 3000 }); } catch (e) {} }- return 'user-foreground';- } if (z !== 'bottomed') { console.log(`[park] "${sessionId}": z-bottom NOT confirmed (${z}) — leaving off-screen (no pop), self-heal will retry`); return 'park-failed';