agent-browser 0.27.3 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,6 +62,8 @@ On Linux, install system dependencies:
62
62
  agent-browser install --with-deps
63
63
  ```
64
64
 
65
+ This exits nonzero if the package manager cannot install every required browser library.
66
+
65
67
  ### Updating
66
68
 
67
69
  Upgrade to the latest version:
@@ -90,12 +92,9 @@ agent-browser screenshot page.png
90
92
  agent-browser close
91
93
  ```
92
94
 
93
- Clicks fail early when another element covers the target's click point,
94
- for example a consent banner or modal. Dismiss or interact with the reported
95
- covering element, then take a fresh snapshot before retrying the original ref.
95
+ Clicks fail early when another element covers the target's click point, for example a consent banner or modal. Dismiss or interact with the reported covering element, then take a fresh snapshot before retrying the original ref.
96
96
 
97
- Headless Chromium screenshots hide native scrollbars for consistent image output.
98
- Pass `--hide-scrollbars false` when launching to keep native scrollbars visible.
97
+ Headless Chromium screenshots hide native scrollbars for consistent image output. Pass `--hide-scrollbars false` when launching to keep native scrollbars visible.
99
98
 
100
99
  ### Traditional Selectors (also supported)
101
100
 
@@ -218,9 +217,7 @@ agent-browser wait "#spinner" --state hidden
218
217
 
219
218
  ### Batch Execution
220
219
 
221
- Execute multiple commands in a single invocation. Commands can be passed as
222
- quoted arguments or piped as JSON via stdin. This avoids per-command process
223
- startup overhead when running multi-step workflows.
220
+ Execute multiple commands in a single invocation. Commands can be passed as quoted arguments or piped as JSON via stdin. This avoids per-command process startup overhead when running multi-step workflows.
224
221
 
225
222
  ```bash
226
223
  # Argument mode: each quoted argument is a full command
@@ -314,15 +311,9 @@ agent-browser tab close [t<N>|label] # Close a tab (defaults to active
314
311
  agent-browser window new # New window
315
312
  ```
316
313
 
317
- Tab ids are stable strings of the form `t1`, `t2`, `t3`. They're never reused
318
- within a session, so scripts and agents can keep referring to the same tab
319
- even after other tabs are opened or closed. Positional integers like `tab 2`
320
- are **not** accepted; the `t` prefix disambiguates handles from indices and
321
- mirrors the `@e1` convention used for element refs.
314
+ Tab ids are stable strings of the form `t1`, `t2`, `t3`. They're never reused within a session, so scripts and agents can keep referring to the same tab even after other tabs are opened or closed. Positional integers like `tab 2` are **not** accepted; the `t` prefix disambiguates handles from indices and mirrors the `@e1` convention used for element refs.
322
315
 
323
- You can also assign a memorable label (`docs`, `app`, `admin`) and use it
324
- interchangeably with the id. Labels are never auto-generated and never
325
- rewritten on navigation — they're yours to name and keep:
316
+ You can also assign a memorable label (`docs`, `app`, `admin`) and use it interchangeably with the id. Labels are never auto-generated and never rewritten on navigation — they're yours to name and keep:
326
317
 
327
318
  ```bash
328
319
  agent-browser tab new --label docs https://docs.example.com
@@ -402,10 +393,7 @@ agent-browser pushstate <url> # SPA client-side nav; auto-detects window
402
393
 
403
394
  ### Pre-navigation setup
404
395
 
405
- Some flows (SSR debug, auth cookies for protected origins, init scripts)
406
- need state set up *before* the first navigation. Use `open` with no URL
407
- to launch the browser, then stage cookies / routes / init scripts, then
408
- navigate. `batch` sends it all in one CLI call:
396
+ Some flows (SSR debug, auth cookies for protected origins, init scripts) need state set up *before* the first navigation. Use `open` with no URL to launch the browser, then stage cookies / routes / init scripts, then navigate. `batch` sends it all in one CLI call:
409
397
 
410
398
  ```bash
411
399
  agent-browser batch \
@@ -415,14 +403,11 @@ agent-browser batch \
415
403
  '["navigate","http://localhost:3000/target"]'
