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
Regenerate-overlays button now runs the sweep in the background and answers instantly (dashboard icons update live via SSE); header shows regenerating/last-sweep status; per-window drift report logged
4 files changed
+50−36
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.298",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.298/adom-bridge-puppeteer-v1.9.298.zip",- "sha256": "d3052b81f0da0c1fae5f66d75f7dcd9303a3bcd1c563d78cc09242eb455ed0c6",- "size": 722783,+ "version": "1.9.299",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.299/adom-bridge-puppeteer-v1.9.299.zip",+ "sha256": "531605fa0e602bdebdf9bb535250ddd2a80402d77049b2bd07279ce72f3e7812",+ "size": 723296, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.298+1.9.299
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.298",+ "version": "1.9.299", "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+44−30@@ -312,6 +312,8 @@ const _launchInFlight = new Map(); // a fleet of AI threads opening default windows simultaneously is the 10,000-user case. const _profileOpenChain = new Map(); // profileName -> tail promise let _tabClaimSeq = 0; // monotonic per-call marker for in-window tab adoption (see addTabToSession)+let _regenBusy = false; // a dashboard "regenerate all overlays" sweep is in flight+let _lastRegen = null; // { at, done, swept, painted, changed, results[] } from the last sweep // v1.9.110 (issue #22, AdityaAngajala) — ADMISSION-TIME OWNERSHIP CLAIM. // Two defects he measured: (a) `owner` is optional, so in practice sessions end up unowned and the guard // that protects a busy window is opt-out by omission; (b) ownership was established when the BROWSER was@@ -8698,6 +8700,8 @@ async function dashboardSnapshot() { taskbarButtons: [...buttons.values()], untrackedWindows: untracked, toasts: _dashToasts.filter(t => Date.now() - t.at < 15000),+ regen: _regenBusy ? { running: true, inFlight: (_lastRegen && _lastRegen.inFlight) || 0 }+ : (_lastRegen && _lastRegen.done ? { running: false, at: _lastRegen.at, swept: _lastRegen.swept, painted: _lastRegen.painted, changed: _lastRegen.changed } : null), windows: wins.sort((a, b) => (b.openedAt || 0) - (a.openedAt || 0)), }; }@@ -8912,7 +8916,7 @@ function render(){ if((d.untrackedWindows||[]).length) roll='red'; // an unmodeled real button = the mimic CANNOT claim MATCH _q('#cLedDot').className='led '+roll; _q('#cLedTxt').textContent=(d.untrackedWindows||[]).length?((d.untrackedWindows||[]).length+' UNTRACKED'):roll==='green'?'MATCH':roll==='amber'?'generic':'MISMATCH';- _q('#age').textContent='updated '+new Date(d.ts).toLocaleTimeString();+ _q('#age').textContent='updated '+new Date(d.ts).toLocaleTimeString()+(d.regen?(d.regen.running?' · regenerating '+d.regen.inFlight+' windows…':(d.regen.changed!=null?' · last sweep: '+d.regen.changed+'/'+d.regen.swept+' corrected':'')):''); const sel=_q('#f'),cur=sel.value; if(sel.options.length-1!==d.threads.length){sel.innerHTML='<option value="">all AI threads</option>'+d.threads.map(t=>'<option>'+esc(t)+'</option>').join('');sel.value=cur;} const q=_q('#q').value.toLowerCase(),th=sel.value;@@ -8999,7 +9003,8 @@ async function act(p){ const r=await fetch('/dashboard/action',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(p)}); const j=await r.json().catch(()=>({})); const what=(ACTMSG[p.action]||p.action)+(p.sessionId?' '+p.sessionId:'');- if(j.ok) toast(what+(p.action==='unflash-all'&&j.swept!=null?' ('+j.swept+' windows swept)':'')+(p.action==='flash-all'&&j.delivered!=null?' ('+j.delivered+' of '+j.n+' delivered)':'')+(p.action==='regen-overlays'&&j.swept!=null?' ('+j.swept+' windows, '+j.painted+' painted, '+j.changed+' corrected)':''), p.action.indexOf('close')===0?'success':'info');+ if(p.action==='regen-overlays'){ if(j.ok&&j.started) toast('Regenerating overlays on '+j.swept+' windows — watch the icons update live','info'); else if(j.ok&&j.alreadyRunning) toast('A regenerate sweep is already running','info'); else toast('regenerate failed'+(j.error?': '+j.error:''),'error'); return j; }+ if(j.ok) toast(what+(p.action==='unflash-all'&&j.swept!=null?' ('+j.swept+' windows swept)':'')+(p.action==='flash-all'&&j.delivered!=null?' ('+j.delivered+' of '+j.n+' delivered)':''), p.action.indexOf('close')===0?'success':'info'); else toast(what+' failed'+(j.error?': '+j.error:''),'error'); return j; }catch(e){toast(p.action+' failed: '+e.message,'error');}@@ -9321,35 +9326,44 @@ const server = http.createServer(async (req, res) => { } if (act === 'regen-overlays') { // v1.9.298 (John: "give me a button to regenerate all overlay icons — a clean sweep so I can- // verify you're doing it right, and it may help debug why they drift"). This runs the SAME- // from-scratch computation used on load, for EVERY window, and rewrites the badge PNG the- // dashboard reads — so the taskbar and the dashboard are both refreshed from one source. It- // returns per-window before/after so drift is visible: a window that CHANGES here was being- // shown wrong until the sweep, which points at whichever verb mutated it without re-triggering- // the overlay calc (John's hypothesis — the thing we can now catch).- const results = [];- for (const [id, sess] of sessions) {- if (!sess || !(sess.tabs || []).length) continue;+ // verify you're doing it right, and it may help debug why they drift"). Runs the SAME+ // from-scratch computation used on load, for EVERY window, rewriting the badge PNG the+ // dashboard reads — so the taskbar and dashboard both refresh from one source. A full sweep+ // re-resolves each window handle (serialized wiggle) + refetches each favicon, which takes+ // longer than an HTTP round-trip, so RUN IT IN THE BACKGROUND and answer immediately. The+ // dashboard icons update live over SSE as each window repaints; the per-window drift report+ // (which windows were wrong until the sweep — i.e. which verb failed to re-trigger the calc,+ // John's hypothesis) goes to the bridge log AND is stored for the header to show.+ if (_regenBusy) return done({ ok: true, started: false, alreadyRunning: true, swept: (_lastRegen && _lastRegen.inFlight) || 0 });+ const ids = [...sessions.keys()].filter(id => { const s = sessions.get(id); return s && (s.tabs || []).length; });+ _regenBusy = true;+ _lastRegen = { startedAt: Date.now(), inFlight: ids.length, done: false, swept: 0, painted: 0, changed: 0 };+ (async () => {+ const results = []; const favKind = (f) => (f && f.kind) || 'none';- const before = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };- // Clear every cache so this is a TRUE recompute, not a replay of the last cached pick, and- // force handle re-resolution (a stale/wrong handle is the other half of the drift).- sess._overlayFav = null; sess._faviconRetried = false; sess._noFavLogged = false;- sess._hwnd = null; sess._appOverlay = false; sess._overlayEnforceAt = 0;- let painted = false;- try { painted = await applyAppOverlay(sess, id); } catch (e) {}- const after = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };- const changed = String(before.hwnd) !== String(after.hwnd) || before.fav !== after.fav;- results.push({ sessionId: id, painted: !!painted, favKind: after.fav,- hwndBefore: before.hwnd, hwndAfter: after.hwnd, favBefore: before.fav, changed });- }- // Sweep orphan badges / stale bookkeeping so the dashboard strip is fully reconciled too.- try { await reconcileModel('regen-overlays (dashboard button)'); } catch (e) {}- const changed = results.filter(r => r.changed).length;- const painted = results.filter(r => r.painted).length;- console.log(`[regen] swept ${results.length} windows — ${painted} painted, ${changed} corrected (hwnd or favicon changed on the sweep)`);- for (const r of results.filter(x => x.changed)) console.log(`[regen] CORRECTED "${r.sessionId}": hwnd ${r.hwndBefore}->${r.hwndAfter}, fav ${r.favBefore}->${r.favKind}`);- return done({ ok: true, swept: results.length, painted, changed, results });+ for (const id of ids) {+ const sess = sessions.get(id);+ if (!sess || !(sess.tabs || []).length) continue;+ const before = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };+ // Clear every cache so this is a TRUE recompute, not a replay of the last cached pick,+ // and force handle re-resolution (a stale/wrong handle is the other half of the drift).+ sess._overlayFav = null; sess._faviconRetried = false; sess._noFavLogged = false;+ sess._hwnd = null; sess._appOverlay = false; sess._overlayEnforceAt = 0;+ let painted = false;+ try { painted = await applyAppOverlay(sess, id); } catch (e) {}+ const after = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };+ const changed = String(before.hwnd) !== String(after.hwnd) || before.fav !== after.fav;+ results.push({ sessionId: id, painted: !!painted, favKind: after.fav, hwndBefore: before.hwnd, hwndAfter: after.hwnd, favBefore: before.fav, changed });+ }+ try { await reconcileModel('regen-overlays (dashboard button)'); } catch (e) {}+ const changed = results.filter(r => r.changed).length;+ const painted = results.filter(r => r.painted).length;+ console.log(`[regen] DONE — swept ${results.length} windows, ${painted} painted, ${changed} corrected (hwnd or favicon changed on the sweep)`);+ for (const r of results.filter(x => x.changed)) console.log(`[regen] CORRECTED "${r.sessionId}": hwnd ${r.hwndBefore}->${r.hwndAfter}, fav ${r.favBefore}->${r.favKind}`);+ _lastRegen = { at: Date.now(), done: true, swept: results.length, painted, changed, results };+ _regenBusy = false;+ })().catch(() => { _regenBusy = false; });+ return done({ ok: true, started: true, swept: ids.length }); } return done({ ok: false, error: 'unknown action' }); } catch (e) { return done({ ok: false, error: e.message }); }