@btraut/browser-bridge 0.3.0 → 0.4.2
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 +42 -0
- package/README.md +72 -31
- package/dist/api.js +1671 -1384
- package/dist/api.js.map +4 -4
- package/dist/index.js +228 -2
- package/dist/index.js.map +4 -4
- package/extension/dist/background.js +509 -2
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/content.js +71 -0
- package/extension/dist/content.js.map +2 -2
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
- package/skills/browser-bridge/SKILL.md +12 -0
- package/skills/browser-bridge/skill.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,48 @@ The format is based on "Keep a Changelog", and this project adheres to Semantic
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
_TBD_
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
_TBD_
|
|
16
|
+
|
|
17
|
+
## [0.4.2] - 2026-02-07
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fix the GitHub release workflow tag/version verification step so tag pushes reliably create a GitHub Release and upload the extension zip.
|
|
22
|
+
|
|
23
|
+
## [0.4.1] - 2026-02-07
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- `health_check` MCP tool and core endpoint (`/health_check`) for uptime/memory/session/extension status.
|
|
28
|
+
- Full-page scrolling screenshots for `artifacts.screenshot` via `fullPage: true` (scroll + stitch, up to ~50K px tall).
|
|
29
|
+
- MCP Streamable HTTP server transport (in addition to stdio).
|
|
30
|
+
- Pre-built Chrome extension zip attached to GitHub releases.
|
|
31
|
+
- Element-targeted screenshots for `artifacts.screenshot` via `selector`.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
_TBD_
|
|
36
|
+
|
|
37
|
+
## [0.4.0] - 2026-02-06
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- Core idle session TTL cleanup (configurable via `BROWSER_BRIDGE_SESSION_TTL_MS`).
|
|
42
|
+
- Diagnostics now include a session summary (count and max age/idle time).
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Sanitize Chrome extension error messages before forwarding them to clients (remove file paths and redact URLs to origin).
|
|
47
|
+
- Share the core <-> extension protocol types via `@btraut/browser-bridge-shared` (remove manual sync).
|
|
48
|
+
- Refactor InspectService internals into `packages/core/src/inspect/*` modules and expand unit test coverage (no API changes).
|
|
49
|
+
- Stabilize `scripts/cli-full-tool-smoke.sh` dialog steps by refreshing debugger attachment before opening JS dialogs.
|
|
50
|
+
|
|
9
51
|
## [0.3.0] - 2026-02-06
|
|
10
52
|
|
|
11
53
|
### Added
|
package/README.md
CHANGED
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
<img src="docs/assets/readme-header.png" alt="Browser Bridge header graphic" width="720" />
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@btraut/browser-bridge) [](https://github.com/btraut/browser-bridge/actions/workflows/ci.yml) [](LICENSE)
|
|
3
|
+
[](https://www.npmjs.com/package/@btraut/browser-bridge) [](https://www.npmjs.com/package/@btraut/browser-bridge) [](https://github.com/btraut/browser-bridge/actions/workflows/ci.yml) [](LICENSE)
|
|
4
4
|
|
|
5
5
|
# Browser Bridge
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Reliable local Chrome control for coding agents.**
|
|
8
|
+
|
|
9
|
+
Browser Bridge drives your real, local Chrome (not headless) and inspects page state through a Chrome extension plus a local daemon. You stay in the loop with your existing tabs and login state.
|
|
10
|
+
|
|
11
|
+
What makes it different:
|
|
12
|
+
|
|
13
|
+
- **Real browser state**: operate on your actual Chrome profile (tabs, cookies, logins, extensions).
|
|
14
|
+
- **Two-plane architecture**: a **drive** plane that does what a user does (click, type, navigate), plus an **inspect** plane that reads state (DOM, console, screenshots). This separation makes runs less flaky and lets inspection happen in parallel.
|
|
15
|
+
- **Token-efficient inspection**: stable element refs like `@e1` (find once, reuse everywhere) plus knobs to bound output (`--max-nodes`, `--compact`, `--interactive`, `--selector`).
|
|
16
|
+
- **Structured errors for agents**: stable error codes with a `retryable` flag (no more guessing whether to retry).
|
|
17
|
+
- **Recovery-first**: sessions have an explicit state machine with `session.recover()` and `diagnostics doctor`.
|
|
18
|
+
- **Inspect beyond screenshots**: DOM snapshots (AX + HTML) and `inspect dom-diff` to detect page changes.
|
|
19
|
+
|
|
20
|
+
## Why Browser Bridge
|
|
21
|
+
|
|
22
|
+
Browser Bridge is built for agent reliability and "stay logged in" workflows in your real Chrome, not for headless test automation.
|
|
23
|
+
|
|
24
|
+
If you're coming from Playwright/Puppeteer-style tooling:
|
|
25
|
+
|
|
26
|
+
- Browser Bridge targets the user's existing, interactive Chrome session by default (typical Playwright/Puppeteer flows spin up a separate browser/context).
|
|
27
|
+
- Browser Bridge surfaces retry guidance in the API (`retryable`) instead of forcing the agent to infer it from exceptions and timing.
|
|
28
|
+
- Browser Bridge ships a first-class inspect plane (DOM snapshots, diffs, diagnostics) designed for LLM consumption, with output-bounding options to keep agent context small.
|
|
29
|
+
|
|
30
|
+
If you're coming from an extension-only MCP tool:
|
|
31
|
+
|
|
32
|
+
- Browser Bridge puts a stateful local Core daemon behind the tools (sessions, recovery, diagnostics, artifacts).
|
|
33
|
+
- Drive actions are serialized for determinism; inspect is a separate plane that can keep producing structured state.
|
|
34
|
+
- CLI works everywhere; MCP is optional.
|
|
35
|
+
|
|
36
|
+
## How It Works
|
|
37
|
+
|
|
38
|
+
Core keeps a session state machine and exposes a small set of stable tools:
|
|
39
|
+
|
|
40
|
+
- `session.*` - lifecycle + recovery
|
|
41
|
+
- `drive.*` - navigation + input (single-flight)
|
|
42
|
+
- `inspect.*` - DOM snapshots/diffs + evaluation
|
|
43
|
+
- `diagnostics.*` - health checks
|
|
44
|
+
- `artifacts.*` - screenshots
|
|
8
45
|
|
|
9
46
|
## Requirements
|
|
10
47
|
|
|
@@ -13,7 +50,7 @@ Local Chrome control for coding agents. Browser Bridge provides a CLI and an opt
|
|
|
13
50
|
- Browser Bridge extension (Chrome Web Store listing pending; see manual install below)
|
|
14
51
|
- Local-only usage (all services bind to 127.0.0.1)
|
|
15
52
|
|
|
16
|
-
## Install
|
|
53
|
+
## Install (CLI)
|
|
17
54
|
|
|
18
55
|
```bash
|
|
19
56
|
npm i -g @btraut/browser-bridge
|
|
@@ -24,6 +61,10 @@ browser-bridge --help
|
|
|
24
61
|
|
|
25
62
|
Chrome Web Store listing is pending. For now, install the extension manually:
|
|
26
63
|
|
|
64
|
+
1. Download the latest pre-built extension zip from [GitHub Releases](https://github.com/btraut/browser-bridge/releases) (Assets), unzip it, and use the unzipped folder for step 3.
|
|
65
|
+
|
|
66
|
+
Alternative (build from source):
|
|
67
|
+
|
|
27
68
|
1. Clone this repo.
|
|
28
69
|
2. Install deps and build:
|
|
29
70
|
|
|
@@ -33,14 +74,13 @@ npm run build
|
|
|
33
74
|
```
|
|
34
75
|
|
|
35
76
|
3. Open Chrome and navigate to `chrome://extensions`.
|
|
36
|
-
4. Enable **Developer mode**, click **Load unpacked**, and select
|
|
77
|
+
4. Enable **Developer mode**, click **Load unpacked**, and select the extension folder (the folder with `manifest.json`).
|
|
37
78
|
|
|
38
79
|
## Quickstart
|
|
39
80
|
|
|
40
|
-
1. Install the extension
|
|
41
|
-
2.
|
|
42
|
-
3.
|
|
43
|
-
4. Run a quick CLI check:
|
|
81
|
+
1. Install the extension.
|
|
82
|
+
2. (Optional) Run `browser-bridge install` (skill + optional MCP).
|
|
83
|
+
3. Run a quick CLI check (Core auto-starts by default):
|
|
44
84
|
|
|
45
85
|
```bash
|
|
46
86
|
browser-bridge session create
|
|
@@ -54,7 +94,9 @@ Notes:
|
|
|
54
94
|
|
|
55
95
|
- `inspect dom-snapshot` defaults to `--format ax`; `--max-nodes` is only supported for AX snapshots.
|
|
56
96
|
|
|
57
|
-
## Skills (
|
|
97
|
+
## Skills (Agent Clients)
|
|
98
|
+
|
|
99
|
+
Browser Bridge skills work across many agent clients, including Codex and Claude Code.
|
|
58
100
|
|
|
59
101
|
Easiest option (recommended):
|
|
60
102
|
|
|
@@ -62,7 +104,14 @@ Easiest option (recommended):
|
|
|
62
104
|
browser-bridge install
|
|
63
105
|
```
|
|
64
106
|
|
|
65
|
-
|
|
107
|
+
Skill only:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
browser-bridge skill install
|
|
111
|
+
browser-bridge skill status
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or copy the Browser Bridge skill into your agent skills directory (advanced):
|
|
66
115
|
|
|
67
116
|
```bash
|
|
68
117
|
# From this repo:
|
|
@@ -80,11 +129,14 @@ Restart your agent app if it does not pick up the new skill automatically.
|
|
|
80
129
|
|
|
81
130
|
The MCP server runs over stdio and forwards tool calls to Core. It is optional, since you can use the CLI directly. MCP clients launch it automatically when needed, so you typically do not run it yourself.
|
|
82
131
|
|
|
132
|
+
- Easiest option: `browser-bridge mcp install`
|
|
83
133
|
- Manual start (debugging): `browser-bridge mcp`
|
|
84
134
|
- Use your MCP client to call `tools/list`, then `session.create`
|
|
85
135
|
- Override Core host/port with `--host`, `--port`, or `BROWSER_BRIDGE_CORE_HOST` / `BROWSER_BRIDGE_CORE_PORT`.
|
|
86
136
|
|
|
87
|
-
##
|
|
137
|
+
## Manual MCP Setup (Advanced)
|
|
138
|
+
|
|
139
|
+
Codex:
|
|
88
140
|
|
|
89
141
|
```bash
|
|
90
142
|
codex mcp add browser-bridge -- browser-bridge mcp
|
|
@@ -99,7 +151,7 @@ codex mcp add browser-bridge \
|
|
|
99
151
|
-- browser-bridge mcp
|
|
100
152
|
```
|
|
101
153
|
|
|
102
|
-
|
|
154
|
+
Claude Code:
|
|
103
155
|
|
|
104
156
|
```bash
|
|
105
157
|
claude mcp add --transport stdio browser-bridge -- browser-bridge mcp
|
|
@@ -119,27 +171,16 @@ claude mcp add --transport stdio browser-bridge \
|
|
|
119
171
|
- CLI: `browser-bridge diagnostics doctor --session-id <id>`
|
|
120
172
|
- Reports extension and debugger status alongside session state.
|
|
121
173
|
|
|
122
|
-
##
|
|
123
|
-
|
|
124
|
-
See `CHANGELOG.md`.
|
|
125
|
-
|
|
126
|
-
## Releasing
|
|
127
|
-
|
|
128
|
-
See `docs/releasing.md`.
|
|
129
|
-
|
|
130
|
-
## Security Model (v1)
|
|
174
|
+
## Recovery
|
|
131
175
|
|
|
132
|
-
|
|
133
|
-
- Do not expose the port or run the Core daemon on shared hosts.
|
|
176
|
+
If drive or inspect gets into a bad state, recovery is explicit:
|
|
134
177
|
|
|
135
|
-
|
|
178
|
+
- `browser-bridge session recover --session-id <id>`
|
|
179
|
+
- Then retry the failed operation once (tools report whether failures are `retryable`).
|
|
136
180
|
|
|
137
|
-
|
|
181
|
+
## Session TTL (Core Daemon)
|
|
138
182
|
|
|
139
|
-
|
|
140
|
-
2. Enable **Developer mode**.
|
|
141
|
-
3. Click **Load unpacked** and select `packages/extension` (repo).
|
|
142
|
-
4. Confirm the extension's background service worker is running.
|
|
143
|
-
5. Start the Core daemon (or run `browser-bridge session create`) so the extension can connect to `127.0.0.1`.
|
|
183
|
+
The Core daemon keeps sessions in memory. By default, it automatically cleans up idle sessions after 1 hour.
|
|
144
184
|
|
|
145
|
-
|
|
185
|
+
- `BROWSER_BRIDGE_SESSION_TTL_MS`: Idle session TTL in milliseconds. Set to `0` to disable cleanup.
|
|
186
|
+
- `BROWSER_BRIDGE_SESSION_CLEANUP_INTERVAL_MS`: Cleanup interval in milliseconds. Defaults to a small value relative to the TTL.
|