From 87f11b41904cd21b7caf25821c1fa2da85098cfc Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Sun, 11 Jan 2026 04:30:01 -0600 Subject: [PATCH] fixes --- bin/agent-browser | 4 ---- bin/agent-browser.cmd | 3 --- docker/docker-compose.yml | 29 ++++++++--------------------- package.json | 4 +++- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/bin/agent-browser b/bin/agent-browser index 973e2ad..96a04c1 100755 --- a/bin/agent-browser +++ b/bin/agent-browser @@ -1,6 +1,4 @@ #!/bin/sh -# agent-browser CLI wrapper - SCRIPT="$0" while [ -L "$SCRIPT" ]; do SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)" @@ -8,12 +6,10 @@ while [ -L "$SCRIPT" ]; do case "$SCRIPT" in /*) ;; *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;; esac done SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)" - OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case "$OS" in darwin) OS="darwin" ;; linux) OS="linux" ;; mingw*|msys*|cygwin*) OS="win32" ;; esac case "$ARCH" in x86_64|amd64) ARCH="x64" ;; aarch64|arm64) ARCH="arm64" ;; esac - BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}" [ -f "$BINARY" ] && [ -x "$BINARY" ] && exec "$BINARY" "$@" exec node "$SCRIPT_DIR/../dist/index.js" "$@" diff --git a/bin/agent-browser.cmd b/bin/agent-browser.cmd index adc144b..58750e2 100644 --- a/bin/agent-browser.cmd +++ b/bin/agent-browser.cmd @@ -1,8 +1,5 @@ @echo off setlocal set "SCRIPT_DIR=%~dp0" -if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set "ARCH=x64") else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (set "ARCH=arm64") else (set "ARCH=x64") -set "BINARY=%SCRIPT_DIR%agent-browser-win32-%ARCH%.exe" -if exist "%BINARY%" ("%BINARY%" %* & exit /b %errorlevel%) node "%SCRIPT_DIR%..\dist\index.js" %* exit /b %errorlevel% diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 33b39ae..8dda619 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,12 +1,12 @@ # Docker Compose for building agent-browser -# Usage: docker compose -f docker/docker-compose.yml run build-all +# Usage: docker compose -f docker/docker-compose.yml run build-linux # -# Note: Windows is skipped because the Rust CLI uses Unix sockets. -# Windows users will use the Node.js fallback automatically. +# Note: macOS builds should be done natively on macOS for compatibility. +# Windows uses Node.js fallback (Unix sockets not supported). services: - # Build for all Unix platforms - build-all: + # Build for Linux platforms only (macOS should be built natively) + build-linux: build: context: .. dockerfile: docker/Dockerfile.build @@ -16,7 +16,7 @@ services: command: | -c ' set -e - echo "Building for all platforms..." + echo "Building for Linux platforms..." # Linux x64 echo "→ Linux x64" @@ -30,22 +30,9 @@ services: cp /build/target/aarch64-unknown-linux-gnu/release/agent-browser /output/agent-browser-linux-arm64 chmod +x /output/agent-browser-linux-arm64 - # macOS x64 - echo "→ macOS x64" - cargo zigbuild --release --target x86_64-apple-darwin - cp /build/target/x86_64-apple-darwin/release/agent-browser /output/agent-browser-darwin-x64 - chmod +x /output/agent-browser-darwin-x64 - - # macOS ARM64 - echo "→ macOS ARM64" - cargo zigbuild --release --target aarch64-apple-darwin - cp /build/target/aarch64-apple-darwin/release/agent-browser /output/agent-browser-darwin-arm64 - chmod +x /output/agent-browser-darwin-arm64 - echo "" - echo "✓ All platforms built successfully!" - echo "(Windows uses Node.js fallback - Unix sockets not supported)" - ls -la /output/agent-browser-* + echo "✓ Linux platforms built successfully!" + ls -la /output/agent-browser-linux-* ' # Build for a single target (override with TARGET env var) diff --git a/package.json b/package.json index 27711e0..0b6cc57 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "scripts": { "build": "tsc", "build:native": "cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js", - "build:all-platforms": "docker compose -f docker/docker-compose.yml run --rm build-all", + "build:linux": "docker compose -f docker/docker-compose.yml run --rm build-linux", + "build:macos": "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 && 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", + "build:all-platforms": "npm run build:linux && npm run build:macos", "build:docker": "docker build -t agent-browser-builder -f docker/Dockerfile.build .", "start": "node dist/index.js", "dev": "tsx src/index.ts",