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
Adds pup_uninstall: cleanly removes pups whole machine footprint. Destructive and reason-gated behind confirm uninstall; dryRun true previews the plan without removing. Wipes the HKCU AppUserModelId Adom.Pup registry keys, all staged extensions, all pup profiles and sessions, the OS-keychain credential vault, pup-settings.json, the badge-debug temp dir, and the jump-list launcher; keep-flags keepCredentials and keepProfiles preserve user data, and Chrome-for-Testing plus firewall rules are left alone unless removeChrome or removeFirewallRules. Closes every window and quits every browser first to release profile locks. New credential_vault wipeAll helper
5 files changed
+90−6
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.125",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.125/adom-bridge-puppeteer-v2.0.125.zip",- "sha256": "824bc0b28045dc0de3ec412d51179c5c443560bbf7925ca036c002daf1606469",- "size": 866899,+ "version": "2.0.126",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.126/adom-bridge-puppeteer-v2.0.126.zip",+ "sha256": "7787fd368a691ca66d56e289a264cf24f1796e0e5eea1a48e0220812c40ac35d",+ "size": 869113, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.125+2.0.126
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.125",+ "version": "2.0.126", "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/credential_vault.js+15@@ -375,12 +375,27 @@ async function autofillFormFromVault(page, url, { submit = false } = {}) { } } +// v2.0.126: wipe the ENTIRE vault (uninstaller). Deletes every keychain secret this vault holds,+// then removes the index file. Returns {removed, total}. Never throws — best-effort per entry.+async function wipeAll() {+ const entries = readIndex();+ let removed = 0;+ if (keytar) {+ for (const e of entries) {+ try { if (await keytar.deletePassword(KEYTAR_SERVICE, keytarAccountFor(e))) removed++; } catch (err) {}+ }+ }+ try { if (fs.existsSync(INDEX_PATH)) fs.unlinkSync(INDEX_PATH); } catch (err) {}+ return { removed, total: entries.length };+}+ module.exports = { setCredential, mergeImportedCredentials, getCredentialForUrl, listCredentials, deleteCredential,+ wipeAll, applyCredentialsToPage, fillLoginForm, autofillFormFromVault,
src/server.js+69@@ -12346,6 +12346,75 @@ const server = http.createServer(async (req, res) => { sendJSON(res, { success: true, output: JSON.stringify({ ok: true, closed, skipped, protectedByPages, _hint: closed.length ? `Closed the idle browser process for: ${closed.join(', ')}. The next pup_open_window on these profiles launches a FRESH Chrome, which re-reads staged extensions.` : `No idle browsers to close.${protectedByPages.length ? ` PROTECTED from closing (still hold open windows, likely mid-re-adoption after a restart): ${protectedByPages.join(', ')}.` : ' Every known browser still carries live sessions (listed in skipped).'}` }) }); return; }+ case 'pup_uninstall': {+ // v2.0.126 (John): cleanly remove pup's WHOLE machine footprint. Destructive — REASON-+ // GATED behind confirm:"uninstall". dryRun:true reports what WOULD be removed. Keep-flags+ // preserve user data (keepCredentials, keepProfiles). Chrome-for-Testing + firewall rules+ // are SHARED/system, left alone unless removeChrome / removeFirewallRules. Everything runs+ // in-process on the desktop (this bridge IS on the machine) via fs + reg.exe.+ const dry = args && args.dryRun === true;+ const rmChrome = args && args.removeChrome === true;+ if (!dry && (!args || args.confirm !== 'uninstall')) {+ sendJSON(res, { success: false, errorCode: 'confirm_required', _hint: 'pup_uninstall REMOVES pup\'s footprint from this machine (registry AUMID keys, staged extensions, all pup profiles, the login vault, settings, temp + launcher files). Preview first: pup_uninstall {dryRun:true}. To actually remove: pup_uninstall {confirm:"uninstall"}. Keep your saved logins: add keepCredentials:true. Keep profiles/sessions: keepProfiles:true. Chrome-for-Testing and firewall rules are left unless removeChrome:true / removeFirewallRules:true.' });+ return;+ }+ const home = os.homedir();+ const P = (...a) => path.join(home, '.adom', ...a);+ const dirTargets = [+ { path: PROFILES_DIR, label: 'pup-profiles (all windows/logins)', skip: args && args.keepProfiles === true },+ { path: P('pup-sessions'), label: 'pup-sessions', skip: args && args.keepProfiles === true },+ { path: P('pup-sessions-bak'), label: 'pup-sessions-bak', skip: args && args.keepProfiles === true },+ { path: P('pup-extension'), label: 'toolbar extension' },+ { path: P('pup-identity-extension'), label: 'identity extension' },+ { path: P('pup-identity-anon-extension'), label: 'anon identity extension' },+ { path: P('pup-annotate-extension'), label: 'annotate extension' },+ { path: P('pup-avatars'), label: 'pup-avatars' },+ { path: path.join(require('os').tmpdir(), 'pup-badge-debug'), label: 'badge-debug temp' },+ ];+ const fileTargets = [+ { path: PUP_SETTINGS_PATH, label: 'pup-settings.json' },+ { path: pupJumplistLauncherPath(), label: 'jump-list launcher' },+ { path: path.join(home, '.adom', 'pup-jumplist-port'), label: 'jump-list port file' },+ ];+ if (rmChrome) dirTargets.push({ path: path.join(home, '.cache', 'puppeteer', 'chrome'), label: 'Chrome-for-Testing install' });+ // count/measure+ const exists = (p) => { try { return fs.existsSync(p); } catch (e) { return false; } };+ const willRemoveDirs = dirTargets.filter(t => !t.skip && exists(t.path));+ const willRemoveFiles = fileTargets.filter(t => exists(t.path));+ // AUMID registry keys+ let aumidKeys = [];+ if (_isWin) { try { aumidKeys = String(execFileSync('reg', ['query', 'HKCU\\Software\\Classes\\AppUserModelId'], { encoding: 'utf8', timeout: 5000, windowsHide: true })).split(/\r?\n/).filter(l => /\\Adom\.Pup/i.test(l)).map(l => l.trim()); } catch (e) {} }+ const vaultCount = (args && args.keepCredentials === true) ? 0 : (() => { try { return credentialVault.listCredentials().length; } catch (e) { return 0; } })();++ const plan = {+ registryKeys: aumidKeys.length,+ profilesAndSessions: (args && args.keepProfiles === true) ? 'KEPT' : willRemoveDirs.filter(t => /profile|session/.test(t.label)).map(t => t.label),+ directories: willRemoveDirs.map(t => t.label),+ files: willRemoveFiles.map(t => t.label),+ vaultCredentials: (args && args.keepCredentials === true) ? 'KEPT' : vaultCount,+ chromeForTesting: rmChrome ? 'WILL REMOVE' : 'kept (shared)',+ firewallRules: (args && args.removeFirewallRules === true) ? 'WILL REMOVE' : 'kept',+ };+ if (dry) { sendJSON(res, { success: true, output: JSON.stringify({ ok: true, dryRun: true, plan, _hint: `Preview only — nothing removed. To do it: pup_uninstall {confirm:"uninstall"}${args && args.keepCredentials ? ', keepCredentials:true' : ''}${args && args.keepProfiles ? ', keepProfiles:true' : ''}.` }) }); return; }++ // EXECUTE. First close every window + quit every browser so profile dirs unlock.+ const removed = { registryKeys: 0, dirs: [], files: [], vaultCredentials: 0, errors: [] };+ try { for (const [pName, be] of [...browsers]) { try { await killBrowserProcess(be.browser, pName); } catch (e2) {} } browsers.clear(); sessions.clear(); } catch (e) { removed.errors.push('close-all: ' + e.message); }+ await new Promise(r => setTimeout(r, 1500));+ // registry+ if (_isWin) { for (const line of aumidKeys) { try { execFileSync('reg', ['delete', line, '/f'], { timeout: 5000, windowsHide: true, stdio: 'ignore' }); removed.registryKeys++; } catch (e) { removed.errors.push('reg ' + line + ': ' + e.message); } } }+ // dirs+ for (const t of willRemoveDirs) { try { fs.rmSync(t.path, { recursive: true, force: true, maxRetries: 3, retryDelay: 300 }); removed.dirs.push(t.label); } catch (e) { removed.errors.push(t.label + ': ' + e.message); } }+ // files+ for (const t of willRemoveFiles) { try { fs.rmSync(t.path, { force: true }); removed.files.push(t.label); } catch (e) { removed.errors.push(t.label + ': ' + e.message); } }+ // vault+ if (!(args && args.keepCredentials === true)) { try { const w = await credentialVault.wipeAll(); removed.vaultCredentials = w.removed; } catch (e) { removed.errors.push('vault: ' + e.message); } }+ // firewall (needs admin; best-effort)+ if (_isWin && args && args.removeFirewallRules === true) { try { execFileSync('powershell', ['-NoProfile', '-Command', "Get-NetFirewallApplicationFilter | Where-Object { $_.Program -match 'puppeteer.*chrome' } | Remove-NetFirewallRule -ErrorAction SilentlyContinue"], { timeout: 15000, windowsHide: true, stdio: 'ignore' }); removed.firewallRules = 'attempted'; } catch (e) { removed.errors.push('firewall (needs admin): ' + e.message); } }++ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, removed, _hint: `pup uninstalled from this machine. Removed ${removed.registryKeys} registry key(s), ${removed.dirs.length} dir(s), ${removed.files.length} file(s), ${removed.vaultCredentials} vault credential(s).${removed.errors.length ? ' Some items errored (may need Chrome fully closed or admin): ' + removed.errors.slice(0, 5).join('; ') : ''} Chrome-for-Testing ${rmChrome ? 'removed' : 'left in place (shared)'}. The bridge itself is managed by Adom Bridge — remove pup from Bridge to stop it re-seeding.` }) });+ return;+ } case 'pup_rescan': { // v1.5.1+: orphan-recovery primitive. Walk every known profile // (in-memory + on-disk session files), attempt reconnect for any