browser-pilot-cli 0.4.0 → 0.5.1

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.
@@ -299,11 +299,11 @@ Preserve Browser Pilot advantages:
299
299
  - [x] **B5.4** Update the universal skill with decision guidance grounded in
300
300
  actual tool errors and state, not framework-specific prompts.
301
301
  - Covers: FR-1, FR-8.
302
- - Complete: the Agent-neutral skill now separates direct one-shot CLI use
303
- from embedded stdio integration, starts from current tab/page state, uses
302
+ - Complete: the Agent-neutral skill now uses the same CLI workflow for
303
+ Agent-installed and product-bundled use, starts from current tab/page state, uses
304
304
  fresh refs, verifies action results, and gives explicit recovery decisions
305
- for structured evidence, hints, stable errors, events, reconnects, dialogs,
306
- and Artifacts. Command guidance now reflects all-tab inventory, explicit
305
+ for structured evidence, hints, stable errors, reconnects, dialogs, and
306
+ local file results. Command guidance now reflects all-tab inventory, explicit
307
307
  dialog handling, managed-only bulk cleanup, and actual local capture output.
308
308
  It names no Agent framework in its runtime decisions and adds no adapter or
309
309
  prompt-specific production behavior.
@@ -383,8 +383,8 @@ Preserve Browser Pilot advantages:
383
383
  `stagnant_page`; action parameters, typed values, page text, and hashes are
384
384
  not exposed.
385
385
  - [x] **B7.6** Keep the additions Agent-neutral and backward compatible.
386
- - Complete: one-shot CLI commands and Broker `tools/list` share the canonical
387
- implementations. The tools reuse existing capabilities and are additive
386
+ - Complete: all CLI commands use the Broker's canonical internal
387
+ implementations and schemas. The commands reuse existing capabilities and are additive
388
388
  for protocol 1.0/1.1. Multi-action queues, LLM extraction, planning, and
389
389
  memory remain Host-Agent responsibilities.
390
390
 
@@ -198,7 +198,7 @@ candidate targets were closed.
198
198
  - [x] P2: implement Profile context registry, target propagation, Workspace
199
199
  selection, multiple ManagedTabSets, and janitor adoption.
200
200
  - [x] P3: implement `bp profiles`, `bp profile`, and `bp open --profile`.
201
- - [x] P4: update stdio integration guidance, adapters, skill, and release docs.
201
+ - [x] P4: update CLI integration guidance, skill, and release docs.
202
202
  - [x] P5: add protocol, dual-Profile, concurrency, reconnect, cleanup, and
203
203
  compatibility tests.
204
204
  - [x] P6: run real Chrome acceptance and publish `v0.3.0-rc.2`.
@@ -1,352 +1,125 @@
1
- # Universal Agent Integration Plan
1
+ # Universal Agent CLI Integration Plan
2
2
 
3
- Status: **Complete**
4
- Source of truth: `docs/architecture/browser-pilot-platform-spec.md`
5
- Workstream: A
3
+ Status: implementation and local release verification complete for the
4
+ CLI-only architecture; formal publication remains.
6
5
 
7
6
  ## Goal
8
7
 