416
404
  ```
417
405
 
418
- Without `batch` the same sequence is three commands that all reuse the
419
- same daemon (fast, but not one turn).
406
+ Without `batch` the same sequence is three commands that all reuse the same daemon (fast, but not one turn).
420
407
 
421
408
  ### React / Web Vitals
422
409
 
423
- Agent-browser ships with first-class React introspection and universal Web
424
- Vitals metrics. The React commands need the React DevTools hook installed at
425
- launch; Web Vitals and pushstate are framework-agnostic.
410
+ Agent-browser ships with first-class React introspection and universal Web Vitals metrics. The React commands need the React DevTools hook installed at launch; Web Vitals and pushstate are framework-agnostic.
426
411
 
427
412
  ```bash
428
413
  agent-browser open --enable react-devtools <url> # Launch with React hook installed
@@ -435,15 +420,10 @@ agent-browser react suspense [--only-dynamic] [--json] # Suspense boundaries +
435
420
  agent-browser vitals [url] [--json] # LCP/CLS/TTFB/FCP/INP + hydration summary
436
421
  ```
437
422
 
438
- Each `react ...` subcommand requires `--enable react-devtools` to have been
439
- passed at launch (the React DevTools `installHook.js` is embedded in the
440
- binary). Without it the commands error with `React DevTools hook not installed
423
+ Each `react ...` subcommand requires `--enable react-devtools` to have been passed at launch (the React DevTools `installHook.js` is embedded in the binary). Without it the commands error with `React DevTools hook not installed
441
424
  - relaunch with --enable react-devtools`.
442
425
 
443
- Works on any React app — Next.js, Remix, Vite+React, CRA, TanStack Start,
444
- React Native Web, etc. `vitals` and `pushstate` are framework-agnostic.
445
- `vitals` prints a summary by default; pass `--json` for the full structured
446
- payload.
426
+ Works on any React app — Next.js, Remix, Vite+React, CRA, TanStack Start, React Native Web, etc. `vitals` and `pushstate` are framework-agnostic. `vitals` prints a summary by default; pass `--json` for the full structured payload.
447
427
 
448
428
  ### Init scripts
449
429
 
@@ -463,12 +443,10 @@ agent-browser upgrade # Upgrade agent-browser to the latest vers
463
443
  agent-browser doctor # Diagnose the install and auto-clean stale daemon files
464
444
  agent-browser doctor --fix # Also run destructive repairs (reinstall Chrome, purge old state, ...)
465
445
  agent-browser doctor --offline --quick # Skip network probes and the live launch test
