browser-pilot-cli 0.3.0-rc.6 → 0.4.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/README.md CHANGED
@@ -3,9 +3,16 @@
3
3
  Give your AI agent control of your real browser — with your logins, cookies, and extensions intact. No extension needed.
4
4
 
5
5
  ```bash
6
- npm install -g browser-pilot-cli
6
+ npm install -g browser-pilot-cli@latest
7
+ bp --version
7
8
  ```
8
9
 
10
+ Each skill/plugin release declares a supported CLI range and the exact version
11
+ it was tested with. Newer CLI releases remain usable within that range;
12
+ embedded products should pin the tested version for reproducible builds.
13
+ The native release targets Apple Silicon macOS, x64 Linux, and x64 Windows;
14
+ Intel Mac is not supported.
15
+
9
16
  ## Agent Setup
10
17
 
11
18
  ### 1. Enable Chrome remote debugging (one-time)
@@ -29,8 +36,12 @@ Use `bp connect --browser <id|product|channel>` for an explicit choice. Product
29
36
  embedders can pass the same selector to `browser-pilot bridge --stdio
30
37
  --browser <selector>`; otherwise selection follows a stable platform order.
31
38
  One connection covers every live Chrome Profile on that endpoint. When several
32
- Profiles are open, `bp connect` lists them without creating a Pilot window; use
33
- `bp profiles` and `bp profile <index>`, or pass `--profile` to `bp open --new`.
39
+ Profiles are open, `bp connect` lists them without creating a Pilot window. Use
40
+ the passive `bp profiles` inventory first. Run `bp profiles --identify` only
41
+ when account-aware names are needed; it briefly opens and closes one visible
42
+ `chrome://version` page per unidentified Profile. Profile and tab indexes are
43
+ one-based. Select with `bp profile <index>`, or pass `--profile` to
44
+ `bp open --new`.
34
45
 
35
46
  ### 2. Install the plugin for your agent
36
47
 
@@ -42,7 +53,7 @@ Profiles are open, `bp connect` lists them without creating a Pilot window; use
42
53
 
43
54
  **Codex CLI:**
44
55
  ```bash
45
- npx skills add relixiaobo/browser-pilot
56
+ npx skills add relixiaobo/browser-pilot --skill browser-pilot
46
57
  ```
47
58
 
48
59
  **OpenClaw:**
@@ -52,7 +63,7 @@ cp -r plugin/skills/browser-pilot ~/.agents/skills/
52
63
 
53
64
  **Cursor / VS Code Copilot:**
54
65
  ```bash
55
- npx skills add relixiaobo/browser-pilot
66
+ npx skills add relixiaobo/browser-pilot --skill browser-pilot
56
67
  ```
57
68
 
58
69
  ### 3. Use it
@@ -69,7 +80,7 @@ The agent will use `bp` commands automatically. Your real login sessions are pre
69
80
 
70
81
  - **No extension required** — Uses Chrome 144's native remote debugging toggle, not the Extension Debugger API
71
82
  - **Real login sessions** — Operates your actual browser profile. Cookies, extensions, logins all intact
72
- - **Multi-Profile routing** — Lists user tabs across live Chrome Profiles and creates managed work only in a resolved Profile
83
+ - **Multi-Profile routing** — Lists user tabs across live Chrome Profiles, explicitly verifies account-aware Profile identity, and creates managed work only in a resolved Profile
73
84
  - **CLI-native** — Any agent with bash access can use it. No MCP protocol, no SDK integration needed
74
85
  - **Auto-snapshot** — Every action returns page state with numbered `[ref]` elements, so the agent always knows what's on screen
75
86
  - **Adaptive page views** — Bounded read, text search, DOM metadata, page geometry, and annotated screenshots let an agent choose the smallest useful representation