9
- Deliver the executable, Broker, machine protocol, distribution contract, and
10
- conformance assets required for any local Agent to install or embed Browser
11
- Pilot. Tenon and OpenClaw are reference consumers only.
12
-
13
- ## Scope Guardrails
14
-
15
- - Preserve existing one-shot CLI workflows under **FR-1**.
16
- - Expose only the executable protocol under **DEC-3**; do not publish a Native
17
- SDK or MCP server.
18
- - Do not place Agent-specific lifecycle nouns or payloads in production code.
19
- - Do not improve page understanding in this workstream except where needed to
20
- preserve the shared Observation contract.
21
- - Coordinate all changes to Observation/ref identity with Workstream B.
22
- - Keep Broker-created ManagedTabSets as the default independent task surface,
23
- while including every eligible user tab in the same inventory. Never add an
24
- Agent-callable raw-CDP `adopt(targetId)` shortcut.
25
-
26
- ## Delivery Order
27
-
28
- ### A0. Freeze the shared contract
29
-
30
- - [x] **A0.1** Publish the platform specification with stable decisions,
31
- requirements, rules, and acceptance criteria.
32
- - Covers: DEC-1 through DEC-7, FR-1 through FR-8.
33
- - Verification: product-spec inspection and contradiction review.
34
- - [x] **A0.2** Encode protocol versions, capabilities, domain identifiers,
35
- result envelopes, stable errors, and Artifact/Event descriptors as internal
36
- TypeScript types and runtime validators.
37
- - Covers: FR-2, FR-5, FR-6, FR-7.
38
- - Acceptance: incompatible versions and malformed messages fail with stable
39
- codes; unknown fields follow the compatibility rules.
40
- - [x] **A0.3** Publish the canonical machine-readable tool manifest and schema
41
- snapshots used by bridge and conformance tests.
42
- - Covers: FR-2, NFR-1.
43
- - Acceptance: `tools/list` output is generated from the same definitions used
44
- to validate `tools/call`.
45
-
46
- ### A1. Extract the internal service boundary
47
-
48
- - [x] **A1.1** Move browser discovery, target operations, observations,
49
- actions, capture, network, auth, and cookies out of Commander handlers into
50
- `BrowserPilotService` modules.
51
- - Covers: FR-1, FR-2.
52
- - Acceptance: CLI handlers contain parsing and formatting only; existing CLI
53
- fixture behavior remains unchanged.
54
- - Complete: every Commander handler now performs only parsing, compatibility
55
- formatting, and explicit client-owned file export. Browser discovery,
56
- target/session/frame state, observations, actions, capture, upload, tabs,
57
- dialogs, auth, cookies, and network operations execute through the same
58
- canonical Broker tools used by embedded clients.
59
- - [x] **A1.2** Replace process exits and console/file side effects below the CLI
60
- adapter with typed results, stable errors, and Artifact operations.
61
- - Covers: FR-2, FR-6, NFR-1.
62
- - Complete: protected screenshot/PDF/upload bytes cross the CLI boundary only
63
- through Artifact import/export/release; services return typed data and
64
- stable errors without console, process-exit, or destination-file effects.
65
- - [x] **A1.3** Make arbitrary CDP forwarding private and gate page evaluation
66
- behind `developer.eval` for machine clients.
67
- - Covers: DEC-5, CON-4, AC-4.
68
- - Complete: public CLI and stdio clients expose only canonical high-level
69
- operations. The daemon's CDP transport remains an internal implementation
70
- endpoint, and public evaluation requires `developer.eval`.
71
-
72
- ### A2. Build Broker domain isolation
73
-
74
- - [x] **A2.1** Implement ClientPrincipal, ClientConnection,
75
- BrowserWorkspace, ManagedTabSet, ControlLease, BrowserInstance,
76
- and ControlledTarget registries.
77
- - Covers: FR-3, FR-4, FR-5.
78
- - Complete: the daemon owns bounded in-memory Principal, Connection,
79
- Workspace, default ManagedTabSet, and Lease registries. Principal identity
80
- survives a bridge reconnect within one daemon lifetime; Connection-owned
81
- Leases do not.
82
- - [x] **A2.2** Create managed targets only through the control registry and
83
- validate the complete popup opener chain before adoption.
84
- - Covers: BR-1, BR-2, AC-4.
85
- - Progress: legacy CLI popup adoption now requires a complete opener chain
86
- ending at an already controlled Pilot target. Workspace control registry and
87
- Broker-only target creation remain.
88
- - Progress: the Broker inventory foundation now adopts managed popups only
89
- through a complete live opener chain and refuses to cross a user-tab record.
90
- - Complete: machine-created targets enter through `BrowserToolService` and
91
- `MemoryControlledTargetRegistry`; no public machine call accepts a raw CDP
92
- target ID.
93
- - [x] **A2.3** Replace global target/frame/session state with Workspace and
94
- Lease state; provide a compatibility Workspace for one-shot CLI calls.
95
- - Covers: FR-1, FR-3, AC-1, AC-3.
96
- - Complete: the CLI derives a stable one-shot Connection identity from
97
- `BROWSER_PILOT_CLIENT_KEY`/`--client-key`, plus an idempotently keyed
98
- compatibility Workspace and renewable five-minute Lease. The default key
99
- preserves single-Agent compatibility; distinct stable keys isolate Agents.
100
- Every CLI command calls canonical tools; selected targets, frames, sessions,
101
- Observations, refs, auth, rules, and request identity remain only in daemon
102
- memory. No `state.json` or `refs.json` compatibility mapping remains.
103
- - [x] **A2.4** Serialize commands through a per-target actor and implement
104
- explicit control transfer.
105
- - Covers: BR-5, BR-6, NFR-4.
106
- - Complete: reads and mutations for one physical CDP target share the same
107
- actor across Workspace-local opaque IDs, while different physical targets
108
- proceed concurrently. `browser.tabs.release` provides idempotent two-step
109
- handoff: the owner releases and fully retires its scoped target session,
110
- then another Lease acquires through its own opaque ID. Foreign Lease IDs,
111
- silent stealing, and tab closure are not part of transfer.
112
- - [x] **A2.5** Scope auth, network rules, request journals, downloads, and
113
- cleanup to their owner.
114
- - Covers: BR-3, BR-4, AC-3.
115
- - Complete: Broker auth, interception rules, and bounded request journals are
116
- Workspace scoped; request identity includes CDP session identity, sensitive
117
- events are metadata-only, and legacy daemon handlers ignore Broker sessions.
118
- Lease replacement preserves Workspace configuration while Workspace release
119
- clears it. Downloads preserve each Profile's Chrome default directory;
120
- Page events bind GUID ownership to controlled sessions, browser-level
121
- completion paths are copied into bounded Workspace-owned Artifacts, and
122
- cleanup deletes only the copy without cancelling or moving user downloads.
123
- - [x] **A2.6** Implement the default-unrestricted BrowserControlPolicy and
124
- optional launch-time Host operation removal.
125
- - Covers: FLOW-5, BR-21, BR-22, AC-4.
126
- - Acceptance: no request/grant/approval lifecycle exists; every supported
127
- operation is available by default; explicitly denied operations fail with
128
- `capability_denied` before CDP dispatch.
129
- - Complete: `createBrowserControlPolicy` exposes all eligible user tabs and
130
- validates optional `deniedOperations` without any Agent-specific policy.
131
- - [x] **A2.7** Build eligible user-tab discovery and internal-target exclusion.
132
- - Covers: CON-2, FLOW-5, BR-2, BR-25, BR-26, FR-4.
133
- - Acceptance: current and future ordinary tabs are returned, while managed
134
- targets, Browser Pilot internal targets, DevTools, unsupported internal
135
- pages, and non-page targets are excluded.
136
- - Complete: `CdpBrowserTargetCatalog` implements the CDP catalog boundary.
137
- - [x] **A2.8** Merge ManagedTabSets and all eligible user tabs in
138
- ControlledTarget resolution, listing, switching, and popup inheritance.
139
- - Covers: BR-1, BR-2, BR-23 through BR-27.
140
- - Acceptance: `tabs.list` returns managed and user tabs with
141
- origin metadata; conflicting control reports `target_busy`; bulk cleanup
142
- closes only managed tabs; closing a user tab is explicit.
143
- - Complete: `MemoryControlledTargetRegistry`, `TargetInventoryService`, and
144
- `CdpBrowserTargetCatalog` now provide opaque per-Workspace target IDs,
145
- immediate managed/user inventory merging, dynamic new-tab discovery,
146
- physical-target Lease exclusion across Principals, ineligible-target
147
- invalidation, managed-popup inheritance, and safe managed-only bulk close.
148
- `tools/call` now lists, switches to, and explicitly closes both origins;
149
- Workspace release closes only managed targets. The compatibility CLI
150
- retains the same all-tab behavior.
151
-
152
- ### A3. Add bounded runtime lifecycle and command semantics
153
-
154
- - [x] **A3.1** Add in-memory Workspace, Lease, target assignment, command,
155
- idempotency, and bounded journal stores.
156
- - Covers: FR-5, NFR-2, NFR-5.
157
- - Complete: Workspace, Lease, target assignment, Command, idempotency, and
158
- per-Workspace event stores are bounded and live in daemon memory.
159
- - [x] **A3.2** Implement heartbeat, expiry, release, crash recovery, and
160
- idempotent cleanup for Workspaces and Leases.
161
- - Covers: AC-5, NFR-5.
162
- - Broker restart invalidates transient state; clients initialize, list, and
163
- observe again. Do not recover stale browser state from disk.
164
- - Complete: Lease heartbeat/expiry/release, EOF cleanup, idle Connection and
165
- Workspace reclamation, and idempotent Workspace release are implemented.
166
- Target, auth, network, frame, Observation, Artifact, and partial download
167
- cleanup is connected. Browser connection loss now rejects tools, invalidates
168
- sessions/refs, passively rediscovers the selected profile, and advances
169
- generation only after an explicit reconnect succeeds. A private child janitor solely owns the browser-level CDP
170
- connection, proxies daemon traffic over IPC, tracks verified managed popup
171
- descendants, and closes them on daemon-pipe EOF, including `SIGKILL`,
172
- without persisting target IDs or grouping by browser window. Process-level
173
- tests prove user tabs survive and only one browser WebSocket is opened.
174
- - [x] **A3.3** Implement command accepted/dispatched/completed,
175
- `unknown_outcome`, deadline, cancellation, and duplicate-call behavior.
176
- - Covers: BR-8 through BR-12, AC-5.
177
- - Complete: caller or Broker IDs, Workspace-scoped idempotency, bounded
178
- terminal outcomes, pre-dispatch cancellation, best-effort post-dispatch
179
- cancellation, deadlines, cached results, and no-replay unknown outcomes are
180
- enforced through the public bridge.
181
- - [x] **A3.4** Replace dialog auto-acceptance with typed events and explicit
182
- accept/dismiss commands.
183
- - Covers: DEC-5, event contract.
184
- - Complete: dialogs stay pending, emit opened/closed events, and can be listed
185
- and explicitly accepted or dismissed through out-of-band dialog tools.
186
- One-shot CLI dialogs use those same Workspace-scoped canonical tools and
187
- cannot list or respond to another Workspace's dialogs.
188
-
189
- ### A4. Deliver the stdio bridge
190
-
191
- - [x] **A4.1** Implement strict NDJSON framing, JSON-RPC parsing, stdout/stderr
192
- separation, initialization, and graceful shutdown.
193
- - Covers: FR-2, NFR-1.
194
- - Complete: fatal UTF-8 decoding, bounded line assembly, strict JSON-RPC
195
- envelopes, ordered normal dispatch, command-control bypass, notification
196
- semantics, stdout-only protocol, EOF cleanup, bridge-only shutdown, and
197
- structured framing errors are covered by black-box stream tests.
198
- - [x] **A4.2** Implement tool discovery/call, Workspace/Lease lifecycle,
199
- cancellation, and structured errors.
200
- - Covers: AC-2, FR-7.
201
- - Includes direct all-tab inventory and optional Host-configured operation
202
- removal. There are no browser-access approval methods.
203
- - Complete: canonical `tools/list`, validated `tools/call`, Workspace/Lease
204
- lifecycle, all-tab inventory, and production implementation filtering are
205
- implemented. `commands/get/cancel` can overtake a pending call on the same
206
- stdio connection and return structured outcomes.
207
- - [x] **A4.3** Implement event notifications plus cursor polling and
208
- `cursor_expired` recovery.
209
- - Covers: events contract, NFR-3.
210
- - Complete: bounded Workspace journals, explicit initial cursors, ordered
211
- replay, `cursor_expired` bounds, Principal isolation, best-effort stdio
212
- notifications, and daemon notification long-polling are implemented.
213
- - [x] **A4.4** Add protocol backpressure, negotiated message limits, and
214
- malformed-client isolation.
215
- - Covers: NFR-1, NFR-5.
216
- - Complete: protocol 1.1 negotiates per-Connection message/result ceilings;
217
- bootstrap and pipelined framing apply them deterministically. Input/output
218
- backpressure, bounded ordinary/control call queues, oversized-result
219
- replacement, notification dropping with cursor recovery, and bridge-local
220
- malformed-client termination prevent one client from exhausting or
221
- terminating another.
222
-
223
- ### A5. Deliver secure Artifacts
224
-
225
- - [x] **A5.1** Add protected Artifact storage, metadata, quotas, TTL, preview
226
- relationships, retain/release, and cleanup.
227
- - Covers: BR-17 through BR-20, FR-6.
228
- - [x] **A5.2** Return screenshot, PDF, and download results as Artifacts while
229
- keeping explicit CLI export behavior compatible.
230
- - Covers: AC-1, AC-6.
231
- - Complete: screenshot and PDF tools return scoped Artifacts; large captures
232
- produce model-sized previews with optional originals. Session-scoped Page
233
- events establish download ownership, and browser-level completion events
234
- copy only those files into protected `download` Artifacts without publishing
235
- Chrome source paths or CDP GUIDs.
236
- - [x] **A5.3** Add adapter-facing file authorization and revoke access on
237
- release or expiry.
238
- - Covers: CON-5, NFR-5.
239
- - Complete: import/get/export/retain/release require an owning active Workspace
240
- and Lease. `artifacts/import` copies an absolute client-authorized path to a
241
- `user_file` / `upload_input` Artifact, and `browser.upload` accepts only that
242
- kind. Release, expiry, Workspace cleanup, and Broker shutdown delete Broker
243
- bytes without deleting the source file.
244
-
245
- ### A6. Browser discovery and multi-version operation
246
-
247
- - [x] **A6.1** Return structured browser candidates and setup remediation;
248
- persist only explicit or deterministic selection.
249
- - Covers: browser discovery contract.
250
- - Complete: discovery enumerates installed supported product/profile candidates
251
- with stable IDs and separate process, remote-debugging, and authorization
252
- state. `initialize`, `browser.discover`, and `bp browsers` are passive and
253
- return bounded remediation; the Broker can start before any candidate is
254
- ready, connect candidates only through explicit `browser.connect`, and route ready browser instances by
255
- `browserId`. Selection is explicit (`--browser`/`browserId`) or stable-order
256
- deterministic and remains daemon-memory state only.
257
- - [x] **A6.2** Define the per-user Broker locator, socket/pipe permissions,
258
- startup locking, stale process recovery, and platform-specific paths.
259
- - Covers: FR-7, CON-5.
260
- - Complete: a versioned, owner-only locator records the per-user endpoint and
261
- Broker process identity. Unix uses a mode-`0600` domain socket with a
262
- deterministic short runtime path when required; Windows uses a per-user
263
- named pipe. State/runtime directories and metadata are owner-only. An
264
- atomic startup lock plus a post-lock health check makes concurrent launch a
265
- single-winner operation. Broker startup never requests Chrome authorization;
266
- concurrent explicit connect calls share one in-flight attempt. Dead owners are
267
- reclaimed without killing a PID; live but unresponsive ready Brokers fail
268
- with explicit remediation and are never silently replaced.
269
- - [x] **A6.3** Implement executable/protocol negotiation, live-client upgrade
270
- protection, rollback metadata, and deliberate version isolation.
271
- - Covers: AC-7, NFR-2.
272
- - Complete: compatible embedded clients negotiate and reuse the running
273
- Broker, while the one-shot compatibility CLI retains exact executable
274
- version semantics. Health and schema-2 locator metadata expose the current
275
- service, executable installation identity, protocol range, and bounded live
276
- client counts. Protected compare-and-stop shutdown rejects mismatched
277
- executables and returns `broker_in_use` while embedded Connections or any
278
- active Lease remains.
279
- Owner-only version history retains only current/previous executable metadata
280
- and no transient browser state. `BROWSER_PILOT_HOME` provides explicit
281
- cross-platform isolation; incompatibility never triggers hidden replacement
282
- or isolation. Process tests cover reuse, incompatibility, shutdown
283
- protection, crash recovery, and two intentional Broker namespaces.
284
- - [x] **A6.4** Preserve global npm, local npm/npx, and product-bundled launch
285
- modes. Add signed/self-contained artifacts where each platform permits.
286
- - Covers: FR-1, FR-2.
287
- - Complete: build-time version injection and a runtime layout abstraction
288
- preserve adjacent-script npm installs while allowing one Node SEA executable
289
- to serve the public CLI and reserved private Broker/janitor roles. Packed
290
- global npm, local npm/npx, and product-owned absolute-path launches pass
291
- black-box version, bridge, Broker startup, and cleanup tests. Native bundles
292
- include actual-state signature metadata, SHA-256 manifests, licenses, and
293
- platform archives; macOS Developer ID/notarization and Windows Authenticode
294
- hooks activate only with complete credentials, while unsigned/ad-hoc state
295
- remains explicit. Release CI uses fixed official Node 22.17.0 native runners
296
- and verifies every artifact before publishing it. The supported native
297
- matrix is Apple Silicon macOS, x64 Linux, and x64 Windows; Intel Mac is not
298
- supported. A versioned release index binds these assets to the npm package,
299
- exact Agent plugin/skill version, protocol range, and checksums, and GitHub
300
- Release publication waits for npm publication.
301
-
302
- ### A7. Agent-neutral integration kit
303
-
304
- - [x] **A7.1** Publish the process adapter contract: launch, initialize,
305
- manifest registration, tool calls, event handling, Artifact conversion, and
306
- cleanup.
307
- - Covers: AC-2, AC-6.
308
- - [x] **A7.2** Build a language-neutral conformance runner that treats the
309
- executable as a black box.
310
- - Covers: FR-2 through FR-7.
311
- - [x] **A7.3** Add Tenon and OpenClaw adapters as separate examples or consumer
312
- changes. Keep their lifecycle mapping out of Browser Pilot production code.
313
- - Covers: DEC-1, CON-3.
314
- - Complete: source-only Tenon and OpenClaw adapters consume only
315
- `bridge --stdio`, runtime `tools/list`, and protected Artifact files. They
316
- map Thread/Turn and Agent-session/run lifecycles to transient
317
- Workspace/Lease contexts, require explicit targets, derive Command identity
318
- from host tool-call IDs, convert screenshots to native image content, export
319
- files to host-owned absolute paths, explicitly acknowledge processed event
320
- cursors, and invalidate local state on failed cleanup. Concurrent begin,
321
- initialization/release failure, cursor recovery, media conversion, bounded
322
- model text, structured errors, and unknown outcomes are covered by process
323
- tests. The examples remain excluded from the npm package and no
324
- Agent-specific concept enters production code.
325
- - [x] **A7.4** Update the Agent skill to teach direct one-shot use and embedded
326
- stdio use without assuming a particular Agent runtime.
327
- - Covers: FR-1, AC-1.
328
- - Complete: the main skill is a bounded operating guide with progressive
329
- command/stdio references, version-range CLI compatibility checking, stable
330
- one-shot error recovery, explicit user-tab/Profile/tab-group boundaries,
331
- local capture semantics, and generated Codex UI metadata. Release
332
- verification and a machine-readable skill compatibility manifest prevent
333
- silent CLI/skill version drift.
334
-
335
- ## Cross-Workstream Dependencies
336
-
337
- - A0.2 and B0.1 jointly own the Observation/ref public contract.
338
- - A1 exposes internal service interfaces; B1-B4 implement improved behavior
339
- behind those interfaces.
340
- - A2 target actors provide B3 action ordering and document-change cancellation.
341
- - A4 events depend on B4 event producers but can be tested initially with
342
- synthetic Broker events.
343
- - A5 Artifact delivery is required before B5 screenshot guidance is complete.
344
-
345
- ## Release Gate
346
-
347
- Workstream A is complete only when AC-1 through AC-7 pass, existing CLI tests
348
- remain green, two concurrent reference clients are isolated, all eligible user
349
- tabs are combined with the Agent's managed tabs without a grant step, bulk
350
- cleanup leaves user tabs open, Host-disabled operations fail before dispatch,
351
- and a client can send a screenshot Artifact to its runtime's native image
352
- content without an SDK or MCP dependency.
8
+ Allow any shell-capable Agent to control the user's eligible Chrome tabs by
9
+ installing the Browser Pilot skill and invoking the same `bp` CLI, whether the
10
+ CLI was installed by the Agent or bundled by an Agent product.
11
+
12
+ ```text
13
+ Agent -> skill -> existing shell tool -> bp CLI -> shared Broker -> Chrome
14
+ ```
15
+
16
+ The integration must not require an extension, MCP, Native SDK, native Browser
17
+ Pilot tools, a persistent adapter, or Agent-specific runtime code.
18
+
19
+ ## Decisions
20
+
21
+ - [x] Keep one public Agent interface: skill plus CLI.
22
+ - [x] Keep the Broker and CDP transport private.
23
+ - [x] Use stable `BROWSER_PILOT_CLIENT_KEY` values for independent Agents.
24
+ - [x] Preserve logical Agent state across short-lived CLI calls.
25
+ - [x] Expose all eligible managed and user-opened tabs.
26
+ - [x] Keep user tabs open during release and crash cleanup.
27
+ - [x] Leave task-intent permission policy to the Agent host.
28
+ - [x] Support product bundling by putting a pinned CLI on the Agent `PATH`.
29
+ - [x] Support Apple Silicon macOS, x64 Linux, and x64 Windows only.
30
+
31
+ ## Workstream A: CLI Contract
32
+
33
+ - [x] Provide stable JSON success and error results.
34
+ - [x] Add stable error codes to parser, input, service, and browser failures.
35
+ - [x] Make `--client-key` discoverable in top-level help.
36
+ - [x] Add `bp status` with service, browser, selected state, command state, and
37
+ structured recovery.
38
+ - [x] Add bounded `bp commands`, `bp command`, and `bp cancel` commands.
39
+ - [x] Add global `--request-id` and deterministic idempotent recovery.
40
+ - [x] Add global `--timeout` and best-effort cancellation on process signals.
41
+ - [x] Add browser-visible `bp wait` conditions.
42
+ - [x] Add download list/export commands.
43
+ - [x] Add `BROWSER_PILOT_OUTPUT_DIR` and structured file metadata.
44
+ - [x] Keep `bp --help` as the canonical runtime command inventory.
45
+
46
+ ## Workstream B: Shared State and Concurrency
47
+
48
+ - [x] Replace global active-tab/ref files with Broker-owned keyed state.
49
+ - [x] Isolate selected profile, target, frame, refs, auth, network rules,
50
+ downloads, and commands by Agent key.
51
+ - [x] Serialize commands per physical tab and allow independent tabs to run in
52
+ parallel.
53
+ - [x] Enforce one controlling Agent per physical user tab.
54
+ - [x] Return stable `target_busy` rather than stealing control.
55
+ - [x] Reclaim expired state and managed targets.
56
+ - [x] Preserve user tabs on Agent release and crash cleanup.
57
+ - [x] Invalidate browser-generation-scoped state after reconnect.
58
+
59
+ ## Workstream C: Cross-Installation Broker Reuse
60
+
61
+ - [x] Negotiate compatibility by protocol rather than executable path.
62
+ - [x] Allow compatible global and product-bundled CLIs to share one Broker.
63
+ - [x] Keep one stable Agent principal across compatible CLI versions.
64
+ - [x] Use separate internal client sessions when compatible versions differ.
65
+ - [x] Let `bp disconnect` release the invoking Agent's namespace from any
66
+ compatible installation.
67
+ - [x] Require exact executable identity only for whole-Broker shutdown.
68
+ - [x] Refuse incompatible protocol clients without replacing the live Broker.
69
+ - [x] Support explicit incompatible isolation through `BROWSER_PILOT_HOME`.
70
+
71
+ ## Workstream D: Product Embedding
72
+
73
+ - [x] Document one generic integration for Tenon, OpenClaw, and other Agents.
74
+ - [x] Require the complete skill and a normal command runner.
75
+ - [x] Require a pinned native CLI or npm CLI plus pinned Node runtime.
76
+ - [x] Put the bundled CLI directory on the Agent command environment's `PATH`.
77
+ - [x] Inject a stable client key per logical Agent.
78
+ - [x] Inject a task-owned absolute output directory.
79
+ - [x] Return files by absolute path for the host's existing image/file tools.
80
+ - [x] Avoid command-to-native-tool mapping and permanent tool-schema context.
81
+ - [x] Keep Agent-managed and bundled installs on the same behavior path.
82
+
83
+ ## Workstream E: Skill and Documentation
84
+
85
+ - [x] Keep the main skill focused on the browser operating loop.
86
+ - [x] Split command, recovery, async, and embedding details into on-demand
87
+ references.
88
+ - [x] Remove internal state IDs and transport concepts from Agent guidance.
89
+ - [x] Document all eligible user tabs and explicit user-tab close behavior.
90
+ - [x] Document Chrome profile identity and routing.
91
+ - [x] Document tab-group control limitations without limiting grouped tabs.
92
+ - [x] Document local screenshot, PDF, download, and network-body results.
93
+ - [x] Document stable request recovery and uncertain mutation rules.
94
+
95
+ ## Workstream F: Distribution
96
+
97
+ - [x] Keep CLI, plugin, skill compatibility, and marketplace versions synced
98
+ from the root package version.
99
+ - [x] Publish a release index binding CLI, skill range, protocol, platforms,
100
+ checksums, and tested version.
101
+ - [x] Exclude Intel Mac assets.
102
+ - [x] Verify global, local, and product-bundled npm use.
103
+ - [x] Verify native archives do not need system Node.
104
+ - [x] Bump the next release version and produce local release artifacts.
105
+ - [ ] Publish the npm package, plugin archive, native archives, checksums, and
106
+ release index.
107
+
108
+ ## Acceptance Criteria
109
+
110
+ - [x] An Agent can install Browser Pilot itself and follow the skill.
111
+ - [x] A product can bundle Browser Pilot without adding native browser tools.
112
+ - [x] Two Agent products can share one Broker with isolated state.
113
+ - [x] A compatible bundled CLI can use a Broker started by a global CLI.
114
+ - [x] A compatible non-owner CLI can disconnect cleanly without stopping that
115
+ Broker.
116
+ - [x] Every eligible user-opened tab can be selected and controlled.
117
+ - [x] The same physical tab cannot be controlled by two Agents concurrently.
118
+ - [x] Browser authorization is requested only by explicit connection.
119
+ - [x] Stable request IDs prevent duplicate dispatch during recovery.
120
+ - [x] Screenshots, PDFs, downloads, and saved bodies are available as local
121
+ files with structured metadata.
122
+ - [x] Removed persistent adapter commands are absent from CLI help and release
123
+ packages.
124
+ - [x] Full unit, Playwright, distribution, standalone, and controlled real
125
+ Chrome release gates pass for the new version.
@@ -0,0 +1,93 @@
1
+ # Browser Pilot 0.5.0
2
+
3
+ Browser Pilot 0.5.0 establishes one public integration model for every Agent:
4
+ the Browser Pilot skill invokes the short-lived `bp` CLI through the Agent's
5
+ existing shell tool. Agent-installed and product-bundled copies now use the
6
+ same commands, state model, and recovery behavior.
7
+
8
+ ## One Agent interface
9
+
10
+ - The public `bridge --stdio` command, JSON-RPC adapter, reference host
11
+ adapters, conformance suites, and adapter documentation have been removed.
12
+ - Browser Pilot does not require an MCP server, Native SDK, Browser Pilot
13
+ native tools, Agent-specific runtime, or browser extension.
14
+ - Tenon, OpenClaw, Codex, Claude Code, and other shell-capable Agents integrate
15
+ by bundling a compatible CLI on the Agent `PATH`, installing the same skill,
16
+ and assigning a stable `BROWSER_PILOT_CLIENT_KEY` per independent Agent.
17
+ - The internal Broker remains shared and long-lived. Individual CLI processes
18
+ remain short-lived and do not expose the Broker protocol as a public API.
19
+
20
+ ## Stateful CLI recovery
21
+
22
+ - `bp status` returns bounded browser, profile, tab, active-command,
23
+ uncertain-command, and structured recovery state for the current Agent.
24
+ - `bp commands`, `bp command <id>`, and `bp cancel <id>` expose command
25
+ inspection and best-effort cancellation without a persistent client.
26
+ - Global `--request-id` provides deterministic deduplication for recovery of
27
+ one intended operation. Global `--timeout` sets its command deadline.
28
+ - `SIGINT` and `SIGTERM` request cancellation of an active command. Mutations
29
+ that may already have reached Chrome still return `unknown_outcome` and must
30
+ be inspected before retry.
31
+ - `bp wait` waits for one browser-visible URL, text, selector, dialog,
32
+ download, or popup condition and returns stable `wait_timeout` on expiry.
33
+ Terminating the wait CLI returns `command_cancelled` without releasing its
34
+ Agent browser state.
35
+ - `bp status` queries active and uncertain command states independently, so a
36
+ long condition wait cannot hide an older `unknown_outcome` behind its polling
37
+ reads.
38
+
39
+ ## Files and downloads
40
+
41
+ - `BROWSER_PILOT_OUTPUT_DIR` provides a task-owned default destination for
42
+ screenshots, PDFs, exported downloads, and saved network bodies.
43
+ - Capture and download results return an absolute file path, MIME type, byte
44
+ size, and image dimensions when available.
45
+ - `bp downloads` lists completed downloads retained for the current Agent;
46
+ `bp download <index> [filename]` copies one result without moving or deleting
47
+ Chrome's original file.
48
+ - Artifact exports and saved network bodies are written with private file
49
+ permissions.
50
+
51
+ ## Shared Broker and Agent isolation
52
+
53
+ - The private Broker RPC envelope is versioned independently from the public
54
+ CLI. A 0.5 CLI detects a pre-0.5 Broker before sending RPC and returns
55
+ `protocol_incompatible` with explicit stop-or-isolate remediation.
56
+ - Compatible global, Agent-installed, and product-bundled CLI versions reuse
57
+ one per-user Broker through protocol negotiation rather than executable-path
58
+ equality.
59
+ - A stable Agent key preserves selected profile, tab, frame, refs, auth,
60
+ network rules, downloads, and command history across CLI calls. Different
61
+ keys remain isolated.
62
+ - Commands are serialized per physical target. A second Agent receives
63
+ `target_busy` instead of taking control of a tab already leased by another
64
+ Agent.
65
+ - `bp disconnect` releases only the invoking Agent's state and managed tabs.
66
+ A compatible CLI that does not own the Broker executable cannot stop the
67
+ shared Broker.
68
+ - All eligible Browser Pilot-created and user-opened tabs remain available;
69
+ user tabs stay open during Agent release and crash cleanup.
70
+
71
+ ## Skill and distribution
72
+
73
+ - The skill uses progressive disclosure: the main operating loop links to
74
+ separate command, asynchronous recovery, failure recovery, and product
75
+ embedding references.
76
+ - `bp --help` is the canonical runtime command inventory. The plugin no longer
77
+ publishes a permanent native-tool manifest.
78
+ - CLI, skill, plugin, marketplace metadata, compatibility range, checksums,
79
+ and release index are versioned together at 0.5.0.
80
+ - Native release targets remain Apple Silicon macOS, x64 Linux, and x64
81
+ Windows. Intel Mac is not supported.
82
+
83
+ ## Migration from 0.4.x
84
+
85
+ Remove any `browser-pilot bridge --stdio` process and Browser Pilot-specific
86
+ tool mapping. Keep the Agent's normal shell tool, install the complete
87
+ `browser-pilot` skill, make a compatible `bp` executable available on `PATH`,
88
+ and inject `BROWSER_PILOT_CLIENT_KEY` plus an absolute
89
+ `BROWSER_PILOT_OUTPUT_DIR`. Use `bp status`, command recovery, and `bp wait`
90
+ when the host previously depended on a persistent adapter for state or events.
91
+ If a pre-0.5 Broker is still running, stop it once with the older executable's
92
+ `bp disconnect` before starting 0.5; Browser Pilot never replaces a live
93
+ incompatible process automatically.