446
+ agent-browser mcp # Start an MCP stdio server
466
447
  ```
467
448
 
468
- `doctor` checks your environment, Chrome install, daemon state, config files,
469
- encryption key, providers, network reachability, and runs a live headless
470
- browser launch test. Stale socket/pid sidecar files are auto-cleaned. Output
471
- is also available as `--json` for agents.
449
+ `doctor` checks your environment, Chrome install, daemon state, config files, encryption key, providers, network reachability, and runs a live headless browser launch test. Stale socket/pid sidecar files are auto-cleaned. Output is also available as `--json` for agents.
472
450
 
473
451
  ### Skills
474
452
 
@@ -483,6 +461,74 @@ agent-browser skills path [name] # Print skill directory path
483
461
 
484
462
  Serves bundled skill content that always matches the installed CLI version. AI agents use this to get current instructions rather than relying on cached copies. Set `AGENT_BROWSER_SKILLS_DIR` to override the skills directory path.
485
463
 
464
+ ### MCP Server
465
+
466
+ ```bash
467
+ agent-browser mcp
468
+ agent-browser mcp --tools all
469
+ agent-browser mcp --tools core,network,react
470
+ ```
471
+
472
+ Starts a Model Context Protocol server over stdio. MCP clients launch this command as a subprocess and exchange newline-delimited JSON-RPC on stdin and stdout. The server defaults to MCP protocol 2025-11-25 and accepts older supported client protocol versions during initialization.
473
+
474
+ The default tools profile is `core`, which keeps MCP context small for everyday browser automation. Use `--tools all` for the full typed CLI parity surface, or combine profiles with commas, such as `--tools core,network,react`.
475
+
476
+ Profiles:
477
+
478
+ - `core` — Default. Navigation, snapshots, interaction, waits, reads, screenshots, JavaScript eval, close, tab basics, and profile discovery
479
+ - `network` — Network routes, request inspection, HAR, headers, credentials, offline
480
+ - `state` — Cookies, storage, auth, saved state, sessions, profiles, skills
481
+ - `debug` — Console/errors, tracing, profiling, recording, clipboard, plugins, doctor, dashboard, install, upgrade, chat, diff, batch, confirm/deny
482
+ - `tabs` — Back/forward/reload, tabs, windows, frames, dialogs
483
+ - `react` — React tree/inspect/renders/suspense, vitals, pushstate
484
+ - `mobile` — Viewport/device/geolocation/media, touch, swipe, mouse, keyboard
485
+ - `all` — Every MCP tool, including the full typed CLI parity surface
486
+
487
+ Common tools include:
488
+
489
+ - `agent_browser_tools_profiles`
490
+ - `agent_browser_open`
491
+ - `agent_browser_snapshot`
492
+ - `agent_browser_click`
493
+ - `agent_browser_fill`
494
+ - `agent_browser_type`
495
+ - `agent_browser_press`
496
+ - `agent_browser_wait_for_selector`
497
+ - `agent_browser_screenshot`
498
+ - `agent_browser_get_url`
499
+ - `agent_browser_eval`
500
+ - `agent_browser_close`
501
+
502
+ Each tool has typed fields such as `url`, `selector`, `text`, `key`, and `session`, so MCP clients show meaningful approval prompts instead of raw command arrays. Each tool also accepts `extraArgs` for advanced CLI flags and exact CLI parity. Tool discovery is paginated and includes read-only/open-world annotations so modern MCP clients can load the large typed surface incrementally.
503
+
504
+ Example MCP client config:
505
+
506
+ ```json
507
+ {
508
+ "mcpServers": {
509
+ "agent-browser": {
510
+ "command": "agent-browser",
511
+ "args": ["mcp"]
512
+ }
513
+ }
514
+ }
515
+ ```
516
+
517
+ Full parity MCP client config:
518
+
519
+ ```json
520
+ {
521
+ "mcpServers": {
522
+ "agent-browser": {
523
+ "command": "agent-browser",
524
+ "args": ["mcp", "--tools", "all"]
525
+ }
526
+ }
527
+ }
528
+ ```
529
+
530
+ Tool invocations use the same config files and environment variables as the CLI. Use `session` in the tool arguments, or set `AGENT_BROWSER_SESSION`, to isolate browser state.
531
+
486
532
  ## Authentication
487
533
 
488
534
  agent-browser provides multiple ways to persist login sessions so you don't re-authenticate every run.
@@ -641,6 +687,7 @@ agent-browser --session-name secure open example.com
641
687
  agent-browser includes security features for safe AI agent deployments. All features are opt-in, and existing workflows are unaffected until you explicitly enable a feature:
642
688
 
643
689
  - **Authentication Vault**: Store credentials locally (always encrypted), reference by name. The LLM never sees passwords. `auth login` navigates with `load` and then waits for login form selectors to appear (SPA-friendly, timeout follows the default action timeout). A key is auto-generated at `~/.agent-browser/.encryption-key` if `AGENT_BROWSER_ENCRYPTION_KEY` is not set: `echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin` then `agent-browser auth login github`
690
+ - **Plugin System**: Extend agent-browser with external executable plugins. Plugins run out-of-process over the `agent-browser.plugin.v1` stdio JSON protocol and declare capabilities such as `credential.read`, `browser.provider`, `launch.mutate`, or `command.run`.
644
691
  - **Content Boundary Markers**: Wrap page output in delimiters so LLMs can distinguish tool output from untrusted content: `--content-boundaries`
645
692
  - **Domain Allowlist**: Restrict navigation to trusted domains (wildcards like `*.example.com` also match the bare domain): `--allowed-domains "example.com,*.example.com"`. Sub-resource requests (scripts, images, fetch) and WebSocket/EventSource connections to non-allowed domains are also blocked. Include any CDN domains your target pages depend on (e.g., `*.cdn.example.com`).
646
693
  - **Action Policy**: Gate destructive actions with a static policy file: `--action-policy ./policy.json`
@@ -655,9 +702,97 @@ agent-browser includes security features for safe AI agent deployments. All feat
655
702
  | `AGENT_BROWSER_ACTION_POLICY` | Path to action policy JSON file |
656
703
  | `AGENT_BROWSER_CONFIRM_ACTIONS` | Action categories requiring confirmation |
657
704
  | `AGENT_BROWSER_CONFIRM_INTERACTIVE` | Enable interactive confirmation prompts |
705
+ | `AGENT_BROWSER_PLUGINS` | JSON plugin registry override |
658
706
 
659
707
  See [Security documentation](https://agent-browser.dev/security) for details.
660
708
 
709
+ ### Plugin System
710
+
711
+ Plugins let third-party tools integrate without becoming built-in agent-browser dependencies. Add a plugin from npm or GitHub:
712
+
713
+ ```bash
714
+ agent-browser plugin add agent-browser-plugin-captcha
715
+ agent-browser plugin add @company/agent-browser-plugin-vault --name vault
716
+ agent-browser plugin add org/agent-browser-plugin-cloud-browser
717
+ ```
718
+
719
+ References are resolved by shape: `name` uses npm, `@scope/name` uses npm, and `owner/repo` uses GitHub. `plugin add` writes `./agent-browser.json` by default; use `--global` for `~/.agent-browser/config.json`.
720
+
721
+ Plugin packages should support `plugin.manifest` so `plugin add` can discover their name and capabilities automatically. If a plugin does not support manifests, pass `--capability <name>` during add.
722
+
723
+ Plugins can also be configured manually in `agent-browser.json`:
724
+
725
+ ```json
726
+ {
727
+ "plugins": [
728
+ {
729
+ "name": "vault",
730
+ "command": "agent-browser-plugin-vault",
731
+ "capabilities": ["credential.read"]
732
+ },
733
+ {
734
+ "name": "cloud-browser",
735
+ "command": "agent-browser-plugin-cloud-browser",
736
+ "capabilities": ["browser.provider"]
737
+ },
738
+ {
739
+ "name": "stealth",
740
+ "command": "agent-browser-plugin-stealth",
741
+ "capabilities": ["launch.mutate"]
742
+ },
743
+ {
744
+ "name": "captcha",
745
+ "command": "agent-browser-plugin-captcha",
746
+ "capabilities": ["command.run", "captcha.solve"]
747
+ }
748
+ ]
749
+ }
750
+ ```
751
+
752
+ Inspect configured plugins:
753
+
754
+ ```bash
755
+ agent-browser plugin list
756
+ agent-browser plugin show vault
757
+ ```
758
+
759
+ Use a credential provider plugin for one login:
760
+
761
+ ```bash
762
+ agent-browser auth login my-app --credential-provider vault --item "My App"
763
+ agent-browser auth login my-app --credential-provider vault --item "My App" --url https://app.example.com/login --username-selector "#email" --password-selector "#password" --submit-selector "button[type=submit]"
764
+ ```
765
+
766
+ Use a browser provider plugin:
767
+
768
+ ```bash
769
+ agent-browser --provider cloud-browser open https://example.com
770
+ ```
771
+
772
+ Use a launch mutator plugin for stealth or local launch customization. The plugin can append Chrome args, extensions, and init scripts before the browser starts:
773
+
774
+ ```bash
775
+ agent-browser open https://example.com
776
+ ```
777
+
778
+ Use a generic plugin command for domain-specific tools such as CAPTCHA solvers:
779
+
780
+ ```bash
781
+ agent-browser plugin run captcha captcha.solve --payload '{"siteKey":"...","url":"https://example.com"}'
782
+ ```
783
+
784
+ The protocol request always includes `protocol`, `type`, `capability`, and `request`. A credential plugin receives `credential.resolve`, a browser provider receives `browser.launch`, a launch mutator receives `launch.mutate`, and generic commands receive the supplied request type. `plugin run` is for `command.run` and custom capabilities; core capabilities and protocol request types use their dedicated command paths. agent-browser keeps browser automation, redaction-sensitive output, and policy enforcement in core.
785
+
786
+ Gate plugin access by capability action:
787
+
788
+ ```bash
789
+ agent-browser --confirm-actions plugin:vault:credential.read auth login my-app --credential-provider vault --item "My App"
790
+ agent-browser --confirm-actions plugin:cloud-browser:browser.provider --provider cloud-browser open https://example.com
791
+ agent-browser --confirm-actions plugin:stealth:launch.mutate open https://example.com
792
+ ```
793
+
794
+ Do not put vault tokens or passwords in plugin command args. Use the vault vendor's own login/session mechanism or environment outside agent-browser config.
795
+
661
796
  ## Snapshot Options
662
797
 
663
798
  The `snapshot` command supports filtering to reduce output size:
@@ -723,7 +858,7 @@ This is useful for multimodal AI models that can reason about visual layout, unl
723
858
  | `--ignore-https-errors` | Ignore HTTPS certificate errors (useful for self-signed certs) |
724
859
  | `--allow-file-access` | Allow file:// URLs to access local files (Chromium only) |
725
860
  | `--hide-scrollbars <bool>` | Hide native scrollbars in headless Chromium screenshots, enabled by default (or `AGENT_BROWSER_HIDE_SCROLLBARS` env) |
726
- | `-p, --provider <name>` | Cloud browser provider (or `AGENT_BROWSER_PROVIDER` env) |
861
+ | `-p, --provider <name>` | Browser provider, including configured `browser.provider` plugins (or `AGENT_BROWSER_PROVIDER` env) |
727
862
  | `--device <name>` | iOS device name, e.g. "iPhone 15 Pro" (or `AGENT_BROWSER_IOS_DEVICE` env) |
728
863
  | `--json` | JSON output (for agents) |
729
864
  | `--annotate` | Annotated screenshot with numbered element labels (or `AGENT_BROWSER_ANNOTATE` env) |
@@ -820,7 +955,14 @@ Create an `agent-browser.json` file to set persistent defaults instead of repeat
820
955
  "profile": "./browser-data",
821
956
  "userAgent": "my-agent/1.0",
822
957
  "hideScrollbars": false,
823
- "ignoreHttpsErrors": true
958
+ "ignoreHttpsErrors": true,
959
+ "plugins": [
960
+ {
961
+ "name": "vault",
962
+ "command": "agent-browser-plugin-vault",
963
+ "capabilities": ["credential.read"]
964
+ }
965
+ ]
824
966
  }
825
967
  ```
