agent-browser-priv 0.27.3-priv.3 → 0.27.3-priv.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
- # agent-browser-priv
1
+ # agent-browser
2
2
 
3
- Browser automation CLI for AI agents, forked for opt-in local privacy/runtime
4
- backends. Fast native Rust CLI.
3
+ Browser automation CLI for AI agents, distributed from the
4
+ `agent-browser-priv` fork with Patchright as the default local backend. Fast
5
+ native Rust CLI.
5
6
 
6
7
  [![skills.sh](https://skills.sh/b/vercel-labs/agent-browser)](https://skills.sh/vercel-labs/agent-browser)
7
8
 
@@ -13,7 +14,7 @@ Installs the native Rust binary:
13
14
 
14
15
  ```bash
15
16
  npm install -g agent-browser-priv
16
- agent-browser-priv install # Download Chrome from Chrome for Testing (first time only)
17
+ agent-browser install # Install Patchright browser artifacts (first time only)
17
18
  ```
18
19
 
19
20
  ### Project Installation (local dependency)
@@ -22,7 +23,7 @@ For projects that want to pin the version in `package.json`:
22
23
 
23
24
  ```bash
24
25
  npm install agent-browser-priv
25
- agent-browser-priv install
26
+ agent-browser install
26
27
  ```
27
28
 
28
29
  Then use via `package.json` scripts or by invoking `agent-browser` directly.
@@ -30,15 +31,15 @@ Then use via `package.json` scripts or by invoking `agent-browser` directly.
30
31
  ### Homebrew (macOS)
31
32
 
32
33
  ```bash
33
- brew install liuwen/agent-browser-priv/agent-browser-priv
34
- agent-browser-priv install # Download Chrome from Chrome for Testing (first time only)
34
+ brew install liuwen/agent-browser-priv/agent-browser
35
+ agent-browser install # Install Patchright browser artifacts (first time only)
35
36
  ```
36
37
 
37
38
  ### Cargo (Rust)
38
39
 
39
40
  ```bash
40
41
  cargo install --git https://github.com/liuwen/agent-browser-priv
41
- agent-browser-priv install # Download Chrome from Chrome for Testing (first time only)
42
+ agent-browser install # Install Patchright browser artifacts (first time only)
42
43
  ```
43
44
 
44
45
  ### From Source
@@ -51,8 +52,8 @@ cd agent-browser-priv
51
52
  pnpm install
52
53
  pnpm build
53
54
  pnpm build:native # Requires Rust (https://rustup.rs)
54
- pnpm link --global # Makes agent-browser-priv available globally
55
- agent-browser-priv install
55
+ pnpm link --global # Makes agent-browser available globally
56
+ agent-browser install
56
57
  ```
57
58
 
58
59
  ### Linux Dependencies
@@ -60,7 +61,7 @@ agent-browser-priv install
60
61
  On Linux, install system dependencies:
61
62
 
62
63
  ```bash
63
- agent-browser-priv install --with-deps
64
+ agent-browser install --with-deps
64
65
  ```
65
66
 
66
67
  ### Updating
@@ -68,14 +69,15 @@ agent-browser-priv install --with-deps
68
69
  Upgrade to the latest version:
69
70
 
70
71
  ```bash
71
- agent-browser-priv upgrade
72
+ agent-browser upgrade
72
73
  ```
73
74
 
74
75
  Detects your installation method (npm, Homebrew, or Cargo) and runs the appropriate update command automatically.
75
76
 
76
77
  ### Requirements
77
78
 
78
- - **Chrome** - Run `agent-browser-priv install` to download Chrome from [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (Google's official automation channel). Existing Chrome, Brave, Playwright, and Puppeteer installations are detected automatically. No Playwright or Node.js required for the daemon.
79
+ - **Patchright backend** - Run `agent-browser install` to install Patchright and its browser artifacts for the default local backend.
80
+ - **Chrome backend** - Use `agent-browser install chrome` to download Chrome from [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) for `--backend chrome`. Existing Chrome, Brave, Playwright, and Puppeteer installations are detected automatically.
79
81
  - **Node.js 24+ and pnpm 11+** - Only needed when building from source.
80
82
  - **Rust** - Only needed when building from source (see From Source above).
81
83
 
@@ -458,18 +460,19 @@ agent-browser removeinitscript <identifier> # Remove a previously register
458
460
  ### Setup
459
461
 
460
462
  ```bash
461
- agent-browser install # Download Chrome from Chrome for Testing (Google's official automation channel)
463
+ agent-browser install # Install Patchright browser artifacts
464
+ agent-browser install chrome # Download Chrome from Chrome for Testing
462
465
  agent-browser install --with-deps # Also install system deps (Linux)
463
466
  agent-browser upgrade # Upgrade agent-browser to the latest version
464
467
  agent-browser doctor # Diagnose the install and auto-clean stale daemon files
465
- agent-browser doctor --fix # Also run destructive repairs (reinstall Chrome, purge old state, ...)
468
+ agent-browser doctor --fix # Also run destructive repairs
466
469
  agent-browser doctor --offline --quick # Skip network probes and the live launch test
467
470
  ```
468
471
 
469
- `doctor` checks your environment, Chrome install, daemon state, config files,
470
- encryption key, providers, network reachability, and runs a live headless
471
- browser launch test. Stale socket/pid sidecar files are auto-cleaned. Output
472
- is also available as `--json` for agents.
472
+ `doctor` checks your environment, browser backend install, daemon state,
473
+ config files, encryption key, providers, network reachability, and runs a live
474
+ headless browser launch test. Stale socket/pid sidecar files are auto-cleaned.
475
+ Output is also available as `--json` for agents.
473
476
 
474
477
  ### Skills
475
478
 
@@ -743,7 +746,7 @@ This is useful for multimodal AI models that can reason about visual layout, unl
743
746
  | `--confirm-actions <list>` | Action categories requiring confirmation (or `AGENT_BROWSER_CONFIRM_ACTIONS` env) |
744
747
  | `--confirm-interactive` | Interactive confirmation prompts; auto-denies if stdin is not a TTY (or `AGENT_BROWSER_CONFIRM_INTERACTIVE` env) |
745
748
  | `--engine <name>` | Browser engine: `chrome` (default), `lightpanda` (or `AGENT_BROWSER_ENGINE` env) |
746
- | `--backend <name>` | Local Chrome backend: `chrome` (default), `patchright` (or `AGENT_BROWSER_BACKEND` env) |
749
+ | `--backend <name>` | Local Chrome backend: `patchright` (default), `chrome` (or `AGENT_BROWSER_BACKEND` env) |
747
750
  | `--no-auto-dialog` | Disable automatic dismissal of `alert`/`beforeunload` dialogs (or `AGENT_BROWSER_NO_AUTO_DIALOG` env) |
748
751
  | `--model <name>` | AI model for chat command (or `AI_GATEWAY_MODEL` env) |
749
752
  | `-v`, `--verbose` | Show tool commands and their raw output (chat) |
@@ -751,27 +754,33 @@ This is useful for multimodal AI models that can reason about visual layout, unl
751
754
  | `--config <path>` | Use a custom config file (or `AGENT_BROWSER_CONFIG` env) |
752
755
  | `--debug` | Debug output |
753
756
 
754
- ## Patchright backend
757
+ ## Local backends
755
758
 
756
- `agent-browser-priv` keeps the normal Chrome CDP backend by default. For local
757
- development environments that need Patchright-managed Chromium artifacts or a
758
- Patchright-launched persistent browser, install the backend once:
759
+ This fork defaults local Chrome-compatible launches to Patchright. For fresh
760
+ remote hosts, sandboxes, and CI environments, install the default backend once:
759
761
 
760
762
  ```bash
761
- agent-browser-priv install patchright
763
+ agent-browser install
762
764
  ```
763
765
 
764
- Then opt in per session:
766
+ Then use the normal command surface:
765
767
 
766
768
  ```bash
767
- agent-browser-priv --backend patchright --headed open https://example.com
768
- agent-browser-priv --backend patchright --profile ~/.agent-browser-priv/profiles/dev open https://example.com
769
+ agent-browser --headed open https://example.com
770
+ agent-browser --profile ~/.agent-browser/profiles/dev open https://example.com
771
+ ```
772
+
773
+ Use the built-in Chrome CDP launcher when a site behaves better on that lane:
774
+
775
+ ```bash
776
+ agent-browser install chrome
777
+ agent-browser --backend chrome open https://example.com
778
+ AGENT_BROWSER_BACKEND=chrome agent-browser open https://example.com
769
779
  ```
770
780
 
771
781
  Patchright is used only to launch the local Chrome-compatible browser and expose
772
- CDP on localhost. The agent-browser command surface remains unchanged. This
773
- backend does not solve CAPTCHA, Turnstile, or other human verification pages;
774
- preserve those pages for human handoff.
782
+ CDP on localhost. It does not solve CAPTCHA, Turnstile, or other human
783
+ verification pages; preserve those pages for human handoff.
775
784
 
776
785
  ## Observability Dashboard
777
786
 
@@ -1255,7 +1264,7 @@ agent-browser uses a client-daemon architecture:
1255
1264
 
1256
1265
  The daemon starts automatically on first command and persists between commands for fast subsequent operations. To auto-shutdown the daemon after a period of inactivity, set `AGENT_BROWSER_IDLE_TIMEOUT_MS` (value in milliseconds). When set, the daemon closes the browser and exits after receiving no commands for the specified duration.
1257
1266
 
1258
- **Browser Engine:** Uses Chrome (from Chrome for Testing) by default. The `--engine` flag selects between `chrome` and `lightpanda`. Supported browsers: Chromium/Chrome (via CDP) and Safari (via WebDriver for iOS).
1267
+ **Browser Engine:** Uses the Chrome-compatible engine with Patchright by default. The `--engine` flag selects between `chrome` and `lightpanda`; the `--backend` flag selects `patchright` or `chrome` for local Chrome-compatible launches. Supported browsers: Chromium/Chrome (via CDP) and Safari (via WebDriver for iOS).
1259
1268
 
1260
1269
  ## Platforms
1261
1270
 
Binary file
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Cross-platform CLI wrapper for agent-browser-priv
4
+ * Cross-platform CLI wrapper for the agent-browser-priv npm package.
5
5
  *
6
6
  * This wrapper enables npx support on Windows where shell scripts don't work.
7
7
  * For global installs, postinstall.js patches the shims to invoke the native
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser-priv",
3
- "version": "0.27.3-priv.3",
3
+ "version": "0.27.3-priv.5",
4
4
  "description": "Browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.1.3",
@@ -15,6 +15,7 @@
15
15
  "skills"
16
16
  ],
17
17
  "bin": {
18
+ "agent-browser": "bin/agent-browser.js",
18
19
  "agent-browser-priv": "bin/agent-browser.js"
19
20
  },
20
21
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Postinstall script for agent-browser-priv
4
+ * Postinstall script for the agent-browser-priv npm package.
5
5
  *
6
6
  * Downloads the platform-specific native binary if not present.
7
7
  * On global installs, patches npm's bin entry to use the native binary directly:
@@ -91,7 +91,7 @@ async function downloadFile(url, dest) {
91
91
 
92
92
  /**
93
93
  * Detect which package manager ran this postinstall and write a marker file
94
- * next to the binary so `agent-browser-priv upgrade` can use the correct one
94
+ * next to the binary so `agent-browser upgrade` can use the correct one
95
95
  * without fragile path heuristics or slow subprocess probing.
96
96
  *
97
97
  * npm_config_user_agent is set by npm/pnpm/yarn/bun during lifecycle scripts,
@@ -205,21 +205,25 @@ function showInstallReminder() {
205
205
  if (systemChrome) {
206
206
  console.log('');
207
207
  console.log(` ✓ System Chrome found: ${systemChrome}`);
208
- console.log(' agent-browser-priv will use it automatically.');
208
+ console.log(' Use --backend chrome or config backend=chrome to launch it directly.');
209
+ console.log('');
210
+ console.log(' The default Patchright backend is prepared with:');
211
+ console.log('');
212
+ console.log(' agent-browser install');
209
213
  console.log('');
210
214
  return;
211
215
  }
212
216
 
213
217
  console.log('');
214
- console.log(' ⚠ No Chrome installation detected.');
215
- console.log(' If you plan to use a local browser, run:');
218
+ console.log(' ⚠ No system Chrome installation detected.');
219
+ console.log(' To prepare the default Patchright backend, run:');
216
220
  console.log('');
217
- console.log(' agent-browser-priv install');
221
+ console.log(' agent-browser install');
218
222
  if (platform() === 'linux') {
219
223
  console.log('');
220
224
  console.log(' On Linux, include system dependencies with:');
221
225
  console.log('');
222
- console.log(' agent-browser-priv install --with-deps');
226
+ console.log(' agent-browser install --with-deps');
223
227
  }
224
228
  console.log('');
225
229
  console.log(' You can skip this if you use --cdp, --provider, --engine, or --executable-path.');
@@ -252,27 +256,29 @@ async function fixUnixSymlink() {
252
256
  return; // npm not available
253
257
  }
254
258
 
255
- const symlinkPath = join(npmBinDir, 'agent-browser-priv');
259
+ const symlinkPaths = [
260
+ join(npmBinDir, 'agent-browser'),
261
+ join(npmBinDir, 'agent-browser-priv'),
262
+ ];
256
263
 
257
- // Check if symlink exists (indicates global install)
258
- try {
259
- const stat = lstatSync(symlinkPath);
260
- if (!stat.isSymbolicLink()) {
261
- return; // Not a symlink, don't touch it
264
+ let optimized = false;
265
+ for (const symlinkPath of symlinkPaths) {
266
+ try {
267
+ const stat = lstatSync(symlinkPath);
268
+ if (!stat.isSymbolicLink()) {
269
+ continue;
270
+ }
271
+
272
+ unlinkSync(symlinkPath);
273
+ symlinkSync(binaryPath, symlinkPath);
274
+ optimized = true;
275
+ } catch {
276
+ // Symlink missing during postinstall or not writable; JS wrapper still works.
262
277
  }
263
- } catch {
264
- return; // Symlink doesn't exist, not a global install
265
278
  }
266
279
 
267
- // Replace symlink to point directly to native binary
268
- try {
269
- unlinkSync(symlinkPath);
270
- symlinkSync(binaryPath, symlinkPath);
271
- console.log('✓ Optimized: symlink points to native binary (zero overhead)');
272
- } catch (err) {
273
- // Permission error or other issue - not critical, JS wrapper still works
274
- console.log(`⚠ Could not optimize symlink: ${err.message}`);
275
- console.log(' CLI will work via Node.js wrapper (slightly slower startup)');
280
+ if (optimized) {
281
+ console.log('✓ Optimized: command symlink points to native binary (zero overhead)');
276
282
  }
277
283
  }
278
284
 
@@ -289,16 +295,6 @@ async function fixWindowsShims() {
289
295
  return;
290
296
  }
291
297
 
292
- const cmdShim = join(npmBinDir, 'agent-browser-priv.cmd');
293
- const ps1Shim = join(npmBinDir, 'agent-browser-priv.ps1');
294
-
295
- // Shims may not exist yet during postinstall (npm creates them after
296
- // lifecycle scripts). If missing, fall back: the JS wrapper at
297
- // bin/agent-browser.js handles Windows correctly via child_process.spawn.
298
- if (!existsSync(cmdShim)) {
299
- return;
300
- }
301
-
302
298
  // Detect architecture so ARM64 Windows is handled correctly
303
299
  // (falls back to x64 binary — see platform detection above)
304
300
  const cpuArch = effectiveArch;
@@ -310,17 +306,24 @@ async function fixWindowsShims() {
310
306
  return;
311
307
  }
312
308
 
313
- try {
309
+ let optimized = false;
310
+ for (const commandName of ['agent-browser', 'agent-browser-priv']) {
311
+ const cmdShim = join(npmBinDir, `${commandName}.cmd`);
312
+ const ps1Shim = join(npmBinDir, `${commandName}.ps1`);
313
+ if (!existsSync(cmdShim)) {
314
+ continue;
315
+ }
316
+
314
317
  const cmdContent = `@ECHO off\r\n"%~dp0${relativeBinaryPath}" %*\r\n`;
315
318
  writeFileSync(cmdShim, cmdContent);
316
319
 
317
320
  const ps1Content = `#!/usr/bin/env pwsh\r\n$basedir = Split-Path $MyInvocation.MyCommand.Definition -Parent\r\n& "$basedir\\${relativeBinaryPath}" $args\r\nexit $LASTEXITCODE\r\n`;
318
321
  writeFileSync(ps1Shim, ps1Content);
322
+ optimized = true;
323
+ }
319
324
 
325
+ if (optimized) {
320
326
  console.log('✓ Optimized: shims point to native binary (zero overhead)');
321
- } catch (err) {
322
- console.log(`⚠ Could not optimize shims: ${err.message}`);
323
- console.log(' CLI will work via Node.js wrapper (slightly slower startup)');
324
327
  }
325
328
  }