@@ -102,16 +113,17 @@ CLI Process ──── HTTP/Unix Socket ──── Daemon Process (persisten
102
113
 
103
114
  │ WebSocket (CDP)
104
115
 
105
- Chrome (your browser, your profile)
106
- ├── Your windows (untouched)
107
- └── Pilot window (agent operates here)
116
+ Chrome (your browser, your Profiles)
117
+ ├── Eligible user tabs (selectable)
118
+ └── Managed windows (Broker-owned)
108
119
  ```
109
120
 
110
121
  The Broker maintains isolated state for each Agent. A private connection
111
122
  supervisor owns the Broker's single browser-level CDP WebSocket and proxies it
112
123
  to the daemon. It also owns only Browser Pilot-created tabs so it can clean them
113
- after a Broker crash without touching user-opened tabs. A pulsing blue glow
114
- around a Pilot window indicates Agent activity.
124
+ after a Broker crash without touching user-opened tabs. Controller identity is
125
+ returned to the embedding Host; Browser Pilot never injects a status border or
126
+ other control UI into the page DOM.
115
127
 
116
128
  ## Platform Evolution
117
129
 
@@ -144,7 +156,8 @@ tabs remain open when a session ends.
144
156
 
145
157
  The `browser-pilot bridge --stdio` transport, Broker lifecycle, browser tool
146
158
  dispatch, event replay, protected Artifacts, protocol 1.1 transport limit
147
- negotiation, and protocol 1.2 Chrome Profile routing are implemented. Browser
159
+ negotiation, protocol 1.2 Chrome Profile routing, and protocol 1.3 verified
160
+ Profile identity and unambiguous result vocabulary are implemented. Browser
148
161
  disconnect and explicit reconnect handling, scoped
149
162
  download Artifacts, Workspace resource isolation, and typed watchdog events for
150
163
  stalled navigation, selected-frame detach, pending dialogs, and repeated
@@ -161,7 +174,8 @@ browser discovery are passive. Only `bp connect` or the versioned
161
174
  one in-flight request, and a failed or dropped connection is never retried by a
162
175
  timer.
163
176
  Compatible Agent products reuse one per-user Broker through protocol
164
- negotiation. Protected shutdown cannot terminate live embedded clients, and an
177
+ negotiation. Protected shutdown cannot terminate live embedded clients or
178
+ another CLI Agent's active Lease, and an
165
179
  incompatible product must explicitly select a separate `BROWSER_PILOT_HOME`.
166
180
  Global npm installation, local npm/npx use, and product-bundled absolute-path
167
181
  launches are covered by distribution black-box tests. Native self-contained
@@ -173,7 +187,8 @@ and janitor roles, with no runtime download or system-Node fallback.
173
187
  Agent-managed installation remains supported:
174
188
 
175
189
  ```bash
176
- npm install -g browser-pilot-cli
190
+ npm install -g browser-pilot-cli@latest
191
+ bp --version
177
192
  bp connect
178
193
  bp tabs
179
194
  ```
@@ -182,7 +197,7 @@ A project can pin Browser Pilot locally and run the same CLI without a global
182
197
  installation:
183
198
 
184
199
  ```bash
185
- npm install --save-exact browser-pilot-cli@0.3.0-rc.6
200
+ npm install --save-exact browser-pilot-cli@latest
186
201
  npx --no-install browser-pilot tabs
187
202
  ```
188
203
 
@@ -199,10 +214,29 @@ kind: Developer ID or ad-hoc on macOS, Authenticode or unsigned on Windows, and
199
214
  unsigned on Linux. Release automation never labels an artifact signed when its
200
215
  signing credentials were unavailable.
201
216
 
217
+ The same GitHub release also contains
218
+ `browser-pilot-plugin-<version>.tgz`, its checksum, and a versioned release index
219
+ that binds the npm version, protocol range, compatible skill/plugin range,
220
+ tested CLI version, and the three supported native assets. Consumers should
221
+ verify that index before bundling. No `darwin-x64` asset is produced.
222
+
202
223
  All three forms use the same protocol and compatible per-user Broker. Use a
203
224
  distinct absolute `BROWSER_PILOT_HOME` only when a product deliberately needs
204
225
  an incompatible isolated Broker.
205
226
 
227
+ Products embedding `bridge --stdio` already receive isolated Connections,
228
+ Workspaces, and Leases. When several independent Agents instead invoke the
229
+ one-shot CLI directly, assign each integration a distinct stable namespace:
230
+
231
+ ```bash
232
+ BROWSER_PILOT_CLIENT_KEY=agent.product.install-01 bp tabs
233
+ bp --client-key agent.product.install-01 snapshot
234
+ ```
235
+
236
+ Repeated commands with the same key reuse that Agent's selected target, frame,
237
+ refs, auth, and network state. Different keys cannot overwrite one another.
238
+ The default key remains `browser-pilot-cli` for a single interactive Agent.
239
+
206
240
  ## Commands
207
241
 
208
242
  ### Core Loop
@@ -250,8 +284,10 @@ Broker clients.
250
284
 
251
285
  Run `bp tabs` to list Pilot-managed tabs, their popups, and eligible tabs the
252
286
  user opened elsewhere across all live Profiles in the same browser endpoint.
253
- Each JSON entry includes its opaque `profileContextId`; `bp tab <n>` switches
254
- control to any listed tab.
287
+ Extension-owned and browser-internal pages are excluded. Each JSON entry
288
+ includes its opaque `profileContextId`; `bp tab <n>` selects any listed tab for
289
+ the current Agent Lease. Its `selected` field is not a claim about Chrome's
290
+ foreground tab or operating-system focus.
255
291
 
256
292
  ### Network
257
293
 
@@ -271,11 +307,12 @@ control to any listed tab.
271
307
  | Command | Description |
272
308
  |---------|-------------|
273
309
  | `bp connect` | Connect to Chrome; create a Pilot window immediately only when Profile routing is unambiguous |
274
- | `bp disconnect` | Close the CLI Pilot window; stop the daemon when no embedded client is live |
275
- | `bp profiles` | List live Chrome Profile contexts and representative tabs |
276
- | `bp profile <index\|id\|label\|name>` | Select a Profile for subsequent managed tabs |
310
+ | `bp disconnect` | Release this CLI namespace; stop the daemon only when no other client or active Lease is live |
311
+ | `bp profiles` | Passively list live Chrome Profile contexts and representative tabs |
312
+ | `bp profiles --identify [--refresh]` | Explicitly verify Profile/account identity using temporary visible Chrome pages |
313
+ | `bp profile <index\|id\|label\|name\|email>` | Select a Profile for subsequent managed tabs |
277
314
  | `bp tabs` | List all controllable tabs in the current browser |
278
- | `bp tab <n>` | Switch to any listed managed or user tab |
315
+ | `bp tab <n>` | Select any listed managed or user tab for the current Agent Lease |
279
316
  | `bp close` | Close the current tab (`--all` closes Pilot-managed tabs only) |
280
317
 
281
318
  ## Refs
@@ -300,10 +337,12 @@ action. Elements inside Shadow DOM are included automatically. Snapshot JSON
300
337
  may also include a `page` block with viewport/document size, scroll position,
301
338
  remaining pixels, and scroll percentages.
302
339
 
303
- Across one-shot CLI processes, active target, frame, and refs live only in the
340
+ Across one-shot CLI processes, selected target, frame, and refs live only in the
304
341
  daemon's keyed compatibility Workspace and renewable Lease. They are never
305
342
  written to `state.json` or `refs.json`; after Lease expiry the Agent must
306
- observe again. `bp disconnect` explicitly clears the compatibility Workspace.
343
+ observe again. Set a distinct stable `BROWSER_PILOT_CLIENT_KEY` for each Agent
344
+ that directly invokes the CLI. `bp disconnect` clears only that namespace and
345
+ stops the Broker only when no other active Lease or embedded client remains.
307
346
 
308
347
  ## Output
309
348
 
@@ -313,11 +352,14 @@ observe again. `bp disconnect` explicitly clears the compatibility Workspace.
313
352
  {"ok":true,"title":"Example","url":"https://example.com","page":{"viewportWidth":1280,"viewportHeight":720,"documentWidth":1280,"documentHeight":1800,"scrollX":0,"scrollY":0,"pixelsAbove":0,"pixelsBelow":1080,"pixelsLeft":0,"pixelsRight":0,"scrollPercentX":0,"scrollPercentY":0},"elements":[{"ref":1,"role":"link","name":"More info"}]}
314
353
  ```
315
354
 
316
- Errors include hints:
355
+ Machine errors include stable codes and may include hints or remediation:
317
356
  ```json
318
- {"ok":false, "error":"Ref [99] not found.", "hint":"Run 'bp snapshot' to refresh element refs."}
357
+ {"ok":false,"error":"Ref [99] is stale.","code":"stale_ref","retryable":false,"context":{"field":"ref"},"hint":"Run 'bp snapshot' to refresh element refs."}
319
358
  ```
320
359
 
360
+ Branch on `code`, not English text. `retryable` means a later call may be valid;
361
+ it does not make the same uncertain mutation safe to replay.
362
+
321
363
  Force human output: `bp --human open https://example.com`
322
364
 
323
365
  `bp screenshot [file]`, `bp pdf [file]`, and `bp net show <id> --save <file>`
@@ -379,10 +421,12 @@ bp click --xy 400,300 # click canvas area
379
421
 
380
422
  Shadow DOM elements are traversed automatically — no special commands needed. Elements inside open shadow roots (even deeply nested) appear in snapshots and can be clicked/typed normally.
381
423
 
382
- For `<select>` dropdowns (shown as `combobox`), use `bp eval`:
424
+ For `<select>` and exposed ARIA dropdowns, inspect and select with the dedicated
425
+ commands:
383
426
 
384
427
  ```bash
385
- bp eval 'document.querySelector("select").value = "opt2"; document.querySelector("select").dispatchEvent(new Event("change",{bubbles:true}))'
428
+ bp dropdown 4
429
+ bp select 4 "Option 2"
386
430
  ```
387
431
 
388
432
  ## Network Interception
@@ -446,6 +490,24 @@ npm run verify:standalone
446
490
  npm run package:standalone
447
491
  ```
448
492
 
493
+ For a new release, bump only the root package version through npm. The npm
494
+ `version` lifecycle synchronizes every active distribution manifest from that
495
+ source of truth:
496
+
497
+ ```bash
498
+ npm version "$BROWSER_PILOT_RELEASE_VERSION" --no-git-tag-version
499
+ npm run release:check-version
500
+ node scripts/verify-release-version.mjs
501
+ ```
502
+
503
+ The sync step updates the lockfile root, Agent plugin version and CLI peer
504
+ range, Claude plugin/marketplace manifests, and skill `compatibility.json`.
505
+ The current release becomes the skill's tested/minimum CLI version while the
506
+ upper bound remains the next major version. Browser Pilot keeps public one-shot
507
+ commands backward compatible within a major line, including additive `0.x`
508
+ releases before 1.0. Historical release notes and version-specific fixtures are
509
+ never rewritten.
510
+
449
511
  The canary report is written to
450
512
  `test-results/real-site-canary/report.json`. It distinguishes semantic drift,
451
513
  third-party unavailability, and runner errors. Set
@@ -456,6 +518,7 @@ third-party unavailability, and runner errors. Set
456
518
  - Chrome 144+ / Edge / Brave (any Chromium-based browser)
457
519
  - Node.js >= 18
458
520
  - Remote debugging enabled (`chrome://inspect/#remote-debugging`)
521
+ - Native archives: Apple Silicon macOS, x64 Linux, or x64 Windows; no Intel Mac
459
522
 
460
523
  ## License
461
524