826
968
 
@@ -831,7 +973,7 @@ agent-browser --config ./ci-config.json open example.com
831
973
  AGENT_BROWSER_CONFIG=./ci-config.json agent-browser open example.com
832
974
  ```
833
975
 
834
- All options from the table above can be set in the config file using camelCase keys (e.g., `--executable-path` becomes `"executablePath"`, `--proxy-bypass` becomes `"proxyBypass"`). Unknown keys are ignored for forward compatibility.
976
+ All options from the table above can be set in the config file using camelCase keys (e.g., `--executable-path` becomes `"executablePath"`, `--proxy-bypass` becomes `"proxyBypass"`). Plugins are configured with the `"plugins"` array shown above. Unknown keys are ignored for forward compatibility.
835
977
 
836
978
  A [JSON Schema](agent-browser.schema.json) is available for IDE autocomplete and validation. Add a `$schema` key to your config file to enable it:
837
979
 
@@ -887,9 +1029,7 @@ agent-browser get text @e1 # Get heading text
887
1029
  agent-browser hover @e4 # Hover the link
888
1030
  ```
889
1031
 
890
- When a ref click is blocked by an overlay, the error includes the covering
891
- element, such as `covered by <div#consent-banner>`. Click the banner or dialog
892
- control first, then run `snapshot` again before reusing refs.
1032
+ When a ref click is blocked by an overlay, the error includes the covering element, such as `covered by <div#consent-banner>`. Click the banner or dialog control first, then run `snapshot` again before reusing refs.
893
1033
 
