@btraut/browser-bridge 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,37 @@ The format is based on "Keep a Changelog", and this project adheres to Semantic
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.14.0] - 2026-03-13
10
+
11
+ ### Added
12
+
13
+ - Added a project-local `bump-version` skill that walks an agent through the repo's release flow: explicit SemVer bump selection, changelog move, release commit/tag push, GitHub release verification, npm publish, and the final extension-update reminder.
14
+
15
+ ### Changed
16
+
17
+ - Refactored the extension action path into smaller, clearer pieces: tab resolution, permission gating, debugger dispatch, click strategies, and locator scoring no longer all live inline in the same giant handlers.
18
+ - Refactored inspect internals into explicit subsystems for target selection, content extraction policy, and snapshot-ref lifecycle management, which makes the core behavior easier to follow and safer to change.
19
+
20
+ ### Fixed
21
+
22
+ - Clicks and locator resolution are much more reliable on real sites, especially for popup/menu triggers, duplicate controls, exact text matches, and visible-vs-hidden targets.
23
+ - Inspect is more stable and useful on dynamic pages: AX snapshots keep the right interactive nodes, `extract_content` handles SPA layouts better, and snapshot refs recover more cleanly after rerenders.
24
+ - Drive and inspect targeting are more predictable: session tab affinity is preserved by default, explicit `tab_id` targeting works end-to-end, and tab-activation failures degrade more gracefully when the right tab is already active.
25
+ - The inspect/setup story is much cleaner: current builds treat inspect as always-on, `dev enable-inspect` behaves like a diagnostics/remediation command, and the docs/runtime guidance now match reality.
26
+ - CLI and runtime plumbing got tougher around packaging and failure handling, including cleaner startup errors, better executable/shebang preservation, and less debugger coupling for screenshots.
27
+ - Repo tooling and validation were cleaned up too, including hook fixes, docs cleanup, and follow-up CI/lint/typecheck regressions on `main`.
28
+ - Plus 35 other bug fixes and polish items across diagnostics, docs, test coverage, and developer tooling.
29
+
30
+ ## [0.13.2] - 2026-02-18
31
+
32
+ ### Changed
33
+
34
+ - Maintenance patch release for `0.13.2`.
35
+
36
+ ### Fixed
37
+
38
+ - MCP adapter readiness tests now model POST/GET health probing correctly, preventing false failures when daemon auto-start is enabled.
39
+
9
40
  ## [0.13.1] - 2026-02-18
10
41
 
11
42
  ### Fixed
package/README.md CHANGED
@@ -19,6 +19,10 @@ npm i -g @btraut/browser-bridge
19
19
  browser-bridge --help
20
20
  ```
21
21
 
22
+ zsh gotcha:
23
+
24
+ - If `browser-bridge` is not installed or not on `PATH` and you run it from inside a directory also named `browser-bridge`, zsh can print a misleading `permission denied` by trying to execute the directory itself. Check `command -v browser-bridge` before treating that error as a packaging failure.
25
+
22
26
  2. Run the installer:
23
27
 
24
28
  ```bash
@@ -45,6 +49,8 @@ Then load the unpacked extension from `packages/extension/`.
45
49
 
46
50
  </details>
47
51
 
52
+ Repo contributors: run `npm run hooks:install` once after clone. This repo expects `core.hooksPath=.githooks` so local `pre-commit` and `pre-push` block the same format/lint/typecheck failures that CI enforces.
53
+
48
54
  4. Try it:
49
55
 
50
56
  ```text
@@ -106,7 +112,7 @@ See `docs/cdp-input-model.md` for details and smoke verification.
106
112
 
107
113
  ## 🔒 Site Permissions (Drive Actions)
108
114
 
109
- Browser Bridge is intentionally safe: **drive actions** (`drive.navigate`, click, type, etc.) require **per-site approval**. `inspect.*` is additionally guarded behind an explicit debugger-capability toggle in extension options.
115
+ Browser Bridge is intentionally safe: **drive actions** (`drive.navigate`, click, type, etc.) require **per-site approval**. `inspect.*` is always available in current builds; if diagnostics reports missing inspect capability, that is stale runtime drift, not a separate permission toggle.
110
116
 
111
117
  <details>
112
118
  <summary>How approvals work (click to expand)</summary>
@@ -124,7 +130,7 @@ Manage approvals (and bypass mode):
124
130
  - Switch **Permission mode** to **Bypass (dangerous)** to skip the allowlist and prompts entirely.
125
131
  - In bypass mode, the agent can take actions on any website without asking.
126
132
  - Restricted URLs (for example `chrome://` and `file://`) are still blocked.
