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.8.0: background-by-default open (no focus steal, still drivable) + real browser_lower/raise_os_window verbs + strong placement hints
6 files changed
+97−34
SKILL.md+18−14@@ -108,24 +108,28 @@ adom-desktop browser_reload '{"sessionId":"myapp"}' **These are Bash commands, not MCP tools.** Always pass `sessionId` — `'{}'` targets the *active* session, which may not be the one you mean. -## Background by default — don't disrupt the user+## Background by default — pup NEVER pops onto the user's screen unless asked -**Pup is the AI's workspace, not the user's. Keep its windows OUT of the user's way unless they asked to watch.**+**Pup is the AI's workspace, not the user's.** `browser_open_window` opens **in the background by default**+(behind the user's windows, no focus stolen) — you do NOT need to lower it yourself; it's automatic. The+window is **fully drivable while hidden**: `browser_screenshot`, `browser_eval`, `browser_navigate` all+work on a background window. So for the overwhelmingly common case — the AI opens a page to screenshot/scrape/+debug — **just open it and drive it; the user never sees a thing.** -- After opening/driving a window for automation (screenshot, eval, scrape, a debug loop), call- **`browser_lower_os_window`** to send it to the back so it doesn't sit on top of what the user is doing.-- **Never** call `browser_raise_os_window` (foreground) unless the user must SEE it — a recording, a demo,- or a finished result you're explicitly showing them.-- Use **`browser_alert_window`** (flashes the taskbar) for a non-intrusive "it's ready / done" nudge- instead of stealing focus.-- For long-running dashboards the user WILL look at, opening a dedicated pup window is fine — but still- don't keep re-raising it on every update; flash the taskbar instead.+- **Only bring a window to the user's screen when they explicitly want to WATCH** — a demo, a recording, a+ "show me this" / "open it so I can see." Then (and only then) pass **`foreground:true`** on open, or call+ **`browser_raise_os_window`**. Opening something the user didn't ask to see, in the foreground, is exactly+ the disruption to avoid.+- Use **`browser_alert_window`** (flashes the taskbar) for a non-intrusive "it's ready / done" nudge instead+ of raising the window.+- Re-hide a window you foregrounded with **`browser_lower_os_window`**. ```bash-adom-desktop browser_open_window '{"sessionId":"job","profile":"job","url":"<url>"}'-adom-desktop browser_lower_os_window '{"sessionId":"job"}' # get it off the user's screen; keep driving headlessly-# ...screenshot / eval / navigate as needed (works while lowered)...-adom-desktop browser_alert_window '{"sessionId":"job"}' # non-intrusive "done" when you want their attention+# Default: opens in the BACKGROUND, drive it invisibly — the user is never interrupted.+adom-desktop browser_open_window '{"sessionId":"job","url":"<url>"}'+adom-desktop browser_screenshot '{"sessionId":"job"}' # works while the window is in the background+# Only if the user asked to SEE it:+adom-desktop browser_open_window '{"sessionId":"demo","url":"<url>","foreground":true}' ``` ## Core verbs
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.7.2",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.7.2/adom-bridge-puppeteer-v1.7.2.zip",- "sha256": "3e10b42effe8e5337c28f0737e7eddb36c76ab1e58534b8f25fc78ae380dcf30",- "size": 128908,+ "version": "1.8.0",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.0/adom-bridge-puppeteer-v1.8.0.zip",+ "sha256": "18deadfe1b3453e5842bc6e99b009759feac9bf238aed7cc74a5f27fc46b94f6",+ "size": 130623, "verbPrefixes": [ "browser_", "desktop_recorder_",
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "adom-desktop-puppeteer-bridge",- "version": "1.7.2",+ "version": "1.8.0", "type": "app", "description": "CONTAINER-SIDE install \u2014 the everyday `pup` user skill only. This pkg drops the `pup` skill (drive the browser bridge: open/close/tabs/screenshot/record, background-by-default) into ~/.claude/skills/ AND ~/.codex/skills/. It does NOT install the developer/publishing skills (pup-bridge-dev, pup-bridge-publish) \u2014 those are source-only; clone the repo (adom-wiki repo clone adom/adom-desktop-puppeteer-bridge) to get them from dev-skills/. It also does NOT contain the bridge runtime: the bridge (Node + Chrome for Testing) lives on the DESKTOP \u2014 bundled inside Adom Desktop and published here on the Releases tab as adom-bridge-puppeteer-v<ver>.zip, which Adom Desktop streams into its bridges-cache. TL;DR: `pkg install` = the pup user skill; dev skills = clone the source; the bridge = the Release zip + bundled in Adom Desktop.", "keywords": [
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.7.2+1.8.0
src/bridge.json+6−2@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.7.2",+ "version": "1.8.0", "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.", "homepage": "https://wiki.adom.inc/adom/adom-desktop", "author": "Adom Inc.",@@ -46,7 +46,11 @@ "desktop_recorder_open", "desktop_record_start", "desktop_record_stop",- "browser_describe"+ "browser_describe",+ "browser_lower_os_window",+ "browser_raise_os_window",+ "browser_focus_window",+ "browser_alert_window" ], "statusVerb": "browser_readiness", "updateManifestUrl": "https://wiki.adom.inc/api/v1/pages/adom-desktop-puppeteer-bridge/files/adom-bridge-puppeteer-manifest.json",
src/server.js+67−12@@ -1361,6 +1361,39 @@ function browserPickReport() { }; } +// Push a pup window to the BACK of the z-order WITHOUT activating it. Occluded, NOT+// minimized — it keeps compositing, so screenshots/eval still work while it sits behind+// the user's windows. This is what makes "open in pup" non-disruptive BY DEFAULT: the AI+// drives it invisibly and only an explicit request ever brings it forward. Scoped to THIS+// session's Chrome pid (+ its child chrome/msedge processes) so it never touches the+// user's real browser windows. Windows-only; no-op elsewhere.+function osSendWindowToBack(profileName) {+ if (process.platform !== 'win32') return false;+ const be = browsers.get(profileName);+ const pid = (be && be.browser && (be.browser._detachedPid || (be.browser.process() && be.browser.process().pid))) || null;+ if (!pid) return false;+ try {+ const psScript = path.join(require('os').tmpdir(), `_adom_bg_${pid}.ps1`);+ const ps = [+ 'Add-Type @"',+ 'using System; using System.Runtime.InteropServices;',+ 'public class WinBg { [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr h, IntPtr a, int x, int y, int cx, int cy, uint f); }',+ '"@',+ `$targetPid = ${pid}`,+ '$BOTTOM = [IntPtr]1', // HWND_BOTTOM+ '$F = 0x1 -bor 0x2 -bor 0x10', // SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE+ 'function Back($h){ if($h -ne [IntPtr]::Zero){ [WinBg]::SetWindowPos($h,$BOTTOM,0,0,0,0,$F) | Out-Null } }',+ '$p = Get-Process -Id $targetPid -ErrorAction SilentlyContinue',+ 'if ($p -and $p.MainWindowHandle -ne 0) { Back $p.MainWindowHandle }',+ 'Get-CimInstance Win32_Process -Filter "ParentProcessId=$targetPid" -ErrorAction SilentlyContinue | Where-Object { $_.Name -in @("chrome.exe","msedge.exe") } | ForEach-Object { $cp = Get-Process -Id $_.ProcessId -ErrorAction SilentlyContinue; if ($cp -and $cp.MainWindowHandle -ne 0) { Back $cp.MainWindowHandle } }',+ 'Write-Output "bg"',+ ].join('\r\n');+ fs.writeFileSync(psScript, ps);+ execSync(`powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${psScript}"`, { timeout: 6000 });+ return true;+ } catch (e) { console.error(`[bg] send-to-back failed for "${profileName}": ${e.message}`); return false; }+}+ async function getOrLaunchBrowser(profileName, { freshProfile = false, strictPermissions = false, nativeSite = false } = {}) { // Check if browser already running for this profile. // isConnected() can be stale after laptop sleep/wake — the WebSocket hasn't@@ -2425,7 +2458,7 @@ const server = http.createServer(async (req, res) => { hint: m.hint || summary, related: m.related || [], pitfalls: m.pitfalls || [] }; }; sendJSON(res, { success: true, bridge: 'puppeteer', verbs: [- V('browser_open_window', 'Open a generic pup window — a fresh isolated Chrome/Edge process (never your real signed-in browser), fully drivable via CDP. profile defaults to sessionId. (For the user\'s REAL Chrome/Edge, use the Adom extension\'s nbrowser_* verbs.)', { sessionId: 'required str', url: 'optional str', profile: 'optional str — defaults to sessionId' }, 60, { sessionId: 'work', url: 'https://example.com' }),+ V('browser_open_window', 'Open a generic pup window — a fresh isolated Chrome/Edge process (never your real signed-in browser), fully drivable via CDP. Opens in the BACKGROUND by default (does not steal focus; still fully screenshottable/drivable) — pass foreground:true ONLY if the user wants to watch. profile defaults to sessionId. (For the user\'s REAL Chrome/Edge, use the Adom extension\'s nbrowser_* verbs.)', { sessionId: 'required str', url: 'optional str', profile: 'optional str — defaults to sessionId', foreground: 'optional bool — bring the window to the user\'s screen (default false = background)' }, 60, { sessionId: 'work', url: 'https://example.com' }), V('browser_open_tab', 'Open a new tab in a session.', { sessionId: 'required str', url: 'optional str' }, 30, { sessionId: 'work', url: 'https://example.com' }), V('browser_close_tab', 'Close a tab.', { sessionId: 'required str', tabId: 'optional str (default active)' }, 15, { sessionId: 'work' }), V('browser_close_window', 'Close a window/session (its tabs go too).', { sessionId: 'required str' }, 20, { sessionId: 'work' }),@@ -2450,6 +2483,9 @@ const server = http.createServer(async (req, res) => { V('browser_readiness', 'Readiness + which browser pup will drive (installed Chrome/Edge, or cached Chrome for Testing) + the full candidate list and current default. READ-ONLY; never downloads.', {}, 10, {}), V('browser_prewarm', 'Install Chrome for Testing WITHOUT opening a window, and pin it as the default. Use when you specifically want CfT rather than the machine\'s installed Chrome/Edge.', { wait: 'optional bool — block until installed', setDefault: 'optional bool (default true) — pin CfT as the default' }, 240, {}), V('browser_use', 'Pin (or clear) the browser pup drives by default: chrome | edge | cft | auto (or an explicit executablePath). "cft" fetches Chrome for Testing then pins it. With {browser:"chrome", install:true} it DOWNLOADS & INSTALLS real Google Chrome (user-scoped, no admin) on an Edge-only box, then pins it. Persists across restarts; launch still spawn-verifies + falls back.', { browser: '"chrome" | "edge" | "cft" | "auto"', install: 'optional bool — with browser:"chrome", install real Chrome if missing', executablePath: 'optional — pin an exact browser binary' }, 240, {}),+ V('browser_lower_os_window', 'Send a pup window to the BACKGROUND (behind the user\'s windows) without stealing focus — still fully drivable. The default for open; use this to re-hide a window you foregrounded.', { sessionId: 'optional str' }, 15, {}),+ V('browser_raise_os_window', 'Bring a pup window to the FOREGROUND (user\'s screen). Use SPARINGLY — only when the user must SEE it (a demo, recording, "show me"). Alias: browser_focus_window.', { sessionId: 'optional str' }, 15, {}),+ V('browser_alert_window', 'Flash the taskbar icon for a pup window — a non-intrusive "it\'s ready/done" nudge that does NOT steal focus. Prefer this over raising the window.', { sessionId: 'optional str' }, 15, {}), V('browser_describe', 'This list — the bridge\'s verbs + schemas, for AD\'s Verbs tab.', {}, 10, {}), ] }); return;@@ -2533,30 +2569,34 @@ const server = http.createServer(async (req, res) => { // tab open or popup auto-attach in this session. if (session) session._downloadPath = downloadPath; const info = await getSessionInfo(sessionId, session);- // Verbose browser report: which browser we actually drove, what else is- // available, the current default, and how to switch / install full CfT.+ // v1.8.0: BACKGROUND BY DEFAULT. pup is the AI's workspace, not the user's —+ // a window that pops to the foreground and covers what the user is doing is+ // disruptive. So unless the caller EXPLICITLY asks to show it (foreground/raise/+ // show:true — e.g. the user said "let me watch" or it's a recording/demo), we+ // push it behind the user's windows immediately. It stays fully drivable ++ // screenshottable there (occluded, not minimized).+ const foreground = !!(args.foreground || args.raise || args.show);+ if (!foreground) { try { osSendWindowToBack(args.profile); } catch (e) {} }+ // Verbose browser report: which browser we actually drove, what else is available. const brep = browserPickReport();+ const bgHint = foreground+ ? 'Opened in the FOREGROUND as requested. Return it to the background with browser_lower_os_window once the user is done watching.'+ : 'Opened in the BACKGROUND (behind the user\'s windows, did NOT steal focus) — this is the default so pup never disrupts the user. It is FULLY drivable there: browser_screenshot / browser_eval / browser_navigate all work while it stays hidden. ONLY bring it to the user\'s screen if they explicitly want to WATCH (a demo, a recording, a "show me") — then call browser_raise_os_window (or pass foreground:true on open). Otherwise keep it in the background.'; sendJSON(res, { success: true, output: JSON.stringify({ ok: true,- // Surface what we did to permissions so callers can audit the- // session's behavior. defaultPermissionsApplied is true on- // first browser launch for this profile; subsequent sessions- // sharing the same profile see false (the browser already- // had the grants from its first launch). defaultPermissionsApplied: !args.strictPermissions, defaultPermissions: args.strictPermissions ? [] : PERMISSIVE_DEFAULT_PERMISSIONS.map(p => `${p.name}=${p.setting}`),- // v1.6.3+: downloads enabled by default. Surface the path so- // the caller knows where downloads will land (and can pass- // it to desktop_watch_files without re-deriving). downloadsEnabled: !args.strictPermissions, downloadPath, // v1.4.0: which browser pup drove + the full fallback picture. browser: brep.browser, availableBrowsers: brep.availableBrowsers, defaultBrowser: brep.defaultBrowser,- _hint: brep._hint,+ // v1.8.0: window placement — background unless explicitly foregrounded.+ placement: foreground ? 'foreground' : 'background',+ _hint: `${bgHint} ${brep._hint}`, ...info, }), });@@ -2774,6 +2814,21 @@ const server = http.createServer(async (req, res) => { } return; }+ case 'browser_lower_os_window': {+ // Send a pup window to the BACKGROUND (behind the user's windows) without+ // stealing focus. It stays fully drivable + screenshottable. This is the+ // "get it off the user's screen" verb — the counterpart to raise/focus.+ const sessionId = args.sessionId || activeSessionId;+ if (!sessionId || !sessions.has(sessionId)) {+ sendJSON(res, { success: false, error: `Session "${sessionId}" not found` });+ return;+ }+ const session = sessions.get(sessionId);+ const ok = osSendWindowToBack(session.profileName);+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId, placement: 'background', applied: ok, _hint: 'Window sent behind the user\'s windows (still drivable/screenshottable). Keep pup in the background unless the user asked to watch.' }) });+ return;+ }+ case 'browser_raise_os_window': case 'browser_focus_window': { // Actually brings the Chrome window to the foreground using Win32 SetForegroundWindow const sessionId = args.sessionId || activeSessionId;