* fix(install): link global bin entry relatively
Volta installs into a staging directory and renames it afterwards, which left the absolute bin symlink dangling. A relative link survives the rename.
* fix(install): keep failed downloads out of bin/
The fallback download created the binary before checking the HTTP status, so a 404 left a 0-byte executable that the launcher then ran (ENOEXEC). Download to a temp file, rename on success, remove on failure, follow 301/302/307/308, and skip empty candidates when locating the binary.
Co-Authored-By: Lykin <293371022+xunguangzlj-cloud@users.noreply.github.com>
Co-Authored-By: hassnalalshaikh <51247426+hassnalalshaikh@users.noreply.github.com>
* fixup! fix(install): keep failed downloads out of bin/
* fix(install): name empty binaries in the launcher error and bound postinstall tests
---------
Co-authored-by: Lykin <293371022+xunguangzlj-cloud@users.noreply.github.com>
Co-authored-by: hassnalalshaikh <51247426+hassnalalshaikh@users.noreply.github.com>
* Ship native binaries as per-platform packages
- Publish each platform binary as an @agent-browser/cli-* optional dependency, so installs download only the host's binary
- Link the global command to the native binary on first run when install scripts are blocked (npm 12, pnpm, bun), and in postinstall when they run
- Release and CI publish the platform packages and test global installs with scripts blocked and allowed
* fix: link the native binary on pnpm 12 and keep skills resolvable
Three fixes on top of the per-platform packaging work.
relinkPnpmShim compared the shim's cmd-shim-target marker to argv[1] with
string equality. On pnpm 12 the marker keeps the ./ from the package's
"./bin/agent-browser.js" and argv[1] does not, so the shim was never
rewritten and every command still started Node. It now compares resolved
paths, which also covers the pnpm 10 and 11 spellings.
The launcher spawned the binary straight out of the platform package.
npm hoists that package beside agent-browser, so skills.rs, chat.rs and
upgrade.rs, which resolve their files by walking up from the executable,
found nothing. It now materializes into agent-browser/bin first and runs
from there.
postinstall only linked when npm_config_global was set, which only npm
does, so pnpm, yarn and bun never linked at install time. It now asks the
invoking manager for its global bin directory and also considers the
enclosing node_modules/.bin, which Yarn Classic links through. The probe
is skipped for local installs so they do not pay a subprocess.
The Windows shims are rewritten in a format npm's read-cmd-shim can parse,
each file's own target is checked before it is replaced, and replacement
is staged then renamed so a failure leaves the working launcher in place.
Verified with real global installs on macOS and Linux: npm with scripts
allowed and blocked, pnpm 11 and 12, and bun. Yarn could not be verified
locally because it fails when an optionalDependency is unresolvable and
the platform packages are unpublished. Windows is unverified.
* fix(pnpm): link the shim to the binary in the package bin
The pnpm branch wrote the platform package's own path into the shim, so
once that package resolved, the binary ran from a directory with no
skills/ above it. It now links the same materialized path the symlink and
Windows branches already use.
---------
Co-authored-by: Lahfir <70215676+lahfir@users.noreply.github.com>
* Prepare v0.32.0 release
- Bump agent-browser, Cargo, dashboard, sandbox, and Eve package versions to 0.32.0
- Add v0.32.0 changelog entries for the Eve extension, domain allowlist hardening, and completed-page wait fixes
- Keep Eve linked to the local sandbox workspace package while preserving publish-time semver output
* Fix Eve package CI prepare
Build the local sandbox package before Eve prepare/test so clean CI installs can resolve @agent-browser/sandbox.
* Add Eve browser extension
- Add @agent-browser/eve with namespaced browser tools, configuration, and tests.
- Move the Eve example out of sandbox helpers and document extension usage.
- Improve snapshot selector errors and sync/version workspace handling.
* Ship Eve extension release path
- Publish @agent-browser/eve through the trusted npm release workflow
- Add Eve package CI, version sync, docs, and skill discovery
- Harden Eve waits and sandbox command deadlines
* Add agent-browser sandbox package
- Add @agent-browser/sandbox with shared, Eve, and Vercel Sandbox helpers.
- Wire workspace and version sync so the package stays aligned with agent-browser releases.
- Add sandbox examples and update docs/skills to use the new helper API.
* Fix sandbox package release path
* Fix sandbox package release flow
* Fix sandbox helper cleanup and dependency validation
* Add Eve sandbox example
Windows ARM64 does not have a native build in CI. Previously, the
postinstall script tried to download gent-browser-win32-arm64.exe
which does not exist in GitHub releases, resulting in a 0kb install.
Fall back to the x64 binary on Windows ARM64, which runs via the OS
built-in x64 emulation. This matches the behavior of the existing
ixWindowsShims() function and unifies the arch detection logic.
Fixes#1256
* windows debugging
* fixes
* fixes
* fix: handle Windows path separators in Chrome zip extraction
The zip crate's enclosed_name() normalizes paths to use backslashes on
Windows, but extract_zip used split_once('/') which only matches forward
slashes. This caused Chrome to be extracted into a nested chrome-win64/
subdirectory instead of directly into the version directory.
Also adds debug diagnostics to find_installed_chrome() (gated behind
AGENT_BROWSER_DEBUG) and better error messages when Chrome cache exists
but no binary is found.
Fixes#1076
* feat: add Puppeteer browser cache as Chrome fallback
Search ~/.cache/puppeteer/chrome/ (or PUPPETEER_CACHE_DIR) for Chrome
binaries before falling back to Playwright's cache. Puppeteer v19+
stores Chrome for Testing in this location, so users with an existing
Puppeteer install can use agent-browser without a separate install step.
* fmt
* Improve upgrade command installation method detection robustness
The upgrade command was failing to detect installation method for users who installed via pnpm, yarn, or bun, showing "Could not detect installation method" errors.
## Changes Made
- **Added support for additional package managers**: Extended detection to include pnpm, yarn, and bun alongside existing npm, Homebrew, and Cargo support
- **Implemented install-time marker system**: Modified `postinstall.js` to write a `.install-method` marker file during installation, providing reliable detection that doesn't depend on fragile path heuristics
- **Enhanced path-based fallback detection**: Improved executable path analysis to better identify installation locations for all supported package managers
- **Added command probing**: Implemented fallback checks that query package managers directly to verify global installations
The detection now follows this robust hierarchy:
1. Read install-time marker file (most reliable)
2. Analyze executable path patterns
3. Probe package managers via subprocess calls
This ensures users can successfully upgrade regardless of their chosen package manager.
Fixes#954
* Add .install-method to .gitignore and note Yarn v2+ limitation
- Prevent bin/.install-method marker file from being accidentally
committed during development
- Add comment clarifying that yarn global upgrade path only works
with Yarn Classic (v1), not Yarn Berry (v2+)
---------
Co-authored-by: ctate <366502+ctate@users.noreply.github.com>
* Improve postinstall message to detect existing Chrome installations
Previously, the npm postinstall script always recommended running `agent-browser install` to download Chrome for Testing, even when users already had a working Chrome installation on their system.
This change adds Chrome detection logic to the postinstall script that mirrors the runtime behavior:
- Checks for system Chrome installations on macOS, Linux, and Windows
- Shows a success message when Chrome is found, indicating it will be used automatically
- Only shows the `agent-browser install` warning when no Chrome is detected
- Provides platform-specific guidance (Linux `--with-deps` flag, `--executable-path` alternative)
The detection logic matches the existing Rust `find_chrome()` implementation to ensure consistency between postinstall messaging and runtime behavior.
Fixes#814
* Mention --cdp, --provider, --engine as alternatives in postinstall message
---------
Co-authored-by: ctate <366502+ctate@users.noreply.github.com>
* feat: add linux-musl (Alpine) builds for x64 and arm64
Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets to
the release workflow using cargo-zigbuild. Update the JS wrapper and
postinstall script to detect musl libc and select the correct binary.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: simplify isMusl() and add musl targets to build script
Address PR #784 review feedback:
- Remove redundant first try block in isMusl() (ldd --version always
throws on musl, so only the `|| true` variant works)
- Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets
to build-all-platforms.sh to stay in sync with the release workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(windows): resolve daemon startup failures and Git Bash compatibility
Three root causes behind 27 open Windows issues:
1. Path::canonicalize() returns \\?\ prefixed paths on Windows that
Node.js cannot parse, preventing daemon startup. Strip the prefix
before passing to Node. (fixes#522, #390, #56, #25, #37, #89)
2. Git Bash/MSYS2 translates Unix-style paths and resolves node to
a shell wrapper script. Use node.exe explicitly and set
MSYS_NO_PATHCONV/MSYS2_ARG_CONV_EXCL to prevent argument mangling.
(fixes#148, #108, #171)
3. postinstall fixWindowsShims() hardcoded x64 arch and did not verify
the native binary exists before rewriting shims. Now detects arch
dynamically and validates the binary path. (fixes#262)
Also:
- Error messages now show TCP port on Windows instead of Unix socket path
- Windows CI expanded to test full daemon lifecycle (open, snapshot, close)
* fix(windows): strip \\?\ prefix in auth-cli path (fixes#579)
Same canonicalize() issue as the daemon spawn path, but in
run_auth_cli() which passes the script path to Node.js.
Update sync-version.js to also run `cargo update -p agent-browser` after
updating Cargo.toml, keeping Cargo.lock in sync. Also update pre-commit
hook to stage Cargo.lock along with Cargo.toml.
This commit also brings Cargo.lock up to date (was stuck at 0.7.6).
Add automated verification that package.json and cli/Cargo.toml versions
stay in sync. This prevents version drift between the npm package and
Rust CLI binary.
- Add CI job to check version sync on push/PR
- Update pre-commit hook to sync versions automatically
- Update ci:version script to include version sync step
- Add check-version-sync.js script for CI validation
* test: add Windows npm global install CI test (reproduces #262)
This test packs the package and installs it globally with npm,
then runs agent-browser --version. This reproduces the issue where
npm-generated shims on Windows try to invoke /bin/sh which doesn't exist.
The bin/agent-browser.js wrapper is added but not yet wired up,
so this commit should fail CI to confirm the issue.
* fix: Windows npm global install and npx support
The shell script wrapper (bin/agent-browser) with #!/bin/sh shebang
causes npm to generate Windows shims that try to invoke /bin/sh,
which doesn't exist on Windows.
This fix uses a hybrid approach:
1. Node.js wrapper (bin/agent-browser.js) as bin entry
- Makes npx work on all platforms
- ~100ms overhead (acceptable since npx has its own overhead)
2. postinstall patches bin entries for global installs
- Windows: Overwrites .cmd/.ps1 shims to invoke .exe directly
- Mac/Linux: Replaces symlink to point to native binary
- Zero overhead for `npm i -g agent-browser` users on all platforms
Also fixes PowerShell glob expansion in CI test.
Fixes#262
* fix: Windows npm global install and npx support
The shell script wrapper (bin/agent-browser) with #!/bin/sh shebang
causes npm to generate Windows shims that try to invoke /bin/sh,
which doesn't exist on Windows.
This fix uses a hybrid approach:
1. Node.js wrapper (bin/agent-browser.js) as bin entry
- Makes npx work on all platforms
- ~100ms overhead (acceptable since npx has its own overhead)
2. postinstall patches bin entries for global installs
- Windows: Overwrites .cmd/.ps1 shims to invoke .exe directly
- Mac/Linux: Replaces symlink to point to native binary
- Zero overhead for `npm i -g agent-browser` users on all platforms
Also adds cross-platform CI tests for npm global install to catch
regressions on all platforms (Ubuntu, macOS, Windows).
Fixes#262
* test global install
* remove dead code
The copy-native.js script was looking for 'agent-browser' but on Windows
the compiled binary is 'agent-browser.exe', causing the copy to fail.
Co-authored-by: jiazhuangai <jiazhuangai@example.com>
Co-authored-by: Claude <noreply@anthropic.com>