← Commit history

Ownership conveyed the way John designed it instead of title mangling: every pup window's jump-list now leads with an 'Owned by: <ai-thread>' task, and clicking it runs the new pup_window_info verb, which paints a native always-on-top click-through caption card just above the taskbar (ab desktop_caption, 12s auto-dismiss) showing the owning thread, container, profile, tabs, window age, last agent action, and any takeover history; the verb also returns the same info as JSON for AI callers and is read-only and never owner-gated

John Lauer ·ddfbe77662 ·2mo ago ·parent 05ef140
4 files changed +75−7
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.20",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.20/adom-bridge-puppeteer-v2.0.20.zip",-  "sha256": "fcb510a333cabb72f80f3fce34e794d7e4bf17bd6788a82e37c365002cf02c14",-  "size": 645225,+  "version": "2.0.21",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.21/adom-bridge-puppeteer-v2.0.21.zip",+  "sha256": "10ce93c9af5d07a869af6c9ff6394473608aab42848333413ecfaee11df0144b",+  "size": 646808,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.20+2.0.21
src/bridge.json+2−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.20",+  "version": "2.0.21",   "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.",@@ -53,6 +53,7 @@     "pup_raise_os_window",     "pup_focus_window",     "pup_alert_window",+    "pup_window_info",     "pup_status",     "pup_list_windows",     "pup_switch_window",
src/server.js+68−1
@@ -3851,6 +3851,20 @@ async function updateWikiJumplist(session, sessionId, opts) {     tasks.push({ title: 'Switch to public view', description: 'Reload this Adom wiki page logged OUT — exactly what the public/world sees (already public? harmless reload)', iconPath: _taskIcon, args: taskArgs('public') });   }   if (pupSettings().jlCloseAll === 'on') tasks.push(closeAllTask);+  // v2.0.21 (John: "stop trying to mangle the titles... instead give a jump list item that explains+  // the ai-thread that owns that window, and clicking it shows a native window with all the info"):+  // the FIRST task on every pup window names the owning AI thread; clicking it runs pup_window_info,+  // which paints a native always-on-top caption card just above the taskbar (ab desktop_caption)+  // with everything about this window. This replaces the title-tag approach for good.+  if (pupSettings().jlOwnerTask !== 'off') {+    const _ownT = (session && (session.owner || session._ownerThread)) || null;+    if (_ownT) tasks.unshift({+      title: `Owned by: ${String(_ownT).slice(0, 40)}`,+      description: `Show everything about this window as a native card above the taskbar — the AI thread that owns it ("${_ownT}"), its container, profile, tabs, age, and the last agent action`,+      iconPath: _taskIcon,+      args: jarg('pup_window_info', { sessionId }),+    });+  }   // The shell ignores a jump list on an unregistered AUMID — ensure it's registered first.   // v1.9.314 (John: "i turned on jump lists and none of them work"): this guard REQUIRED the appId to   // be in _registeredPupAumids, but that set is ONLY filled by desktop_register_app_identity, which@@ -10623,6 +10637,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_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' }),@@ -11454,6 +11469,58 @@ const server = http.createServer(async (req, res) => {           return;         } +        // v2.0.21 (John): the "Owned by: <thread>" jump-list callback — show everything about this+        // window as a NATIVE always-on-top caption card just above the taskbar (ab desktop_caption,+        // click-through, auto-expires). Replaces the title-tag approach to conveying ownership.+        // Read-only + not owner-gated: any thread (and the jump-list click itself) may ask.+        case 'pup_window_info': {+          const sid = args.sessionId || activeSessionId;+          const session = sid && sessions.get(sid);+          if (!session) { sendJSON(res, { success: false, error: `Session "${sid}" not found` }, 404); return; }+          const ownT = session.owner || session._ownerThread || null;+          const ageMin = session.createdAt ? Math.round((Date.now() - session.createdAt) / 60000) : null;+          const tabs = [];+          try {+            for (const t of (session.tabs || [])) {+              let u = null, ti = null;+              try { u = t.page.url(); } catch (e) {}+              try { ti = await Promise.race([t.page.title(), new Promise(r => setTimeout(() => r(null), 1500))]); } catch (e) {}+              tabs.push({ tabId: t.tabId, url: u, title: ti, active: t.tabId === session.activeTabId });+            }+          } catch (e) {}+          const lu = session._lastAgentUpdate || null;+          const _fmtAge = (m) => m == null ? 'unknown' : (m < 60 ? `${m} min` : `${Math.round(m / 6) / 10} h`);+          const lines = [];+          lines.push(`Adom Pup window "${sid}" — owned by AI thread: ${ownT || 'unclaimed'}`);+          const bits = [];+          if (session._ownerContainer) bits.push(`container ${session._ownerContainer}`);+          bits.push(`profile ${session.profileName || '?'}`);+          bits.push(`${tabs.length} tab${tabs.length === 1 ? '' : 's'}`);+          bits.push(`open ${_fmtAge(ageMin)}`);+          lines.push(bits.join(' · '));+          const at = tabs.find(t => t.active) || tabs[0];+          if (at) lines.push(`Showing: ${(at.title || at.url || '?').slice(0, 90)}`);+          if (lu) lines.push(`Last agent action: ${lu.verb}${lu.note ? ` — ${lu.note}` : ''} (${_fmtAge(Math.round((Date.now() - lu.ts) / 60000))} ago)`);+          if (session._lastTakeoverBy) lines.push(`⚠ last takeover: by "${session._lastTakeoverBy}" ${_fmtAge(Math.round((Date.now() - (session._takenOverAt || Date.now())) / 60000))} ago`);+          let captionShown = false;+          try {+            const r = await chrome.adCommand('desktop_caption', {+              id: `pup-info-${sid}`, text: lines.join('\n'),+              position: 'bottom', size: 'medium', duration: 12000,+            }, { timeoutMs: 8000, caller: sessionCaller(session) });+            captionShown = !(r && r.success === false);+          } catch (e) {}+          sendJSON(res, {+            success: true, sessionId: sid, owner: ownT, ownerContainer: session._ownerContainer || null,+            profile: session.profileName || null, ageMinutes: ageMin, tabs, lastAgentUpdate: lu,+            foreground: !!session._foreground, lastTakeoverBy: session._lastTakeoverBy || null,+            captionShown,+            _hint: captionShown+              ? 'A native card with this info is showing just above the taskbar for ~12s (click-through, auto-dismisses).'+              : 'Caption could not be shown (desktop_caption unavailable on this ab?) — the same info is in this JSON.',+          });+          return;+        }         // v1.9.3 (AD #208): the taskbar jump-list callback — flip THIS wiki window between the         // logged-in and public view IN PLACE. A view switch = a cookie-jar (userDataDir) switch,         // fixed at browser launch, so it's a close-and-relaunch of the same sessionId under the@@ -14117,7 +14184,7 @@ const server = http.createServer(async (req, res) => {         }          default:-          sendJSON(res, { success: false, error: `Unknown command: ${command}. Valid commands: pup_open_window, pup_switch_window, pup_list_windows, pup_close_window, pup_alert_window, pup_focus_window, pup_open_tab, pup_switch_tab, pup_close_tab, pup_list_tabs, pup_screenshot, pup_screenshot_full_res, pup_eval, pup_errors, pup_reload, pup_navigate, pup_status, pup_configure, pup_close, pup_wait, desktop_recorder_open, desktop_record_start, desktop_record_stop, desktop_record_status, desktop_record_list, desktop_recorder_close, desktop_list_monitors, pup_record_start, pup_record_stop, pup_record_status, pup_record_list. Tab-aware commands (screenshot, eval, errors, reload, navigate) accept an optional "tabId" to target a specific tab.` }, 404);+          sendJSON(res, { success: false, error: `Unknown command: ${command}. Valid commands: pup_open_window, pup_switch_window, pup_list_windows, pup_close_window, pup_alert_window, pup_focus_window, pup_open_tab, pup_switch_tab, pup_close_tab, pup_list_tabs, pup_window_info, pup_screenshot, pup_screenshot_full_res, pup_eval, pup_errors, pup_reload, pup_navigate, pup_status, pup_configure, pup_close, pup_wait, desktop_recorder_open, desktop_record_start, desktop_record_stop, desktop_record_status, desktop_record_list, desktop_recorder_close, desktop_list_monitors, pup_record_start, pup_record_stop, pup_record_status, pup_record_list. Tab-aware commands (screenshot, eval, errors, reload, navigate) accept an optional "tabId" to target a specific tab.` }, 404);           return;       }     }