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
Fix issue 50 and issue 51: viewport screenshots now reflect the page's live scroll position (puppeteer's captureBeyondViewport default was rendering from the document origin), and the boot-time AUMID prune waits until at least one identity stamp has landed after a respawn so reloaded sessions' live thread keys are never wiped as orphans.
4 files changed
+20−9
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.185",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.185/adom-bridge-puppeteer-v2.0.185.zip",- "sha256": "147237518c5fc46949b84a679b020be56f75ff6190f86d24001bfd7273d415e5",- "size": 922111,+ "version": "2.0.186",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.186/adom-bridge-puppeteer-v2.0.186.zip",+ "sha256": "277a89092561a353eff3687b323f010e63cde2e6951d53533179de67ac164cb9",+ "size": 922591, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.185+2.0.186
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.185",+ "version": "2.0.186", "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+14−3@@ -3925,6 +3925,7 @@ async function ensurePupIdentityRegistered() { // recreate #2). Remember pre-registration stamps here; launchSession copies them onto the session // at registration so the idempotence gate makes the second stamp a true no-op. const _earlyStamped = new Map(); // sessionId -> appId stamped before session registration+let _stampLandedThisBoot = false; // v2.0.186 (#51): gates the AUMID prune until re-stamps land after a respawn async function stampPupIdentity(sessionId, opts) { // v1.9.271: the dashboard must never gang onto the shared button. v1.9.272 (John: "if we're in // aumid mode then the pup dashboard should be in that mode too. right now you're being@@ -4163,6 +4164,7 @@ async function stampPupIdentity(sessionId, opts) { console.log(`[identity] "${sessionId}" stamped appId=${appId}: ${(data.applied || []).join(',') || 'ok'}`); if (!sess) _earlyStamped.set(sessionId, appId); // v2.0.25: pre-registration stamp — see above if (sess && prevAppId !== appId) {+ _stampLandedThisBoot = true; sess._curAppId = appId; // v2.0.168: timestamp a landed THREAD stamp — the overlay paint waits a settle beat after // this so the shell finishes moving the window onto the thread button before any@@ -4496,6 +4498,11 @@ async function renderThreadTileIco(page, name) { // <sid> is not a live session. Never touch the pinnable base id. function pruneStaleAumids() { if (process.platform !== 'win32') return;+ // v2.0.186 (#51): after a respawn, RELOADED sessions carry _curAppId=null until their first stamp+ // lands, so every live thread key looked orphaned and the boot prune wiped them (measured during+ // the 2.0.182 ladder proof). Until at least one stamp has landed this boot, keys on disk are+ // presumed live; pruning waits. An empty session map (nothing reloaded) still prunes as before.+ if (sessions.size && !_stampLandedThisBoot) { console.log('[identity] AUMID prune skipped — no stamp has landed since boot (reloaded sessions not yet re-branded)'); return; } // v2.0.161 — rewritten to key off the LIVE appIds directly, across EVERY AUMID shape // (per-session Adom.Pup.<sid>.<cat>.<gen>, category-group Adom.Pup.<cat>.<gen>, dashboard // Adom.Pup.Dashboard.<gen>, and THREAD TILES Adom.Pup.thread.<slug>.<gen>). The old code derived@@ -15063,7 +15070,11 @@ const server = http.createServer(async (req, res) => { const maxWidth = args.maxWidth || MAX_SCREENSHOT_DIM; const ts = Date.now(); let screenshotBuf = await withTimeout(- raceCrash(tab, resolvedId, tab.page.screenshot({ type: 'png', fullPage })),+ // v2.0.186 (#50): captureBeyondViewport defaults TRUE in current puppeteer, which renders+ // from the document ORIGIN — so a viewport screenshot ignored the page's live scroll+ // position (scroll via pup_eval, screenshot still showed the top). Viewport shots now+ // capture the compositor's real viewport; fullPage keeps beyond-viewport ON (it needs it).+ raceCrash(tab, resolvedId, tab.page.screenshot({ type: 'png', fullPage, captureBeyondViewport: fullPage })), 20_000, 'page.screenshot' ); // v1.8.21: fullPage only covers DOCUMENT-level scroll. On SPAs that scroll inside@@ -15282,7 +15293,7 @@ const server = http.createServer(async (req, res) => { const fullPage = args.fullPage || false; const ts = Date.now(); const screenshotBuf = await withTimeout(- tab.page.screenshot({ type: 'png', fullPage }),+ tab.page.screenshot({ type: 'png', fullPage, captureBeyondViewport: fullPage }), 20_000, 'page.screenshot' ); // Probe dimensions for the warning payload — cheap. No resize, no@@ -17306,7 +17317,7 @@ const server = http.createServer(async (req, res) => { const session = (() => { const s = getActiveSession(); if (!s) throw new Error('No session. Use /launch first.'); return s; })(); const ts = Date.now(); const fp = url.searchParams.get('fullPage') === 'true';- let shotBuf = await session.page.screenshot({ type: 'png', fullPage: fp });+ let shotBuf = await session.page.screenshot({ type: 'png', fullPage: fp, captureBeyondViewport: fp }); // Downscale when sharp is available; else serve at capture size (sharp optional). const shot = await processScreenshot(shotBuf, MAX_SCREENSHOT_DIM); shotBuf = shot.buf;