127
- - `inspect.*` requires enabling **Debugger-based inspect** in extension options. If disabled, inspect calls fail with `ATTACH_DENIED` and a clear next step.
133
+ - `inspect.*` should already be enabled in current builds. Use `browser-bridge dev enable-inspect` as a diagnostics probe; if it reports missing inspect capability, treat that as stale runtime drift and reload or update the Browser Bridge extension.
128
134
 
129
135
  </details>
130
136
 
@@ -206,8 +212,8 @@ Or copy the Browser Bridge skill into your agent skills directory (advanced):
206
212
 
207
213
  ```bash
208
214
  # From this repo:
209
- # cp -R docs/skills/browser-bridge ~/.agents/skills/browser-bridge
210
- # cp -R docs/skills/browser-bridge ~/.claude/skills/browser-bridge
215
+ # cp -R skills/browser-bridge ~/.agents/skills/browser-bridge
216
+ # cp -R skills/browser-bridge ~/.claude/skills/browser-bridge
211
217
 
212
218
  # From npm (global install):
213
219
  cp -R "$(npm root -g)/@btraut/browser-bridge/skills/browser-bridge" ~/.agents/skills/browser-bridge
@@ -234,12 +240,12 @@ Codex:
234
240
  codex mcp add browser-bridge -- browser-bridge mcp
235
241
  ```
236
242
 
237
- Optional custom host/port (use `browser-bridge dev info` to get the current worktree port):
243
+ Optional custom host/port override (only if you intentionally run Core somewhere else):
238
244
 
239
245
  ```bash
240
246
  codex mcp add browser-bridge \
241
247
  --env BROWSER_BRIDGE_CORE_HOST=127.0.0.1 \
242
- --env BROWSER_BRIDGE_CORE_PORT=<port-from-dev-info> \
248
+ --env BROWSER_BRIDGE_CORE_PORT=<custom-port> \
243
249
  -- browser-bridge mcp
244
250
  ```
245
251
 
@@ -249,12 +255,12 @@ Claude Code:
249
255
  claude mcp add --transport stdio browser-bridge -- browser-bridge mcp
250
256
  ```
251
257
 
252
- Optional custom host/port (use `browser-bridge dev info` to get the current worktree port):
258
+ Optional custom host/port override (only if you intentionally run Core somewhere else):
253
259
 
254
260
  ```bash
255
261
  claude mcp add --transport stdio browser-bridge \
256
262
  --env BROWSER_BRIDGE_CORE_HOST=127.0.0.1 \
257
- --env BROWSER_BRIDGE_CORE_PORT=<port-from-dev-info> \
263
+ --env BROWSER_BRIDGE_CORE_PORT=<custom-port> \
258
264
  -- browser-bridge mcp
259
265
  ```
260
266
 
@@ -262,13 +268,12 @@ claude mcp add --transport stdio browser-bridge \
262
268
 
263
269
  ## ✅ Default Runtime (Normal Usage)
264
270
 
265
- For normal usage, Browser Bridge is zero-setup:
271
+ Browser Bridge is now a single-runtime setup by default:
266
272
 
267
- - Core and CLI default to `127.0.0.1:3210`.
268
- - The extension also defaults to `3210`.
269
- - You do not need `dev activate` unless you intentionally opt into isolated worktree routing.
273
+ - Core, CLI, and extension target `127.0.0.1:3210`.
274
+ - You do not need any activation or routing step for normal use.
270
275
  - After reboot/cold start, the first CLI or MCP request auto-starts Core (no manual daemon wake-up required).
271
- - If Core is idle/offline, the extension popup may show `disconnected` or `backoff`; this is expected until Core is reachable again.
276
+ - If Core is idle/offline, the extension popup may show `disconnected` or `backoff`; that just means Core is not reachable yet.
272
277
 
273
278
  Optional status check:
274
279
 
@@ -276,32 +281,18 @@ Optional status check:
276
281
  browser-bridge dev info --json
277
282
  ```
278
283
 
