← Commit history
bridge/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.1.37\ No newline at end of file+0.1.38\ No newline at end of file
bridge/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "native-browser",   "displayName": "Adom Browser Extension",-  "version": "0.1.37",+  "version": "0.1.38",   "expectedExtensionVersion": "0.1.3",   "description": "Drives the user's REAL signed-in Chrome/Edge via an installed extension (native-messaging transport). Mirrors the puppeteer bridge's verb surface as nbrowser_* but runs inside the actual logged-in profile, so cookies/SSO/saved-logins/captcha human-trust all work. The bridge binds an ephemeral loopback port (PORTS.md compliant) and writes a discovery file; the native-messaging host pumps stdio <-> this bridge; the extension never touches a TCP port.",   "homepage": "https://wiki.adom.inc/adom/adom-browser-extension",
bridge/package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-native-browser-bridge",-  "version": "0.1.37",+  "version": "0.1.38",   "private": true,   "description": "adom-desktop bridge for the Adom native-browser extension (Chrome + Edge)",   "main": "server.js",
bridge/server.js+17−7
@@ -1163,7 +1163,7 @@ const VERB_META = {   nbrowser_profiles: { hint: 'List every BROWSER x PROFILE you can drive + which is active. Each row carries browser (chrome|edge), email, displayName (the human label the user sees on the browser profile button, e.g. "John Personal" vs "adom.inc"), and profileDir. Pick work-vs-personal from the email DOMAIN + displayName, never from which window happens to be focused. Drive several in parallel with profile:"<key>".', related: ['nbrowser_use_profile', 'nbrowser_profile_block', 'nbrowser_resolve_profiles'], pitfalls: ['active is only the default when no profile is passed', 'an entry with unresolved:true has no email yet - nbrowser_resolve_profiles first, or you may drive the wrong account', 'the same email can live in Chrome AND Edge - match browser too', 'asleep:true = the profile exists (Local State) but has no open window so its extension is not running - it cannot be driven until the user opens a window in it; never claim a profile "does not exist" when it is merely asleep'] },   nbrowser_use_profile: { hint: 'Set the default profile that verbs target.', related: ['nbrowser_profiles', 'nbrowser_pin_session'], pitfalls: ['you can still override per-call with profile:"<email>"'] },   nbrowser_pin_session: { hint: 'Pin a sessionId to a profile so EVERY verb carrying that sessionId auto-routes to it (no cross-profile mistakes when driving several accounts). open_window pins automatically to the profile it opened in; use this to re-pin explicitly.', related: ['nbrowser_profiles', 'nbrowser_resolve_profiles', 'nbrowser_open_window'], pitfalls: ['pins are per-session; a verb with an explicit profile: still overrides the pin', 'if the pinned profile goes offline, verbs fall back to the active profile'] },-  nbrowser_open_os_window: { hint: 'EXTENSION-FREE: open a URL in the user\'s REAL browser profile (Chrome or Edge) when ABE is not installed there - the graceful-degradation path for flows where the USER does the clicking, above all OAuth consent (adom-google, Autodesk APS: they are already signed in; they just click Approve). BACKGROUND by default: brief blip, then minimized + ORANGE flashing taskbar button = "come click when ready". Registration (sessionId+thread+purpose) required like every window.', related: ['nbrowser_profiles', 'nbrowser_os_windows', 'nbrowser_force_close', 'nbrowser_wake_profile'], pitfalls: ['you CANNOT read, drive, or screenshot this window - no extension in that profile; poll the outcome out-of-band (OAuth token poll) or ask the user', 'if the extension IS installed in the profile, prefer wake_profile + open_window (full control, guards, cleanup)', 'foreground:true needs foregroundReason (+ notify_user first) - background+flash is almost always right', 'REFUSES (live_profile) if the target browser is hosting the user\'s workspace / an active AI thread - never launch a sibling browser into the profile the user is working in; use a DIFFERENT profile or pup. confirmLiveProfile:true overrides AND protects the workspace/other-session windows from minimize/close', 'close it afterwards with nbrowser_force_close {hwnd} - never leave auth litter', 'every response nudges the ABE install - relay the upsell to the user at a natural moment, never mid-auth'] },+  nbrowser_open_os_window: { hint: 'EXTENSION-FREE: open a URL in the user\'s REAL browser profile (Chrome or Edge) when ABE is not installed there - the graceful-degradation path for flows where the USER does the clicking, above all OAuth consent (adom-google, Autodesk APS: they are already signed in; they just click Approve). BACKGROUND by default: brief blip, then minimized + ORANGE flashing taskbar button = "come click when ready". Registration (sessionId+thread+purpose) required like every window.', related: ['nbrowser_profiles', 'nbrowser_os_windows', 'nbrowser_force_close', 'nbrowser_wake_profile'], pitfalls: ['you CANNOT read, drive, or screenshot this window - no extension in that profile; poll the outcome out-of-band (OAuth token poll) or ask the user', 'if the extension IS installed in the profile, prefer wake_profile + open_window (full control, guards, cleanup)', 'foreground:true needs foregroundReason (+ notify_user first) - background+flash is almost always right', 'HARD-REFUSES (live_profile, no override) if the target browser is hosting the user\'s workspace / a live AI session - launching into that shared process can restart the browser and kill the running windows; use a DIFFERENT profile, pup, or install ABE (in-process window creation, no restart risk)', 'close it afterwards with nbrowser_force_close {hwnd} - never leave auth litter', 'every response nudges the ABE install - relay the upsell to the user at a natural moment, never mid-auth'] },   nbrowser_os_windows: { hint: 'OS-level browser-window inventory measured ON the laptop by the bridge: every Chrome/Edge/pup window (hwnd, title, rect, z) annotated with the ABE session that owns it. THE reliable probe when your own desktop_list_windows returns 0/null (wrong --target, AD hiccup) or when a profile has no extension (Edge) so list_windows cannot see it.', related: ['nbrowser_force_close', 'nbrowser_list_windows', 'nbrowser_profiles'], pitfalls: ['a window with abeSession set belongs to a LIVE thread - never force-close it', 'ok:false = the bridge\'s AD link is down, meaning "unknown", NOT "no windows"'] },   nbrowser_wake_profile: { hint: 'Wake an ASLEEP profile (exists in nbrowser_profiles with asleep:true but not drivable) WITHOUT opening any window: launches the browser with --no-startup-window so the profile + its extension load in background mode - nothing foregrounds, no focus is stolen. When it returns woke:true, drive normally.', related: ['nbrowser_profiles', 'nbrowser_open_window', 'nbrowser_resolve_profiles'], pitfalls: ['NEVER launch a foreground browser window to wake a profile - this verb exists so waking honors background-by-default', 'woke:false usually means the Adom extension is not installed in THAT profile (extensions are per-profile)'] },   nbrowser_resolve_profiles: { hint: 'Force every connected extension to re-resolve its Google email and re-announce, so pending-N / empty-email keys eagerly become chrome:<email> / edge:<email> - call it up front so you never drive the wrong (unresolved) profile.', related: ['nbrowser_profiles', 'nbrowser_pin_session', 'nbrowser_whoami'], pitfalls: ['takes ~2.5s (waits for each re-announce)', 'a profile not signed into Google stays email-less - target it by id-key or browser:'] },@@ -1354,7 +1354,7 @@ function dispatch(verb, args) {         d('nbrowser_profiles', 'List connected BROWSER×PROFILE targets + which is active.', {}, { ok: 'bool', profiles: '[{profile,email,browser,active,blocked,live}]', active: 'str' }, 15, { example: {} }),         d('nbrowser_use_profile', 'Set the default profile action verbs target.', { profile: 'required str (key or email)' }, { ok: 'bool', active: 'str' }, 15, { example: { profile: 'chrome:[email protected]' } }),         d('nbrowser_pin_session', 'Pin a sessionId to a profile so every verb on that session auto-routes there (prevents cross-profile mistakes). open_window pins automatically.', { sessionId: 'required str', profile: 'required str (key or email)' }, { ok: 'bool', sessionId: 'str', pinnedTo: 'str' }, 15, { example: { sessionId: 'schwab', profile: 'chrome:[email protected]' } }),-        d('nbrowser_open_os_window', 'EXTENSION-FREE open of a URL in the user\'s real browser profile (OAuth consent etc). Background by default (minimize + orange taskbar flash); foreground needs foregroundReason. Returns hwnd (close later via force_close). Upsells the ABE install in every response.', { sessionId: 'required str', thread: 'required str', purpose: 'required str', profile: 'required str (key or email)', url: 'required http(s) str', browser: 'optional chrome|edge', foreground: 'optional bool', foregroundReason: 'required if foreground', confirmLiveProfile: 'optional bool (override the live_profile guard)' }, { ok: 'bool', hwnd: 'int?', minimized: 'bool', flashed: 'bool', extensionInstalled: 'bool' }, 20, { example: { sessionId: 'gauth', thread: 'adom-google-setup', purpose: 'open Google OAuth consent for adom-google', profile: 'chrome:[email protected]', url: 'https://accounts.google.com/o/oauth2/auth?...' } }),+        d('nbrowser_open_os_window', 'EXTENSION-FREE open of a URL in the user\'s real browser profile (OAuth consent etc). Background by default (minimize + orange taskbar flash); foreground needs foregroundReason. Returns hwnd (close later via force_close). Upsells the ABE install in every response.', { sessionId: 'required str', thread: 'required str', purpose: 'required str', profile: 'required str (key or email)', url: 'required http(s) str', browser: 'optional chrome|edge', foreground: 'optional bool', foregroundReason: 'required if foreground' }, { ok: 'bool', hwnd: 'int?', minimized: 'bool', flashed: 'bool', extensionInstalled: 'bool' }, 20, { example: { sessionId: 'gauth', thread: 'adom-google-setup', purpose: 'open Google OAuth consent for adom-google', profile: 'chrome:[email protected]', url: 'https://accounts.google.com/o/oauth2/auth?...' } }),         d('nbrowser_os_windows', 'OS-level browser-window inventory from the laptop (bridge-side): all Chrome/Edge/pup windows with hwnd/title/rect/z + which ABE session owns each. Reliable even when the caller\'s desktop_list_windows returns 0 (wrong target / AD hiccup) or a profile has no extension.', {}, { ok: 'bool (false = AD link down, data unknown)', count: 'int', windows: '[{hwnd,title,rect,z,kind,abeSession}]' }, 15, { example: {} }),         d('nbrowser_wake_profile', 'Wake an asleep browser profile with NO window (launches --no-startup-window; nothing foregrounds). Profile becomes live/drivable when its extension connects.', { profile: 'required str (key or email)', browser: 'optional chrome|edge' }, { ok: 'bool', woke: 'bool', alreadyLive: 'bool?', profile: 'str' }, 15, { example: { profile: 'chrome:[email protected]' } }),         d('nbrowser_resolve_profiles', 'Force every connected extension to re-resolve its Google email + re-announce, so pending-N/empty-email keys become chrome:<email>/edge:<email>.', {}, { ok: 'bool', profiles: '[{profile,email,browser}]' }, 15, { example: {} }),@@ -1563,10 +1563,15 @@ function dispatch(verb, args) {       for (const w of curWins) { const t = String(w.title || ''); if (BRAND.test(t) && WORKSPACE.test(t)) { protectedHwnds.add(w.hwnd); hostWins.push(t); } }       // another THREAD's live extension-driven session pinned to this exact profile (not my own, not os-opened)       for (const [sid, pk] of sessionProfile) { if (pk === kp.key && sid !== a.sessionId && !osOpened.has(sid)) { const h = sessionHwnd.get(sid); if (h) protectedHwnds.add(h); } }-      if ((hostWins.length || protectedHwnds.size) && a.confirmLiveProfile !== true) {+      // HARD REFUSE — NO OVERRIDE. Launching a competing browser process into a profile whose browser+      // is currently hosting the user's workspace / an active AI session can make the browser do a+      // singleton takeover and RESTART that profile, destroying the running windows. This killed the+      // user's thread twice (2026-07-19), the second time because a confirmLiveProfile:true escape let+      // me click past this very check. That escape is GONE. The safe paths are in the hint.+      if (hostWins.length || protectedHwnds.size) {         return resolve({ success: false, errorCode: 'live_profile',-          error: `live_profile: the ${kp.browser} profile '${kp.displayName}' appears to be hosting the user's live Adom workspace or an active AI session${hostWins.length ? ` (window: "${hostWins[0].slice(0, 60)}")` : ''}. Launching another browser window into the SAME profile can disrupt that running session (a real incident).`,-          _hint: 'Do NOT open into the profile that runs the workspace/thread. Prefer a DIFFERENT profile for the task, or pup (browser_open_window) for a throwaway. Only if you are CERTAIN it is safe, re-call with confirmLiveProfile:true - the workspace/other-thread windows are then explicitly protected from minimize/close, but a browser can still get grumpy about a sibling launch into a live profile.' });+          error: `live_profile: ${kp.browser} is currently hosting ${hostWins.length ? `the user's live Adom workspace (window: "${hostWins[0].slice(0, 60)}")` : 'an active AI session'}, and it shares ONE process across all its windows. Launching a window into it risks a singleton takeover that RESTARTS the browser and destroys the running windows. REFUSED (no override).`,+          _hint: `Never launch a browser into the process running the workspace/thread. Options: (1) a DIFFERENT ${kp.browser} profile that is NOT live; (2) pup (browser_open_window) for a fully isolated throwaway browser; (3) install the Adom extension in this profile (installing-the-extension) — with ABE, a window is created via chrome.windows.create FROM INSIDE the already-running browser, so there is NO process launch and NO restart risk, even on a single-profile browser. To open the user's REAL signed-in ${kp.browser} session in the background, ABE is the reliable path.` });       }       const local = process.env.LOCALAPPDATA;       const exes = kp.browser === 'edge'@@ -1581,7 +1586,12 @@ function dispatch(verb, args) {           // 30ms resolution -> minimize the new window the instant it exists (often before first paint).           // v1 orchestrated launch + demote from the bridge as two round-trips = a visible ~200ms flash           // of the window; doing it all in-process on the laptop shrinks that to imperceptible.-          const argStr = `--profile-directory="${kp.profileDir}" --new-window "${url.replace(/["']/g, '')}"`;+          // Clean per-arg quoting via a PowerShell ARRAY (each element quoted by PS) — NOT an embedded-+          // quote string. The old `--profile-directory="Default"` string passed LITERAL quotes to+          // Chromium, which can break the singleton handshake and trigger a takeover/restart.+          const dirArg = kp.profileDir.replace(/'/g, '');+          const urlArg = url.replace(/['"]/g, '');+          const argArr = `@('--profile-directory=${dirArg}','--new-window','${urlArg}')`;           const psBody = [             'Add-Type @"',             'using System;using System.Text;using System.Collections.Generic;using System.Runtime.InteropServices;',@@ -1598,7 +1608,7 @@ function dispatch(verb, args) {             `$protected = @(${[...protectedHwnds].map((h) => `[long]${h}`).join(',')})`,             '$pre = [WWatch]::Browsers()',             'foreach ($p in $protected) { if ($pre -notcontains $p) { $pre += $p } }',-            `Start-Process -FilePath "${exe}" -ArgumentList '${argStr}'`,+            `Start-Process -FilePath "${exe}" -ArgumentList ${argArr}`,             '$deadline = (Get-Date).AddSeconds(10)',             '$found = 0',             'while ((Get-Date) -lt $deadline) {',
native-browser-bridge-manifest.json+4−4
@@ -1,8 +1,8 @@ {   "manifest_version": 1,-  "version": "0.1.37",-  "url": "https://wiki.adom.inc/download/adom/adom-browser-extension/0.1.37/native-browser-bridge-v0.1.37.zip",-  "sha256": "0c945cf4bd3973607d825361a6fdb4677c31b7808e9c824a9c326cc4c349535e",-  "size": 86246,+  "version": "0.1.38",+  "url": "https://wiki.adom.inc/download/adom/adom-browser-extension/0.1.38/native-browser-bridge-v0.1.38.zip",+  "sha256": "ab6805b45617e61d9a86fe59e3ee58742004741b8f813075003ce40f3420b125",+  "size": 86661,   "released_at": "2026-07-19T00:00:00Z" }