agent-browser 0.20.1 → 0.20.2

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -8,7 +8,7 @@
8
8
  * binary directly (zero overhead).
9
9
  */
10
10
 
11
- import { spawn } from 'child_process';
11
+ import { spawn, execSync } from 'child_process';
12
12
  import { existsSync, accessSync, chmodSync, constants } from 'fs';
13
13
  import { dirname, join } from 'path';
14
14
  import { fileURLToPath } from 'url';
@@ -16,6 +16,17 @@ import { platform, arch } from 'os';
16
16
 
17
17
  const __dirname = dirname(fileURLToPath(import.meta.url));
18
18
 
19
+ // Detect if the system uses musl libc (e.g. Alpine Linux)
20
+ function isMusl() {
21
+ if (platform() !== 'linux') return false;
22
+ try {
23
+ const result = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
24
+ return result.toLowerCase().includes('musl');
25
+ } catch {
26
+ return existsSync('/lib/ld-musl-x86_64.so.1') || existsSync('/lib/ld-musl-aarch64.so.1');
27
+ }
28
+ }
29
+
19
30
  // Map Node.js platform/arch to binary naming convention
20
31
  function getBinaryName() {
21
32
  const os = platform();
@@ -27,7 +38,7 @@ function getBinaryName() {
27
38
  osKey = 'darwin';
28
39
  break;
29
40
  case 'linux':
30
- osKey = 'linux';
41
+ osKey = isMusl() ? 'linux-musl' : 'linux';
31
42
  break;
32
43
  case 'win32':
33
44
  osKey = 'win32';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "files": [
@@ -61,6 +61,12 @@ build_target "x86_64-apple-darwin" "agent-browser-darwin-x64"
61
61
  # macOS ARM64 (via zig for cross-compilation)
62
62
  build_target "aarch64-apple-darwin" "agent-browser-darwin-arm64"
63
63
 
64
+ # Linux musl x64 (Alpine)
65
+ build_target "x86_64-unknown-linux-musl" "agent-browser-linux-musl-x64"
66
+
67
+ # Linux musl ARM64 (Alpine)
68
+ build_target "aarch64-unknown-linux-musl" "agent-browser-linux-musl-arm64"
69
+
64
70
  echo ""
65
71
  echo -e "${GREEN}Build complete!${NC}"
66
72
  echo ""
@@ -20,8 +20,20 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
20
20
  const projectRoot = join(__dirname, '..');
21
21
  const binDir = join(projectRoot, 'bin');
22
22
 
23
+ // Detect if the system uses musl libc (e.g. Alpine Linux)
24
+ function isMusl() {
25
+ if (platform() !== 'linux') return false;
26
+ try {
27
+ const result = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
28
+ return result.toLowerCase().includes('musl');
29
+ } catch {
30
+ return existsSync('/lib/ld-musl-x86_64.so.1') || existsSync('/lib/ld-musl-aarch64.so.1');
31
+ }
32
+ }
33
+
23
34
  // Platform detection
24
- const platformKey = `${platform()}-${arch()}`;
35
+ const osKey = platform() === 'linux' && isMusl() ? 'linux-musl' : platform();
36
+ const platformKey = `${osKey}-${arch()}`;
25
37
  const ext = platform() === 'win32' ? '.exe' : '';
26
38
  const binaryName = `agent-browser-${platformKey}${ext}`;
27
39
  const binaryPath = join(binDir, binaryName);