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
v2.0.240: More duplication retired: the Chrome-style generic globe and PDF glyphs are built by one function instead of being written out as SVG literals in two different no-favicon paths, the PowerShell regex escape used by the process scans lives in one helper, and four more copies of the session-resolution guard now call the shared one.
4 files changed
+44−48
adom-bridge-puppeteer-manifest.json+5−5@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.239",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.239/adom-bridge-puppeteer-v2.0.239.zip",- "sha256": "9987da7968e7cc7e075d4cc65ef47aa5836ba2bdc369d1e33397ca5d276f36fe",- "size": 944160,+ "version": "2.0.240",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.240/adom-bridge-puppeteer-v2.0.240.zip",+ "sha256": "04a9d608389a4896bdb3cd2abf6aa342e60a9e56a557600219caf4c9fede24d1",+ "size": 944473, "verbPrefixes": [ "browser_", "desktop_recorder_",@@ -12,5 +12,5 @@ ], "healthEndpoint": "/status", "statusVerb": "browser_readiness",- "released_at": "2026-08-18T13:29:29.437582Z"+ "released_at": "2026-08-18T13:39:48.922439Z" }
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.239+2.0.240
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.239",+ "version": "2.0.240", "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/server.js+37−41@@ -1581,7 +1581,7 @@ async function findChromesByProfile(profileName) { const result = spawnSync('powershell', [ '-NoProfile', '-Command',- `Get-CimInstance Win32_Process -Filter "Name='chrome.exe'" | Where-Object { $_.CommandLine -match '${profileName.replace(/[\\.\\^\\$\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\\\]/g, '\\\\$&')}' } | Select-Object ProcessId, CommandLine | ConvertTo-Json -Compress`,+ `Get-CimInstance Win32_Process -Filter "Name='chrome.exe'" | Where-Object { $_.CommandLine -match '${psRegexEscape(profileName)}' } | Select-Object ProcessId, CommandLine | ConvertTo-Json -Compress`, ], { encoding: 'utf8', timeout: 10_000, windowsHide: true }); if (result.stdout) { let parsed;@@ -1939,7 +1939,7 @@ async function rescanAllProfiles({ adoptOrphans = false } = {}) { try { if (process.platform === 'win32') { const { spawnSync } = require('child_process');- const profilesDir = PROFILES_DIR.replace(/[\\.\\^\\$\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\\\]/g, '\\\\$&');+ const profilesDir = psRegexEscape(PROFILES_DIR); const result = spawnSync('powershell', [ '-NoProfile', '-Command', `Get-CimInstance Win32_Process -Filter "Name='chrome.exe'" | Where-Object { $_.CommandLine -match 'remote-debugging-port' -and $_.CommandLine -match '${profilesDir}' -and $_.CommandLine -notmatch '--type=' } | ForEach-Object { if ($_.CommandLine -match 'user-data-dir=([^"]*?)(?=\\s+--|"$|$)') { Split-Path -Leaf $matches[1] } } | Sort-Object -Unique`,@@ -6259,19 +6259,7 @@ async function applyAppOverlay(session, sessionId) { let _u2 = ''; try { _u2 = (activePage && activePage.url()) || ''; } catch (e) {} const _isPdf2 = /\.pdf(\?|#|$)/i.test(_u2);- const _svg2 = _isPdf2- ? '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">'- + '<rect x="0" y="0" width="48" height="48" rx="9" fill="#f1f3f4"/>'- + '<path d="M13 8 h15 l8 8 v24 a1 1 0 0 1-1 1 H14 a1 1 0 0 1-1-1 V9 a1 1 0 0 1 1-1 Z" fill="#ffffff" stroke="#9aa0a6" stroke-width="1.6"/>'- + '<path d="M28 8 v8 h8 Z" fill="#dadce0"/>'- + '<rect x="13" y="26" width="23" height="12" rx="2" fill="#e34f4f"/>'- + '<text x="24.5" y="35.4" font-family="Segoe UI,Arial,sans-serif" font-size="9" font-weight="700" fill="#ffffff" text-anchor="middle">PDF</text></svg>'- : '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">'- + '<rect x="0" y="0" width="48" height="48" rx="9" fill="#f1f3f4"/>'- + '<circle cx="24" cy="24" r="13" fill="none" stroke="#5f6368" stroke-width="3"/>'- + '<ellipse cx="24" cy="24" rx="5.6" ry="13" fill="none" stroke="#5f6368" stroke-width="2.6"/>'- + '<path d="M11.4 24 H36.6" stroke="#5f6368" stroke-width="2.6"/>'- + '<path d="M13.6 16.4 H34.4 M13.6 31.6 H34.4" stroke="#5f6368" stroke-width="2"/></svg>';+ const _svg2 = genericIconSvg(_isPdf2); src = { b64: Buffer.from(_svg2).toString('base64'), mime: 'image/svg+xml', href: _isPdf2 ? 'generic:pdf' : 'generic:page' }; session._overlayFav = { kind: _isPdf2 ? 'generic-pdf' : 'generic-web', format: 'svg', mode: 'default', transparent: false, via: 'generated (no favicon existed anywhere in this window)', href: src.href, candidates: 0 }; if (session._noFavLogKey !== _u2) { session._noFavLogKey = _u2; console.log(`[overlay] "${sessionId}" no favicon in this session — generic ${_isPdf2 ? 'PDF' : 'webpage'} icon + Adom mark`); }@@ -6378,22 +6366,7 @@ async function applyAppOverlay(session, sessionId) { let u = ''; try { u = (activePage && activePage.url()) || ''; } catch (e) {} const isPdf = /\.pdf(\?|#|$)/i.test(u) || /application\/pdf/i.test(String(src && src.mime || ''));- const svg = isPdf- // Document sheet with a folded corner + PDF wordmark, on Adobe-ish red so a datasheet- // reads instantly as a PDF at 16px.- ? '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">'- + '<rect x="0" y="0" width="48" height="48" rx="9" fill="#f1f3f4"/>'- + '<path d="M13 8 h15 l8 8 v24 a1 1 0 0 1-1 1 H14 a1 1 0 0 1-1-1 V9 a1 1 0 0 1 1-1 Z" fill="#ffffff" stroke="#9aa0a6" stroke-width="1.6"/>'- + '<path d="M28 8 v8 h8 Z" fill="#dadce0"/>'- + '<rect x="13" y="26" width="23" height="12" rx="2" fill="#e34f4f"/>'- + '<text x="24.5" y="35.4" font-family="Segoe UI,Arial,sans-serif" font-size="9" font-weight="700" fill="#ffffff" text-anchor="middle">PDF</text></svg>'- // Chrome's generic page icon: a grey globe on a light plate.- : '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">'- + '<rect x="0" y="0" width="48" height="48" rx="9" fill="#f1f3f4"/>'- + '<circle cx="24" cy="24" r="13" fill="none" stroke="#5f6368" stroke-width="3"/>'- + '<ellipse cx="24" cy="24" rx="5.6" ry="13" fill="none" stroke="#5f6368" stroke-width="2.6"/>'- + '<path d="M11.4 24 H36.6" stroke="#5f6368" stroke-width="2.6"/>'- + '<path d="M13.6 16.4 H34.4 M13.6 31.6 H34.4" stroke="#5f6368" stroke-width="2"/></svg>';+ const svg = genericIconSvg(isPdf); // v1.9.326: render the glyph straight INTO iconPng. The composite below only draws // iconPng, so the old code (which set `src` and left iconPng null) fell through to a // mark-only badge — exactly the "no main overlay icon" John kept reporting. sharp@@ -8132,6 +8105,29 @@ const PS_RAISE_TYPEDEF = [ '}', '"@', ];+// v2.0.240: the Chrome-style generic icons (grey globe / PDF sheet) were written out as SVG string+// literals in TWO different no-favicon paths — the second was added because the first was missed,+// and the comment above it says so. One builder now, so the glyph a user sees cannot depend on+// which path produced it.+function genericIconSvg(isPdf) {+ const plate = '<rect x="0" y="0" width="48" height="48" rx="9" fill="#f1f3f4"/>';+ return isPdf+ ? '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">' + plate+ + '<path d="M13 8 h15 l8 8 v24 a1 1 0 0 1-1 1 H14 a1 1 0 0 1-1-1 V9 a1 1 0 0 1 1-1 Z" fill="#ffffff" stroke="#9aa0a6" stroke-width="1.6"/>'+ + '<path d="M28 8 v8 h8 Z" fill="#dadce0"/>'+ + '<rect x="13" y="26" width="23" height="12" rx="2" fill="#e34f4f"/>'+ + '<text x="24.5" y="35.4" font-family="Segoe UI,Arial,sans-serif" font-size="9" font-weight="700" fill="#ffffff" text-anchor="middle">PDF</text></svg>'+ : '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">' + plate+ + '<circle cx="24" cy="24" r="13" fill="none" stroke="#5f6368" stroke-width="3"/>'+ + '<ellipse cx="24" cy="24" rx="5.6" ry="13" fill="none" stroke="#5f6368" stroke-width="2.6"/>'+ + '<path d="M11.4 24 H36.6" stroke="#5f6368" stroke-width="2.6"/>'+ + '<path d="M13.6 16.4 H34.4 M13.6 31.6 H34.4" stroke="#5f6368" stroke-width="2"/></svg>';+}+// v2.0.240: escaping a string for use inside a PowerShell -match pattern was written out twice as+// the same dense character class. One helper, so a fix to the escaping cannot land in only one scan.+function psRegexEscape(v) {+ return String(v).replace(/[\\.^$*+?()[\]{}|]/g, '\\$&');+} async function reconcileModel(reason) { if (process.platform !== 'win32' || _reconcileBusy) return; _reconcileBusy = true;@@ -14218,10 +14214,7 @@ const server = http.createServer(async (req, res) => { case 'pup_close_window': { invalidateEnumCache(); // v2.0.187: the desktop is about to change const sessionId = args.sessionId;- if (!sessionId || !sessions.has(sessionId)) {- sendJSON(res, { success: false, error: `Session "${sessionId}" not found` });- return;- }+ if (!requireLiveSession(res, { ...args, sessionId })) return; const session = sessions.get(sessionId); // v1.8.16: refuse a declared cross-owner close (destroying another thread's window). { const refusal = ownershipRefusal(session, sessionId, args, 'pup_close_window'); if (refusal) { sendJSON(res, refusal); return; } }@@ -14570,8 +14563,9 @@ const server = http.createServer(async (req, res) => { // is brought on-screen. Not meant for AI threads (they pass wikiView on pup_open_window). case 'pup_wiki_set_view': { const sessionId = args.sessionId;- if (!sessionId || !sessions.has(sessionId)) { sendJSON(res, { success: false, error: `Session "${sessionId}" not found` }); return; }- const session = sessions.get(sessionId);+ const _lv = requireLiveSession(res, { ...args, sessionId });+ if (!_lv) return;+ const session = _lv.session; let url = null; try { url = session.page.url() || null; } catch (e) {} if (!url || !isAdomUrl(url)) { sendJSON(res, { success: false, error: 'wiki view toggle applies only to Adom (adom.inc) URLs', output: JSON.stringify({ ok: false, url }) }); return; } const curView = session._wikiView === 'authed' ? 'authed' : 'public';@@ -17063,8 +17057,9 @@ const server = http.createServer(async (req, res) => { // the full production chain without CDP input-simulation flakiness. Honest errors: floaty // absent means the setting is off or the page never got the injection. const sessionId = args.sessionId;- if (!sessionId || !sessions.has(sessionId)) { sendJSON(res, { success: false, error: `Session "${sessionId}" not found` }); return; }- const session = sessions.get(sessionId);+ const _lv = requireLiveSession(res, { ...args, sessionId });+ if (!_lv) return;+ const session = _lv.session; const tab = (args.tabId && (session.tabs || []).find(t => t.tabId === args.tabId)) || (session.activeTabId && (session.tabs || []).find(t => t.tabId === session.activeTabId)) || (session.tabs || [])[0]; if (!tab || !tab.page) { sendJSON(res, { success: false, error: 'no tab' }); return; } try {@@ -17084,8 +17079,9 @@ const server = http.createServer(async (req, res) => { // start/cancel the human annotation overlay on a window's active tab. Jump-list clicks // arrive as user-taskbar-menu (ownership-gate exempt); threads annotate their OWN windows. const sessionId = args.sessionId;- if (!sessionId || !sessions.has(sessionId)) { sendJSON(res, { success: false, error: `Session "${sessionId}" not found` }); return; }- const session = sessions.get(sessionId);+ const _lv = requireLiveSession(res, { ...args, sessionId });+ if (!_lv) return;+ const session = _lv.session; try { if (args.action === 'cancel') { const tab0 = (session.tabs || [])[0];