← Commit history

Two fixes John flagged live. (1) STALE TASKBAR PROGRESS BAR ('i see you leave those stale quite often'): the busy-state idle-timer cleared by window title via desktop_taskbar, which SILENTLY FAILS if the window is not findable that instant (churned/leftover session) — leaving the OS bar lit while pup thinks it is off. Fixed: clearSessionBusy now explicitly turns the OS bar OFF on teardown, AND a 20s reconciler asserts progress:none for every live session that is not actively busy, so any stranded bar self-heals within the interval instead of lingering until John notices. (2) TOAST BEFORE FOREGROUND ('use an AD toast to get a human's attention' — told repeatedly): pup now auto-fires notify_user whenever it FOREGROUNDS a window (browser_raise_os_window grant + foreground:true open), debounced per session, with the foregroundReason as the body — so a window never appears on the user's screen silently again. Standing rule added to SKILL.md.

John Lauer ·9c53c7eb79 ·3mo ago ·parent f1961e0
4 files changed +38−7
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.165",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.165/adom-bridge-puppeteer-v1.9.165.zip",-  "sha256": "fd7f8ec6f491dc9236a2ae9167be6a9e617f7c4a71af7c45fc73d067639210dc",-  "size": 404402,+  "version": "1.9.166",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.166/adom-bridge-puppeteer-v1.9.166.zip",+  "sha256": "dbf05b6cb32039229d7859d0e7ac128e56320d11f1058da6ee6a25761944937a",+  "size": 404995,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.165+1.9.166
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.165",+  "version": "1.9.166",   "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. 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, 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.",
src/server.js+32−1
@@ -2763,6 +2763,20 @@ async function setSessionProgress(sessionId, busy) {     }, { timeoutMs: 4000 });   } catch (e) {} }+// v1.9.166 (John, repeatedly: 'use an AD toast to get a human's attention'). Whenever pup FOREGROUNDS+// a window (a reveal / demo / 'show me'), fire an AD toast FIRST so the user's eyes are drawn to what+// just appeared — never silently push a window onto their screen. Best-effort; debounced per session.+const _fgToastAt = new Map();+async function toastForeground(sessionId, reason) {+  try {+    if (process.platform !== 'win32') return;+    const now = Date.now();+    if (now - (_fgToastAt.get(sessionId) || 0) < 4000) return;   // debounce a burst+    _fgToastAt.set(sessionId, now);+    const body = reason ? String(reason).slice(0, 140) : 'Adom opened a window on your screen.';+    await chrome.adCommand('notify_user', { title: 'Adom is showing you a window', body, focus: false }, { timeoutMs: 4000 });+  } catch (e) {}+} function markSessionBusy(sessionId) {   if (process.platform !== 'win32' || !sessionId) return;   if (pupSettings().agentActivity === 'off') return;      // user opt-out via browser_configure@@ -2783,7 +2797,14 @@ function markSessionBusy(sessionId) { } function clearSessionBusy(sessionId) {   const st = _busyState.get(sessionId);-  if (st) { clearTimeout(st.timer); _busyState.delete(sessionId); }+  if (st) {+    clearTimeout(st.timer);+    // v1.9.166 (John: 'i see you leave those stale quite often'): explicitly turn the OS taskbar+    // progress OFF on teardown. Deleting the internal state alone left the taskbar bar lit whenever+    // the window churned before its idle-timer fired (the stale-bar bug).+    if (st.busy) setSessionProgress(sessionId, false).catch(() => {});+    _busyState.delete(sessionId);+  } } // Verbs that are pure status/polling: they do NOT mean an agent is driving the window, and lighting // the bar for them would make every window look permanently busy (the audit loops alone poll these).@@ -7085,6 +7106,7 @@ const server = http.createServer(async (req, res) => {           }           if (session && fgGranted) {             session._lastForeground = { ts: Date.now(), verb: 'browser_open_window', reason: fgReason };+            toastForeground(sessionId, fgReason).catch(() => {});   // v1.9.166             try { recordAgentUpdate(session, 'browser_open_window', { updateNote: `FOREGROUND: ${fgReason}` }, session.activeTabId); } catch (e) {}           }           // v1.8.23: session-level auto-flash default (autoFlash:false → this window never@@ -7990,6 +8012,7 @@ const server = http.createServer(async (req, res) => {           }           console.log(`[foreground] "${sessionId}" raise GRANTED — reason: ${fgReason}`);           session._lastForeground = { ts: Date.now(), verb: command, reason: fgReason };+          toastForeground(sessionId, fgReason).catch(() => {});   // v1.9.166: ping the human before/as we reveal           // v1.9.150: the reveal redraws the taskbar button; nothing re-wore the favicon, so all           // three of John's foregrounded windows lost their overlay. Re-assert it after the raise.           setTimeout(() => { updateTabCountBadge(session, args.sessionId || session._sessionId).catch(() => {}); }, 1200);@@ -9877,6 +9900,14 @@ server.listen(PORT, BIND_HOST, async () => {   // net, so an unbranded window can never persist even if its window-opened event was missed.   setTimeout(() => { reclaimUnmanagedWindows().catch(() => {}); }, 12000);   setInterval(() => { reclaimUnmanagedWindows().catch(() => {}); }, 90000);+  // v1.9.166: taskbar-progress reconciler — clear any bar that is lit but shouldn't be.+  setInterval(async () => {+    if (process.platform !== 'win32' || pupSettings().agentActivity === 'off') return;+    for (const [sid] of [...sessions]) {+      const st = _busyState.get(sid);+      if (!st || !st.busy) { try { await setSessionProgress(sid, false); } catch (e) {} }+    }+  }, 20000);   // v1.9.145 (John found v21-review stranded at -32000 all day) — PLACEMENT SWEEP. The healer   // (healOffscreenWindow) existed but only ran from a few verb paths, so a long-lived window that   // predated the on-screen park kept its off-screen geometry FOREVER — made worse by the reparent: