agent-browser 0.3.5 → 0.3.7

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/bin/agent-browser CHANGED
@@ -1,40 +1,15 @@
1
1
  #!/bin/sh
2
- # agent-browser CLI wrapper
3
- # Tries native binary first, falls back to Node.js
4
-
5
- # Resolve symlinks to find real script location
6
2
  SCRIPT="$0"
7
3
  while [ -L "$SCRIPT" ]; do
8
4
  SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
9
5
  SCRIPT="$(readlink "$SCRIPT")"
10
- # Handle relative symlinks
11
- case "$SCRIPT" in
12
- /*) ;;
13
- *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;;
14
- esac
6
+ case "$SCRIPT" in /*) ;; *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;; esac
15
7
  done
16
8
  SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
17
-
18
9
  OS=$(uname -s | tr '[:upper:]' '[:lower:]')
19
10
  ARCH=$(uname -m)
20
-
21
- case "$OS" in
22
- darwin) OS="darwin" ;;
23
- linux) OS="linux" ;;
24
- mingw*|msys*|cygwin*) OS="win32" ;;
25
- esac
26
-
27
- case "$ARCH" in
28
- x86_64|amd64) ARCH="x64" ;;
29
- aarch64|arm64) ARCH="arm64" ;;
30
- esac
31
-
11
+ case "$OS" in darwin) OS="darwin" ;; linux) OS="linux" ;; mingw*|msys*|cygwin*) OS="win32" ;; esac
12
+ case "$ARCH" in x86_64|amd64) ARCH="x64" ;; aarch64|arm64) ARCH="arm64" ;; esac
32
13
  BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
33
-
34
- # Try native binary if it exists
35
- if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
36
- exec "$BINARY" "$@"
37
- fi
38
-
39
- # Fall back to Node.js
14
+ [ -f "$BINARY" ] && [ -x "$BINARY" ] && exec "$BINARY" "$@"
40
15
  exec node "$SCRIPT_DIR/../dist/index.js" "$@"
Binary file
Binary file
Binary file
Binary file
@@ -1,28 +1,5 @@
1
1
  @echo off
2
- :: agent-browser CLI wrapper for Windows
3
- :: Tries native binary first, falls back to Node.js
4
-
5
2
  setlocal
6
-
7
3
  set "SCRIPT_DIR=%~dp0"
8
-
9
- :: Detect architecture
10
- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
11
- set "ARCH=x64"
12
- ) else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
13
- set "ARCH=arm64"
14
- ) else (
15
- set "ARCH=x64"
16
- )
17
-
18
- set "BINARY=%SCRIPT_DIR%agent-browser-win32-%ARCH%.exe"
19
-
20
- :: Try native binary first
21
- if exist "%BINARY%" (
22
- "%BINARY%" %*
23
- exit /b %errorlevel%
24
- )
25
-
26
- :: Fall back to Node.js
27
4
  node "%SCRIPT_DIR%..\dist\index.js" %*
28
5
  exit /b %errorlevel%
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,9 @@
15
15
  "scripts": {
16
16
  "build": "tsc",
17
17
  "build:native": "cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js",
18
- "build:all-platforms": "docker compose -f docker/docker-compose.yml run --rm build-all",
18
+ "build:linux": "docker compose -f docker/docker-compose.yml run --rm build-linux",
19
+ "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",
20
+ "build:all-platforms": "npm run build:linux && npm run build:macos",
19
21
  "build:docker": "docker build -t agent-browser-builder -f docker/Dockerfile.build .",
20
22
  "start": "node dist/index.js",
21
23
  "dev": "tsx src/index.ts",