← Commit history

v2.0.369: Fleet fix for the missing toolbar: CfT-first is now enforced by CODE, not pinning. When toolbarExtension is on, warmup background-fetches Chrome for Testing on EVERY box at bridge spawn (i.e. at ah/ab install time) and a cached CfT outranks any unpinned Chrome/Edge, so a fresh Edge-only machine converges onto the toolbar-capable browser with zero setup; an explicit pup_use pin still wins, and pup_use now WARNS when pinning off CfT while the toolbar is on (issue 81). Also fixes the popup's 'pup not reachable': the bridge writes its live port into the staged extension dir (port.json) at every boot and the popup reads it instead of guessing from a hardcoded 2-port list.

John Lauer ·99e07824cb ·1mo ago ·parent ee1b85e
6 files changed +58−12
adom-bridge-puppeteer-manifest.json+5−5
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.368",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.368/adom-bridge-puppeteer-v2.0.368.zip",-  "sha256": "cb5b6e103b7c63f29b8d82fcb0d5634b46a2170e8fc454a2c1622d9fef81b449",-  "size": 1536501,+  "version": "2.0.369",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.369/adom-bridge-puppeteer-v2.0.369.zip",+  "sha256": "7f981cfe80a136336e41346f6225830e8fcdfdf3d400574729383999b81a0815",+  "size": 1538075,   "verbPrefixes": [     "browser_",     "desktop_recorder_",@@ -12,5 +12,5 @@   ],   "healthEndpoint": "/status",   "statusVerb": "browser_readiness",-  "released_at": "2026-09-02T11:09:22.422896Z"+  "released_at": "2026-09-02T11:36:11.826883Z" }
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "pup-bridge",-  "version": "2.0.368",+  "version": "2.0.369",   "type": "app",   "description": "The pup SKILL PACK \u2014 the AI skills that teach a cloud/container AI how to drive the Adom Desktop Puppeteer (pup) bridge (browser_* verbs): the everyday `pup` skill plus focused sub-skills for windows/sessions/tabs, screenshots+recording, browsers+Chrome install, and driving the Adom wiki. Installs into ~/.claude/skills + ~/.codex/skills. DOCS ONLY \u2014 this is NOT the bridge runtime. The bridge itself (the Node program that drives the browser) runs on the DESKTOP: Adom Desktop bundles it and auto-installs/updates it, and it's published separately on the Releases tab as adom-bridge-puppeteer-v<ver>.zip. The pkg version is kept in lockstep with the Release version so the page's max version row always carries BOTH a pkg tarball (skills) and a runtime zip (bridge) \u2014 a skills-only or runtime-only bump on the top row breaks constraint installs. TL;DR: pkg install = the skills for your AI; the bridge = the Release zip, which Adom Desktop manages for you.",   "keywords": [
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.368\ No newline at end of file+2.0.369\ No newline at end of file
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.368",+  "version": "2.0.369",   "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/chrome.js+23−2
@@ -178,6 +178,14 @@ function markVerified(cand) { //   [stored default, if still present] → installed Chrome → installed Edge → cached CfT. // Each entry is a fully-launchable {kind, executablePath, source}. The launch path // tries them top-to-bottom and spawn-verifies each, so a broken top pick falls through.+// v2.0.369 (the Azure-VM Edge regression, John 2026-09-02): the server tells us whether the+// toolbar family is wanted. The toolbar rides ONLY CfT (--load-extension is dead on branded+// Chrome ≥137 and pup never passes it to Edge), so when this is true a cached CfT outranks any+// UNPINNED system browser — otherwise every Edge-only box (most fresh Windows machines) silently+// loses the pen/dots/identity tiles and the user is the first to notice (pup-bridge #81).+let PREFER_CFT = false;+function setPreferCft(v) { PREFER_CFT = !!v; }+ function launchCandidates() {   // ⚠ 2026-08-22: the EDITORIAL below is STALE POLICY — kept for the history, but the current   // policy is CFT-FIRST again (2026-08-10, docs/WHY-CFT.md: the automation banner + branded Chrome@@ -213,6 +221,13 @@ function launchCandidates() {     // A forced-but-not-yet-present default (e.g. 'cft' still downloading) simply     // doesn't reorder — the system browsers serve as the fallback until it arrives.   }+  // v2.0.369: CFT-FIRST is now enforced by CODE, not by per-machine pinning. When the toolbar is+  // wanted and CfT is cached, it outranks every unpinned candidate (including a cached-but-not-+  // forced default, so machines CONVERGE onto CfT). An explicit pup_use pin still wins.+  if (PREFER_CFT && !(def && def.forced)) {+    const i = all.findIndex(c => c.kind === 'chrome-for-testing');+    if (i > 0) { const [c] = all.splice(i, 1); all.unshift(c); }+  }   return all; } @@ -1007,10 +1022,16 @@ function warmup() {     // no Chrome). This replaces the old "CfT on every box" doctrine that pulled 150MB even on machines     // that already had a perfectly good, battle-tested browser.     const hasNative = cands.some(c => c.kind === 'chrome' || c.kind === 'edge');-    if (hasNative) {+    // v2.0.369: when the toolbar family is wanted, CfT is fetched on EVERY box (background, at+    // bridge spawn — i.e. at ah/ab install time), because the toolbar cannot ride Edge/branded+    // Chrome. A fresh Edge-only box serves Edge for any open that races the download, then+    // converges to CfT on the next launch. Native-first stays the rule only when the toolbar+    // is explicitly off.+    if (hasNative && !PREFER_CFT) {       console.log('[warmup] native Chrome/Edge present — native-first: NOT fetching Chrome for Testing (no download needed)');       return;     }+    if (hasNative) console.log('[warmup] native browser present but the toolbar policy wants CfT — background-fetching so launches carry the toolbar');     if (free != null && free < CFT_MIN_FREE_MB) {       console.log(`[warmup] no native browser + CfT missing + low disk (${free}MB) — NOT auto-fetching; readiness reports lowDisk and opens will surface the disk hint`);       return;@@ -1024,6 +1045,6 @@ module.exports = {   detectChrome, detectSystemBrowser, listSystemBrowsers, launchCandidates, resolveBrowser,   installChrome, ensureChromeReady, readiness, expectedBuildId, cacheDir, diskFreeMb,   setDefaultBrowser, readDefault, clearDefault, markVerified, pickSummary,-  installChromeStable, chromeStableStatus, warmup,+  installChromeStable, chromeStableStatus, warmup, setPreferCft,   abCommand, // v1.8.40: reused by server.js to call AD verbs (e.g. desktop_taskbar) via the direct-API };
src/server.js+27−2
@@ -4202,6 +4202,18 @@ function writePupPortFile(overridePort) {     fs.writeFileSync(f, JSON.stringify({ port: Number(overridePort) || PORT, pid: process.pid, version: BRIDGE_VERSION, host: '127.0.0.1', assignedPort: PORT, fallback: !!overridePort }));   } catch (e) { console.error('[jumplist] port-discovery write failed:', e.message); } }+// v2.0.369 (CRR "pup not reachable", John 2026-09-02): the toolbar popup used to GUESS the port+// from a 2-entry hardcoded list, which broke the moment ab assigned anything else (CRR got 50950).+// The bridge now writes its LIVE port into the staged extension dir; the popup fetches+// chrome.runtime.getURL('port.json') — an unpacked extension reads that from disk on every popup+// open, so a bridge respawn on a new port is picked up with NO Chrome relaunch.+function writeExtensionPortFile(overridePort) {+  try {+    const d = path.join(os.homedir(), '.adom', 'pup-extension');+    fs.mkdirSync(d, { recursive: true });+    fs.writeFileSync(path.join(d, 'port.json'), JSON.stringify({ port: Number(overridePort) || PORT, version: BRIDGE_VERSION, pid: process.pid }));+  } catch (e) { console.error('[toolbar] port.json write failed:', e.message); }+} const PUP_JL_LAUNCHER_VERSION = 3;   // bump to force-rewrite the .ps1 on upgrade function pupJumplistLauncherPath() {   const la = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');@@ -5743,7 +5755,7 @@ async function updateWikiJumplist(session, sessionId, opts) {   // Explorer/ad-taskrun argv re-parsing hazard.   // v2.0.41: every task now routes through pupTask() → the pup-owned launcher (direct-to-pup POST,   // CLI fallback). We ensure the launcher .ps1 + the port-discovery file exist before committing.-  try { ensurePupJumplistLauncher(); writePupPortFile(); } catch (e) {}+  try { ensurePupJumplistLauncher(); writePupPortFile(); writeExtensionPortFile(); } catch (e) {}   // v1.9.51: a CLOSE-ALL task on every pup window (John: "i have like 8 open right now"). It calls   // pup_close with no sessionId, which kills every pup Chrome + clears every session.   const closeAllTask = pupTask('pup_close', {}, {@@ -10148,6 +10160,9 @@ async function getOrLaunchBrowser(profileName, { freshProfile = false, strictPer   // SPAWN-VERIFIES it — a broken/partial top pick (e.g. a corrupt Chrome install)   // falls through to the next real browser instead of hard-failing the open. The   // browser that actually launches is cached as the default (chrome.markVerified).+  // v2.0.369: refresh the CfT-first policy from the LIVE setting on every launch, so flipping+  // toolbarExtension applies without a bridge restart.+  try { if (chrome.setPreferCft) chrome.setPreferCft(pupSettings().toolbarExtension !== 'off'); } catch (e) {}   const candidates = chrome.launchCandidates();   if (candidates.length) {     console.log(`[launch] ${candidates.length} browser candidate(s): ` + candidates.map(c => `${c.kind}(${c.source})`).join(' → '));@@ -19174,6 +19189,12 @@ const server = http.createServer(async (req, res) => {             hint = `Pinned Chrome for Testing as the default and started the ~150 MB download in the background. Poll pup_readiness until ready:true — until then pup falls back to installed Chrome/Edge (${availTxt}). Once cached, every open uses CfT.`;           } else {             hint = `Default pinned → ${result.defaultBrowser ? result.defaultBrowser.kind : args.browser}. The next pup_open_window drives it. Available: ${availTxt}. Revert anytime with pup_use {browser:"auto"}.`;+            // v2.0.369 (pup-bridge #81): pinning off CfT silently strips the toolbar family from+            // every later launch (--load-extension rides ONLY CfT). Say so at pin time.+            const _pk = result.defaultBrowser ? result.defaultBrowser.kind : args.browser;+            if (_pk && _pk !== 'chrome-for-testing' && _pk !== 'cft' && pupSettings().toolbarExtension !== 'off') {+              hint += ` ⚠ WARNING: the Adom toolbar (pen/dots/identity tiles) rides ONLY Chrome for Testing — windows launched on ${_pk} will have NO toolbar. If this pin is temporary (a comparison/spike), revert to auto when done or the user loses the toolbar on every relaunch.`;+            }           }           sendJSON(res, {             success: !!result.ok,@@ -19914,7 +19935,7 @@ const _onPupBound = async () => {   console.log(`Puppeteer Bridge running on http://${BIND_HOST}:${PORT} (bind=${BIND_HOST}; no firewall prompt)`);   // v2.0.41: publish pup's own port so jump-list tasks can talk straight back to us (pup→pup), and   // (re)write the callback launcher so the .ps1 tracks any format change on upgrade.-  try { writePupPortFile(); ensurePupJumplistLauncher(); } catch (e) {}+  try { writePupPortFile(); writeExtensionPortFile(); ensurePupJumplistLauncher(); } catch (e) {}   console.log('Multi-session support: sessions are tabs sharing Chrome profiles via userDataDir');   console.log('Endpoints: /health, /command, /launch, /navigate, /reload, /screenshot, /screenshot.png, /errors, /eval, /wait, /status, /close');   // v2.0.13 (John, "everyone keeps saying pup is down"): DEFER the heavy native load + warm-up +@@ -19926,6 +19947,10 @@ const _onPupBound = async () => {   setImmediate(async () => {     try { ensureHeavyInit(); } catch (e) { console.error('heavy init failed:', e.message); }     // Self-warm: detect browsers + disk so the FIRST open is instant (cheap no-op if a browser exists).+    // v2.0.369: tell chrome.js whether the toolbar family is wanted BEFORE warmup, so a fresh+    // Edge-only box background-fetches CfT at install time and converges onto the toolbar-capable+    // browser with zero pinning (the Azure-VM Edge regression).+    try { if (chrome && chrome.setPreferCft) chrome.setPreferCft(pupSettings().toolbarExtension !== 'off'); } catch (e) {}     try { if (chrome && chrome.warmup) chrome.warmup(); } catch (e) { console.error('warmup failed:', e.message); }     // Recover sessions from disk (reconnect to Chrome windows that survived a bridge restart).     // Fire-and-forget: recovery must NEVER gate readiness or block the health probe.