← Commit history

Human clicks get the foreground: the Open-pup-dashboard jump-list task now raises the dashboard when a person clicks it, opening fresh or refocusing the already-running window, while AI callers keep the background default; also unblock the dashboard button's favicon overlay, which the thread-tile latch guard was suppressing forever.

John Lauer ·b90302edf3 ·2mo ago ·parent bc001f2
4 files changed +28−12
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.177",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.177/adom-bridge-puppeteer-v2.0.177.zip",-  "sha256": "9f8a25e37e8e230e6fcfb480f3560c8270ba4efe60bd78d22cf180bfa6e02c2f",-  "size": 917505,+  "version": "2.0.178",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.178/adom-bridge-puppeteer-v2.0.178.zip",+  "sha256": "f36bead4d4ffc7c0801c4999987978c82a5523518a170f62333d54fe5390c8d6",+  "size": 918052,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.177+2.0.178
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.177",+  "version": "2.0.178",   "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+22−6
@@ -5762,7 +5762,11 @@ async function applyAppOverlay(session, sessionId) {   // ONLY once the thread appId has landed, plus a settle beat for the shell to finish the move.   // No 30s-grace fallback here — painting the pre-thread button is exactly the latch that breaks the   // direct CfT -> thread-tile transition (John's rule).-  if (pupSettings().threadTiles === 'on' && session && (session.owner || session._ownerThread)) {+  // v2.0.178 (John: dashboard button had NO overlay, "shame on you"): the latch guard below must+  // only gate sessions whose DESIRED identity is a thread tile. The dashboard has an owner+  // ("pup-dashboard") but deliberately wears its own Adom.Pup.Dashboard identity, never a thread+  // one — so the old guard blocked its overlay FOREVER. Same _dashInfra carve-out as the stamp.+  if (pupSettings().threadTiles === 'on' && sessionId !== 'pup-dashboard' && session && (session.owner || session._ownerThread)) {     if (!(session._curAppId || '').startsWith(`${PUP_APP_ID}.thread.`)) return false;     if (!session._threadStampAt || (Date.now() - session._threadStampAt) < 5000) return false;   }@@ -16394,17 +16398,29 @@ const server = http.createServer(async (req, res) => {           // the one window instead of spawning duplicates. Opens in the background like any pup           // window: it is a monitor, and monitors must not steal the screen.           const dashUrl = `http://127.0.0.1:${PORT}/dashboard`;+          // v2.0.178 (John: "when I click the jump list to open the dashboard, open it FOREGROUND —+          // it was a human action, not an AI action"). Exactly right: the background-always rule+          // exists so AIs never steal the screen, but a jump-list / toolbar click IS the user asking+          // to see it — backgrounding it just makes the click feel broken. USER_CALLERS is the+          // human-surface marker (taskbar menu, toolbar, pill), so those callers get the window+          // raised; AI callers keep the background default + raise-with-reason path.+          const _humanClick = USER_CALLERS.has(_callerThread);+          const _humanReason = 'you clicked "Open pup dashboard" in the taskbar menu';           try {             const existing = sessions.get('pup-dashboard');             if (existing) {               try { await existing.page.goto(dashUrl, { waitUntil: 'domcontentloaded', timeout: 15000 }); } catch (e) {}-              sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: 'pup-dashboard', url: dashUrl, reused: true,-                _hint: `The pup dashboard is already open in its own window (session "pup-dashboard") and was refreshed. It is BACKGROUNDED like any pup window; raise it with pup_raise_os_window + a foregroundReason if the user asked to see it.` }) });+              if (_humanClick) { try { await osRaiseSessionWindow(existing, 'pup-dashboard', _humanReason); } catch (e) {} }+              sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: 'pup-dashboard', url: dashUrl, reused: true, foregrounded: _humanClick,+                _hint: _humanClick+                  ? `The pup dashboard was already open — refreshed and RAISED to the foreground (a human clicked the jump-list task, so no background etiquette applies).`+                  : `The pup dashboard is already open in its own window (session "pup-dashboard") and was refreshed. It is BACKGROUNDED like any pup window; raise it with pup_raise_os_window + a foregroundReason if the user asked to see it.` }) });               return;             }-            await launchSession('pup-dashboard', dashUrl, { profile: 'pup-dashboard', owner: 'pup-dashboard' });-            sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: 'pup-dashboard', url: dashUrl, reused: false,-              _hint: `Opened the live pup dashboard in its OWN window (session "pup-dashboard", its own profile so it has its own taskbar icon). It shows every window pup is driving, grouped taskbar button -> window -> tabs, with each tab's favicon, the owning AI thread, foreground/background plus the reason given to foreground, highFps lease, uptime, and how each overlay icon was chosen. Updates live over SSE. Backgrounded by default.` }) });+            const _dashSess = await launchSession('pup-dashboard', dashUrl, { profile: 'pup-dashboard', owner: 'pup-dashboard', foreground: _humanClick });+            if (_humanClick) { try { await osRaiseSessionWindow(_dashSess || sessions.get('pup-dashboard'), 'pup-dashboard', _humanReason); } catch (e) {} }+            sendJSON(res, { success: true, output: JSON.stringify({ ok: true, sessionId: 'pup-dashboard', url: dashUrl, reused: false, foregrounded: _humanClick,+              _hint: `Opened the live pup dashboard in its OWN window (session "pup-dashboard", its own profile so it has its own taskbar icon). It shows every window pup is driving, grouped taskbar button -> window -> tabs, with each tab's favicon, the owning AI thread, foreground/background plus the reason given to foreground, highFps lease, uptime, and how each overlay icon was chosen. Updates live over SSE. ${_humanClick ? 'FOREGROUNDED (human click on a user surface).' : 'Backgrounded by default.'}` }) });           } catch (e) {             sendJSON(res, { success: false, errorCode: 'dashboard_open_failed', error: `could not open the dashboard: ${e.message}` });           }