browser-pilot-cli 0.4.0 → 0.5.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 +259 -406
- package/dist/cli.js +1089 -2550
- package/dist/daemon.js +125 -172
- package/docs/architecture/browser-pilot-platform-spec.md +443 -1047
- package/docs/plans/browser-capability-evolution.md +6 -6
- package/docs/plans/profile-context-routing.md +1 -1
- package/docs/plans/universal-agent-integration.md +121 -348
- package/docs/releases/v0.5.0.md +93 -0
- package/package.json +2 -8
- package/docs/integration/stdio-bridge.md +0 -694
- package/docs/integration/stdio-conformance.md +0 -51
- package/scripts/run-stdio-conformance.mjs +0 -698
|
@@ -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
|
|
303
|
-
|
|
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,
|
|
306
|
-
|
|
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:
|
|
387
|
-
implementations. The
|
|
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
|
|
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:
|
|
4
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Keep
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- [x]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- [x]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- [x]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- [x]
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [x]
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- [x]
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- [x]
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
- [x]
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- [x]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
- [x]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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.
|