326
329
 
@@ -1,20 +1,19 @@
1
1
  ---
2
2
  name: core
3
3
  description: Core agent-browser usage guide. Read this before running any agent-browser commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth, waiting for content, running multiple browser sessions in parallel, and troubleshooting common failures. Use when the user asks to interact with a website, fill a form, click something, extract data, take a screenshot, log into a site, test a web app, or automate any browser task.
4
- allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*), Bash(agent-browser-priv:*)
4
+ allowed-tools: Bash(agent-browser:*), Bash(agent-browser-priv:*), Bash(npx agent-browser-priv:*)
5
5
  ---
6
6
 
7
7
  # agent-browser core
8
8
 
9
- Fast browser automation CLI for AI agents. Chrome/Chromium via CDP, no
10
- Playwright or Puppeteer dependency. Accessibility-tree snapshots with compact
11
- `@eN` refs let agents interact with pages in ~200-400 tokens instead of
12
- parsing raw HTML.
9
+ Fast browser automation CLI for AI agents. This fork is distributed as the
10
+ `agent-browser-priv` npm package, but it intentionally installs the
11
+ `agent-browser` command for daily use. Local Chrome-compatible launches use
12
+ Patchright by default; use `--backend chrome` for the built-in Chrome CDP
13
+ launcher when that lane behaves better for a target. Accessibility-tree
14
+ snapshots with compact `@eN` refs let agents interact with pages in ~200-400
15
+ tokens instead of parsing raw HTML.
13
16
 
