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
|
-
#
|
|
3
|
-
#
|
|
2
|
+
# agent-browser CLI wrapper
|
|
3
|
+
# Tries native binary first, falls back to Node.js
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
#
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
package/bin/agent-browser.cmd
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@echo off
|
|
2
|
-
::
|
|
3
|
-
::
|
|
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
|
-
::
|
|
27
|
-
|
|
28
|
-
|
|
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%
|