agent-browser 0.3.2 → 0.3.4

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,47 +1,28 @@
1
1
  #!/bin/sh
2
- # Cross-platform launcher for agent-browser
3
- # Detects OS/arch and runs the appropriate native binary
2
+ # agent-browser CLI wrapper
3
+ # Tries native binary first, falls back to Node.js
4
4
 
5
- # Get the directory where this script lives
6
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
-
8
- # Detect platform
9
- OS="$(uname -s)"
10
- ARCH="$(uname -m)"
5
+ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
6
+ ARCH=$(uname -m)
11
7
 
12
8
  case "$OS" in
13
- Linux) PLATFORM="linux" ;;
14
- Darwin) PLATFORM="darwin" ;;
15
- MINGW*|MSYS*|CYGWIN*) PLATFORM="win32" ;;
16
- *) PLATFORM="unknown" ;;
9
+ darwin) OS="darwin" ;;
10
+ linux) OS="linux" ;;
11
+ mingw*|msys*|cygwin*) OS="win32" ;;
17
12
  esac
18
13
 
19
14
  case "$ARCH" in
20
15
  x86_64|amd64) ARCH="x64" ;;
21
16
  aarch64|arm64) ARCH="arm64" ;;
22
- *) ARCH="unknown" ;;
23
17
  esac
24
18
 
25
- # Build binary name
26
- if [ "$PLATFORM" = "win32" ]; then
27
- BINARY="agent-browser-${PLATFORM}-${ARCH}.exe"
28
- else
29
- BINARY="agent-browser-${PLATFORM}-${ARCH}"
30
- fi
31
-
32
- BINARY_PATH="$SCRIPT_DIR/$BINARY"
33
-
34
- # Try native binary first
35
- if [ -x "$BINARY_PATH" ]; then
36
- exec "$BINARY_PATH" "$@"
37
- fi
19
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
20
+ BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
38
21
 
39
- # Fallback to Node.js implementation
40
- NODE_CLI="$SCRIPT_DIR/../dist/cli-light.js"
41
- if [ -f "$NODE_CLI" ]; then
42
- exec node "$NODE_CLI" "$@"
22
+ # Try native binary if it exists
23
+ if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
24
+ exec "$BINARY" "$@"
43
25
  fi
44
26
 
45
- echo "Error: No binary found for $PLATFORM-$ARCH" >&2
46
- echo "Run 'npm run build:native' or 'npm run build:all-platforms' to build" >&2
47
- exit 1
27
+ # Fall back to Node.js
28
+ exec node "$SCRIPT_DIR/../dist/index.js" "$@"
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  @echo off
2
- :: Cross-platform launcher for agent-browser (Windows)
3
- :: Detects architecture and runs the appropriate native binary
2
+ :: agent-browser CLI wrapper for Windows
3
+ :: Tries native binary first, falls back to Node.js
4
4
 
5
5
  setlocal
6
6
 
@@ -23,13 +23,6 @@ if exist "%BINARY%" (
23
23
  exit /b %errorlevel%
24
24
  )
25
25
 
26
- :: Fallback to Node.js implementation
27
- set "NODE_CLI=%SCRIPT_DIR%..\dist\cli-light.js"
28
- if exist "%NODE_CLI%" (
29
- node "%NODE_CLI%" %*
30
- exit /b %errorlevel%
31
- )
32
-
33
- echo Error: No binary found for win32-%ARCH% >&2
34
- echo Run 'npm run build:native' or 'npm run build:all-platforms' to build >&2
35
- exit /b 1
26
+ :: Fall back to Node.js
27
+ node "%SCRIPT_DIR%..\dist\index.js" %*
28
+ exit /b %errorlevel%
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",