From 58bbd17635eb0a188ef40e5fcfe0c0fbde81084e Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Sun, 11 Jan 2026 04:00:44 -0600 Subject: [PATCH] 0.3.4 --- bin/agent-browser | 23 +++++++---------------- bin/agent-browser.cmd | 17 +++++------------ package.json | 2 +- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/bin/agent-browser b/bin/agent-browser index 2279b3f..b883e56 100755 --- a/bin/agent-browser +++ b/bin/agent-browser @@ -1,6 +1,6 @@ #!/bin/sh # agent-browser CLI wrapper -# Detects platform and runs the appropriate native binary +# Tries native binary first, falls back to Node.js OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) @@ -9,29 +9,20 @@ case "$OS" in darwin) OS="darwin" ;; linux) OS="linux" ;; mingw*|msys*|cygwin*) OS="win32" ;; - *) echo "Unsupported OS: $OS" >&2; exit 1 ;; esac case "$ARCH" in x86_64|amd64) ARCH="x64" ;; aarch64|arm64) ARCH="arm64" ;; - *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; esac SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}" -if [ "$OS" = "win32" ]; then - BINARY="agent-browser-${OS}-${ARCH}.exe" -else - BINARY="agent-browser-${OS}-${ARCH}" +# Try native binary if it exists +if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then + exec "$BINARY" "$@" fi -BINARY_PATH="$SCRIPT_DIR/$BINARY" - -if [ ! -f "$BINARY_PATH" ]; then - echo "Native binary not found: $BINARY" >&2 - echo "Falling back to Node.js..." >&2 - exec node "$SCRIPT_DIR/../dist/index.js" "$@" -fi - -exec "$BINARY_PATH" "$@" +# Fall back to Node.js +exec node "$SCRIPT_DIR/../dist/index.js" "$@" diff --git a/bin/agent-browser.cmd b/bin/agent-browser.cmd index 7c34e19..f71d7ae 100644 --- a/bin/agent-browser.cmd +++ b/bin/agent-browser.cmd @@ -1,6 +1,6 @@ @echo off -:: Cross-platform launcher for agent-browser (Windows) -:: Detects architecture and runs the appropriate native binary +:: agent-browser CLI wrapper for Windows +:: Tries native binary first, falls back to Node.js setlocal @@ -23,13 +23,6 @@ if exist "%BINARY%" ( exit /b %errorlevel% ) -:: Fallback to Node.js implementation -set "NODE_CLI=%SCRIPT_DIR%..\dist\cli-light.js" -if exist "%NODE_CLI%" ( - node "%NODE_CLI%" %* - exit /b %errorlevel% -) - -echo Error: No binary found for win32-%ARCH% >&2 -echo Run 'npm run build:native' or 'npm run build:all-platforms' to build >&2 -exit /b 1 +:: Fall back to Node.js +node "%SCRIPT_DIR%..\dist\index.js" %* +exit /b %errorlevel% diff --git a/package.json b/package.json index 4e8390a..b83f55e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agent-browser", - "version": "0.3.3", + "version": "0.3.4", "description": "Headless browser automation CLI for AI agents", "type": "module", "main": "dist/index.js",