browser-pilot-cli 0.3.0-rc.2 → 0.3.0-rc.4

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.
@@ -818,21 +818,30 @@ a screenshot, PDF, download, or arbitrary Broker-internal path as upload
818
818
  authorization.
819
819
 
820
820
  Downloads are event-produced Artifacts rather than a separate path-returning
821
- tool. The implementation must configure download behavior on the controlled
822
- target session only, stage bytes in a mode-`0700` per-session directory, keep
823
- the CDP download GUID and staging path private, and ingest a completed file as a
824
- Workspace-owned `download` Artifact before publishing the completed `download`
825
- event. Lease/session/Workspace release removes partial staging files; failed,
826
- cancelled, oversized, or detached downloads publish bounded metadata without a
827
- local path. Browser-wide `Browser.setDownloadBehavior` on the user's default
828
- context is forbidden because it would redirect downloads from unrelated user
829
- tabs. If target-session isolation is unavailable in a Chrome version, Browser
830
- Pilot reports download capture as unavailable and does not fall back globally.
831
- The implementation applies per-download, per-Workspace staging, and global
832
- staging bounds. An oversized or over-capacity download is cancelled by its
833
- private GUID without changing download behavior for the browser's default
834
- context. Stale staging directories from a prior Broker process are removed before
835
- the first new download session is configured.
821
+ tool. CDP download behavior is browser-context scoped even when invoked through
822
+ an attached target session, so per-session download directories cannot provide
823
+ isolation. For each browser connection generation and Chrome Profile context,
824
+ the Broker enables `Browser.downloadProgress` once with
825
+ `Browser.setDownloadBehavior({ behavior: "default", eventsEnabled: true })`.
826
+ The `default` behavior preserves Chrome's configured download directory and
827
+ does not redirect user downloads.
828
+
829
+ `Page.downloadWillBegin` on an attached controlled target binds the private CDP
830
+ GUID to that target's Workspace and Lease. The browser-level completed event
831
+ supplies the absolute source `filePath`; the Broker accepts it only for a GUID
832
+ already bound by the Page event, validates a regular file, and copies it into a
833
+ Workspace-owned `download` Artifact before publishing completion. Browser-level
834
+ events without a controlled Page owner are ignored. GUIDs and source paths never
835
+ appear in protocol output.
836
+
837
+ The Browser Pilot copy is subject to tracking, item, Workspace, and global
838
+ Artifact bounds. Exceeding a bound rejects only Artifact creation: it must not
839
+ cancel, move, truncate, or delete Chrome's original download. Lease, session,
840
+ Workspace, Artifact, and Broker cleanup stop tracking and delete only protected
841
+ Artifact copies. The original file in the user's Chrome download directory is
842
+ always left intact. If browser-level download events are unavailable, Browser
843
+ Pilot reports capture as unavailable without changing Chrome's download
844
+ behavior.
836
845
 
837
846
  ## Browser Discovery and Setup
838
847
 
@@ -544,10 +544,11 @@ downloads are rejected as upload inputs. Workspace cleanup deletes the imported
544
544
  copy but never deletes the client-owned source file.
545
545
 
546
546
  Downloads have no path-returning tool. Once a controlled target session is
547
- attached, the Broker configures target-session download capture and emits
548
- `download` events with one of these states:
547
+ attached, the Broker enables browser-level completion events while preserving
548
+ Chrome's default download behavior, and emits `download` events with one of
549
+ these states:
549
550
 
550
- - `capture_unavailable`: that Chrome version rejected target-session isolation;
551
+ - `capture_unavailable`: Chrome rejected browser-level completion events;
551
552
  - `started`: includes an opaque `downloadId`, bounded URL, and suggested filename;
552
553
  - `completed`: includes the Workspace-owned `download` Artifact descriptor;
553
554
  - `failed` or `cancelled`: includes a stable, bounded reason and byte metadata.
@@ -558,14 +559,24 @@ public `artifactId`, and terminal failures recommend inspecting the bounded
558
559
  failure reason. `capture_unavailable` is setup state and does not claim that a
559
560
  download started.
560
561
 
