From c6de80b95e48b2a9b6f48966c38a748133e407ae Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Tue, 17 Mar 2026 13:38:54 -0500 Subject: [PATCH] prepare v0.21 (#886) --- .changeset/feat-batch-command.md | 5 --- .changeset/fix-pid-namespace.md | 5 --- .changeset/prepare-v0.21.md | 21 +++++++++++ README.md | 2 +- cli/src/output.rs | 1 - docs/src/app/cdp-mode/page.mdx | 2 +- docs/src/app/changelog/page.mdx | 52 ++++++++++++++++++++++++++++ docs/src/app/commands/page.mdx | 27 ++++++++++++++- docs/src/app/engines/chrome/page.mdx | 2 +- skills/agent-browser/SKILL.md | 20 +++++++++++ 10 files changed, 122 insertions(+), 15 deletions(-) delete mode 100644 .changeset/feat-batch-command.md delete mode 100644 .changeset/fix-pid-namespace.md create mode 100644 .changeset/prepare-v0.21.md diff --git a/.changeset/feat-batch-command.md b/.changeset/feat-batch-command.md deleted file mode 100644 index 3e29d33..0000000 --- a/.changeset/feat-batch-command.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"agent-browser": minor ---- - -Add `batch` command for executing multiple commands from stdin in a single invocation. Accepts a JSON array of string arrays and returns results sequentially. Supports `--bail` to stop on first error and `--json` for structured output. diff --git a/.changeset/fix-pid-namespace.md b/.changeset/fix-pid-namespace.md deleted file mode 100644 index 2cb5576..0000000 --- a/.changeset/fix-pid-namespace.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"agent-browser": patch ---- - -Fix daemon detection for PID namespace isolation (e.g. `unshare`). Use socket connectivity as the sole liveness check instead of `kill(pid, 0)`, which fails when the caller cannot see the daemon's PID. diff --git a/.changeset/prepare-v0.21.md b/.changeset/prepare-v0.21.md new file mode 100644 index 0000000..1be8eff --- /dev/null +++ b/.changeset/prepare-v0.21.md @@ -0,0 +1,21 @@ +--- +"agent-browser": minor +--- + +### New Features + +- **`batch` command** -- Execute multiple commands from stdin in a single invocation. Accepts a JSON array of string arrays and returns results sequentially. Supports `--bail` to stop on first error and `--json` for structured output (#865) +- **iframe support** -- CLI interactions and snapshots now traverse into iframe content, enabling automation of cross-frame pages (#869) +- **`network har start/stop` command** -- Capture and export network traffic in HAR 1.2 format (#874) +- **WebSocket fallback for CDP discovery** -- When HTTP-based CDP endpoint discovery fails, the CLI now falls back to a WebSocket connection automatically (#873) + +### Improvements + +- **`--full`/`-f` refactored to command-level flag** -- Moved from a global flag to a per-command flag for clearer scoping (#877) +- **Enhanced Chrome launch** -- Added `--user-data-dir` support and configurable launch timeout for more reliable browser startup (#852) + +### Bug Fixes + +- Fixed `/json/list` fallback when `/json/version` endpoint is unavailable, improving compatibility with non-standard CDP implementations (#861) +- Fixed daemon liveness detection for PID namespace isolation (e.g. `unshare`). Uses socket connectivity as the sole liveness check instead of `kill(pid, 0)`, which fails when the caller cannot see the daemon's PID (#879) +- Fixed Ubuntu dependency install accidentally removing system packages (#884) diff --git a/README.md b/README.md index 47293a7..b419bb8 100644 --- a/README.md +++ b/README.md @@ -560,7 +560,6 @@ This is useful for multimodal AI models that can reason about visual layout, unl | `-p, --provider ` | Cloud browser provider (or `AGENT_BROWSER_PROVIDER` env) | | `--device ` | iOS device name, e.g. "iPhone 15 Pro" (or `AGENT_BROWSER_IOS_DEVICE` env) | | `--json` | JSON output (for agents) | -| `--full, -f` | Full page screenshot | | `--annotate` | Annotated screenshot with numbered element labels (or `AGENT_BROWSER_ANNOTATE` env) | | `--screenshot-dir ` | Default screenshot output directory (or `AGENT_BROWSER_SCREENSHOT_DIR` env) | | `--screenshot-quality ` | JPEG quality 0-100 (or `AGENT_BROWSER_SCREENSHOT_QUALITY` env) | @@ -898,6 +897,7 @@ Auto-connect discovers Chrome by: 1. Reading Chrome's `DevToolsActivePort` file from the default user data directory 2. Falling back to probing common debugging ports (9222, 9229) +3. If HTTP-based discovery (`/json/version`, `/json/list`) fails, falling back to a direct WebSocket connection This is useful when: diff --git a/cli/src/output.rs b/cli/src/output.rs index d32637a..b0f948a 100644 --- a/cli/src/output.rs +++ b/cli/src/output.rs @@ -2606,7 +2606,6 @@ Options: -p, --provider Browser provider: ios, browserbase, kernel, browseruse, browserless --device iOS device name (e.g., "iPhone 15 Pro") --json JSON output - --full, -f Full page screenshot --annotate Annotated screenshot with numbered labels and legend --screenshot-dir Default screenshot output directory (or AGENT_BROWSER_SCREENSHOT_DIR) --screenshot-quality JPEG quality 0-100; ignored for PNG (or AGENT_BROWSER_SCREENSHOT_QUALITY) diff --git a/docs/src/app/cdp-mode/page.mdx b/docs/src/app/cdp-mode/page.mdx index 065b84e..6a1b314 100644 --- a/docs/src/app/cdp-mode/page.mdx +++ b/docs/src/app/cdp-mode/page.mdx @@ -53,6 +53,7 @@ Auto-connect discovers Chrome by: 1. Reading Chrome's `DevToolsActivePort` file from the default user data directory 2. Falling back to probing common debugging ports (9222, 9229) +3. If HTTP-based discovery (`/json/version`, `/json/list`) fails, falling back to a direct WebSocket connection This is useful when: @@ -102,7 +103,6 @@ This enables control of: --proxy <url>Proxy server URL --proxy-bypass <hosts>Hosts to bypass proxy --jsonJSON output for scripts - --full, -fFull page screenshot --name, -nLocator name filter --exactExact text match --headedShow browser window diff --git a/docs/src/app/changelog/page.mdx b/docs/src/app/changelog/page.mdx index 013f1c2..195c83c 100644 --- a/docs/src/app/changelog/page.mdx +++ b/docs/src/app/changelog/page.mdx @@ -4,6 +4,58 @@ export const metadata = pageMetadata("changelog") # Changelog +## v0.21.0 + +

March 2026

+ +### New Commands + +- **`batch`** -- Execute multiple commands in a single invocation. Pipe a JSON array of string arrays to stdin and receive results sequentially. Supports `--bail` to stop on first error and `--json` for structured output. + +```bash +echo '[["open","example.com"],["snapshot"]]' | agent-browser batch --json +``` + +- **`network har start/stop`** -- Capture and export network traffic in HAR 1.2 format. + +```bash +agent-browser network har start +# ... interact with the page ... +agent-browser network har stop ./trace.har +``` + +### New Features + +- **iframe support** -- CLI interactions and snapshots now traverse into iframe content, enabling automation of cross-frame pages. +- **`--idle-timeout` flag** -- Automatically shut down the daemon after a period of inactivity. Accepts human-friendly formats such as `10s`, `3m`, `1h`, or raw milliseconds. Also available as `AGENT_BROWSER_IDLE_TIMEOUT_MS`. +- **Cursor-interactive elements in snapshots** -- Cursor-interactive elements are now embedded directly into the snapshot tree for richer context. +- **Brave Browser auto-connect** -- Auto-discovery of Brave Browser for CDP connections on macOS, Linux, and Windows. +- **linux-musl (Alpine) builds** -- Pre-built binaries for linux-musl targeting both x64 and arm64, enabling native support for Alpine Linux and other musl-based distributions. +- **WebSocket fallback for CDP discovery** -- When HTTP-based CDP endpoint discovery fails, the CLI now falls back to a WebSocket connection automatically. + +### Improvements + +- **`--full`/`-f` refactored to command-level flag** -- Moved from a global flag to a per-command flag for clearer scoping. +- **Enhanced Chrome launch** -- Added `--user-data-dir` support and configurable launch timeout for more reliable browser startup. Chrome now retries launching up to 3 times on transient startup failures. +- **Consecutive `--auto-connect` commands** -- Multiple consecutive auto-connect commands no longer require a full browser relaunch; external connections are correctly identified and reused. +- **Batched CDP calls** -- `snapshot -C` and `screenshot --annotate` now batch CDP calls instead of issuing sequential round-trips per element, preventing timeouts on high-latency WSS connections. + +### Bug Fixes + +- Fixed remote CDP (WSS) snapshot and screenshot hangs by removing WebSocket message/frame size limits +- Fixed Material Design `check`/`uncheck` falling back to JS `.click()` for overlay-based controls +- Fixed punctuation characters being dropped in the `type` command +- Fixed WebSocket streaming by keeping the StreamServer instance alive +- Filtered internal Chrome targets (`chrome://`, `devtools://`) from auto-connect discovery +- Fixed `snapshot --selector` scoping to the matched element's subtree +- Fixed network idle detection returning prematurely for cached pages +- Fixed daemon panic on broken stderr pipe during Chrome launch +- Fixed broadcast channel lag being treated as stream closure +- Fixed daemon liveness detection for PID namespace isolation (e.g. `unshare`) +- Fixed Ubuntu dependency install accidentally removing system packages + +--- + ## v0.20.0

March 2026

diff --git a/docs/src/app/commands/page.mdx b/docs/src/app/commands/page.mdx index 985aa98..a5c350f 100644 --- a/docs/src/app/commands/page.mdx +++ b/docs/src/app/commands/page.mdx @@ -333,7 +333,6 @@ agent-browser reload # Reload page -p, --provider # Browser provider (ios, browserbase, kernel, browseruse, browserless) --device # iOS device name (e.g., "iPhone 15 Pro") --json # JSON output (for scripts) ---full, -f # Full page screenshot --annotate # Annotated screenshot with numbered element labels --screenshot-dir # Default screenshot output directory (or AGENT_BROWSER_SCREENSHOT_DIR) --screenshot-quality # JPEG quality 0-100 (or AGENT_BROWSER_SCREENSHOT_QUALITY) @@ -353,6 +352,32 @@ agent-browser reload # Reload page --debug # Debug output ``` +## Batch execution + +Execute multiple commands in a single invocation by piping a JSON array of string arrays to `batch`: + +```bash +echo '[ + ["open", "https://example.com"], + ["snapshot", "-i"], + ["click", "@e1"], + ["screenshot", "result.png"] +]' | agent-browser batch --json + +# Stop on first error +agent-browser batch --bail < commands.json +``` + + + + + + + + + +
OptionDescription
--bailStop on first error (default: continue all commands)
--jsonOutput results as a JSON array
+ ## Command chaining Chain commands with `&&` in a single shell invocation. The browser persists via a background daemon, so chaining works naturally and is more efficient than separate calls: diff --git a/docs/src/app/engines/chrome/page.mdx b/docs/src/app/engines/chrome/page.mdx index 7b4071d..517f126 100644 --- a/docs/src/app/engines/chrome/page.mdx +++ b/docs/src/app/engines/chrome/page.mdx @@ -86,7 +86,7 @@ These features are available only with Chrome: Browser extensions--extension <path> - Persistent profiles--profile <path> + Persistent profiles--profile <path> (sets Chrome's --user-data-dir) Storage state--state <path> File URL access--allow-file-access Headed mode--headed diff --git a/skills/agent-browser/SKILL.md b/skills/agent-browser/SKILL.md index 2b4b304..0a11d8a 100644 --- a/skills/agent-browser/SKILL.md +++ b/skills/agent-browser/SKILL.md @@ -181,6 +181,24 @@ agent-browser diff url --wait-until networkidle # Custom wait str agent-browser diff url --selector "#main" # Scope to element ``` +## Batch Execution + +Execute multiple commands in a single invocation by piping a JSON array of string arrays to `batch`. This avoids per-command process startup overhead when running multi-step workflows. + +```bash +echo '[ + ["open", "https://example.com"], + ["snapshot", "-i"], + ["click", "@e1"], + ["screenshot", "result.png"] +]' | agent-browser batch --json + +# Stop on first error +agent-browser batch --bail < commands.json +``` + +Use `batch` when you have a known sequence of commands that don't depend on intermediate output. Use separate commands or `&&` chaining when you need to parse output between steps (e.g., snapshot to discover refs, then interact). + ## Common Patterns ### Form Submission @@ -311,6 +329,8 @@ agent-browser --auto-connect snapshot agent-browser --cdp 9222 snapshot ``` +Auto-connect discovers Chrome via `DevToolsActivePort`, common debugging ports (9222, 9229), and falls back to a direct WebSocket connection if HTTP-based CDP discovery fails. + ### Color Scheme (Dark Mode) ```bash