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 the Bills thread's second-pass findings + the root cause of the input-blocking freeze. ORPHANED CURSOR: pre-1.9.196 pup drew '#__pupCursor' while the HD port draws '#__adom_cursor__', and nothing removed the legacy element — plus the cursor is injected per-DOCUMENT, so interacting with a field inside an iframe (Chase's iframe#logonbox) left that frame's instance stranded forever. showPupCursor now sweeps EVERY frame and removes BOTH ids before drawing. STUCK OCCLUSION (the big one): Chrome's Win32 native occlusion detector can latch a window as occluded and never re-evaluate; that window reports visibilityState hidden while FRONTMOST and Chrome withholds both paint AND input — measured directly, browser_eval DOM writes land while CDP key events vanish, which is why typing silently failed and scrolling did nothing. pup parks windows at z-bottom by design so it hits this constantly. --disable-features=CalculateNativeWinOcclusion is now a DEFAULT launch flag; it disables only the occlusion calculation, so ordinary background throttling (and the issue-#14 battery saving) is untouched. Also: new browser_hover verb (pointer-over without clicking, reveals tooltips), and browser_input_dispatch {type:'move'} now glides the drawn cursor instead of only clicks moving it.
4 files changed
+77−8
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.197",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.197/adom-bridge-puppeteer-v1.9.197.zip",- "sha256": "5694b48f35f04472e2b194eeeb70aed6d0c860197071393740ec703996eca500",- "size": 429878,+ "version": "1.9.198",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.198/adom-bridge-puppeteer-v1.9.198.zip",+ "sha256": "2d894a7dee8ddf3cee2bcd935d94e73a66440e434b5c782a7afd55739e97a61b",+ "size": 431523, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.197+1.9.198
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.197",+ "version": "1.9.198", "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+71−2@@ -1758,8 +1758,31 @@ function pupCursorMarkUri() { return _pupCursorMarkUri; } +async function hidePupCursorEverywhere(page) {+ // v1.9.198 (Bills thread): an ORPHANED cursor sat on the username field forever — old-style art,+ // never moving, while the live cursor moved around it. Two causes, both fixed here:+ // (1) LEGACY ID. Pre-1.9.196 pup drew '#__pupCursor'; the HD port draws '#__adom_cursor__'. The+ // new code never removed the old element, so any page that had ever hosted the old cursor+ // kept it on screen forever.+ // (2) PER-FRAME LEAK. The cursor is injected into whatever DOCUMENT is driven. Interacting with a+ // field inside an iframe (Chase's iframe#logonbox) draws a cursor in THAT frame's document;+ // when focus returns to the top frame nothing ever disposed the iframe's instance.+ // So: sweep EVERY frame and remove BOTH ids before drawing, and on explicit hide.+ const frames = (() => { try { return page.frames(); } catch (e) { return [page]; } })();+ await Promise.all(frames.map(fr => fr.evaluate(() => {+ try {+ ['__adom_cursor__', '__pupCursor', '__adom_cursor_ring__', '__adom_cursor_label__'].forEach(id => {+ const el = document.getElementById(id);+ if (el && el.parentNode) el.parentNode.removeChild(el);+ });+ } catch (e) {}+ }).catch(() => {})));+}+ async function showPupCursor(page, x, y, { click = true, label = null } = {}) { try {+ // Remove any stale instance ANYWHERE (legacy id, or one left in an iframe) before drawing.+ await hidePupCursorEverywhere(page); await page.evaluate((tx, ty, doClick, lbl, markUri) => { var id = '__adom_cursor__'; var c = document.getElementById(id);@@ -3272,7 +3295,7 @@ function clearSessionBusy(sessionId) { // Verbs that are pure status/polling: they do NOT mean an agent is driving the window, and lighting // the bar for them would make every window look permanently busy (the audit loops alone poll these). const PASSIVE_VERBS = new Set([- 'browser_list_windows', 'browser_list_tabs', 'browser_readiness', 'browser_status', 'browser_maximize',+ 'browser_list_windows', 'browser_list_tabs', 'browser_readiness', 'browser_status', 'browser_maximize', 'browser_hover', 'browser_describe', 'browser_configure', 'browser_prewarm', 'browser_rescan', 'browser_wait', ]); @@ -5482,11 +5505,22 @@ async function getOrLaunchBrowser(profileName, { freshProfile = false, strictPer // (wiki issue #14). A NORMAL Chrome window does not do this because it throttles when // occluded — ours structurally could not. Default is now Chrome's own power behaviour; // callers that genuinely need continuous frames ask for highFps and get a LEASE.+ // v1.9.198 — ALWAYS disable Chrome's NATIVE WINDOWS OCCLUSION CALCULATION. This is the single+ // targeted cure for the bug behind John's "can't scroll", "frozen", and the Bills thread's+ // silently-failing typing: Chrome's Win32 occlusion detector can latch a window as OCCLUDED and+ // never re-evaluate it. A window in that state reports visibilityState:'hidden' even while it is+ // FRONTMOST, and Chrome then withholds BOTH paint and INPUT — measured directly: browser_eval+ // DOM writes still land (main thread runs) while CDP key events vanish (compositor wedged). Only+ // a real OS click cleared it, which is why pup windows felt broken in a way no verb could fix.+ // pup windows are parked at z-bottom BY DESIGN, so they hit this detector constantly — far more+ // than a normal Chrome window ever would. This flag disables only the occlusion CALCULATION; the+ // three anti-throttle flags below stay opt-in (highFps), so ordinary background throttling — and+ // the battery saving from issue #14 — is untouched.+ '--disable-features=CalculateNativeWinOcclusion', ...(highFps ? [ '--disable-renderer-backgrounding', '--disable-backgrounding-occluded-windows', '--disable-background-timer-throttling',- '--disable-features=CalculateNativeWinOcclusion', ] : []), ], ignoreDefaultArgs: ['--enable-automation'],@@ -7337,6 +7371,7 @@ const server = http.createServer(async (req, res) => { V('browser_assisted_click', 'RESPECTFUL real-cursor click for a surface pup CDP cannot drive (a NATIVE OS dialog, or a cross-origin FedCM "Sign in with Google" account chooser that rejects every in-page click). Do NOT hand-roll raise+desktop_click for these — use THIS. It: captions the reason + toasts BEFORE touching the screen; foregrounds; then WAITS, detecting if the user alt-tabbed away and holding (captioning "Adom is waiting — click back when ready") until the user is actually on the window; then runs the TIGHT real-cursor hover->click that FedCM accepts (interleaving any screenshot/eval between raise and click makes the click silently no-op); captions each step. Times out as user_not_ready clicking NOTHING if they never return. First take a desktop_screenshot_window of the session to read the target\'s WINDOW-pixel x,y.', { sessionId: 'required str', x: 'required int — WINDOW-image pixel of the target (from desktop_screenshot_window)', y: 'required int', reason: 'required str — WHY you must click (shown to the user as a caption)', label: 'required str — WHAT you are clicking (e.g. "your Google account")', maxWaitMs: 'optional int — how long to wait for the user (default 120000)' }, 130, { sessionId: 'adsk', x: 900, y: 379, reason: 'clicking your Google account to finish signing into Autodesk', label: 'your Google account' }), V('browser_type', 'Type text into a field. Pass clear:true to REPLACE the existing value instead of appending (this is what you want on any prefilled/React form — it selects-all then deletes with real key events, which React-controlled inputs honour, unlike setting .value).', { sessionId: 'required str', text: 'required str', selector: 'optional str', clear: 'optional bool — empty the field first (replace, not append)' }, 20, { sessionId: 'work', selector: '#user', text: 'adominc1', clear: true }), V('browser_press_key', 'Press a key, optionally with modifier chords held (Ctrl+A, Ctrl+V, Shift+Tab).', { sessionId: 'required str', key: 'required str', modifiers: 'optional array — any of ["Control","Shift","Alt","Meta"] (aliases ctrl/cmd/command/option accepted); held down around the key press' }, 15, { sessionId: 'work', key: 'a', modifiers: ['Control'] }),+ V('browser_hover', 'Move the pointer over a target WITHOUT clicking (reveals tooltips / hover menus). Glides the visible Adom cursor there too.', { sessionId: 'required str', selector: 'optional str', x: 'optional int', y: 'optional int', intent: 'optional str — narrated on the cursor label', steps: 'optional int (default 8)' }, 15, { sessionId: 'work', selector: '#menu' }), V('browser_maximize', 'Maximize (or restore/fullscreen/minimize) a pup window via CDP — no AD desktop verb required. Does NOT foreground it.', { sessionId: 'required str', state: 'optional "maximized"|"normal"|"minimized"|"fullscreen" (default maximized)' }, 15, { sessionId: 'work' }), V('browser_screenshot', 'Screenshot the page (PNG; fullPage optional). NOTE: fullPage only covers DOCUMENT-level scroll — on SPAs that scroll inside a nested container it returns just the viewport + a nestedScroll hint; use browser_screenshot_element or browser_scroll for those.', { sessionId: 'required str', fullPage: 'optional bool' }, 30, { sessionId: 'work' }), V('browser_screenshot_element', 'Screenshot ONE element, resolved by CSS selector OR visible text (pierces shadow DOM), scrolled into view first. The clean way to grab a single card/widget on a component-heavy page. Text matches the TIGHTEST text node — to capture the enclosing CARD, add closest (e.g. {text:"Download…", closest:".download-card"}); with closest, an ambiguous phrase still lands on the real widget (skips prose that has no such ancestor). Returns base64 + filePath like browser_screenshot.', { sessionId: 'required str', selector: 'CSS selector (or use text)', text: 'visible text to match (or use selector)', closest: 'optional selector — climb to the nearest ancestor matching it (the card container)', padding: 'optional int px around the element', deep: 'optional bool — pierce shadow DOM (default true)' }, 30, { sessionId: 'work', selector: '.download-card' }),@@ -9082,6 +9117,36 @@ const server = http.createServer(async (req, res) => { // browser_evaluate is the catalog/manifest name; browser_eval the historical one. // Accept both, with either `expr` or `expression`. case 'browser_evaluate':+ case 'browser_hover': {+ // v1.9.198 (Bills thread): browser_hover did not exist — the only way to move the pointer+ // without clicking was browser_input_dispatch {type:'move'}, which is unobvious next to+ // browser_click. Hovering also reveals tooltips/menus that only appear on pointer-over.+ let session, resolvedId;+ try { ({ session, resolvedId } = await recoverOrRelaunchSession(args)); }+ catch (e) { sendSessionResolveError(res, e); return; }+ let tab, tabId;+ try { ({ tab, tabId } = resolveTabOrError(session, resolvedId, args)); }+ catch (e) { sendTabResolveError(res, e); return; }+ try {+ let px = Number(args.x), py = Number(args.y);+ if (args.selector) {+ const box = await tab.page.$eval(args.selector, el => { el.scrollIntoView({ block: 'center' }); const r = el.getBoundingClientRect(); return { x: r.x + r.width / 2, y: r.y + r.height / 2 }; });+ px = box.x; py = box.y;+ }+ if (!Number.isFinite(px) || !Number.isFinite(py)) {+ sendJSON(res, { success: false, errorCode: 'hover_target_missing', error: 'browser_hover needs selector, or x + y.' });+ return;+ }+ const _hIntent = (typeof args.intent === 'string' && args.intent.trim()) ? args.intent.trim() : `Hovering ${args.selector ? `"${args.selector}"` : 'target'}`;+ if (args.showCursor !== false) { try { await showPupCursor(tab.page, px, py, { click: false, label: _hIntent }); } catch (e) {} }+ await withTimeout(tab.page.mouse.move(px, py, { steps: Number(args.steps) || 8 }), 10_000, 'mouse.move');+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: resolvedId, tabId, hovered: args.selector || { x: px, y: py },+ _hint: 'Pointer moved (isTrusted) and the visible Adom cursor glided there. Tooltips/hover menus that need a real pointer-over should now be present — read them with browser_eval.' }) });+ } catch (e) {+ sendJSON(res, { success: false, errorCode: 'hover_failed', error: `browser_hover failed: ${e.message}` });+ }+ return;+ } case 'browser_maximize': { // v1.9.197 GAP 6 (Bills thread): honouring "pup windows must be maximized" required // browser_eval + window.resizeTo(...) because desktop_set_window_state is not in every@@ -9675,6 +9740,10 @@ const server = http.createServer(async (req, res) => { sendJSON(res, { success: false, error: 'browser_input_dispatch move requires {x, y}' }); return; }+ // v1.9.198 (Bills thread): a CDP move returned ok but the DRAWN cursor never budged —+ // only clicks moved it, which undercuts the whole "gliding cursor" idea. Move the+ // visible cursor with the real pointer (no click ripple).+ if (args.showCursor !== false) { try { await showPupCursor(tab.page, Number(args.x), Number(args.y), { click: false, label: args.intent || 'Moving' }); } catch (e) {} } await tab.page.mouse.move(args.x, args.y, { steps: args.steps || 1 }); sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: resolvedId, tabId, dispatched: 'move', x: args.x, y: args.y }) }); return;