← Commit history

Two John asks from live use. One: the corner floaty pencil is now OFF by default and its hover zone no longer exists unless enabled in Settings, because the invisible corner target was fighting real buttons in app headers; the toolbar pen button now carries discovery, the Alt Shift A hotkey survives independently of the pencil via its own setting, and flipping the setting live now genuinely tears the pencil out of every open page instead of only affecting future loads. Two: the owner-initials badge overlay on the toolbar icon is retired as too disruptive; Chrome allows an extension one icon plus a four-character overlay and no toolbar text, so the owning AI thread now rides the tab title as a plain visible suffix, kept idempotently as pages rewrite their titles, live-applied both ways from Settings. Extension worker 0.2.3 clears old badges and keeps the hover title. The floaty ralph harness enables the pencil for its run and restores the prior setting after

John Lauer ·23254874e1 ·2mo ago ·parent 75cf5ee
6 files changed +74−40
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.94",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.94/adom-bridge-puppeteer-v2.0.94.zip",-  "sha256": "10648d5464ef7489834d28baaf9c7e7a90e90bfa17c798f907483b2abdfd124c",-  "size": 843228,+  "version": "2.0.95",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.95/adom-bridge-puppeteer-v2.0.95.zip",+  "sha256": "e5e0836fd81a5ba212087a1590b793edc7995c578fc35a86e3c728cc93baf691",+  "size": 844042,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.94+2.0.95
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.94",+  "version": "2.0.95",   "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/extension/manifest.json+1−1
@@ -1,7 +1,7 @@ {   "manifest_version": 3,   "name": "Adom Pup",-  "version": "0.2.2",+  "version": "0.2.3",   "description": "Toolbar for Adom Pup browser windows: annotate, snip, view toggle, dashboard, owner info. Thin trigger surface - the pup bridge is the engine.",   "action": {     "default_popup": "popup.html",
src/extension/worker.js+7−22
@@ -1,7 +1,8 @@-// Adom Pup service worker — per-tab owner badge + the snip keyboard command.-// Polls pup /health (cheap, cached port) and badges each tab whose URL matches a pup session-// with the owning thread's initials + a stable per-thread color. Settings-aware: pup's-// toolbarExtension/tbOwnerBadge prefs ride /health; OFF clears badges and stands down.+// Adom Pup service worker — per-tab owner hover-title + the snip keyboard command.+// v0.2.3 (John: the initials badge overlay on the icon was too disruptive): the text badge is+// RETIRED — ownership now rides the tab title (pup injects the suffix server-side). The worker+// keeps the per-tab hover title ("Adom Pup — <thread>'s window") and actively CLEARS any badge+// an older worker painted. const CANDIDATE_PORTS = [64230, 8851];  async function findPort() {@@ -17,17 +18,6 @@ async function findPort() {   return null; } -function threadColor(name) {-  let h = 0;-  for (let i = 0; i < (name || '').length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0;-  const palette = ['#f59e0b', '#38bdf8', '#39d98a', '#c084fc', '#fb7185', '#5eead4'];-  return palette[h % palette.length];-}-function initials(name) {-  const parts = String(name || '').split(/[\s-_]+/).filter(Boolean);-  return (parts.length >= 2 ? parts[0][0] + parts[1][0] : String(name || '??').slice(0, 2)).toUpperCase();-}- async function sweepBadges() {   const found = await findPort();   if (!found) return;@@ -37,13 +27,8 @@ async function sweepBadges() {     if (!tab.url) continue;     const hit = sessions.find(s => s.url && (s.url === tab.url || tab.url.startsWith((s.url || '').split('?')[0])));     try {-      if (hit && hit.owner) {-        chrome.action.setBadgeText({ tabId: tab.id, text: initials(hit.owner) });-        chrome.action.setBadgeBackgroundColor({ tabId: tab.id, color: threadColor(hit.owner) });-        chrome.action.setTitle({ tabId: tab.id, title: `Adom Pup — ${hit.owner}'s window` });-      } else {-        chrome.action.setBadgeText({ tabId: tab.id, text: '' });-      }+      chrome.action.setBadgeText({ tabId: tab.id, text: '' });+      if (hit && hit.owner) chrome.action.setTitle({ tabId: tab.id, title: `Adom Pup — ${hit.owner}'s window` });     } catch (e) {}   } }
src/server.js+60−11
@@ -698,9 +698,14 @@ function attachTab(session, sessionId, page, { makeActive = true, opener = 'user     // v2.0.72: PRECACHE the annotate module in every page so the pencil and hotkey open the     // toolbar instantly, client-side, with zero bridge round-trip (John: it was laggy).     try { page.evaluateOnNewDocument(ANNOTATE_OVERLAY_JS).catch(() => {}); page.evaluate(ANNOTATE_OVERLAY_JS).catch(() => {}); } catch (e) {}-    if (pupSettings().tbFloatyPencil !== 'off') {-      const fj = floatyJs();-      try { page.evaluateOnNewDocument(fj).catch(() => {}); page.evaluate(fj).catch(() => {}); } catch (e) {}+    // v2.0.95: always injected — the script self-configures from the baked flags (floaty on/off,+    // hotkey on/off), and injecting the OFF build is what tears an elder pencil out of the page.+    const fj = floatyJs();+    try { page.evaluateOnNewDocument(fj).catch(() => {}); page.evaluate(fj).catch(() => {}); } catch (e) {}+    const _titleOwner = (session && (session.owner || session._ownerThread)) || null;+    if (pupSettings().tbOwnerBadge !== 'off' && _titleOwner) {+      const tj = titleJs(_titleOwner);+      try { page.evaluateOnNewDocument(tj).catch(() => {}); page.evaluate(tj).catch(() => {}); } catch (e) {}     }   }   try { page.evaluateOnNewDocument(PUP_DEEP_HELPERS).catch(() => {}); } catch (e) {}@@ -3080,7 +3085,7 @@ function pupSettings() {   D.jlDashboard = 'on';   D.jlAnnotate = 'on';   // v2.0.49   // v2.0.50 (plan: interactive surface): caption bar baked under captures; toolbar extension family-  D.annCaptionBar = 'on'; D.toolbarExtension = 'on'; D.tbOwnerBadge = 'on'; D.tbSnipHotkey = 'on'; D.tbFloatyPencil = 'on'; D.floatyHitPx = 24;+  D.annCaptionBar = 'on'; D.toolbarExtension = 'on'; D.tbOwnerBadge = 'on'; D.tbSnipHotkey = 'on'; D.tbFloatyPencil = 'off'; D.floatyHitPx = 24;   // v1.9.293 (John): the 'NOT foregrounded by Adom' caption is now OFF by default. He is right that   // input-timing cannot reliably tell his own raises (click / alt+tab / window click) from a rare   // JS raise - and Windows blocks most background foreground-steals anyway, so the case it exists@@ -5661,7 +5666,9 @@ function _stageExtDir(srcName, dstName) { // annotate on THAT tab. Zero extension dependency for discoverability. function floatyJs() {   const px = Math.max(6, Math.min(200, Number(pupSettings().floatyHitPx) || 24));-  return FLOATY_JS.replace(/__HITPX__/g, String(px));+  const floatyOn = pupSettings().tbFloatyPencil !== 'off';+  const hotkeyOn = pupSettings().tbSnipHotkey !== 'off';+  return FLOATY_JS.replace(/__HITPX__/g, String(px)).replace(/__FLOATY_ON__/g, floatyOn ? '1' : '').replace(/__HOTKEY_ON__/g, hotkeyOn ? '1' : ''); } const FLOATY_JS = `(() => {   // v2.0.89: VERSIONED guard. evaluateOnNewDocument scripts from every prior bridge process stay@@ -5669,10 +5676,14 @@ const FLOATY_JS = `(() => {   // floaty win forever (John kept seeing the big hover zone after reloads). The newest module now   // tears down any elder and rebuilds.   if (window !== window.top) return;-  if (window.__pupFloatyV === '${BRIDGE_VERSION}:__HITPX__') return;-  window.__pupFloatyV = '${BRIDGE_VERSION}:__HITPX__'; window.__pupFloaty = true;+  if (window.__pupFloatyV === '${BRIDGE_VERSION}:__HITPX__:__FLOATY_ON__:__HOTKEY_ON__') return;+  window.__pupFloatyV = '${BRIDGE_VERSION}:__HITPX__:__FLOATY_ON__:__HOTKEY_ON__'; window.__pupFloaty = true;   var _oldHost = document.getElementById('__pup_floaty'); if (_oldHost) _oldHost.remove();   function add() {+    // v2.0.95 (John: the corner hover zone fights buttons in app headers — off by default now+    // that the toolbar pen button covers discovery; the elder-host removal above still runs so+    // flipping the setting OFF tears the pencil out of every open page).+    if (!'__FLOATY_ON__') return;     if (!document.body) { setTimeout(add, 400); return; }     var host = document.createElement('div');     host.id = '__pup_floaty';@@ -5748,7 +5759,7 @@ const FLOATY_JS = `(() => {     document.body.appendChild(host);   }   add();-  addEventListener('keydown', function (e) {+  if ('__HOTKEY_ON__') addEventListener('keydown', function (e) {     if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && (e.key === 'A' || e.key === 'a')) {       e.preventDefault(); e.stopPropagation();       if (window.__pupStartAnnotate) { window.__pupStartAnnotate('pen'); }@@ -5756,6 +5767,39 @@ const FLOATY_JS = `(() => {     }   }, true); })()`;+// v2.0.95 (John: the owner-initials badge overlay on the toolbar icon is too disruptive — show+// the ai-thread name DIRECTLY visible). Chrome gives an extension exactly one 16px action icon+// plus a ~4-char colored overlay badge; no text labels, no wider buttons, no custom toolbar UI.+// So the badge is retired and the owning thread rides the TAB TITLE instead: full thread name,+// always visible, native text in the browser top bar. Idempotent exact-suffix keeper, re-applied+// when the page rewrites its own title; versioned + owner-keyed guard like the floaty rail.+const TITLE_JS = `(function () {+  if (window !== window.top) return;+  if (window.__pupTitleV === '${BRIDGE_VERSION}:__OWNER__') return;+  window.__pupTitleV = '${BRIDGE_VERSION}:__OWNER__';+  if (window.__pupTitleTimer) { clearInterval(window.__pupTitleTimer); window.__pupTitleTimer = null; }+  try {+    var prev = window.__pupTitleSuf, t0 = document.title || '';+    if (prev && t0.slice(-prev.length) === prev) document.title = t0.slice(0, -prev.length);+  } catch (e) {}+  var OWNER = '__OWNER__';+  if (!OWNER) { window.__pupTitleSuf = null; return; }+  var SUF = ' \u00b7 ' + OWNER;+  window.__pupTitleSuf = SUF;+  function apply() {+    try {+      var t = document.title || '';+      if (t.slice(-SUF.length) === SUF) return;+      document.title = t + SUF;+    } catch (e) {}+  }+  apply();+  window.__pupTitleTimer = setInterval(apply, 1500);+})()`;+function titleJs(owner) {+  const o = String(owner || '').replace(/[\\'"\r\n]/g, ' ').trim();+  return TITLE_JS.replace(/__OWNER__/g, o);+} function stageToolbarExtension() {   if (process.platform !== 'win32') return null;   if (pupSettings().toolbarExtension === 'off') return null;@@ -10373,9 +10417,9 @@ const SETTINGS_DEF=[  {k:'jlAnnotate',l:'',d:'The Annotate this page task: draw on the page; Done captures it for the AI thread that owns the window.',dep:'jumpLists',subtgl:1},  {k:'annCaptionBar',l:'Caption bar on captures',d:'Bake a thin context strip under every annotation/snip capture (thread, page, time) so any AI you paste it into sees where it came from.'},  {k:'toolbarExtension',l:'Adom toolbar in Chrome',d:'The Adom Pup extension button in the browser toolbar (annotate, snip, view toggle, dashboard, owner, close). Requires the one-time extension install.'},- {k:'tbOwnerBadge',l:'',d:'Per-tab colored badge on the toolbar icon showing which AI thread owns the window.',dep:'toolbarExtension',subtgl:1},+ {k:'tbOwnerBadge',l:'',d:'Appends the owning AI thread to each tab title so ownership is directly visible. Replaces the old badge overlay on the toolbar icon.',dep:'toolbarExtension',subtgl:1},  {k:'tbSnipHotkey',l:'',d:'Alt+Shift+A starts annotate (red pen) on the current pup window.',dep:'toolbarExtension',subtgl:1},- {k:'tbFloatyPencil',l:'',d:'The tiny pencil in the upper-right corner of each page: one click starts annotate. Applies to newly loaded pages.',dep:'toolbarExtension',subtgl:1},+ {k:'tbFloatyPencil',l:'',d:'The tiny pencil in the upper-right corner of each page: one click starts annotate. Off by default: the corner hover zone can fight buttons in app headers, and the toolbar pen button covers discovery.',dep:'toolbarExtension',subtgl:1},  {k:'floatyHitPx',l:'',d:'Pencil corner hit area (px): how big the invisible top-right target is that reveals the pencil. Applies to open pages immediately.',slider:[6,120,2],dep:'tbFloatyPencil'},  {k:'fgWatch',l:'20s foreground watch',d:'For 20s after a window opens or navigates in the background, watch whether something (JavaScript, Chrome, a focus change) brings it to the foreground, and caption that it was not Adom. Never moves the window.'},  {k:'fgCaption',l:'Caption on AI foreground',d:'When an AI brings a window to your screen, show its stated reason as an on-screen caption. The AI is always forced to give a reason; this shows it to you.'},@@ -10723,8 +10767,13 @@ const server = http.createServer(async (req, res) => {           if (['jumpLists', 'jlViewTasks', 'jlCloseAll', 'jlDashboard', 'jlAnnotate'].includes(key)) refreshAllJumplists().catch(() => {});           // v2.0.90: the pencil hit-area slider live-applies — re-inject the floaty on every open           // page (the versioned guard includes the px value, so a change tears down and rebuilds).-          if (key === 'floatyHitPx' || key === 'tbFloatyPencil') {+          if (key === 'floatyHitPx' || key === 'tbFloatyPencil' || key === 'tbSnipHotkey') {             (async () => { try { const fj = floatyJs(); for (const [, s6] of sessions) for (const t6 of (s6.tabs || [])) { try { await Promise.race([t6.page.evaluate(fj), new Promise(r => setTimeout(r, 1200))]); } catch (e) {} } } catch (e) {} })();+          }+          // v2.0.95: the owner-in-tab-title keeper live-applies both ways (ON stamps every owned+          // window now; OFF strips the suffix via the empty-owner build).+          if (key === 'tbOwnerBadge') {+            (async () => { try { for (const [, s7] of sessions) { const ow = (val === 'on' && (s7.owner || s7._ownerThread)) || ''; const tj = titleJs(ow); for (const t7 of (s7.tabs || [])) { try { await Promise.race([t7.page.evaluate(tj), new Promise(r => setTimeout(r, 1200))]); } catch (e) {} } } } catch (e) {} })();           }   // v1.9.320: OFF clears the menu, ON/sub re-commits           if (key === 'ownerChip') applyOwnerChipSetting(val === 'on').catch(() => {});           return done({ ok: true, settings: pupSettings() });