agent-browser 0.3.3 → 0.3.5

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,10 +1,9 @@
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)
5
+ # Resolve symlinks to find real script location
6
6
  SCRIPT="$0"
7
- # Resolve symlinks
8
7
  while [ -L "$SCRIPT" ]; do
9
8
  SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
10
9
  SCRIPT="$(readlink "$SCRIPT")"
@@ -16,43 +15,26 @@ while [ -L "$SCRIPT" ]; do
16
15
  done
17
16
  SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
18
17
 
19
- # Detect platform
20
- OS="$(uname -s)"
21
- ARCH="$(uname -m)"
18
+ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
19
+ ARCH=$(uname -m)
22
20
 
23
21
  case "$OS" in
24
- Linux) PLATFORM="linux" ;;
25
- Darwin) PLATFORM="darwin" ;;
26
- MINGW*|MSYS*|CYGWIN*) PLATFORM="win32" ;;
27
- *) PLATFORM="unknown" ;;
22
+ darwin) OS="darwin" ;;
23
+ linux) OS="linux" ;;
24
+ mingw*|msys*|cygwin*) OS="win32" ;;
28
25
  esac
29
26
 
30
27
  case "$ARCH" in
31
28
  x86_64|amd64) ARCH="x64" ;;
32
29
  aarch64|arm64) ARCH="arm64" ;;
33
- *) ARCH="unknown" ;;
34
30
  esac
35
31
 
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
32
+ BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
49
33
 
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" "$@"
34
+ # Try native binary if it exists
35
+ if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
36
+ exec "$BINARY" "$@"
54
37
  fi
55
38
 
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
39
+ # Fall back to Node.js
40
+ 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.5",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",