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
Self-heal bare BACKGROUND pup windows that have no birth handle (opened before the 2.0.31 fix, or re-attached by recovery/drag-out) on a crowded shared profile where geometry cannot disambiguate: as a last resort the resolver briefly moves the window's own CDP target to a unique far-off-screen slot, enumerates to grab the window now at that exact coordinate (unambiguous identity by construction), then restores it on-screen at z-bottom and re-parks. Invisible because the window is already background z-bottom, and never done to a window the user is using. Gives an on-screen window the same reliable handle a birth-time window gets, so its AUMID and overlay finally paint
4 files changed
+48−6
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.31",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.31/adom-bridge-puppeteer-v2.0.31.zip",- "sha256": "f53fcfb35402639a3b62d2500d361ed68e2d7e8511bb1d731a254ae1e982153e",- "size": 641393,+ "version": "2.0.32",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.32/adom-bridge-puppeteer-v2.0.32.zip",+ "sha256": "40ecd8a711b0d79327b2dddbb273e720acfa75b9be1b3e45c37b35db38f4f6ca",+ "size": 642190, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.31+2.0.32
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.31",+ "version": "2.0.32", "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. pup_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. pup_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. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, pup_alert_window posts a native toast whose click focuses the window, pup_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.", "homepage": "https://wiki.adom.inc/adom/adom-bridge", "author": "Adom Inc.",
src/server.js+42@@ -5551,6 +5551,48 @@ async function resolveSessionHwndByBounds(session, sessionId) { console.log(`[hwnd] "${sessionId}" resolved OS handle ${resolved} — ${how}`); return resolved; }+ // v2.0.32: LAST-RESORT RE-CAPTURE for a bare BACKGROUND window (a window opened before the birth+ // fix, or re-attached by recovery/drag-out, so it has no __pupHwnd, on a crowded shared profile+ // where geometry cannot disambiguate — the raw-Chrome-icon case). Move THIS window's CDP target+ // to a UNIQUE far-off-screen slot, enumerate, grab the window now at that exact coordinate (its+ // identity by construction), then move it straight back on-screen at z-bottom. INVISIBLE because+ // the window is already background/z-bottom; NEVER done to a window the user is using. This gives+ // an on-screen window the same unambiguous handle a birth-time window gets.+ if (!userIsUsingWindow(session)) {+ try {+ const tab0 = (session.tabs || [])[0];+ const pg = tab0 && tab0.page;+ if (pg) {+ const cdp2 = await pg.target().createCDPSession();+ try {+ const { windowId } = await cdp2.send('Browser.getWindowForTarget');+ const gb = await cdp2.send('Browser.getWindowBounds', { windowId });+ const orig = gb && gb.bounds;+ const probeLeft = -33000 - (Math.floor(Date.now() / 7) % 500); // unique, pup-exclusive zone+ await cdp2.send('Browser.setWindowBounds', { windowId, bounds: { left: probeLeft, top: -33000, width: 900, height: 700 } });+ let got = null;+ for (let i = 0; i < 8 && !got; i++) {+ const rr = await enumChromeWidgetWindows();+ const m = rr.find(r => Math.abs(r.T - Math.round(-33000)) <= 300 && [1, 1.25, 1.5, 1.75, 2, 0.8].some(sc => Math.abs(r.L - Math.round(probeLeft * sc)) <= 80));+ if (m) got = m.h; else await new Promise(r => setTimeout(r, 120));+ }+ // restore on-screen (z-bottom park handles final placement); use original size if we had it+ try { await cdp2.send('Browser.setWindowBounds', { windowId, bounds: orig && Number.isFinite(orig.width) ? { left: 0, top: 0, width: orig.width, height: orig.height } : { windowState: 'normal', left: 40, top: 40, width: 1200, height: 800 } }); } catch (e) {}+ if (got) {+ try { if (pg) pg.__pupHwnd = got; } catch (e) {}+ session._hwnd = got; persistSessionHwnd(sessionId, got);+ session._hwndFailStreak = 0; session._hwndBackoffUntil = 0;+ if (_releaseWiggle) { try { _releaseWiggle(); } catch (e) {} }+ try { if (cdp) await cdp.detach(); } catch (e) {}+ try { await cdp2.detach(); } catch (e) {}+ console.log(`[hwnd] "${sessionId}" resolved OS handle ${got} — off-screen RE-CAPTURE (background bare window, no birth handle)`);+ if (!userIsUsingWindow(session)) parkSessionWindowDirect(pg, sessionId).catch(() => {});+ return got;+ }+ } finally { try { await cdp2.detach(); } catch (e) {} }+ }+ } catch (e) { console.log(`[hwnd] "${sessionId}" re-capture probe failed: ${e.message}`); }+ } // Multiple windows on the profile and no unique wiggle match → we cannot know which is ours, so // leave it BARE rather than paint a guessed/shared handle (John's rule: bare > wrong). This is the // case the birth-time resolution (todo #5) will finally fix for multi-window profiles.