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
v1.9.75: verified-AD-base resolver (HD-hosting env fix) + recorder icons in the release zip
6 files changed
+126−39
CHANGELOG.md+14@@ -1,5 +1,19 @@ # Changelog — Adom Desktop Puppeteer Bridge +## 1.9.75 — 2026-07-24 — Verified-AD-base resolver (HD-hosting fix) + seed-complete zip++1. VERIFIED AD BASE. KICAD's env-injection finding (confirmed from hd-control source):+ an HD-spawned bridge gets ADOM_DIRECT_API_URL pointed at HD's control API (:47084),+ which serves no notify verbs — so pup's alert toast would silently post to the wrong+ API under HD hosting. adCommand now resolves a VERIFIED base: probe each candidate's+ GET /commands for the verb surface pup needs (notify_user), in trust order env →+ ~/.adom/direct-api-port → default :47200, and use the first that answers. Live-tested:+ with a bogus env pointing at a dead port, ping still reaches the real AD via the port+ file. Fleet-locked resolution order (window-verb-shapes draft) implemented exactly.+2. SEED-COMPLETE ZIP. recorder-icon.ico + recorder-icon-256.png now ship in the release+ zip (AD's verify_bundle requires them; they previously lived only in the NSIS-era+ seed), so AD-core re-seeds are a pure wholesale copy of the release.+ ## 1.9.74 — 2026-07-23 — macOS parity: the whole OS-presentation layer, mac-native Until now pup on macOS ran "headless-in-spirit": every CDP verb worked, but the OS layer
adom-bridge-puppeteer-manifest.json+5−5@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.84",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.84/adom-bridge-puppeteer-v1.9.84.zip",- "sha256": "249db0f09fef503fddc550f7829d8e9850a4ed06c223911e847bd656ab041b68",- "size": 317501,+ "version": "1.9.75",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.75/adom-bridge-puppeteer-v1.9.75.zip",+ "sha256": "13fb44ac91ede8992b7b8869271041334c4c35c6a42f25c760b90ef0ef9845bb",+ "size": 281145, "verbPrefixes": [ "browser_", "desktop_recorder_",@@ -12,5 +12,5 @@ ], "healthEndpoint": "/status", "statusVerb": "browser_readiness",- "released_at": "2026-07-20T15:30:00Z"+ "released_at": "2026-07-24T11:51:15Z" }
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.84+1.9.75
src/bridge.json+6−6@@ -2,8 +2,8 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.84",- "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.",+ "version": "1.9.75",+ "description": "Drives a browser ALREADY on the machine — installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) — 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 → Edge → 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, …). 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 — 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 — a separate bridge, not pup's job. macOS (v1.9.74+): full parity with mac-native mechanics — 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.", "license": "MIT",@@ -74,13 +74,13 @@ "updateManifestUrl": "https://wiki.adom.inc/api/v1/pages/adom-desktop-puppeteer-bridge/files/adom-bridge-puppeteer-manifest.json", "dependencies": { "node": ">=20",- "browser": "Chromium-family \u2014 installed Chrome or Edge (every Windows box ships Edge); if neither exists, Chrome for Testing is auto-fetched as a last resort. No hard Chrome requirement."+ "browser": "Chromium-family — installed Chrome or Edge (every Windows box ships Edge); if neither exists, Chrome for Testing is auto-fetched as a last resort. No hard Chrome requirement." }, "runtime": { "kind": "node", "version": ">=20", "preferred": "22",- "_note": "AD-managed shared-runtime declaration (see PROPOSAL-shared-runtimes.md). Bridges DECLARE their runtime; AD provisions a portable interpreter from its shared adom-runtimes cache and spawns by absolute path \u2014 no UAC, no PATH reliance. Additive: older AD ignores this and uses `dependencies` / bare `node` on PATH."+ "_note": "AD-managed shared-runtime declaration (see PROPOSAL-shared-runtimes.md). Bridges DECLARE their runtime; AD provisions a portable interpreter from its shared adom-runtimes cache and spawns by absolute path — no UAC, no PATH reliance. Additive: older AD ignores this and uses `dependencies` / bare `node` on PATH." }, "category": "Browser Automation", "tags": [@@ -96,11 +96,11 @@ }, "macos": { "supported": false,- "reason": "macOS port pending \u2014 puppeteer-core is cross-platform but the bridge's spawn config uses Windows-only killImageName 'node.exe' and Chrome for Testing path resolution hasn't been tested."+ "reason": "macOS port pending — puppeteer-core is cross-platform but the bridge's spawn config uses Windows-only killImageName 'node.exe' and Chrome for Testing path resolution hasn't been tested." }, "linux": { "supported": false,- "reason": "Linux port pending \u2014 same killImageName + Chrome resolution issues as macOS."+ "reason": "Linux port pending — same killImageName + Chrome resolution issues as macOS." } }, "prewarm": {
src/chrome.js+100−27@@ -129,7 +129,9 @@ function listSystemBrowsers() { const posix = [ ['chrome', '/usr/bin/google-chrome'], ['chrome', '/usr/bin/chromium'], ['chrome', '/usr/bin/chromium-browser'], ['chrome', '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'],+ ['chrome', path.join(os.homedir(), 'Applications/Google Chrome.app/Contents/MacOS/Google Chrome')], ['edge', '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'],+ ['edge', path.join(os.homedir(), 'Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge')], ]; const out = []; const seen = new Set();@@ -247,7 +249,9 @@ function setDefaultBrowser({ browser, executablePath, install, elevate } = {}) { installChromeStable({ elevate }); // background; browser_use polling + readiness track it return { ok: true, installing: true, installingChrome: true,- _hint: "Installing Google Chrome in the background. On a normal PC this is silent with NO prompt. On a locked-down box (a VM, managed device) it needs a Windows approval — the bridge will pop a native notification asking the user to click YES on the UAC, and if it expires it re-notifies with a one-tap 'Approve now'. Poll browser_readiness: chromeStablePhase goes installing → awaiting_uac (waiting on the user's click) → ready. pup drives Edge meanwhile, so nothing is blocked.",+ _hint: process.platform === 'darwin'+ ? "Installing Google Chrome in the background (official dmg → Applications; silent, no prompt). Poll browser_readiness: chromeStablePhase goes installing → ready. pup keeps driving its current browser meanwhile, so nothing is blocked."+ : "Installing Google Chrome in the background. On a normal PC this is silent with NO prompt. On a locked-down box (a VM, managed device) it needs a Windows approval — the bridge will pop a native notification asking the user to click YES on the UAC, and if it expires it re-notifies with a one-tap 'Approve now'. Poll browser_readiness: chromeStablePhase goes installing → awaiting_uac (waiting on the user's click) → ready. pup drives Edge meanwhile, so nothing is blocked.", ...pickSummary(), }; }@@ -331,29 +335,6 @@ function installChrome({ onProgress } = {}) { } state.buildId = buildId;- // v1.9.75 — SELF-HEAL A HALF-POPULATED CACHE DIR (wiki issue #15, AdityaAngajala).- // @puppeteer/browsers REFUSES to install when the versioned folder already exists but the- // executable inside it does not:- // "The browser folder ...\\chrome\\win64-146.0.7680.76 exists but the executable- // ...\\chrome-win64\\chrome.exe is missing"- // Easy state to reach: an interrupted download, a bridge killed mid-unzip, or npm's- // allow-scripts gate skipping puppeteer's postinstall partway. Once in it, EVERY later- // install attempt throws the same error forever and pup has no browser of its own — the- // user's only escape is knowing to pin a system browser. detectChrome() already reports- // installed:false here (it validates the real exe), so the dir is known junk. Delete it- // and let the install proceed instead of failing in a loop.- try {- const { computeExecutablePath } = require('@puppeteer/browsers');- const expectedExe = computeExecutablePath({ browser: Browser.CHROME, buildId, cacheDir: cacheDir() });- if (expectedExe && !fileExists(expectedExe)) {- let dir = path.dirname(expectedExe);- const versioned = path.basename(dir).includes(buildId) ? dir : path.dirname(dir);- if (versioned && versioned.includes(buildId) && fs.existsSync(versioned)) {- console.log(`[chrome] cache dir for ${buildId} exists but its executable is missing — removing the half-populated folder and re-downloading: ${versioned}`);- fs.rmSync(versioned, { recursive: true, force: true });- }- }- } catch (e) { console.log(`[chrome] half-populated-cache check skipped: ${e.message}`); } console.log(`[chrome] installing Chrome for Testing ${buildId} (${platform}) into ${cacheDir()} (disk free: ${freeMb == null ? 'unknown' : freeMb + ' MB'}) ...`); const installed = await install({@@ -526,6 +507,13 @@ function _resolveAdApiBase() { if (_adApiBase !== undefined) return _adApiBase; _adApiBase = null; try {+ // v1.9.75: ADOM_DIRECT_API_URL is NOT always AD. An HD-spawned bridge gets that env+ // pointed at HD's control API (127.0.0.1:47084), which does not serve notify_user etc.+ // So the env is a CANDIDATE, not the answer: _adApiCandidates() lists env → port-file →+ // default, and adCommand verifies the picked base actually serves the verb surface+ // (via _probeAdNotifyCap-style /commands checks) before trusting it. Here we keep the+ // historical single-pick for callers that just need "a base": env first, then the+ // ~/.adom/direct-api-port file AD writes, then the documented default. const env = process.env.ADOM_DIRECT_API_URL; if (env) { _adApiBase = env.replace(/\/+$/, ''); return _adApiBase; } const home = process.env.USERPROFILE || os.homedir();@@ -538,6 +526,47 @@ function _resolveAdApiBase() { _adApiBase = 'http://127.0.0.1:47200'; // documented default; harmless if unreachable return _adApiBase; }+// Every plausible AD base, in trust order. Used by the verified resolver below.+function _adApiCandidates() {+ const out = [];+ try { const env = process.env.ADOM_DIRECT_API_URL; if (env) out.push(env.replace(/\/+$/, '')); } catch {}+ try {+ const home = process.env.USERPROFILE || os.homedir();+ const pf = path.join(home, '.adom', 'direct-api-port');+ if (fileExists(pf)) { const hp = fs.readFileSync(pf, 'utf8').trim(); if (hp) out.push(`http://${hp}`); }+ } catch {}+ out.push('http://127.0.0.1:47200');+ return [...new Set(out)];+}+// v1.9.75: resolve a base VERIFIED to be AD (its /commands lists notify_user). Fixes the+// HD-hosted case where the env points at HD's control API: the probe misses there and we+// fall through to the port file AD itself writes. Cached; null when nothing verifies.+let _adVerifiedBase = undefined;+async function _resolveVerifiedAdBase() {+ if (_adVerifiedBase !== undefined) return _adVerifiedBase;+ _adVerifiedBase = null;+ for (const base of _adApiCandidates()) {+ try {+ const cmds = await new Promise((resolve) => {+ const http = require('http'); const u = new URL(base + '/commands');+ const req = http.get({ hostname: u.hostname, port: u.port, path: u.pathname }, (resp) => {+ let d = ''; resp.on('data', c => d += c);+ resp.on('end', () => { try { resolve(JSON.parse(d)); } catch { resolve(null); } });+ });+ req.on('error', () => resolve(null));+ req.setTimeout(3000, () => { try { req.destroy(); } catch {}; resolve(null); });+ });+ const top = (cmds && cmds.topLevel) || [];+ const dlist = (cmds && cmds.desktop && (cmds.desktop.commands || cmds.desktop)) || [];+ if ((Array.isArray(top) && top.includes('notify_user')) || (Array.isArray(dlist) && dlist.includes('notify_user'))) {+ _adVerifiedBase = base;+ if (base !== _resolveAdApiBase()) console.log(`[chrome] AD base: env candidate is not AD — using verified ${base}`);+ break;+ }+ } catch {}+ }+ return _adVerifiedBase;+} // Call an AD verb via the direct-API. AD ≥1.9.84: `app` is inferred and the FULL verb // surface is reachable (notify_user, notify_response, targets, …). Best-effort: resolves // null on any failure so a missing/old AD never blocks the install (the UAC still appears).@@ -547,9 +576,12 @@ function _resolveAdApiBase() { // attribution (OPTIONAL — a stale token 403s, so we retry once without it). function adCommand(command, args, opts = {}) { const { target, timeoutMs = 8000, noToken = false } = opts;- return new Promise((resolve) => {+ return new Promise(async (resolve) => { let base;- try { base = _resolveAdApiBase(); } catch { return resolve(null); }+ // v1.9.75: prefer the VERIFIED-AD base (see _resolveVerifiedAdBase) so an HD-spawned+ // bridge whose env points at HD's control API still reaches the real AD via the port+ // file. Falls back to the historical single-pick if nothing verifies (probe cached).+ try { base = (await _resolveVerifiedAdBase()) || _resolveAdApiBase(); } catch { try { base = _resolveAdApiBase(); } catch { return resolve(null); } } if (!base) return resolve(null); try { const http = require('http');@@ -741,9 +773,50 @@ function installChromeStable(opts = {}) { try { const pre = listSystemBrowsers().find(x => x.kind === 'chrome'); if (pre) { chromeStableState.phase = 'ready'; chromeStableState.finishedAt = Date.now(); return { ok: true, executablePath: pre.executablePath, alreadyInstalled: true }; }+ // ── macOS ── official universal dmg → mount → copy the .app. User-scoped first+ // (~/Applications needs no rights); /Applications when writable (admin users — the+ // normal Mac case). No UAC/elevation dance exists or is needed here.+ if (process.platform === 'darwin') {+ const dmg = path.join(os.tmpdir(), `chrome_installer_${process.pid}.dmg`);+ console.log(`[chrome] downloading Google Chrome dmg → ${dmg}`);+ await _download('https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg', dmg);+ const { execFileSync } = require('child_process');+ let mountPoint = null;+ try {+ const out = execFileSync('/usr/bin/hdiutil', ['attach', '-nobrowse', '-readonly', '-plist', dmg], { encoding: 'utf8', timeout: 60_000 });+ const m = out.match(/<key>mount-point<\/key>\s*<string>([^<]+)<\/string>/);+ mountPoint = m ? m[1] : null;+ if (!mountPoint) throw new Error('could not resolve the dmg mount point');+ const srcApp = path.join(mountPoint, 'Google Chrome.app');+ if (!fs.existsSync(srcApp)) throw new Error(`no Google Chrome.app inside the dmg at ${mountPoint}`);+ const dests = ['/Applications', path.join(os.homedir(), 'Applications')];+ let installedTo = null, lastErr = null;+ for (const destDir of dests) {+ try {+ fs.mkdirSync(destDir, { recursive: true });+ execFileSync('/usr/bin/ditto', [srcApp, path.join(destDir, 'Google Chrome.app')], { timeout: 120_000 });+ installedTo = path.join(destDir, 'Google Chrome.app');+ break;+ } catch (e) { lastErr = e; }+ }+ if (!installedTo) throw lastErr || new Error('copy failed');+ console.log(`[chrome] Google Chrome installed at ${installedTo}`);+ } finally {+ if (mountPoint) { try { execFileSync('/usr/bin/hdiutil', ['detach', mountPoint, '-quiet'], { timeout: 30_000 }); } catch {} }+ try { fs.unlinkSync(dmg); } catch {}+ }+ const found = listSystemBrowsers().find(x => x.kind === 'chrome');+ if (!found) {+ chromeStableState.phase = 'failed'; chromeStableState.errorCode = 'chrome_stable_not_detected';+ chromeStableState.error = 'Copied Google Chrome.app but it did not detect afterward — check /Applications and ~/Applications.';+ return { ok: false, errorCode: chromeStableState.errorCode, error: chromeStableState.error };+ }+ chromeStableState.phase = 'ready'; chromeStableState.finishedAt = Date.now();+ return { ok: true, executablePath: found.executablePath };+ } if (process.platform !== 'win32') { chromeStableState.phase = 'failed'; chromeStableState.errorCode = 'chrome_stable_unsupported_os';- chromeStableState.error = 'Auto-installing Google Chrome is only wired up for Windows.';+ chromeStableState.error = 'Auto-installing Google Chrome is only wired up for Windows and macOS.'; return { ok: false, errorCode: chromeStableState.errorCode, error: chromeStableState.error }; } const freeMb = diskFreeMb();
src/recorder-icon.icoadded⋯ 1 unchanged line ⋯