← Commit history

The forever-caption, killed at the root + no more fg/bg toggle + em-dash purge (John: 'i clicked bring to fg and you left the caption up forever. i've told you 100 times to only show that caption for 2 seconds'). ROOT CAUSE: the 2-second clamp NEVER REACHED AD. AD renamed its desktop_caption expiry arg - old builds took expiresInMs, current builds take duration - and pup still sent only expiresInMs, so AD ignored it and used its 30-SECOND default; pup's PUP_CAPTION_MAX_MS clamp was clamping a value nobody read. pupCaption and wikiCaption now send BOTH spellings so every AD build honors its own, and the foreground-reason caption shows for exactly the 2 seconds the standing rule requires. Also purged em-dashes from every user-visible caption/toast string (the no-em-dash rule applies to everything pup puts on screen, not just chat). And per John ('the notion that you would swap bring-to-fg to send-to-bg is asinine - the user alt-tabs to background in a nanosecond, your toggle can never be accurate'): window rows now ALWAYS show both [bring to fg] and [send to bg] statically - no state-derived swapping, because pup's foreground flag cannot track alt-tab reality. Both gotchas recorded in dev-skills/pup-bridge-dev.

John Lauer ·d0546378bf ·2mo ago ·parent 482d1fc
4 files changed +19−14
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.243",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.243/adom-bridge-puppeteer-v1.9.243.zip",-  "sha256": "86de3737b1e4cc64dad56ed3093fd44922a833b85f9398fea51cfabaab48cb86",-  "size": 466202,+  "version": "1.9.244",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.244/adom-bridge-puppeteer-v1.9.244.zip",+  "sha256": "72249f2f8adf5b2367718334f56179852a214d26e15cb0c4afb40afe8bfcbbe8",+  "size": 466384,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.243+1.9.244
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.243",+  "version": "1.9.244",   "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+13−8
@@ -1923,7 +1923,7 @@ async function ensureSafeForNativeInput(sessionId, { reason = 'drive the window   try { await pupCaption(msg, 15000, 'pup-native-guard'); } catch (e) {}   const ready = await waitForUserReady(sessionId, hwnd, { maxMs: 60000 });   if (!ready) {-    try { await pupCaption('Adom skipped that step — the window never came to the front, so nothing was typed.', 6000, 'pup-native-guard'); } catch (e) {}+    try { await pupCaption('Adom skipped that step: the window never came to the front, so nothing was typed.', 6000, 'pup-native-guard'); } catch (e) {}     console.log(`[native-guard] "${sessionId}": user never brought the window forward — REFUSED native input`);     return false;   }@@ -1944,7 +1944,11 @@ async function ensureSafeForNativeInput(sessionId, { reason = 'drive the window const PUP_CAPTION_MAX_MS = 2000; async function pupCaption(text, expiresInMs = PUP_CAPTION_MAX_MS, id = 'pup-assist') {   expiresInMs = Math.min(Number(expiresInMs) || PUP_CAPTION_MAX_MS, PUP_CAPTION_MAX_MS);-  try { await chrome.adCommand('desktop_caption', { text, expiresInMs, id, position: 'bottom', size: 'medium' }, { timeoutMs: 4000 }); } catch (e) {}+  // v1.9.244 (John: "you left the caption up forever. i've told you 100 times: 2 seconds"). The 2s+  // clamp NEVER REACHED AD: current AD's desktop_caption takes `duration`, pup sent `expiresInMs`+  // (an older AD spelling), so AD ignored it and used its 30s default. Send BOTH names so every AD+  // build honors its own; the clamp finally bites.+  try { await chrome.adCommand('desktop_caption', { text, duration: expiresInMs, expiresInMs, id, position: 'bottom', size: 'medium' }, { timeoutMs: 4000 }); } catch (e) {} } async function sessionHwnd(sessionId) {   // v1.9.212: prefer the STORED handle — a title lookup cannot find a PDF-viewer window at all.@@ -1973,7 +1977,7 @@ async function waitForUserReady(sessionId, hwnd, { maxMs = 120000 } = {}) {       if (Date.now() - stableSince >= 1200) return true;     } else {       stableSince = 0;-      if (Date.now() - lastCap > 3500) { lastCap = Date.now(); pupCaption('Adom is waiting — click back into THIS window when you are ready, and I will continue. (Nothing happens until you do.)', 6000).catch(() => {}); }+      if (Date.now() - lastCap > 3500) { lastCap = Date.now(); pupCaption('Adom is waiting: click back into THIS window when you are ready, and I will continue. (Nothing happens until you do.)', 6000).catch(() => {}); }     }     await new Promise(r => setTimeout(r, 400));   }@@ -3374,7 +3378,7 @@ async function captionForegroundReason(sessionId, reason, verb) {   try {     const why = String(reason || '').trim();     if (!why) return;-    await pupCaption(`Adom brought "${sessionId}" to the front — reason given: "${why}"`, 1000, 'pup-fg-reason');+    await pupCaption(`Adom brought "${sessionId}" to the front. Reason: "${why}"`, 2000, 'pup-fg-reason');   } catch (e) {} } @@ -4397,7 +4401,7 @@ async function wikiCaption(text, expiresInMs) {     // This replaced the in-page DOM toast: with a real OS surface available, pup should not be     // injecting elements into the user's page.     const r = await chrome.adCommand('desktop_caption', {-      text, expiresInMs, id: 'pup-wiki-view', position: 'bottom', size: 'medium',+      text, duration: Math.min(Number(expiresInMs) || 2000, 2000), expiresInMs: Math.min(Number(expiresInMs) || 2000, 2000), id: 'pup-wiki-view', position: 'bottom', size: 'medium',     }, { timeoutMs: 4000 });     const raw = r && (typeof r.output === 'string' ? r.output : JSON.stringify(r.output || r || ''));     if (!r || (r.success === false) || /not a built-in desktop verb|unknown/i.test(raw || '')) {@@ -8272,7 +8276,8 @@ function render(){             +(w.errorCount?'<span class="tag warn">'+w.errorCount+' err</span>':'')             +'<span class="meta">'+esc(w.profile)+' &middot; '+ago(w.uptimeMs)+'</span>'             +'<span class="acts">'-              +(w.foreground?'<button class="btn sm" data-act="bg" data-sid="'+esc(w.sessionId)+'">send to bg</button>':'<button class="btn sm" data-act="fg" data-sid="'+esc(w.sessionId)+'">bring to fg</button>')+              +'<button class="btn sm" data-act="fg" data-sid="'+esc(w.sessionId)+'">bring to fg</button>'+              +'<button class="btn sm" data-act="bg" data-sid="'+esc(w.sessionId)+'">send to bg</button>'               +'<button class="btn sm" data-act="flash" data-sid="'+esc(w.sessionId)+'">flash</button>'               +'<button class="btn sm" data-act="unflash" data-sid="'+esc(w.sessionId)+'">clear</button>'               +'<button class="btn sm danger" data-act="close-window" data-sid="'+esc(w.sessionId)+'" data-confirm="Close '+esc(w.sessionId)+'?">close</button></span></div>'@@ -9517,7 +9522,7 @@ const server = http.createServer(async (req, res) => {                     session._foreground = true;                     try { await session.page.bringToFront(); } catch (e) {}                     try { await osRaiseSessionWindow(session, sessionId); } catch (e) {}-                    wikiCaption(`Adom wiki: signed you in automatically${_autoWho && _autoWho !== 'authed' ? ` as ${_autoWho}` : ''} — no login needed`, 6000).catch(() => {});+                    wikiCaption(`Adom wiki: signed you in automatically${_autoWho && _autoWho !== 'authed' ? ` as ${_autoWho}` : ''}, no login needed`, 6000).catch(() => {});                     console.log(`[wikiview] "${sessionId}" AUTO-SIGNED from AD desktop token (${_autoWho}) — no manual login`);                     sendJSON(res, { success: true, output: JSON.stringify({                       ok: true, view: "authed", autoSigned: true, url: session.page.url(),@@ -10661,7 +10666,7 @@ const server = http.createServer(async (req, res) => {             const hwnd = await sessionHwnd(resolvedId);             const ready = await waitForUserReady(resolvedId, hwnd, { maxMs: Number(args.maxWaitMs) || 120000 });             if (!ready) {-              await pupCaption('Adom stopped waiting — you did not return to the window. Ask me to try again when ready.', 7000);+              await pupCaption('Adom stopped waiting: you did not return to the window. Ask me to try again when ready.', 7000);               sendJSON(res, { success: false, errorCode: 'user_not_ready', error: 'Timed out waiting for you to focus the window. Nothing was clicked.', _hint: 'The user alt-tabbed away and did not return within the wait window. Re-issue browser_assisted_click when they are ready.' });               return;             }