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
PERMANENT fix for title-based window lookup (John: stop duct-taping it): add windowTarget() helper that returns the validated HWND, and route every AD window OPERATION (park z-bottom, taskbar overlay/progress/badge, thumbnail, screenshot, focus) through it so hwnd is primary everywhere; titleContains survives only as a cold fallback. Also delete the destructive width-wiggle
4 files changed
+34−18
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.308",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.308/adom-bridge-puppeteer-v1.9.308.zip",- "sha256": "43c6bf1c78732a40140b035cb28e7c66e1e29e4e43d79087c78bd08559ab1f90",- "size": 727455,+ "version": "1.9.309",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.309/adom-bridge-puppeteer-v1.9.309.zip",+ "sha256": "ce1111f7883b300f168ad67a2c97e103e3a9041d842b055327d2b445a4edc78f",+ "size": 727873, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.308+1.9.309
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.308",+ "version": "1.9.309", "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. 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, browser_alert_window posts a native toast whose click focuses the window, browser_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-desktop", "author": "Adom Inc.",
src/server.js+28−12@@ -3572,7 +3572,7 @@ async function setSessionProgress(sessionId, busy) { if (process.platform !== 'win32') return; try { await chrome.adCommand('desktop_taskbar', {- titleContains: `(${TITLE_LABEL}: ${sessionId}`,+ ...(await windowTarget(sessions.get(sessionId), sessionId)), progress: busy ? { state: 'indeterminate' } : { state: 'none' }, }, { timeoutMs: 4000 }); } catch (e) {}@@ -3731,7 +3731,7 @@ async function updateThumbnailTooltip(session, sessionId) { if (session._thumbTip === tip) return; // idempotent: only push real changes try { const r = await chrome.adCommand('desktop_taskbar', {- titleContains: `(${TITLE_LABEL}: ${sessionId}`, thumbnailTooltip: tip,+ ...(await windowTarget(sessions.get(sessionId), sessionId)), thumbnailTooltip: tip, }, { timeoutMs: 5000, caller: sessionCaller(session) }); const raw = r && (typeof r.output === 'string' ? r.output : JSON.stringify(r.output || '')); if (_isUnknownVerb(r, raw) || /unknown (arg|field)|unexpected (arg|field)/i.test(raw || '')) {@@ -3794,8 +3794,8 @@ async function updateTabCountBadge(session, sessionId) { else if (totalTabs >= 2) icon = tabBadgeIcon(totalTabs); // single window: plain tab count for (const [sid2] of sessions) { const args2 = icon- ? { titleContains: `(${TITLE_LABEL}: ${sid2}`, overlay: { icon, tooltip: `Adom Pup — ${wins} window${wins === 1 ? '' : 's'}, ${totalTabs} tab${totalTabs === 1 ? '' : 's'}` } }- : { titleContains: `(${TITLE_LABEL}: ${sid2}`, overlay: { badge: 'none' } };+ ? { ...(await windowTarget(sessions.get(sid2), sid2)), overlay: { icon, tooltip: `Adom Pup — ${wins} window${wins === 1 ? '' : 's'}, ${totalTabs} tab${totalTabs === 1 ? '' : 's'}` } }+ : { ...(await windowTarget(sessions.get(sid2), sid2)), overlay: { badge: 'none' } }; try { await chrome.adCommand('desktop_taskbar', args2, { timeoutMs: 5000 }); } catch (e) {} } return;@@ -3813,12 +3813,12 @@ async function updateTabCountBadge(session, sessionId) { if (!icon) return; session._overlayDesc = `count:${count} (no favicon on the active tab, so the tab-count badge)`; await chrome.adCommand('desktop_taskbar', {- titleContains: `(${TITLE_LABEL}: ${sessionId}`,+ ...(await windowTarget(sessions.get(sessionId), sessionId)), overlay: { icon, tooltip: `Adom Pup — ${count} tabs` }, }, { timeoutMs: 5000 }); } else { await chrome.adCommand('desktop_taskbar', {- titleContains: `(${TITLE_LABEL}: ${sessionId}`,+ ...(await windowTarget(sessions.get(sessionId), sessionId)), overlay: { badge: 'none' }, }, { timeoutMs: 5000 }); }@@ -4950,6 +4950,22 @@ async function enumChromeWidgetWindows() { return rows; } catch (e) { return []; } }+// v1.9.309 (John: "how many times did you say you couldn't look up a window by title... you keep+// duct-taping it instead of a permanent solution"). He counted right — 23 call sites resolved a+// window by its "(ai-thread: X)" TITLE, and that same unreliable lookup independently broke the+// overlay, the park, the flash, and the AUMID stamp. THE PERMANENT FIX: one way to name a session's+// OS window for every AD window verb — its HANDLE. windowTarget() resolves + validates the hwnd+// (read-only; it never resizes anything) and returns { hwnd }. Every operation spreads this, so hwnd+// is primary everywhere; titleContains remains ONLY as a last-ditch fallback for a window we somehow+// never got a handle for. As birth-time capture + persistence cover every window, the fallback goes+// cold and title stops mattering for targeting at all.+async function windowTarget(session, sessionId) {+ try {+ if (session && !session._hwnd) { await resolveSessionHwndByBounds(session, sessionId); }+ if (session && session._hwnd && await hwndBelongsToPup(session._hwnd, session)) return { hwnd: Number(session._hwnd) };+ } catch (e) {}+ return { titleContains: `(${TITLE_LABEL}: ${sessionId}` };+} async function resolveSessionHwndByBounds(session, sessionId) { if (process.platform !== 'win32' || !session) return null; let _releaseWiggle = null; // v1.9.291: hoisted so the outer catch can always release the lock@@ -5675,7 +5691,7 @@ async function badgePupTaskbar(sessionId) { // silently never appeared and every later attempt was debounced away. try { const r = await chrome.adCommand('desktop_taskbar', {- titleContains: `(${TITLE_LABEL}: ${sessionId}`,+ ...(await windowTarget(sessions.get(sessionId), sessionId)), overlay: { icon, tooltip: 'Adom pup — driven from the cloud' }, }, { timeoutMs: 6000 }); const raw = r && (typeof r.output === 'string' ? r.output : JSON.stringify(r.output || r));@@ -6318,7 +6334,7 @@ async function parkSessionWindowDirect(page, sessionId) { // At launch, foreground is NOT a user signal (post-restart reassignment), so pup always // forces. On AD 1.9.114 the arg is ignored (skip-on-foreground) and the wasForeground // fallback below covers it; that fallback auto-obsoletes as desktops update.- const r = await chrome.adCommand('desktop_set_window_state', { titleContains: `(${TITLE_LABEL}: ${sessionId}`, state: 'bottom', force: true }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))});+ const r = await chrome.adCommand('desktop_set_window_state', { ...(await windowTarget(sessions.get(sessionId), sessionId)), state: 'bottom', force: true }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))}); if (r && r.success === false) return { ok: false, err: r.error || 'error' }; const raw = r && (typeof r.output === 'string' ? r.output : JSON.stringify(r.output || '')); const o = raw ? JSON.parse(raw) : {};@@ -6438,7 +6454,7 @@ async function reassertBottomAfterNav(sessionId) { } } catch (e) {} try {- await chrome.adCommand('desktop_set_window_state', { titleContains: `(${TITLE_LABEL}: ${sessionId}`, state: 'bottom', force: false }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))});+ await chrome.adCommand('desktop_set_window_state', { ...(await windowTarget(sessions.get(sessionId), sessionId)), state: 'bottom', force: false }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))}); } catch (e) {} } @@ -10196,7 +10212,7 @@ const server = http.createServer(async (req, res) => { // force:false touches nothing but z, and respects a user-held window. if (!foreground && sized) { try {- await chrome.adCommand('desktop_set_window_state', { titleContains: `(${TITLE_LABEL}: ${sessionId}`, state: 'bottom', force: false }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))});+ await chrome.adCommand('desktop_set_window_state', { ...(await windowTarget(sessions.get(sessionId), sessionId)), state: 'bottom', force: false }, { timeoutMs: 5000 , caller: sessionCaller(sessions.get(sessionId))}); } catch (e) {} } // v1.8.26: record whether this window is meant to be on screen — gates every@@ -11055,7 +11071,7 @@ const server = http.createServer(async (req, res) => { id: toastId, level: 'info', scenario: 'reminder', title: 'A pup window wants your attention', body: `Session "${sid}" has something to show — click to bring it up.`,- focus: { titleContains: `(${TITLE_LABEL}: ${sid}` },+ focus: { ...(await windowTarget(sessions.get(sid), sid)) }, }, { timeoutMs: 6000 }); applied = !!(r2 && r2.success !== false); } catch (e) {}@@ -11798,7 +11814,7 @@ const server = http.createServer(async (req, res) => { return; } await pupCaption(`Adom is clicking ${_label} now.`, 5000);- const shot = adPayload(await chrome.adCommand('desktop_screenshot_window', { titleContains: `(${TITLE_LABEL}: ${resolvedId}` }, { timeoutMs: 8000, caller: sessionCaller(session) }));+ const shot = adPayload(await chrome.adCommand('desktop_screenshot_window', { ...(await windowTarget(sessions.get(resolvedId), resolvedId)) }, { timeoutMs: 8000, caller: sessionCaller(session) })); const shotId = shot && (shot.shotId || (shot.screenshots && shot.screenshots[0] && shot.screenshots[0].shotId)); if (!shotId) { sendJSON(res, { success: false, error: 'could not capture the window to aim the click' }); return; } const X = Math.round(Number(args.x)), Y = Math.round(Number(args.y));