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
Dashboard: actions + overlay reasoning (John). ACTIONS — close all windows, close an individual window, close an individual tab, flash a taskbar button orange or clear it (per button, per window, and flash-all/clear-all). All routed through a POST /dashboard/action endpoint that reuses the same internals the verbs use, so the dashboard can never drift from verb behaviour; closing works by closing the session's tabs, which is exactly what browser_close_window does, rather than inventing a second close path. OVERLAY REASONING — every window now records and displays HOW its taskbar icon was decided: which tab was picked and that it was picked by asking Chrome (visibilityState) rather than pup's own bookkeeping, the favicon source URL, whether it came from the cookie-bearing page fetch, the bridge fetch, an inline data URI or a generic fallback, how it was composed, and critically whether it was painted by resolved HWND or by fragile title matching — the last one being the exact distinction behind a full day of unpaintable PDF-window badges.
4 files changed
+93−9
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.225",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.225/adom-bridge-puppeteer-v1.9.225.zip",- "sha256": "a5f76515d371a34456bffb6a8abfbff0ef5c3ded20d9186e7407e1cd6644b184",- "size": 452578,+ "version": "1.9.226",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.226/adom-bridge-puppeteer-v1.9.226.zip",+ "sha256": "441b469687009d67a58937f7737bf94e32b35380065977f89c071ad4ba5105f7",+ "size": 454305, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.225+1.9.226
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.225",+ "version": "1.9.226", "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+87−3@@ -4217,6 +4217,17 @@ async function applyAppOverlay(session, sessionId) { session._appOverlay = true; // v1.9.150 (John: 'prove what overlay icon you're showing and why'): record the WHAT and WHY // so list_windows can report it and test tables can prove it.+ session._overlayWhy = {+ tabId: (activeTab && activeTab.tabId) || null,+ tabPickedBy: 'visibilityState==="visible" (asked Chrome, not pup bookkeeping)',+ source: (src && src.href) || null,+ fetchedVia: (src && /^generic:/.test(src.href || '')) ? 'generic fallback (no usable favicon)'+ : (src && src.href === 'data:inline') ? 'inline data: URI in the page'+ : 'page fetch with cookies, else bridge fetch',+ composed: 'favicon 48x48 cover + Adom mark 18x18 flush lower-right',+ paintedBy: session._hwnd ? ('hwnd ' + session._hwnd) : 'title match "(session: ' + sessionId + '" (NO hwnd — fragile)',+ at: Date.now(),+ }; try { session._overlayDesc = 'favicon+adom:' + (src && src.href && src.href !== 'data:inline' ? new URL(src.href).hostname : 'inline-icon'); } catch (e) { session._overlayDesc = 'favicon+adom'; } return true; } catch (e) { return false; }@@ -7786,6 +7797,7 @@ async function dashboardSnapshot() { tabCount: tabs.length, tabs, overlay: sess._overlayDesc || null,+ overlayWhy: sess._overlayWhy || null, _curAppId: sess._curAppId || null, hwnd: sess._hwnd || null, emulatedViewport: sess._emulatedViewport || null,@@ -7880,6 +7892,14 @@ td.k{color:#7d8f9f;width:96px;white-space:nowrap} .tab .x{color:#ff7b72;flex:0 0 auto} .empty{color:#7d8f9f;padding:40px;text-align:center;grid-column:1/-1} footer{color:#5c6c7a;font-size:11px;padding:6px 18px 22px}+.btn{background:#16222c;border:1px solid #2a3a47;color:#cfe0ea;border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer}+.btn:hover{background:#1d2b36;border-color:#12e0c4}+.btn.sm{padding:3px 8px;font-size:11px;margin-left:6px}+.btn.xs{padding:0 6px;font-size:11px;line-height:16px;margin-left:auto}+.btn.danger{border-color:#5c2b2b;color:#ff9d95}+.btn.danger:hover{background:#2a1717;border-color:#f85149}+.why2{margin-top:6px;padding:6px 8px;background:#0b1116;border:1px solid #1d2833;border-radius:6px;color:#8fa3b3;font-size:11px;line-height:1.6}+.why2 b{display:block;color:#12e0c4;margin-bottom:3px;font-weight:600} </style></head><body> <header> <h1><span class="dot" id="live"></span>pup — live windows</h1>@@ -7890,6 +7910,9 @@ footer{color:#5c6c7a;font-size:11px;padding:6px 18px 22px} <span class="pill" id="cM" style="display:none">minimal-touch</span> <select id="f"><option value="">all AI threads</option></select> <input id="q" placeholder="filter url / session…" size="22">+ <button class="btn" onclick="act({action:'flash-all'})">flash all</button>+ <button class="btn" onclick="act({action:'unflash-all'})">clear flashes</button>+ <button class="btn danger" onclick="if(confirm('Close ALL pup windows?'))act({action:'close-all'})">close all</button> <span class="sub" id="age"></span> </header> <main id="m"><div class="empty">connecting…</div></main>@@ -7921,7 +7944,9 @@ function render(){ '<div class="tbgroup">' +'<div class="tbhead"><img class="tbicon" src="/dashboard/badge?session='+encodeURIComponent(g.wins[0].sessionId)+'&t='+d.ts+'" onerror="this.style.visibility=\'hidden\'">' +'<span class="tblabel">'+esc(g.label)+'</span>'- +'<span class="tbmeta">taskbar button · '+g.wins.length+' window'+(g.wins.length>1?'s':'')+' · '+esc(g.grouping)+'</span></div>'+ +'<span class="tbmeta">taskbar button · '+g.wins.length+' window'+(g.wins.length>1?'s':'')+' · '+esc(g.grouping)+'</span>'+ +'<button class="btn sm" onclick="g_flash('+JSON.stringify(JSON.stringify(g.windows))+',0)">flash</button>'+ +'<button class="btn sm" onclick="g_flash('+JSON.stringify(JSON.stringify(g.windows))+',1)">clear</button></div>' + g.wins.map(w=>{ const crashed=w.tabs.some(t=>t.crashed)||w.lostBrowser; return '<div class="card '+(w.foreground?'fg':'')+(crashed?' crash':'')+'">'@@ -7929,6 +7954,9 @@ function render(){ +'<img class="badge" src="/dashboard/badge?session='+encodeURIComponent(w.sessionId)+'&t='+d.ts+'" onerror="this.style.visibility=\'hidden\'">' +'<span class="sid">'+esc(w.sessionId)+'</span>' +'<span class="sub">'+esc(w.profile)+' · '+ago(w.uptimeMs)+'</span>'+ +'<button class="btn sm" onclick="act({action:\'flash\',sessionId:'+JSON.stringify(w.sessionId)+'})">flash</button>'+ +'<button class="btn sm" onclick="act({action:\'unflash\',sessionId:'+JSON.stringify(w.sessionId)+'})">clear</button>'+ +'<button class="btn sm danger" onclick="act({action:\'close-window\',sessionId:'+JSON.stringify(w.sessionId)+'})">close</button>' +'</div>' +'<div class="tags">' +'<span class="tag '+(w.foreground?'fg':'bg')+'">'+(w.foreground?'FOREGROUND':'background')+'</span>'@@ -7942,17 +7970,28 @@ function render(){ +(w.foreground&&w.foregroundReason?'<div class="why"><b>why foreground:</b> '+esc(w.foregroundReason)+'</div>':'') +'<table>' +'<tr><td class="k">url</td><td class="url">'+esc(w.url||'—')+'</td></tr>'- +'<tr><td class="k">overlay</td><td>'+esc(w.overlay||'none')+'</td></tr>'+ +'<tr><td class="k">overlay</td><td>'+esc(w.overlay||'none')+ +(w.overlayWhy?'<div class="why2"><b>how this icon was chosen</b>'+ +'<div>tab: '+esc(w.overlayWhy.tabId||'?')+' — '+esc(w.overlayWhy.tabPickedBy)+'</div>'+ +'<div>source: '+esc(w.overlayWhy.source||'none')+'</div>'+ +'<div>fetched via: '+esc(w.overlayWhy.fetchedVia)+'</div>'+ +'<div>composed: '+esc(w.overlayWhy.composed)+'</div>'+ +'<div>painted by: '+esc(w.overlayWhy.paintedBy)+'</div></div>':'')+ +'</td></tr>' +'<tr><td class="k">hwnd</td><td>'+(w.hwnd||'<span style="color:#ff7b72">unresolved</span>')+'</td></tr>' +(w.lastAgentUpdate?'<tr><td class="k">last action</td><td>'+esc(w.lastAgentUpdate.verb||'')+' '+esc(w.lastAgentUpdate.note||'')+'</td></tr>':'') +'</table>' +'<div class="tabs">'+w.tabs.map(t=>'<div class="tab '+(t.active?'act':'')+'">' +'<img class="fav" src="/dashboard/favicon?session='+encodeURIComponent(w.sessionId)+'&tab='+encodeURIComponent(t.tabId)+'" onerror="this.style.visibility=\'hidden\'">' +'<span class="id">'+esc(t.tabId)+'</span><span class="u">'+esc(t.title||t.url||'—')+'</span>'- +(t.crashed?'<span class="x">crashed</span>':'')+'</div>').join('')+'</div>'+ +(t.crashed?'<span class="x">crashed</span>':'')+ +'<button class="btn xs" onclick="act({action:\'close-tab\',sessionId:'+JSON.stringify(w.sessionId)+',tabId:'+JSON.stringify(t.tabId)+'})">×</button>'+ +'</div>').join('')+'</div>' +'</div>';}).join('')+'</div>').join('') : '<div class="empty">no pup windows open'+(th||q?' matching this filter':'')+'</div>'; $('#ft').textContent='bridge up '+ago(d.bridge.uptimeMs)+' · '+d.bridge.platform+' · deps '+(d.bridge.depsOk?'ok':'MISSING')+' · profiles: '+Object.entries(d.profiles).map(([k,v])=>k+'('+v+')').join(', '); }+async function act(p){try{await fetch('/dashboard/action',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(p)});}catch(e){}}+function g_flash(list,stop){try{JSON.parse(list).forEach(s=>act({action:stop?'unflash':'flash',sessionId:s}));}catch(e){}} $('#f').onchange=render; $('#q').oninput=render; const es=new EventSource('/dashboard/events'); es.onmessage=e=>{SNAP=JSON.parse(e.data);$('#live').classList.remove('stale');render();};@@ -8001,6 +8040,51 @@ const server = http.createServer(async (req, res) => { req.on('close', () => { alive = false; clearInterval(iv); }); return; }+ if (pathname === '/dashboard/action' && req.method === 'POST') {+ // v1.9.226 (John): make the dashboard actionable, not just observational — close all / close one+ // window / close one tab, and flash a taskbar button orange (or clear it), per-button and for+ // everything at once. These reuse the SAME internals the verbs use, so the dashboard can never+ // drift from verb behaviour. Flash is the "come look at this one" cue; unflash clears it without+ // stealing focus, which matters because this user alt-tabs away from foregrounded windows.+ let body = '';+ req.on('data', c => { body += c; });+ await new Promise(r => req.on('end', r));+ let a = {}; try { a = JSON.parse(body || '{}'); } catch (e) {}+ const act = a.action, sid = a.sessionId, tid = a.tabId;+ const done = (o2) => { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(o2)); };+ try {+ // Closing = close every tab in the session (the same effect browser_close_window has); the+ // session is then reaped by the existing zero-tab cleanup, so there is no second code path.+ const closeOne = async (id) => {+ const sess = sessions.get(id);+ if (!sess) return false;+ for (const t of [...(sess.tabs || [])]) { try { await t.page.close(); } catch (e) {} }+ try { sessions.delete(id); deleteSessionFile(id); } catch (e) {}+ return true;+ };+ if (act === 'close-all') {+ const ids = [...sessions.keys()];+ for (const id of ids) { try { await closeOne(id); } catch (e) {} }+ return done({ ok: true, closed: ids.length });+ }+ if (act === 'close-window' && sid) { const okc = await closeOne(sid); return done({ ok: okc, closed: sid }); }+ if (act === 'close-tab' && sid && tid) {+ const sess = sessions.get(sid);+ const tab = sess && (sess.tabs || []).find(t => t.tabId === tid);+ if (!tab) return done({ ok: false, error: 'tab not found' });+ try { await tab.page.close(); } catch (e) {}+ return done({ ok: true, closed: tid });+ }+ if (act === 'flash' && sid) { try { await flashViaAD(sid, {}); } catch (e) {} return done({ ok: true }); }+ if (act === 'unflash' && sid) { try { await flashViaAD(sid, { stop: true }); } catch (e) {} return done({ ok: true }); }+ if (act === 'flash-all' || act === 'unflash-all') {+ const stop = act === 'unflash-all';+ for (const id of [...sessions.keys()]) { try { await flashViaAD(id, stop ? { stop: true } : {}); } catch (e) {} }+ return done({ ok: true, n: sessions.size });+ }+ return done({ ok: false, error: 'unknown action' });+ } catch (e) { return done({ ok: false, error: e.message }); }+ } if (pathname === '/dashboard/favicon') { // v1.9.225 (John): every TAB shows its own favicon in the dashboard as a visual cue. Cached per // tab URL so repeated SSE renders never re-fetch, and fetched through the page itself (cookies)