561
- The private CDP GUID and staging path never appear in protocol output. On
562
- `completed`, use the descriptor's `id` with `artifacts/get` or `artifacts/export`
563
- exactly as for screenshots and PDFs. Staging directories are separate per CDP
564
- session, use mode `0700`, enforce concurrency and byte quotas, and are removed on
565
- session, Lease, or Workspace release. The session setting is restored to
566
- `default` before an attached session is retired. Browser Pilot never calls browser-wide
567
- `Browser.setDownloadBehavior`; unsupported target-session capture remains
568
- unavailable instead of redirecting unrelated user downloads.
562
+ The private CDP GUID and Chrome source path never appear in protocol output. On
563
+ `completed`, use the descriptor's `id` with `artifacts/get` or
564
+ `artifacts/export` exactly as for screenshots and PDFs. A session-scoped
565
+ `Page.downloadWillBegin` event establishes Workspace/Lease/target ownership;
566
+ the browser-level completion event is ignored unless that ownership already
567
+ exists. Browser Pilot enables those completion events once per browser
568
+ connection generation and Chrome Profile context with
569
+ `Browser.setDownloadBehavior({ behavior: "default", eventsEnabled: true })`.
570
+ It never supplies `downloadPath`, so Chrome continues to use the user's selected
571
+ download directory.
572
+
573
+ The Broker validates the completed absolute regular-file path and copies it to
574
+ protected Artifact storage. Releasing or expiring the Artifact, Lease, or
575
+ Workspace deletes only that copy. The original Chrome download is never moved
576
+ or deleted. Size, concurrency, or Artifact quota failures reject only the
577
+ Artifact copy and do not call `Browser.cancelDownload`. Downloads from tabs
578
+ without an attached controlled session remain ordinary Chrome downloads and
579
+ produce no Browser Pilot event.
569
580
 
570
581
  ## Cleanup
571
582
 
@@ -1,6 +1,6 @@
1
1
  # Profile Context Routing Plan
2
2
 
3
- Status: **In progress**
3
+ Status: **Complete**
4
4
  Target: Browser Pilot `v0.3.0`, protocol `1.2`
5
5
  Source of truth: `docs/architecture/browser-pilot-platform-spec.md`
6
6
 
@@ -179,21 +179,21 @@ candidate targets were closed.
179
179
  - [x] P4: update stdio integration guidance, adapters, skill, and release docs.
180
180
  - [x] P5: add protocol, dual-Profile, concurrency, reconnect, cleanup, and
181
181
  compatibility tests.
182
- - [ ] P6: run real Chrome acceptance and publish `v0.3.0-rc.2`.
182
+ - [x] P6: run real Chrome acceptance and publish `v0.3.0-rc.2`.
183
183
 
184
184
  ## Acceptance
185
185
 
186
- - All eligible user tabs across live Profile contexts appear in one inventory.
187
- - Existing user tabs can be controlled without selecting a Profile first.
188
- - No multi-context open silently selects a first Profile.
189
- - Explicit, active-target, Workspace, and single-context resolution follow the
186
+ - [x] All eligible user tabs across live Profile contexts appear in one inventory.
187
+ - [x] Existing user tabs can be controlled without selecting a Profile first.
188
+ - [x] No multi-context open silently selects a first Profile.
189
+ - [x] Explicit, active-target, Workspace, and single-context resolution follow the
190
190
  specified order.
191
- - Every managed target and popup matches its ManagedTabSet Profile context.
192
- - Two Workspaces may select different contexts and create targets concurrently
191
+ - [x] Every managed target and popup matches its ManagedTabSet Profile context.
192
+ - [x] Two Workspaces may select different contexts and create targets concurrently
193
193
  without cross-routing.
194
- - Reconnect invalidates old Profile IDs, target mappings, frames, and refs.
195
- - Passive listing creates no target and never focuses or navigates a user tab.
196
- - Janitor EOF/SIGKILL cleanup closes fallback-created managed windows but never
194
+ - [x] Reconnect invalidates old Profile IDs, target mappings, frames, and refs.
195
+ - [x] Passive listing creates no target and never focuses or navigates a user tab.
196
+ - [x] Janitor EOF/SIGKILL cleanup closes fallback-created managed windows but never
197
197
  user tabs.
198
- - Protocol 1.1 clients retain existing-tab control and cannot open ambiguously.
199
- - Single-Profile CLI and fixture behavior remains compatible.
198
+ - [x] Protocol 1.1 clients retain existing-tab control and cannot open ambiguously.
199
+ - [x] Single-Profile CLI and fixture behavior remains compatible.
@@ -114,9 +114,10 @@ Pilot. Tenon and OpenClaw are reference consumers only.
114
114
  Workspace scoped; request identity includes CDP session identity, sensitive
115
115
  events are metadata-only, and legacy daemon handlers ignore Broker sessions.
116
116
  Lease replacement preserves Workspace configuration while Workspace release