279
- ## 🔁 Isolated Multi-Worktree Dev Loop (Advanced)
280
-
281
- Use this loop when you intentionally run multiple worktree instances in parallel.
282
-
283
- 1. Resolve runtime for the current worktree:
284
-
285
- ```bash
286
- browser-bridge dev info --json
287
- ```
288
-
289
- Use the `port`, `worktreeId`, `metadataPath`, and `logDir` from output.
290
-
291
- 2. Activate isolated extension routing for this worktree:
284
+ Use `browser-bridge dev enable-inspect` only as a quick diagnostics probe when you want to sanity-check debugger-backed inspect on the live runtime:
292
285
 
293
286
  ```bash
294
- browser-bridge dev activate --extension-id <id>
287
+ browser-bridge dev enable-inspect
295
288
  ```
296
289
 
297
- After the first run, you can usually omit `--extension-id` because it is saved in `.context/browser-bridge/dev.json`.
298
-
299
- 3. Run your CLI/MCP workflow in this worktree.
290
+ The helper verifies inspect capability against the live runtime and can also sanity-check a specific connected extension via `--extension-id <id>`. It does not flip inspect on through Core. The extension id may be cached in `.context/browser-bridge/dev.json` after a successful run, but that metadata is no longer a routing switch.
300
291
 
301
- ## 🧯 Worktree Troubleshooting
292
+ ## 🧯 Runtime Troubleshooting
302
293
 
303
- - Missing extension id: Run `browser-bridge dev activate --extension-id <id>`. Or set `BROWSER_BRIDGE_EXTENSION_ID=<id>`. You can copy the id from `chrome://extensions` (enable Developer mode to see ids).
304
- - Activation URL did not open in Chrome: Run `browser-bridge dev activate --json`, copy `result.activationUrl`, and open it directly in Chrome. `dev activate` uses the OS URL opener, so your default browser setting matters.
294
+ - Inspect capability still unavailable: restart the Browser Bridge core daemon, then reload or update the Browser Bridge extension and rerun `browser-bridge diagnostics doctor` plus `browser-bridge dev enable-inspect`.
295
+ - Extension id mismatch while verifying inspect: rerun with the correct `--extension-id <id>` or clear `BROWSER_BRIDGE_EXTENSION_ID` if you pinned the wrong unpacked install. You can copy the id from `chrome://extensions` (enable Developer mode to see ids).
305
296
  - Logs and per-stream JSONL inspection: Logs are under `.context/logs/browser-bridge/`. Common streams: `cli.jsonl`, `core.jsonl`, `mcp-adapter.jsonl` (plus rotated files like `core.1.jsonl`).
306
297
 
307
298
  ```bash
@@ -311,7 +302,7 @@ tail -n 80 .context/logs/browser-bridge/core.jsonl
311
302
  tail -n 80 .context/logs/browser-bridge/mcp-adapter.jsonl
312
303
  ```
313
304
 
314
- - Default mode port is `3210`. In isolated mode, port is worktree-specific. Use `browser-bridge dev info` if you are unsure (or pass explicit `--port` / `BROWSER_BRIDGE_CORE_PORT`).
305
+ - Default runtime is `127.0.0.1:3210`. If you are unsure, run `browser-bridge dev info` or pass explicit `--host` / `--port` overrides.
315
306
 
316
307
  ## 🩺 Diagnostics
317
308
 
@@ -322,7 +313,7 @@ tail -n 80 .context/logs/browser-bridge/mcp-adapter.jsonl
322
313
 
323
314
  ### End-to-End Connection Troubleshooting Flow
324
315
 
325
- Use this exact flow when commands fail after reboot, runtime changes, or worktree switching:
316
+ Use this exact flow when commands fail after reboot or runtime changes:
326
317
 
327
318
  1. Check runtime resolution:
328
319
 
@@ -341,8 +332,8 @@ browser-bridge diagnostics doctor --json
341
332
  - Red dot: extension is disconnected or reconnecting.
342
333
 
343
334
  4. If caller/core/extension endpoints differ in the diagnostics report:
344
- - Default mode: remove custom host/port env overrides and retry (`BROWSER_BRIDGE_CORE_HOST`, `BROWSER_BRIDGE_CORE_PORT`).
345
- - Isolated mode: re-run `browser-bridge dev activate --extension-id <id>` for the intended worktree.
335
+ - Remove custom host/port env overrides and retry (`BROWSER_BRIDGE_CORE_HOST`, `BROWSER_BRIDGE_CORE_PORT`).
336
+ - If inspect capability is the missing piece, run `browser-bridge dev enable-inspect --extension-id <id>`.
346
337
 
347
338
  5. If the popup stays red and failures continue:
348
339
  - Inspect logs: