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
Toolbar popup actions actually fire from any tab (John clicked Annotate and nothing happened): the popup could only match a window by its main-page URL, so clicks from any other tab resolved no session and the error was swallowed. User-caller commands now resolve the window server-side by matching ANY tab of any session against the clicking tab's URL, the popup passes its tab URL through, and failures render in the popup instead of vanishing (every action answers back). Also the Adom Identity card becomes the real medium identity card per the identity-card skill: new pup /identity endpoint reads ab's Carbon session on the desktop and serves display name, handle, email, avatar and orgs, and the card renders name bold, handle-dot-email muted, and org pills with org avatars, showing only fields the identity API returns
7 files changed
+98−15
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.57",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.57/adom-bridge-puppeteer-v2.0.57.zip",- "sha256": "d94306acd21385f02f54fb6c1838f2f49f941c089b5c6ace10873796b0b2e553",- "size": 826249,+ "version": "2.0.58",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.58/adom-bridge-puppeteer-v2.0.58.zip",+ "sha256": "ff3c32042c23145f975d9fceef8863b8f8da620010d1b925abf9608f46bfed86",+ "size": 828176, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.57+2.0.58
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.57",+ "version": "2.0.58", "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/extension-identity/identity.html+3−2@@ -25,8 +25,9 @@ <body> <div class="card"> <img class="avatar" src="icon128.png" alt="">- <div class="who">adom-you</div>- <div class="as">the shared Adom browsing profile</div>+ <div class="who" id="who">adom-you</div>+ <div class="as" id="sub">the shared Adom browsing profile</div>+ <div id="orgs" style="display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:2px 0 10px;"></div> <div class="desc"> Every pup window on this profile surfs as <b>adom-you</b>: logins made here are remembered in the shared credential store, so pup can sign in for you next time on every site it has seen.
src/extension-identity/identity.js+28@@ -1,5 +1,33 @@ // Identity card: version stamp from pup /health when reachable (cosmetic only). (async () => {+ // Medium identity card per the identity-card skill: real name bold, @handle · email muted,+ // org pills (max 2 + N) with org avatars, fields only when the identity API returns them.+ for (const port of [64230, 8851]) {+ try {+ const r = await fetch(`http://127.0.0.1:${port}/identity`, { signal: AbortSignal.timeout(2500) });+ const id = await r.json();+ if (!id || !id.ok) break;+ if (id.displayName) document.getElementById('who').textContent = id.displayName;+ const handle = id.username ? '@' + id.username : '';+ const parts = [handle, id.email].filter(Boolean).join(' \u00b7 ');+ if (parts) document.getElementById('sub').textContent = parts;+ const av = document.querySelector('img.avatar');+ if (id.avatarUrl) av.src = id.avatarUrl; else if (id.avatarB64) av.src = id.avatarB64.startsWith('data:') ? id.avatarB64 : 'data:image/png;base64,' + id.avatarB64;+ const orgsEl = document.getElementById('orgs');+ const orgs = (id.orgs || []).slice(0, 2);+ for (const o of orgs) {+ const pill = document.createElement('span');+ pill.style.cssText = 'display:inline-flex;align-items:center;gap:5px;background:rgba(0,184,177,.12);border:1px solid rgba(0,184,177,.4);color:#00d4cb;border-radius:999px;padding:2px 9px 2px 3px;font-size:11px;';+ pill.title = 'Organization you belong to: ' + (o.displayName || o.name);+ if (o.avatarUrl) { const im = document.createElement('img'); im.src = o.avatarUrl; im.style.cssText = 'width:14px;height:14px;border-radius:50%;'; pill.appendChild(im); }+ else { const dt = document.createElement('span'); dt.style.cssText = 'width:8px;height:8px;border-radius:50%;background:#00b8b1;margin-left:4px;'; pill.appendChild(dt); }+ pill.appendChild(document.createTextNode(o.displayName || o.name));+ orgsEl.appendChild(pill);+ }+ if ((id.orgs || []).length > 2) { const n = document.createElement('span'); n.textContent = '+' + (id.orgs.length - 2); n.title = id.orgs.slice(2).map(o => o.displayName || o.name).join(', '); n.style.cssText = 'color:#8b949e;font-size:11px;align-self:center;'; orgsEl.appendChild(n); }+ break;+ } catch (e) {}+ } for (const port of [64230, 8851]) { try { const r = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(1000) });
src/extension/popup.js+14−6@@ -67,13 +67,21 @@ async function cmd(port, command, args) { if (!btn) return; const act = btn.dataset.act; try {- if (act === 'annotate') await cmd(port, 'pup_annotate', { sessionId: sid });- else if (act === 'snip') await cmd(port, 'pup_annotate', { sessionId: sid, tool: 'snip' });- else if (act === 'view') await cmd(port, 'pup_wiki_set_view', { sessionId: sid, view: view === 'authed' ? 'public' : 'authed' });+ const base = sid ? { sessionId: sid } : { _tabUrl: tab && tab.url };+ let r = null;+ if (act === 'annotate') r = await cmd(port, 'pup_annotate', { ...base });+ else if (act === 'snip') r = await cmd(port, 'pup_annotate', { ...base, tool: 'snip' });+ else if (act === 'view') r = await cmd(port, 'pup_wiki_set_view', { ...base, view: view === 'authed' ? 'public' : 'authed' }); else if (act === 'dashboard') await cmd(port, 'pup_dashboard', {});- else if (act === 'info') await cmd(port, 'pup_window_info', { sessionId: sid });- else if (act === 'close') { if (confirm('Close ' + (owner ? owner + "'s" : 'this') + ' pup window?')) await cmd(port, 'pup_close_window', { sessionId: sid }); }- } catch (err) {}+ else if (act === 'info') r = await cmd(port, 'pup_window_info', { ...base });+ else if (act === 'close') { if (confirm('Close ' + (owner ? owner + "'s" : 'this') + ' pup window?')) r = await cmd(port, 'pup_close_window', { ...base }); }+ } catch (err) { r = { success: false, error: String(err) }; }+ // every action answers back (design skill): show a failure instead of vanishing+ if (r && r.success === false) {+ ownerEl.textContent = (r.error || 'action failed').slice(0, 60);+ ownerEl.style.color = '#f85149';+ return; // keep the popup open so the user can read it+ } window.close(); }); })();
src/server.js+47−1@@ -4213,7 +4213,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([- 'pup_list_windows', 'pup_list_tabs', 'pup_readiness', 'pup_status', 'pup_maximize', 'pup_hover', 'pup_deps', 'pup_dashboard',+ 'pup_annotate', 'pup_list_windows', 'pup_list_tabs', 'pup_readiness', 'pup_status', 'pup_maximize', 'pup_hover', 'pup_deps', 'pup_dashboard', 'pup_describe', 'pup_configure', 'pup_prewarm', 'pup_rescan', 'pup_wait', 'pup_import_scan', 'pup_set_identity', ]); @@ -10730,6 +10730,40 @@ const server = http.createServer(async (req, res) => { res.end(DASHBOARD_HTML); return; }+ if (pathname === '/identity') {+ // v2.0.58 (identity-card skill): the Adom identity payload for the toolbar Identity+ // extension's medium card. Reads ab's session (~/.adom/session.json), asks Carbon for+ // /user + /user/orgs, caches 10 min. Fields are passed through as-is; absent stays absent+ // (the card hides what it does not have — never invent fields).+ try {+ if (global.__pupIdCache && Date.now() - global.__pupIdCache.at < 600000) { sendJSON(res, global.__pupIdCache.v); return; }+ let sess = {};+ try { sess = JSON.parse(fs.readFileSync(path.join(os.homedir(), '.adom', 'session.json'), 'utf8')); } catch (e) {}+ const token = sess.token || sess.session_token || sess.access_token || (sess.session && sess.session.token) || null;+ const su = sess.user || {};+ let user = null, orgs = [];+ if (token) {+ const hdrs = { Authorization: 'Bearer ' + token };+ try { const r1 = await fetch('https://carbon.adom.inc/user', { headers: hdrs }); if (r1.ok) user = await r1.json(); } catch (e) {}+ try { const r2 = await fetch('https://carbon.adom.inc/user/orgs', { headers: hdrs }); if (r2.ok) { const j2 = await r2.json(); orgs = Array.isArray(j2) ? j2 : (j2.orgs || []); } } catch (e) {}+ }+ const u = user || su || {};+ const v = {+ ok: true,+ displayName: u.display_name || u.displayName || u.name || null,+ username: u.name || u.username || null,+ email: u.email || null,+ avatarUrl: u.avatar_url || u.avatarUrl || null,+ avatarB64: pupSettings().identityAvatarB64 || null,+ isAdmin: !!(u.is_admin || u.isAdmin),+ orgs: (orgs || []).map(o => ({ name: o.name, displayName: o.display_name || o.name, avatarUrl: o.avatar_url || null })),+ profile: 'adom-you',+ };+ global.__pupIdCache = { at: Date.now(), v };+ sendJSON(res, v);+ } catch (e) { sendJSON(res, { ok: false, error: e.message }); }+ return;+ } if (pathname === '/health') { const sessionList = []; for (const [id, s] of sessions) {@@ -10808,6 +10842,18 @@ const server = http.createServer(async (req, res) => { // ai-<thread-slug> window, else the single window the thread owns under an explicit name. // No match is a teaching error. The old activeSessionId fallback (= whichever window ANY // thread touched last) is gone from every session-targeting verb.+ // v2.0.58 (John clicked Annotate in the toolbar popup and nothing happened): a USER caller+ // (toolbar popup) can only know its tab's URL, and matching only the session's MAIN page+ // failed on any other tab. Resolve by ANY tab of any session when _tabUrl rides the args.+ if (args && !args.sessionId && args._tabUrl && USER_CALLERS.has(_callerThread) && SESSION_TARGETING_VERBS.has(command)) {+ const tu = String(args._tabUrl).split('#')[0];+ outer: for (const [k3, s3] of sessions) {+ for (const t3 of (s3.tabs || [])) {+ let u3 = null; try { u3 = t3.page.url(); } catch (e) {}+ if (u3 && u3.split('#')[0] === tu) { args.sessionId = k3; break outer; }+ }+ }+ } if (args && !args.sessionId && _callerThread && !USER_CALLERS.has(_callerThread) && SESSION_TARGETING_VERBS.has(command)) { const derived = threadDefaultSessionId(_callerThread); if (sessions.has(derived)) args.sessionId = derived;