894
1034
  **Why use refs?**
895
1035
 
@@ -1035,15 +1175,15 @@ AGENT_BROWSER_EXECUTABLE_PATH=/path/to/chromium agent-browser open example.com
1035
1175
  Run agent-browser + Chrome in an ephemeral Vercel Sandbox microVM. No external server needed:
1036
1176
 
1037
1177
  ```typescript
1038
- import { Sandbox } from "@vercel/sandbox";
1178
+ import { runAgentBrowserCommand, withAgentBrowserSandbox } from "@agent-browser/sandbox/vercel";
1039
1179
 
1040
- const sandbox = await Sandbox.create({ runtime: "node24" });
1041
- await sandbox.runCommand("agent-browser", ["open", "https://example.com"]);
1042
- const result = await sandbox.runCommand("agent-browser", ["screenshot", "--json"]);
1043
- await sandbox.stop();
1180
+ const result = await withAgentBrowserSandbox(async (sandbox) => {
1181
+ await runAgentBrowserCommand(sandbox, ["open", "https://example.com"]);
1182
+ return runAgentBrowserCommand(sandbox, ["screenshot"]);
1183
+ });
1044
1184
  ```
1045
1185
 
1046
- See the [environments example](examples/environments/) for a working demo with a UI and deploy-to-Vercel button.
1186
+ Install `@agent-browser/sandbox` and `@vercel/sandbox` in the consuming app. See the [sandbox helper example](examples/sandbox/) for minimal Eve and Vercel Sandbox usage, or the [environments example](examples/environments/) for a full UI demo with a deploy-to-Vercel button.
1047
1187
 