117
- clears it. Downloads use target-session CDP configuration, separate protected
118
- staging directories, bounded concurrency/bytes, Workspace-owned Artifacts,
119
- and Lease/session/Workspace cleanup without browser-wide fallback.
117
+ clears it. Downloads preserve each Profile's Chrome default directory;
118
+ Page events bind GUID ownership to controlled sessions, browser-level
119
+ completion paths are copied into bounded Workspace-owned Artifacts, and
120
+ cleanup deletes only the copy without cancelling or moving user downloads.
120
121
  - [x] **A2.6** Implement the default-unrestricted BrowserControlPolicy and
121
122
  optional launch-time Host operation removal.
122
123
  - Covers: FLOW-5, BR-21, BR-22, AC-4.
@@ -226,9 +227,10 @@ Pilot. Tenon and OpenClaw are reference consumers only.
226
227
  keeping explicit CLI export behavior compatible.
227
228
  - Covers: AC-1, AC-6.
228
229
  - Complete: screenshot and PDF tools return scoped Artifacts; large captures
229
- produce model-sized previews with optional originals. Session-scoped download
230
- events ingest completed files as protected `download` Artifacts without
231
- publishing staging paths or CDP GUIDs.
230
+ produce model-sized previews with optional originals. Session-scoped Page
231
+ events establish download ownership, and browser-level completion events
232
+ copy only those files into protected `download` Artifacts without publishing
233
+ Chrome source paths or CDP GUIDs.
232
234
  - [x] **A5.3** Add adapter-facing file authorization and revoke access on
233
235
  release or expiry.
234
236
  - Covers: CON-5, NFR-5.
@@ -0,0 +1,51 @@
1
+ # Browser Pilot v0.3.0 Stabilization Plan
2
+
3
+ Status: **In progress**
4
+ Candidate baseline: `v0.3.0-rc.3`; correction target: `v0.3.0-rc.4`, protocol `1.2`
5
+
6
+ ## Goal
7
+
8
+ Promote protocol 1.2 to `v0.3.0` only after the published executable passes
9
+ the same multi-host workflows that Tenon, OpenClaw, Codex, and other Agent
10
+ products depend on. No Agent-specific behavior enters Browser Pilot.
11
+
12
+ ## Release gate
13
+
14
+ - [x] Add a black-box host integration runner that launches two independent
15
+ stdio bridge clients against an exact executable command.
16
+ - [x] Verify separate Connections, Workspaces, Leases, opaque target IDs, one
17
+ shared Broker, and one shared in-flight browser connection.
18
+ - [x] Verify eligible user-tab exclusivity, `target_busy`, explicit release,
19
+ and handoff without navigation, editing, or closure.
20
+ - [x] Verify concurrent CLI use and separate managed inventories.
21
+ - [x] Verify screenshot conversion to native image content and PDF/download
22
+ export to host-owned absolute paths.
23
+ - [x] Verify event replay until explicit acknowledgement.
24
+ - [x] Verify Workspace cleanup closes only managed targets and preserves the
25
+ initial user-tab inventory.
26
+ - [x] Verify isolated browser loss/restoration events and invalidate old
27
+ Profile and target identities after reconnect.
28
+ - [x] Replace invalid per-session download redirection with Chrome-default
29
+ downloads, controlled Page-event ownership, browser-level completion paths,
30
+ and copy-only Artifacts. Verify unowned downloads are ignored and user source
31
+ files survive Artifact and Workspace cleanup.
32
+ - [x] Pass TypeScript, 276 Node, 109 Playwright, 13 stdio conformance, three
33
+ distribution-mode, and 13 host integration checks on the candidate source.
34
+ - [x] Publish `v0.3.0-rc.3` through trusted publishing and pass all 13 host
35
+ integration checks against the installed standalone release executable.
36
+ - [x] Run one controlled user-Chrome host acceptance with explicit Profile
37
+ choices and a single authorization attempt.
38
+ - [ ] Publish `v0.3.0-rc.4` with Broker-backed CLI browser status and verify
39
+ that passive discovery reports the live authorized connection.
40
+ - [ ] Soak several real Agent tasks through the installed candidate.
41
+ - [ ] Tag `v0.3.0`, publish npm `latest`, and verify upgrade/rollback metadata.
42
+
43
+ ## Stable decision
44
+
45
+ The first new host gate exposed a deeper CDP constraint: target-session calls to
46
+ `Page.setDownloadBehavior` still share download behavior across a Chrome
47
+ Profile. One host could therefore redirect another host's download, including
48
+ an uncontrolled user tab. `v0.3.0-rc.2` must not be promoted. RC.3 preserves
49
+ Chrome's default download destination and creates an Artifact only after a
50
+ session-scoped Page event proves ownership and a browser-level completion event
51
+ provides the final path.
@@ -1,5 +1,10 @@
1
1
  # Browser Pilot 0.3.0-rc.1
