agent-browser 0.3.3 → 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,58 +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 (resolving symlinks)
6
- SCRIPT="$0"
7
- # Resolve symlinks
8
- while [ -L "$SCRIPT" ]; do
9
- SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
10
- SCRIPT="$(readlink "$SCRIPT")"
11
- # Handle relative symlinks
12
- case "$SCRIPT" in
13
- /*) ;;
14
- *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;;
15
- esac
16
- done
17
- SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
18
-
19
- # Detect platform
20
- OS="$(uname -s)"
21
- ARCH="$(uname -m)"
5
+ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
6
+ ARCH=$(uname -m)
22
7
 
23
8
  case "$OS" in
24
- Linux) PLATFORM="linux" ;;
25
- Darwin) PLATFORM="darwin" ;;
26
- MINGW*|MSYS*|CYGWIN*) PLATFORM="win32" ;;
27
- *) PLATFORM="unknown" ;;
9
+ darwin) OS="darwin" ;;
10
+ linux) OS="linux" ;;
11
+ mingw*|msys*|cygwin*) OS="win32" ;;
28
12
  esac
29
13
 
30
14
  case "$ARCH" in
31
15
  x86_64|amd64) ARCH="x64" ;;
32
16
  aarch64|arm64) ARCH="arm64" ;;
33
- *) ARCH="unknown" ;;
34
17
  esac
35
18
 
36
- # Build binary name
37
- if [ "$PLATFORM" = "win32" ]; then
38
- BINARY="agent-browser-${PLATFORM}-${ARCH}.exe"
39
- else
40
- BINARY="agent-browser-${PLATFORM}-${ARCH}"
41
- fi
42
-
43
- BINARY_PATH="$SCRIPT_DIR/$BINARY"
44
-
45
- # Try native binary first
46
- if [ -x "$BINARY_PATH" ]; then
47
- exec "$BINARY_PATH" "$@"
48
- fi
19
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
20
+ BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
49
21
 
50
- # Fallback to Node.js implementation
51
- NODE_CLI="$SCRIPT_DIR/../dist/cli-light.js"
52
- if [ -f "$NODE_CLI" ]; then
53
- exec node "$NODE_CLI" "$@"
22
+ # Try native binary if it exists
23
+ if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
24
+ exec "$BINARY" "$@"
54
25
  fi
55
26
 
56
- echo "Error: No binary found for $PLATFORM-$ARCH" >&2
57
- echo "Run 'npm run build:native' or 'npm run build:all-platforms' to build" >&2
58
- 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.3",
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",