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 with its AI thread's name in your taskbar or dock.
← Commit history
v1.8.8: implement browser_click/type/press_key/back/forward + browser_evaluate alias (advertised but missing from the router — caught by full verb self-test)
4 files changed
+92−7
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.8.7",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.7/adom-bridge-puppeteer-v1.8.7.zip",- "sha256": "fd2e075f08323d0f0d19659f0441bfd86f1a26dd33aee248a5fc8120a944f16b",- "size": 131661,+ "version": "1.8.8",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.8/adom-bridge-puppeteer-v1.8.8.zip",+ "sha256": "aa707205d09dc65440d1c0d3876c331fbe6e67b71e9189b07ffd484ec7f7f297",+ "size": 132932, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.8.7+1.8.8
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.8.7",+ "version": "1.8.8", "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.",
src/server.js+86−1@@ -3014,9 +3014,13 @@ const server = http.createServer(async (req, res) => { }); return; }+ // browser_evaluate is the catalog/manifest name; browser_eval the historical one.+ // Accept both, with either `expr` or `expression`.+ case 'browser_evaluate': case 'browser_eval': {+ if (!args.expr && args.expression) args.expr = args.expression; if (!args.expr) {- sendJSON(res, { success: false, error: 'Missing required parameter "expr". Usage: browser_eval { "sessionId": "...", "expr": "document.title" }' });+ sendJSON(res, { success: false, error: 'Missing required parameter "expr" (alias: "expression"). Usage: browser_eval { "sessionId": "...", "expr": "document.title" }' }); return; } let session, resolvedId;@@ -3041,6 +3045,87 @@ const server = http.createServer(async (req, res) => { sendJSON(res, { success: true, output: JSON.stringify({ ok: true, result, sessionId: resolvedId, tabId }) }); return; }+ // ── Element-level input + history nav (v1.8.8) ─────────────────────────+ // These five were advertised in bridge.json + browser_describe but had no+ // router cases (found by the full verb self-test). Selector-based where it+ // helps; same session/tab auto-recovery as browser_eval.+ case 'browser_click': {+ if (!args.selector && !(Number.isFinite(Number(args.x)) && Number.isFinite(Number(args.y)))) {+ sendJSON(res, { success: false, error: 'browser_click needs "selector" OR "x"+"y". Usage: { "sessionId": "...", "selector": "#submit" } or { "sessionId": "...", "x": 100, "y": 200 }' });+ return;+ }+ let session, resolvedId;+ try { ({ session, resolvedId } = await recoverOrRelaunchSession(args)); }+ catch (e) { sendSessionResolveError(res, e); return; }+ let tab, tabId;+ try { ({ tab, tabId } = resolveTabOrError(session, resolvedId, args)); }+ catch (e) { sendTabResolveError(res, e); return; }+ try {+ if (args.selector) await withTimeout(tab.page.click(args.selector), 10_000, 'page.click');+ else await withTimeout(tab.page.mouse.click(Number(args.x), Number(args.y)), 10_000, 'mouse.click');+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, clicked: args.selector || { x: Number(args.x), y: Number(args.y) }, sessionId: resolvedId, tabId, _hint: 'Click dispatched (isTrusted, CDP-level). Verify the effect with browser_eval (e.g. document.title or a state probe) — a click that hit nothing still returns ok.' }) });+ } catch (e) {+ sendJSON(res, { success: false, errorCode: 'click_failed', error: `browser_click failed: ${e.message}`, _hint: args.selector ? `Selector "${args.selector}" may not exist/be visible. Probe it first: browser_eval {"expr":"!!document.querySelector('${args.selector}')"} — or click by x/y from a browser_screenshot.` : 'x/y click failed — coordinates are page-viewport pixels; take a browser_screenshot to aim.' });+ }+ return;+ }+ case 'browser_type': {+ if (typeof args.text !== 'string') {+ sendJSON(res, { success: false, error: 'browser_type needs "text" (string). Optional "selector" focuses the element first. Usage: { "sessionId": "...", "selector": "#q", "text": "hello" }' });+ return;+ }+ let session, resolvedId;+ try { ({ session, resolvedId } = await recoverOrRelaunchSession(args)); }+ catch (e) { sendSessionResolveError(res, e); return; }+ let tab, tabId;+ try { ({ tab, tabId } = resolveTabOrError(session, resolvedId, args)); }+ catch (e) { sendTabResolveError(res, e); return; }+ try {+ if (args.selector) await withTimeout(tab.page.type(args.selector, args.text), 15_000, 'page.type');+ else await withTimeout(tab.page.keyboard.type(args.text), 15_000, 'keyboard.type');+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, typed: args.text.length + ' chars', into: args.selector || 'focused element', sessionId: resolvedId, tabId, _hint: 'Typed via CDP (isTrusted). Verify with browser_eval reading the field value.' }) });+ } catch (e) {+ sendJSON(res, { success: false, errorCode: 'type_failed', error: `browser_type failed: ${e.message}`, _hint: args.selector ? `Selector "${args.selector}" may not exist. Probe: browser_eval {"expr":"!!document.querySelector('${args.selector}')"}` : 'No selector given — ensure an element has focus (browser_click it first).' });+ }+ return;+ }+ case 'browser_press_key': {+ if (!args.key) {+ sendJSON(res, { success: false, error: 'browser_press_key needs "key" — a puppeteer KeyInput name like "Enter", "Tab", "Escape", "ArrowDown", "a". Usage: { "sessionId": "...", "key": "Enter" }' });+ return;+ }+ let session, resolvedId;+ try { ({ session, resolvedId } = await recoverOrRelaunchSession(args)); }+ catch (e) { sendSessionResolveError(res, e); return; }+ let tab, tabId;+ try { ({ tab, tabId } = resolveTabOrError(session, resolvedId, args)); }+ catch (e) { sendTabResolveError(res, e); return; }+ try {+ await withTimeout(tab.page.keyboard.press(args.key), 10_000, 'keyboard.press');+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, pressed: args.key, sessionId: resolvedId, tabId, _hint: 'Key pressed in the PAGE (isTrusted). For OS-level chords outside the page (alt+f4, ctrl+shift+p in browser chrome), use AD\'s desktop_press_key instead.' }) });+ } catch (e) {+ sendJSON(res, { success: false, errorCode: 'press_key_failed', error: `browser_press_key failed: ${e.message}`, _hint: `"${args.key}" must be a valid puppeteer KeyInput name (case-sensitive: "Enter", "ArrowLeft", "F5", single chars like "a").` });+ }+ return;+ }+ case 'browser_back':+ case 'browser_forward': {+ let session, resolvedId;+ try { ({ session, resolvedId } = await recoverOrRelaunchSession(args)); }+ catch (e) { sendSessionResolveError(res, e); return; }+ let tab, tabId;+ try { ({ tab, tabId } = resolveTabOrError(session, resolvedId, args)); }+ catch (e) { sendTabResolveError(res, e); return; }+ const dir = command === 'browser_back' ? 'back' : 'forward';+ try {+ const resp = await withTimeout(dir === 'back' ? tab.page.goBack({ waitUntil: 'domcontentloaded' }) : tab.page.goForward({ waitUntil: 'domcontentloaded' }), 20_000, 'history.' + dir);+ let url = null; try { url = tab.page.url(); } catch {}+ sendJSON(res, { success: true, output: JSON.stringify({ ok: true, direction: dir, moved: resp !== null, url, sessionId: resolvedId, tabId, _hint: resp === null ? `No ${dir === 'back' ? 'earlier' : 'later'} history entry — the page did not move (moved:false, not an error).` : `Now at ${url}.` }) });+ } catch (e) {+ sendJSON(res, { success: false, errorCode: dir + '_failed', error: `browser_${dir} failed: ${e.message}` });+ }+ return;+ } case 'browser_input_dispatch': { // Trusted input via puppeteer's CDP-backed page.mouse / page.keyboard. // Events fired here have isTrusted=true (Chromium dispatches them at the