14
- When `agent-browser-priv` is available, use it only for explicitly requested
15
- privacy/local-runtime work or authorized local development debugging where the
16
- normal browser lane hits local-only bot/challenge friction. The command surface
17
- is the same; opt into Patchright with `agent-browser-priv --backend patchright`.
18
17
  Do not add CAPTCHA solving, Turnstile solving, proxy rotation policy, or
19
18
  production stealth defaults. If a challenge remains, classify it and preserve
20
19
  artifacts for human handoff.
@@ -40,8 +39,8 @@ next ref interaction.
40
39
  ## Quickstart
41
40
 
42
41
  ```bash
43
- # Install once
44
- npm i -g agent-browser && agent-browser install
42
+ # Install once from this fork
43
+ npm i -g agent-browser-priv && agent-browser install
45
44
 
46
45
  # Take a screenshot of a page
47
46
  agent-browser open https://example.com
@@ -343,13 +342,13 @@ agent-browser dialog dismiss # cancel
343
342
  ## Diagnosing install issues
344
343
 
345
344
  If a command fails unexpectedly (`Unknown command`, `Failed to connect`,
346
- stale daemons, version mismatches after `upgrade`, missing Chrome, etc.)
345
+ stale daemons, version mismatches after `upgrade`, missing browser backend, etc.)
347
346
  run `doctor` before anything else:
348
347
 
349
348
  ```bash
350
- agent-browser doctor # full diagnosis (env, Chrome, daemons, config, providers, network, launch test)
349
+ agent-browser doctor # full diagnosis (env, browser backend, daemons, config, providers, network, launch test)
351
350
  agent-browser doctor --offline --quick # fast, local-only
352
- agent-browser doctor --fix # also run destructive repairs (reinstall Chrome, purge old state, ...)
351
+ agent-browser doctor --fix # also run destructive repairs (install browser backends, purge old state, ...)
353
352
  agent-browser doctor --json # structured output for programmatic consumption
354
353
  ```
355
354
 
@@ -419,7 +418,7 @@ and [references/authentication.md](references/authentication.md).
419
418
  --headed # show the window (default is headless)
420
419
  --auto-connect # connect to an already-running Chrome
421
420
  --cdp <port> # connect to a specific CDP port
422
- --backend <name> # agent-browser-priv local backend: chrome, patchright
421
+ --backend <name> # local backend: patchright (default), chrome
423
422
  --profile <name|path> # use a Chrome profile (login state survives)
424
423
  --headers <json> # HTTP headers scoped to the URL's origin
425
424
  --proxy <url> # proxy server