1048
1188
  ### Serverless (AWS Lambda)
1049
1189
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "agent-browser",
3
- "version": "0.27.3",
3
+ "version": "0.29.0",
4
4
  "description": "Browser automation CLI for AI agents",
5
5
  "type": "module",
6
- "packageManager": "pnpm@11.1.3",
7
6
  "engines": {
8
7
  "node": ">=24.0.0",
9
8
  "pnpm": ">=11.0.0"
@@ -17,19 +16,6 @@
17
16
  "bin": {
18
17
  "agent-browser": "./bin/agent-browser.js"
19
18
  },
20
- "scripts": {
21
- "version:sync": "node scripts/sync-version.js",
22
- "version": "npm run version:sync && git add cli/Cargo.toml",
23
- "build:native": "npm run version:sync && cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js",
24
- "build:linux": "npm run version:sync && docker compose -f docker/docker-compose.yml run --rm build-linux",
25
- "build:macos": "npm run version:sync && (cargo build --release --manifest-path cli/Cargo.toml --target aarch64-apple-darwin & cargo build --release --manifest-path cli/Cargo.toml --target x86_64-apple-darwin & wait) && cp cli/target/aarch64-apple-darwin/release/agent-browser bin/agent-browser-darwin-arm64 && cp cli/target/x86_64-apple-darwin/release/agent-browser bin/agent-browser-darwin-x64",
26
- "build:windows": "npm run version:sync && docker compose -f docker/docker-compose.yml run --rm build-windows",
27
- "build:all-platforms": "npm run version:sync && (npm run build:linux & npm run build:windows & wait) && npm run build:macos",
28
- "build:docker": "docker build --platform linux/amd64 -t agent-browser-builder -f docker/Dockerfile.build .",
29
- "release": "npm run version:sync && npm run build:all-platforms && npm publish",
30
- "postinstall": "node scripts/postinstall.js",
31
- "build:dashboard": "cd packages/dashboard && pnpm build"
32
- },
33
19
  "keywords": [
34
20
  "browser",
35
21
  "automation",
@@ -48,5 +34,18 @@
48
34
  "url": "https://github.com/vercel-labs/agent-browser/issues"
49
35
  },
50
36
  "homepage": "https://agent-browser.dev",
51
- "devDependencies": {}
52
- }
37
+ "devDependencies": {},
38
+ "scripts": {
39
+ "version:sync": "node scripts/sync-version.js",
40
+ "version": "npm run version:sync && git add cli/Cargo.toml",
41
+ "build:native": "npm run version:sync && cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js",
42
+ "build:linux": "npm run version:sync && docker compose -f docker/docker-compose.yml run --rm build-linux",
43
+ "build:macos": "npm run version:sync && (cargo build --release --manifest-path cli/Cargo.toml --target aarch64-apple-darwin & cargo build --release --manifest-path cli/Cargo.toml --target x86_64-apple-darwin & wait) && cp cli/target/aarch64-apple-darwin/release/agent-browser bin/agent-browser-darwin-arm64 && cp cli/target/x86_64-apple-darwin/release/agent-browser bin/agent-browser-darwin-x64",
44
+ "build:windows": "npm run version:sync && docker compose -f docker/docker-compose.yml run --rm build-windows",
45
+ "build:all-platforms": "npm run version:sync && (npm run build:linux & npm run build:windows & wait) && npm run build:macos",
46
+ "build:docker": "docker build --platform linux/amd64 -t agent-browser-builder -f docker/Dockerfile.build .",
47
+ "release": "npm run version:sync && npm run build:all-platforms && npm publish",
48
+ "postinstall": "node scripts/postinstall.js",
49
+ "build:dashboard": "cd packages/dashboard && pnpm build"
50
+ }
51
+ }
File without changes
@@ -31,6 +31,19 @@ const cargoVersion = cargoVersionMatch[1];
31
31
  const dashboardPkg = JSON.parse(readFileSync(join(rootDir, 'packages/dashboard/package.json'), 'utf-8'));
