← Commit history

pup_window_info is now a pure data query for AI callers: no caption is ever drawn on the user's screen for an AI data request (a 12s caption appeared over John's work when an AI queried a window's info). Visual surfaces are user-initiated only: jump-list click shows the taskbar caption, toolbar click shows the in-page card, and showCaption:true remains as an explicit opt-in for when the user asked to have a window identified. The response now also carries the window's hwnd, which the open-window hint always promised, so chrome-in-frame screenshots never need a desktop_find_window hunt.

John Lauer ·0b39fe7c3f ·2mo ago ·parent bd92d45
4 files changed +22−9
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.130",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.130/adom-bridge-puppeteer-v2.0.130.zip",-  "sha256": "bbf13664bc7a215d751244b0ad9e1ab15fdf474566040281193ff8c50448b325",-  "size": 884627,+  "version": "2.0.131",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.131/adom-bridge-puppeteer-v2.0.131.zip",+  "sha256": "afa7275964089d3d5c803cfd652063c2aac16805ea7976b0e96161f51bb332ce",+  "size": 885109,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.130+2.0.131
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.130",+  "version": "2.0.131",   "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+16−3
@@ -11739,7 +11739,7 @@ const server = http.createServer(async (req, res) => {             V('pup_open_tab', 'Open a new tab in an EXISTING session/window (returns {tabId, tabCount, activeTabId} — no need to diff list_tabs). This is the right verb for multi-URL work: ONE window with many tabs (one taskbar button), not many windows. The window stays in the background; the tab auto-flashes the taskbar (debounced) so the user notices. The USER can click the window\'s taskbar button at any time to view it — pup never pulls it back down.', { sessionId: 'required str', url: 'optional str', updateNote: 'optional str — short "what I did" note surfaced in list_tabs as lastAgentUpdate', silent: 'optional bool — suppress the auto-flash for this call' }, 30, { sessionId: 'work', url: 'https://example.com' }),             V('pup_close_tab', 'Close a tab.', { sessionId: 'required str', tabId: 'optional str (default active)' }, 15, { sessionId: 'work' }),             V('pup_close_window', 'Close a window/session (its tabs go too).', { sessionId: 'required str' }, 20, { sessionId: 'work' }),-            V('pup_window_info', 'Everything about ONE pup window — owner AI thread, container, profile, tabs, age, last agent action — AND (Windows) a native always-on-top caption card just above the taskbar showing it to the user (ab desktop_caption, click-through, ~12s). This is the callback behind the per-window jump-list task "Owned by: <thread>"; AI threads may also call it to identify an unfamiliar window before deciding whether to open their own. Read-only, never owner-gated.', { sessionId: 'optional str (default: active session)' }, 15, { sessionId: 'work' }),+            V('pup_window_info', 'Everything about ONE pup window as JSON — owner AI thread, container, profile, tabs, age, last agent action, and the window\'s hwnd (for desktop_screenshot_window when you need the browser chrome in frame). For an AI caller this is a PURE DATA query: nothing is drawn on the user\'s screen. Visual surfaces are user-initiated only — a jump-list click shows the native taskbar caption, a toolbar-popup click shows the in-page floaty card. showCaption:true opts an AI caller into the caption ONLY when the user asked to have the window identified on screen. Read-only, never owner-gated.', { sessionId: 'optional str', showCaption: 'optional bool — draw the ~12s taskbar caption too; ONLY when the user asked to see which window this is' }, 15, {}),             V('pup_wiki_set_view', 'Flip a WIKI pup window between the logged-in and public view IN PLACE (relaunches the same window under the other cookie jar). This is the callback for the per-window taskbar right-click jump-list task (WINDOWS ONLY — macOS has no taskbar or jump list, so this callback never fires there; flip views with pup_open_window {wikiView} instead) — it is a USER-initiated action (the window is brought on-screen). AI threads should NOT call this; pass wikiView:"authed"|"public" on pup_open_window instead.', { sessionId: 'required str', view: 'required "authed"|"public"' }, 45, { sessionId: 'wiki-bmv080', view: 'authed' }),             V('pup_navigate', 'Navigate the active tab to a URL.', { sessionId: 'required str', url: 'required str' }, 45, { sessionId: 'work', url: 'https://example.com' }),             V('pup_back', 'History back.', { sessionId: 'required str' }, 20, { sessionId: 'work' }),@@ -12963,7 +12963,14 @@ const server = http.createServer(async (req, res) => {               cardShown = true;             } catch (e) { console.log(`[window-info] in-page card injection failed (${e.message}) — falling back to the ab caption`); }           }-          if (!cardShown) {+          // v2.0.131 (John: "why did you show this caption?"): an AI CALLER querying window info is+          // a DATA request — it must never paint anything on the user's screen. The caption is a+          // USER surface, shown only when the USER clicked the jump-list task (user-taskbar-menu);+          // toolbar clicks get the in-page card above. AI callers get JSON only, opt-in+          // showCaption:true for the rare "identify this window to the user" case. (The incident:+          // an AI called this just to get the hwnd and the user got a 12s caption over their work.)+          const _userInitiated = USER_CALLERS.has(_callerThread) || USER_CALLERS.has(args.caller && args.caller.aiThread);+          if (!cardShown && (_userInitiated || args.showCaption === true)) {             try {               const r = await chrome.abCommand('desktop_caption', {                 id: `pup-info-${sid}`, text: lines.join('\n'),@@ -12972,16 +12979,22 @@ const server = http.createServer(async (req, res) => {               captionShown = !(r && r.success === false);             } catch (e) {}           }+          // v2.0.131: include the hwnd — the pup_open_window _next text promises "pup_window_info+          // hands you this window's hwnd for desktop_screenshot_window", but the response never+          // carried it, so callers hwnd-hunted anyway (and tripped the caption doing it).+          let _hwnd = null;+          try { _hwnd = session._hwnd ? Number(session._hwnd) : (await sessionHwnd(sid)); } catch (e) {}           sendJSON(res, {             success: true, sessionId: sid, owner: ownT, ownerContainer: session._ownerContainer || null,             profile: session.profileName || null, ageMinutes: ageMin, tabs, lastAgentUpdate: lu,+            hwnd: _hwnd || null,             foreground: !!session._foreground, lastTakeoverBy: session._lastTakeoverBy || null,             cardShown, captionShown,             _hint: cardShown               ? 'An in-page floaty card with this info is showing in the window (draggable by its grip, hover any row for its explanation, ✕ to close).'               : (captionShown                 ? 'A native card with this info is showing just above the taskbar for ~12s (click-through, auto-dismisses).'-                : 'Neither the in-page card nor the caption could be shown — the same info is in this JSON.'),+                : 'Info returned as JSON only — nothing was drawn on the user\'s screen (hwnd included for desktop_screenshot_window when you need the browser chrome in frame). A USER clicking the jump-list/toolbar gets the visual card; an AI caller can opt in with showCaption:true when the user asked to have the window identified.'),           });           return;         }