2
2
 
3
+ > Superseded by `0.3.0-rc.2`. Real-Chrome acceptance found that some regular
4
+ > Profile tabs report a normalized `TargetInfo.openerId` for fallback-created
5
+ > windows. RC.1 fails closed with `unknown_outcome` but may leave its blank
6
+ > marker tab for caller cleanup. Upgrade to RC.2.
7
+
3
8
  This release candidate adds extension-free multi-Profile routing on one
4
9
  authorized Chrome endpoint. Browser Pilot now inventories eligible user tabs
5
10
  from every live Profile context and keeps those tabs directly controllable.
@@ -44,6 +49,7 @@ Automated release gates completed before tagging:
44
49
  - The npm dry-run package contains the Profile routing plan and this release
45
50
  note.
46
51
 
47
- The controlled real Chrome dual-Profile acceptance is performed after installing
48
- the published RC so it exercises the same package and Codex skill path available
49
- to users.
52
+ The post-publication real Chrome run verified one-authorization Profile listing,
53
+ cross-Profile user-tab control, ambiguity rejection, and direct managed creation.
54
+ It then exposed the fallback issue documented above, which is fixed and accepted
55
+ in RC.2.
@@ -39,5 +39,20 @@ Automated release gates completed before tagging:
39
39
  The RC.1 real-Chrome run used one authorization and verified three live Profile
40
40
  contexts, cross-Profile user-tab inventory, existing-tab control in two
41
41
  Profiles, and managed creation in the direct-create Profile before exposing this