32
32
  const dashboardVersion = dashboardPkg.version;
33
33
 
34
+ // Read sandbox package versions
35
+ const sandboxPkg = JSON.parse(readFileSync(join(rootDir, 'packages/@agent-browser/sandbox/package.json'), 'utf-8'));
36
+ const sandboxVersion = sandboxPkg.version;
37
+ const sandboxVersionSource = readFileSync(join(rootDir, 'packages/@agent-browser/sandbox/src/version.ts'), 'utf-8');
38
+ const sandboxVersionMatch = sandboxVersionSource.match(/AGENT_BROWSER_SANDBOX_VERSION\s*=\s*"([^"]*)"/);
39
+
40
+ if (!sandboxVersionMatch) {
41
+ console.error('Could not find AGENT_BROWSER_SANDBOX_VERSION in packages/@agent-browser/sandbox/src/version.ts');
42
+ process.exit(1);
43
+ }
44
+
45
+ const sandboxRuntimeVersion = sandboxVersionMatch[1];
46
+
34
47
  const mismatches = [];
35
48
  if (packageVersion !== cargoVersion) {
36
49
  mismatches.push(` cli/Cargo.toml: ${cargoVersion}`);
@@ -38,6 +51,12 @@ if (packageVersion !== cargoVersion) {
38
51
  if (packageVersion !== dashboardVersion) {
39
52
  mismatches.push(` packages/dashboard: ${dashboardVersion}`);
40
53
  }
54
+ if (packageVersion !== sandboxVersion) {
55
+ mismatches.push(` packages/@agent-browser/sandbox/package.json: ${sandboxVersion}`);
56
+ }
57
+ if (packageVersion !== sandboxRuntimeVersion) {
58
+ mismatches.push(` packages/@agent-browser/sandbox/src/version.ts: ${sandboxRuntimeVersion}`);
59
+ }
41
60
 
42
61
  if (mismatches.length > 0) {
43
62
  console.error('Version mismatch detected!');
@@ -56,6 +56,36 @@ if (dashboardPkg.version !== version) {
56
56
  console.log(` packages/dashboard/package.json already up to date`);
57
57
  }
58
58
 
59
+ // Update packages/@agent-browser/sandbox/package.json
60
+ const sandboxPkgPath = join(rootDir, "packages", "@agent-browser", "sandbox", "package.json");
61
+ const sandboxPkg = JSON.parse(readFileSync(sandboxPkgPath, "utf-8"));
62
+ if (sandboxPkg.version !== version) {
63
+ const oldVersion = sandboxPkg.version;
64
+ sandboxPkg.version = version;
65
+ writeFileSync(sandboxPkgPath, JSON.stringify(sandboxPkg, null, 2) + "\n");
66
+ console.log(` Updated packages/@agent-browser/sandbox/package.json: ${oldVersion} -> ${version}`);
67
+ } else {
68
+ console.log(` packages/@agent-browser/sandbox/package.json already up to date`);
69
+ }
70
+
71
+ // Update package runtime version constant
72
+ const sandboxVersionPath = join(
73
+ rootDir,
74
+ "packages",
75
+ "@agent-browser",
76
+ "sandbox",
77
+ "src",
78
+ "version.ts",
79
+ );
80
+ const sandboxVersionSource = `export const AGENT_BROWSER_SANDBOX_VERSION = "${version}";\n`;
81
+ const currentSandboxVersionSource = readFileSync(sandboxVersionPath, "utf-8");
82
+ if (currentSandboxVersionSource !== sandboxVersionSource) {
83
+ writeFileSync(sandboxVersionPath, sandboxVersionSource);
84
+ console.log(` Updated packages/@agent-browser/sandbox/src/version.ts -> ${version}`);
85
+ } else {
86
+ console.log(` packages/@agent-browser/sandbox/src/version.ts already up to date`);
87
+ }
88
+
59
89
  // Update Cargo.lock to match Cargo.toml
60
90
  if (cargoTomlUpdated) {
61
91
  try {
File without changes
File without changes
File without changes
File without changes
File without changes