← Commit history

Annotate becomes discoverable (John: people won't find it). The extension now renders a tiny monochrome pencil floaty in each page's upper-right corner; one click starts annotate in red-pen mode, with a great tooltip (600ms, clamped) teaching the feature, the Ctrl+Shift+A shortcut, and the lift-the-mouse-and-it-is-on-your-clipboard flow. The hotkey itself is re-aimed from snip to the red pen since a circle tells the AI what the user means better than a bare crop. The floaty is a content script routing through the worker to pup's loopback (pages cannot reach it themselves), and a new tbFloatyPencil sub-setting (default on) under the toolbar family lets users who find it annoying turn it off

John Lauer ·1c513a33b0 ·2mo ago ·parent 79255ea
7 files changed +104−15
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.62",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.62/adom-bridge-puppeteer-v2.0.62.zip",-  "sha256": "33b25dc14e8c8d5c38c44e48fa08834dae60bb5bc790f13e34cc8a84fc55db5f",-  "size": 828894,+  "version": "2.0.63",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.63/adom-bridge-puppeteer-v2.0.63.zip",+  "sha256": "a2417bcd8f34b3116a5e4de1c233e98c911f1c8c56eb884f9e5b5d9c5ae54b5b",+  "size": 831042,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.62+2.0.63
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.62",+  "version": "2.0.63",   "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/content.jsadded+52
@@ -0,0 +1,52 @@+// Adom Pup floaty pencil: the annotate feature's discoverability handle (John 2026-08-10).+// A tiny monochrome pencil in the page's upper-right; click = enter annotate (red pen) mode.+// Rendered by the extension (not pup injection) so the click can route through the worker to+// pup's loopback. Gated by pup's tbFloatyPencil setting (checked once per page load).+(async () => {+  if (window !== window.top) return;+  let cfg = null;+  try { cfg = await chrome.runtime.sendMessage({ t: 'pup-floaty-cfg' }); } catch (e) {}+  if (!cfg || !cfg.enabled) return;++  const host = document.createElement('div');+  host.style.cssText = 'position:fixed;top:14px;right:14px;z-index:2147483645;pointer-events:auto;';+  const root = host.attachShadow({ mode: 'closed' });+  const btn = document.createElement('button');+  btn.setAttribute('aria-label', 'Annotate this page');+  btn.style.cssText = 'width:30px;height:30px;border-radius:8px;display:grid;place-items:center;'+    + 'background:rgba(13,17,23,.72);border:1px solid rgba(0,184,177,.45);cursor:pointer;'+    + 'opacity:.55;transition:opacity .15s ease;padding:0;';+  btn.innerHTML = '<svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="#e6edf3" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20l1.5-4.5L16 5a2.1 2.1 0 0 1 3 3L8.5 18.5 4 20z"/><path d="M13.5 7.5l3 3"/></svg>';+  btn.onmouseenter = () => { btn.style.opacity = '1'; tipShow(); };+  btn.onmouseleave = () => { btn.style.opacity = '.55'; tipHide(); };+  btn.onclick = () => { tipHide(); chrome.runtime.sendMessage({ t: 'pup-annotate', tool: 'pen' }).catch(() => {}); };+  root.appendChild(btn);++  // great tooltip (tooltips skill: 600ms reveal, 0.18s fade, measured then clamped both axes)+  const tip = document.createElement('div');+  tip.textContent = 'Draw on this page to show your AI exactly what you mean; a red circle says it best. '+    + 'Click to start, or press Ctrl+Shift+A anytime. The moment you lift the mouse, the marked-up '+    + 'area is copied to your clipboard, ready to paste into any AI chat.';+  tip.style.cssText = 'position:fixed;z-index:2147483647;max-width:280px;background:#21262d;'+    + 'border:1px solid #30363d;border-radius:8px;padding:7px 10px;'+    + 'font:12px Satoshi,system-ui,sans-serif;color:#c9d1d9;box-shadow:0 6px 20px #000b;'+    + 'pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity .18s ease,transform .18s ease;';+  root.appendChild(tip);+  let timer = null;+  function tipShow() {+    clearTimeout(timer);+    timer = setTimeout(() => {+      requestAnimationFrame(() => {+        const a = btn.getBoundingClientRect(), M = 8, w = tip.offsetWidth, h = tip.offsetHeight;+        let x = a.right - w, y = a.bottom + 10;+        if (y + h > innerHeight - M) y = a.top - h - 10;+        x = Math.min(Math.max(M, x), innerWidth - w - M);+        y = Math.min(Math.max(M, y), innerHeight - h - M);+        tip.style.left = x + 'px'; tip.style.top = y + 'px';+        tip.style.opacity = '1'; tip.style.transform = 'translateY(0)';+      });+    }, 600);+  }+  function tipHide() { clearTimeout(timer); tip.style.opacity = '0'; tip.style.transform = 'translateY(4px)'; }+  (document.body || document.documentElement).appendChild(host);+})();
src/extension/manifest.json+15−3
@@ -1,7 +1,7 @@ {   "manifest_version": 3,   "name": "Adom Pup",-  "version": "0.1.0",+  "version": "0.2.0",   "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",@@ -23,12 +23,24 @@       "suggested_key": {         "default": "Ctrl+Shift+A"       },-      "description": "Snip a region of this pup window"+      "description": "Annotate this page (red pen)"     }   },   "icons": {     "16": "icon16.png",     "48": "icon48.png",     "128": "icon128.png"-  }+  },+  "content_scripts": [+    {+      "matches": [+        "http://*/*",+        "https://*/*"+      ],+      "js": [+        "content.js"+      ],+      "run_at": "document_idle"+    }+  ] }\ No newline at end of file
src/extension/worker.js+26−2
@@ -54,6 +54,30 @@ chrome.tabs.onActivated.addListener(() => sweepBadges()); chrome.runtime.onStartup.addListener(() => sweepBadges()); sweepBadges(); +// content-script bridge: the floaty pencil's config + click routing (page cannot reach the+// loopback itself; the worker can)+chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {+  (async () => {+    if (msg && msg.t === 'pup-floaty-cfg') {+      const found = await findPort();+      const tb = (found && found.health && found.health.toolbar) || {};+      sendResponse({ enabled: !!found && tb.enabled !== false && tb.floaty !== false });+      return;+    }+    if (msg && msg.t === 'pup-annotate') {+      const found = await findPort();+      if (!found || !sender.tab || !sender.tab.url) { sendResponse({ ok: false }); return; }+      await fetch(`http://127.0.0.1:${found.port}/command`, {+        method: 'POST',+        headers: { 'content-type': 'application/json', 'x-adom-caller-thread': 'user-toolbar', 'x-adom-caller-reason': 'floaty pencil click' },+        body: JSON.stringify({ command: 'pup_annotate', args: { _tabUrl: sender.tab.url, tool: msg.tool || 'pen', caller: { aiThread: 'user-toolbar' } } }),+      }).catch(() => {});+      sendResponse({ ok: true });+    }+  })();+  return true;+});+ chrome.commands.onCommand.addListener(async (command) => {   if (command !== 'pup-snip') return;   const found = await findPort();@@ -64,7 +88,7 @@ chrome.commands.onCommand.addListener(async (command) => {   // main-page-only matching bug — the reason snip "never worked" from the keyboard)   await fetch(`http://127.0.0.1:${found.port}/command`, {     method: 'POST',-    headers: { 'content-type': 'application/json', 'x-adom-caller-thread': 'user-toolbar', 'x-adom-caller-reason': 'Ctrl+Shift+A snip hotkey' },-    body: JSON.stringify({ command: 'pup_annotate', args: { _tabUrl: tab.url, tool: 'snip', caller: { aiThread: 'user-toolbar' } } }),+    headers: { 'content-type': 'application/json', 'x-adom-caller-thread': 'user-toolbar', 'x-adom-caller-reason': 'Ctrl+Shift+A annotate hotkey' },+    body: JSON.stringify({ command: 'pup_annotate', args: { _tabUrl: tab.url, tool: 'pen', caller: { aiThread: 'user-toolbar' } } }),   }).catch(() => {}); });
src/server.js+5−4
@@ -3071,7 +3071,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.annCaptionBar = 'on'; D.toolbarExtension = 'on'; D.tbOwnerBadge = 'on'; D.tbSnipHotkey = 'on'; D.tbFloatyPencil = 'on';   // 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@@ -10166,7 +10166,8 @@ const SETTINGS_DEF=[  {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:'tbSnipHotkey',l:'',d:'Ctrl+Shift+A opens snip on the current pup window.',dep:'toolbarExtension',subtgl:1},+ {k:'tbSnipHotkey',l:'',d:'Ctrl+Shift+A starts annotate (red pen) on the current pup window.',dep:'toolbarExtension',subtgl:1},+ {k:'tbFloatyPencil',l:'',d:'The tiny pencil in each page\'s upper-right corner: one click starts annotate. Applies to newly loaded pages.',dep:'toolbarExtension',subtgl:1},  {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.'},  {k:'fgCaptionMs',l:'',d:'',slider:[500,5000,250],dep:'fgCaption',test:1},@@ -10492,7 +10493,7 @@ const server = http.createServer(async (req, res) => {             reportIssues: ['on', 'off'], autoLogin: ['on', 'off'], minimalTouch: ['on', 'off'],             taskbarGrouping: ['split', 'grouped'],             aumidIconStyle: ['standard', 'category'],-            jlViewTasks: ['on', 'off'], jlCloseAll: ['on', 'off'], jlDashboard: ['on', 'off'], jlAnnotate: ['on', 'off'], annCaptionBar: ['on', 'off'], toolbarExtension: ['on', 'off'], tbOwnerBadge: ['on', 'off'], tbSnipHotkey: ['on', 'off'],+            jlViewTasks: ['on', 'off'], jlCloseAll: ['on', 'off'], jlDashboard: ['on', 'off'], jlAnnotate: ['on', 'off'], annCaptionBar: ['on', 'off'], toolbarExtension: ['on', 'off'], tbOwnerBadge: ['on', 'off'], tbSnipHotkey: ['on', 'off'], tbFloatyPencil: ['on', 'off'],             notMineCaption: ['on', 'off'], ownerChip: ['on', 'off'],             titleTag: ['on', 'off'], titlePrefix: ['on', 'off'],           };@@ -10791,7 +10792,7 @@ const server = http.createServer(async (req, res) => {         bridge: 'puppeteer',         version: BRIDGE_VERSION,         port: PORT,-        toolbar: { enabled: pupSettings().toolbarExtension !== 'off', ownerBadge: pupSettings().tbOwnerBadge !== 'off', snipHotkey: pupSettings().tbSnipHotkey !== 'off' },+        toolbar: { enabled: pupSettings().toolbarExtension !== 'off', ownerBadge: pupSettings().tbOwnerBadge !== 'off', snipHotkey: pupSettings().tbSnipHotkey !== 'off', floaty: pupSettings().tbFloatyPencil !== 'off' },         browserCount: browsers.size,         sessionCount: sessions.size,         activeSession: activeSessionId,