42
- fallback defect. RC.2 is accepted against the same Chrome setup after installing
43
- the published package.
42
+ fallback defect.
43
+
44
+ The published RC.2 package then passed controlled real Chrome acceptance through
45
+ the installed Codex CLI and skill path:
46
+
47
+ - one explicit connection produced one Chrome authorization and discovered three
48
+ live Profile contexts;
49
+ - five eligible user tabs across two Profiles remained listable and controllable;
50
+ - an unanchored new-target request returned `profile_selection_required` before
51
+ browser dispatch and did not create a tab;
52
+ - direct creation and isolated-world fallback creation each landed in the
53
+ explicitly selected Profile with the expected managed origin;
54
+ - no marker target remained after fallback verification;
55
+ - targeted close and managed bulk close preserved all five user tabs;
56
+ - Profile selection, tab control, creation, and cleanup produced no additional
57
+ authorization prompt; and
58
+ - reconnect generated new Profile IDs and the prior connection's ID was rejected.
@@ -0,0 +1,56 @@
1
+ # Browser Pilot 0.3.0-rc.3
2
+
3
+ This release candidate adds a black-box integration gate for real Agent hosts
4
+ and replaces the previous download-capture model after that gate exposed a CDP
5
+ isolation flaw.
6
+
7
+ `Page.setDownloadBehavior` is not truly target-session isolated inside one
8
+ Chrome Profile. Assigning a private directory for Host B can overwrite Host A's
9
+ setting and redirect downloads from an uncontrolled user tab. RC.3 therefore:
10
+
11
+ - preserves Chrome's configured download directory with browser-context
12
+ `Browser.setDownloadBehavior({ behavior: "default", eventsEnabled: true })`;
13
+ - uses session-scoped `Page.downloadWillBegin` only to bind a private GUID to a
14
+ Workspace, Lease, and target;
15
+ - accepts browser-level completion paths only for already-owned GUIDs and
16
+ ignores unrelated browser downloads;
17
+ - copies a completed regular file into the Workspace's protected Artifact
18
+ storage without exposing its source path; and
19
+ - never cancels, moves, or deletes the user's original download when tracking,
20
+ size, quota, Artifact, Lease, or Workspace cleanup ends.
21
+
22
+ The host integration acceptance suite launches two independent stdio clients
23
+ against an exact executable command and verifies:
24
+
25
+ - separate Connections, Workspaces, Leases, and opaque target IDs reuse one
26
+ per-user Broker;
27
+ - concurrent browser connect calls share the Broker connection path;
28
+ - Profile routing and managed inventories remain isolated;
29
+ - one user tab reports `target_busy`, then transfers through explicit release;
30
+ - a one-shot CLI remains usable while both embedded hosts are live;
31
+ - screenshots become native image content while PDFs and downloads export to
32
+ host-owned absolute paths;
33
+ - Chrome's original downloaded file survives Artifact and Workspace cleanup;
34
+ - event polling replays until the host explicitly acknowledges its cursor;
35
+ - Workspace shutdown removes only managed targets and preserves user tabs; and
36
+ - an isolated Chrome restart emits lost/restored events and invalidates old
37
+ Profile and target identities.
38
+
39
+ RC.3 also closes a Broker startup race: the `starting` PID record is now
40
+ published only after exit and signal cleanup handlers are installed, so a
41
+ SIGTERM during browser authorization cannot leave a stale owner record.
42
+
43
+ Automated gates completed for the candidate source:
44
+
45
+ - TypeScript type checking passed.
46
+ - 276 Node unit, protocol, process, adapter, and runner tests passed.
47
+ - 109 isolated Playwright core, compatibility, and network tests passed.
48
+ - The stdio conformance suite passed all 13 checks.
49
+ - The host integration suite passed all 13 isolated checks, including original
50
+ Chrome download preservation.
51
+ - npm distribution verification passed for global, local project, and
52
+ product-bundled executable modes.
53
+
54
+ RC.3 keeps protocol 1.2 and the RC.2 Profile routing contract unchanged. It
55
+ adds no Native SDK, MCP server, browser extension, approval layer, or
56
+ Agent-specific production behavior.
@@ -0,0 +1,28 @@
1
+ # Browser Pilot 0.3.0-rc.4
2
+
3
+ This release candidate fixes a connection-status inconsistency found during
4
+ controlled user-Chrome acceptance of RC.3.
5
+
6
+ When a Broker already held an authorized Chrome connection, `bp profiles` and
7
+ browser operations worked, but `bp browsers` performed a separate local endpoint
8
+ scan and could report the same browser as `disconnected`. An Agent following
9
+ that result could unnecessarily call `bp connect` and cause another Chrome
10
+ authorization prompt.
11
+
12
+ RC.4 makes `bp browsers` use the Broker-owned `browser.discover` operation when
13
+ a compatible Broker is running. Local discovery remains the passive fallback
14
+ when no Broker exists. The command still never starts a Broker or requests
15
+ Chrome authorization.
16
+
17
+ The RC.3 controlled user-Chrome acceptance passed with two independent Agent
18
+ hosts routed to two live Profiles. It verified user-tab handoff, concurrent CLI
19
+ use, native screenshot content, PDF and download export, event replay, managed
20
+ cleanup, and preservation of all existing user tabs. Chrome's original
21
+ download was also confirmed in its default download directory.
22
+
23
+ RC.4 keeps protocol 1.2, browser control behavior, Profile routing, and the
24
+ Agent-neutral stdio integration contract unchanged.
25
+
26
+ Automated candidate gates passed with 276 Node tests, 109 isolated Playwright
27
+ tests, all 13 stdio conformance checks, all 13 host integration checks, and npm
28
+ distribution verification in global, local-project, and product-bundled modes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-pilot-cli",
3
- "version": "0.3.0-rc.2",
3
+ "version": "0.3.0-rc.4",
4
4
  "description": "CLI tool to control your browser via Chrome DevTools Protocol",
5
5
  "repository": "https://github.com/relixiaobo/browser-pilot",
6
6
  "type": "module",
@@ -22,6 +22,7 @@
22
22
  "test:capabilities": "tsup && node --test tests/browser-capability-fixtures.test.mjs",
23
23
  "test:protocol": "tsup && node --test tests/protocol.test.mjs",
24
24
  "test:stdio-conformance": "tsup && node scripts/run-isolated-stdio-conformance.mjs",
25
+ "test:host-acceptance": "tsup && node scripts/run-isolated-host-integration-acceptance.mjs",
25
26
  "test:distribution": "tsup && node scripts/verify-npm-distribution.mjs",
26
27
  "test:canary": "tsup && node scripts/run-real-site-canaries.mjs",
27
28
  "test:canary:strict": "tsup && node scripts/run-real-site-canaries.mjs --strict",
@@ -41,9 +42,12 @@
41
42
  "docs/integration/stdio-conformance.md",
42
43
  "docs/plans/browser-capability-evolution.md",
43
44
  "docs/plans/profile-context-routing.md",
45
+ "docs/plans/v0.3.0-stabilization.md",
44
46
  "docs/plans/universal-agent-integration.md",
45
47
  "docs/releases/v0.3.0-rc.1.md",
46
48
  "docs/releases/v0.3.0-rc.2.md",
49
+ "docs/releases/v0.3.0-rc.3.md",
50
+ "docs/releases/v0.3.0-rc.4.md",
47
51
  "README.md",
48
52
  "LICENSE"
49
53
  ],