agent-browser 0.3.7 → 0.4.0
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/README.md +107 -32
- package/bin/agent-browser +13 -2
- package/bin/agent-browser-darwin-arm64 +0 -0
- package/bin/agent-browser-darwin-x64 +0 -0
- package/bin/agent-browser-linux-arm64 +0 -0
- package/bin/agent-browser-linux-x64 +0 -0
- package/bin/agent-browser-win32-x64.exe +0 -0
- package/dist/daemon.d.ts +16 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +80 -9
- package/dist/daemon.js.map +1 -1
- package/package.json +15 -7
- package/dist/cli-light.d.ts +0 -11
- package/dist/cli-light.d.ts.map +0 -1
- package/dist/cli-light.js +0 -409
- package/dist/cli-light.js.map +0 -1
- package/dist/client.d.ts +0 -17
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -133
- package/dist/client.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1163
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
# agent-browser
|
|
2
2
|
|
|
3
|
-
Headless browser automation CLI for AI agents.
|
|
3
|
+
Headless browser automation CLI for AI agents. Fast Rust CLI with Node.js fallback.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
### npm (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g agent-browser
|
|
11
|
+
agent-browser install # Download Chromium
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### From Source
|
|
15
|
+
|
|
7
16
|
```bash
|
|
17
|
+
git clone https://github.com/vercel-labs/agent-browser
|
|
18
|
+
cd agent-browser
|
|
8
19
|
pnpm install
|
|
9
|
-
npx playwright install chromium
|
|
10
20
|
pnpm build
|
|
21
|
+
agent-browser install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Linux Dependencies
|
|
25
|
+
|
|
26
|
+
On Linux, install system dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
agent-browser install --with-deps
|
|
30
|
+
# or manually: npx playwright install-deps chromium
|
|
11
31
|
```
|
|
12
32
|
|
|
13
33
|
## Quick Start
|
|
@@ -44,17 +64,14 @@ agent-browser fill <sel> <text> # Clear and fill
|
|
|
44
64
|
agent-browser press <key> # Press key (Enter, Tab, Control+a)
|
|
45
65
|
agent-browser keydown <key> # Hold key down
|
|
46
66
|
agent-browser keyup <key> # Release key
|
|
47
|
-
agent-browser insert <text> # Insert text (no key events)
|
|
48
67
|
agent-browser hover <sel> # Hover element
|
|
49
68
|
agent-browser select <sel> <val> # Select dropdown option
|
|
50
|
-
agent-browser multiselect <sel> <v1> <v2> # Multi-select
|
|
51
69
|
agent-browser check <sel> # Check checkbox
|
|
52
70
|
agent-browser uncheck <sel> # Uncheck checkbox
|
|
53
71
|
agent-browser scroll <dir> [px] # Scroll (up/down/left/right)
|
|
54
|
-
agent-browser
|
|
72
|
+
agent-browser scrollintoview <sel> # Scroll element into view
|
|
55
73
|
agent-browser drag <src> <tgt> # Drag and drop
|
|
56
74
|
agent-browser upload <sel> <files> # Upload files
|
|
57
|
-
agent-browser download [path] # Wait for download
|
|
58
75
|
agent-browser screenshot [path] # Take screenshot (--full for full page)
|
|
59
76
|
agent-browser pdf <path> # Save as PDF
|
|
60
77
|
agent-browser snapshot # Accessibility tree with refs (best for AI)
|
|
@@ -140,14 +157,14 @@ agent-browser set geo <lat> <lng> # Set geolocation
|
|
|
140
157
|
agent-browser set offline [on|off] # Toggle offline mode
|
|
141
158
|
agent-browser set headers <json> # Extra HTTP headers
|
|
142
159
|
agent-browser set credentials <u> <p> # HTTP basic auth
|
|
143
|
-
agent-browser set media [dark|light
|
|
160
|
+
agent-browser set media [dark|light] # Emulate color scheme
|
|
144
161
|
```
|
|
145
162
|
|
|
146
163
|
### Cookies & Storage
|
|
147
164
|
|
|
148
165
|
```bash
|
|
149
166
|
agent-browser cookies # Get all cookies
|
|
150
|
-
agent-browser cookies set <
|
|
167
|
+
agent-browser cookies set <name> <val> # Set cookie
|
|
151
168
|
agent-browser cookies clear # Clear cookies
|
|
152
169
|
|
|
153
170
|
agent-browser storage local # Get all localStorage
|
|
@@ -167,14 +184,13 @@ agent-browser network route <url> --body <json> # Mock response
|
|
|
167
184
|
agent-browser network unroute [url] # Remove routes
|
|
168
185
|
agent-browser network requests # View tracked requests
|
|
169
186
|
agent-browser network requests --filter api # Filter requests
|
|
170
|
-
agent-browser response <url> # Get response body (waits for matching request)
|
|
171
187
|
```
|
|
172
188
|
|
|
173
189
|
### Tabs & Windows
|
|
174
190
|
|
|
175
191
|
```bash
|
|
176
192
|
agent-browser tab # List tabs
|
|
177
|
-
agent-browser tab new
|
|
193
|
+
agent-browser tab new [url] # New tab (optionally with URL)
|
|
178
194
|
agent-browser tab <n> # Switch to tab n
|
|
179
195
|
agent-browser tab close [n] # Close tab
|
|
180
196
|
agent-browser window new # New window
|
|
@@ -197,15 +213,15 @@ agent-browser dialog dismiss # Dismiss
|
|
|
197
213
|
### Debug
|
|
198
214
|
|
|
199
215
|
```bash
|
|
200
|
-
agent-browser trace start
|
|
201
|
-
agent-browser trace stop
|
|
216
|
+
agent-browser trace start [path] # Start recording trace
|
|
217
|
+
agent-browser trace stop [path] # Stop and save trace
|
|
202
218
|
agent-browser console # View console messages
|
|
203
219
|
agent-browser console --clear # Clear console
|
|
204
220
|
agent-browser errors # View page errors
|
|
221
|
+
agent-browser errors --clear # Clear errors
|
|
205
222
|
agent-browser highlight <sel> # Highlight element
|
|
206
223
|
agent-browser state save <path> # Save auth state
|
|
207
224
|
agent-browser state load <path> # Load auth state
|
|
208
|
-
agent-browser initscript <js> # Run JS on every page load
|
|
209
225
|
```
|
|
210
226
|
|
|
211
227
|
### Navigation
|
|
@@ -216,25 +232,13 @@ agent-browser forward # Go forward
|
|
|
216
232
|
agent-browser reload # Reload page
|
|
217
233
|
```
|
|
218
234
|
|
|
219
|
-
###
|
|
235
|
+
### Setup
|
|
220
236
|
|
|
221
237
|
```bash
|
|
222
|
-
agent-browser
|
|
223
|
-
agent-browser
|
|
238
|
+
agent-browser install # Download Chromium browser
|
|
239
|
+
agent-browser install --with-deps # Also install system deps (Linux)
|
|
224
240
|
```
|
|
225
241
|
|
|
226
|
-
## Options
|
|
227
|
-
|
|
228
|
-
| Option | Description |
|
|
229
|
-
|--------|-------------|
|
|
230
|
-
| `--session <name>` | Use isolated session (or `AGENT_BROWSER_SESSION` env) |
|
|
231
|
-
| `--json` | JSON output (for agents) |
|
|
232
|
-
| `--full, -f` | Full page screenshot |
|
|
233
|
-
| `--name, -n` | Locator name filter |
|
|
234
|
-
| `--exact` | Exact text match |
|
|
235
|
-
| `--headed` | Show browser window (not headless) |
|
|
236
|
-
| `--debug` | Debug output |
|
|
237
|
-
|
|
238
242
|
## Sessions
|
|
239
243
|
|
|
240
244
|
Run multiple isolated browser instances:
|
|
@@ -244,13 +248,54 @@ Run multiple isolated browser instances:
|
|
|
244
248
|
agent-browser --session agent1 open site-a.com
|
|
245
249
|
agent-browser --session agent2 open site-b.com
|
|
246
250
|
|
|
247
|
-
# Or via environment
|
|
251
|
+
# Or via environment variable
|
|
248
252
|
AGENT_BROWSER_SESSION=agent1 agent-browser click "#btn"
|
|
249
253
|
|
|
250
|
-
# List
|
|
254
|
+
# List active sessions
|
|
251
255
|
agent-browser session list
|
|
256
|
+
|
|
257
|
+
# Show current session
|
|
258
|
+
agent-browser session
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Each session has its own:
|
|
262
|
+
- Browser instance
|
|
263
|
+
- Cookies and storage
|
|
264
|
+
- Navigation history
|
|
265
|
+
- Authentication state
|
|
266
|
+
|
|
267
|
+
## Snapshot Options
|
|
268
|
+
|
|
269
|
+
The `snapshot` command supports filtering to reduce output size:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
agent-browser snapshot # Full accessibility tree
|
|
273
|
+
agent-browser snapshot -i # Interactive elements only (buttons, inputs, links)
|
|
274
|
+
agent-browser snapshot -c # Compact (remove empty structural elements)
|
|
275
|
+
agent-browser snapshot -d 3 # Limit depth to 3 levels
|
|
276
|
+
agent-browser snapshot -s "#main" # Scope to CSS selector
|
|
277
|
+
agent-browser snapshot -i -c -d 5 # Combine options
|
|
252
278
|
```
|
|
253
279
|
|
|
280
|
+
| Option | Description |
|
|
281
|
+
|--------|-------------|
|
|
282
|
+
| `-i, --interactive` | Only show interactive elements (buttons, links, inputs) |
|
|
283
|
+
| `-c, --compact` | Remove empty structural elements |
|
|
284
|
+
| `-d, --depth <n>` | Limit tree depth |
|
|
285
|
+
| `-s, --selector <sel>` | Scope to CSS selector |
|
|
286
|
+
|
|
287
|
+
## Options
|
|
288
|
+
|
|
289
|
+
| Option | Description |
|
|
290
|
+
|--------|-------------|
|
|
291
|
+
| `--session <name>` | Use isolated session (or `AGENT_BROWSER_SESSION` env) |
|
|
292
|
+
| `--json` | JSON output (for agents) |
|
|
293
|
+
| `--full, -f` | Full page screenshot |
|
|
294
|
+
| `--name, -n` | Locator name filter |
|
|
295
|
+
| `--exact` | Exact text match |
|
|
296
|
+
| `--headed` | Show browser window (not headless) |
|
|
297
|
+
| `--debug` | Debug output |
|
|
298
|
+
|
|
254
299
|
## Selectors
|
|
255
300
|
|
|
256
301
|
### Refs (Recommended for AI)
|
|
@@ -317,7 +362,7 @@ agent-browser is visible @e2 --json
|
|
|
317
362
|
```bash
|
|
318
363
|
# 1. Navigate and get snapshot
|
|
319
364
|
agent-browser open example.com
|
|
320
|
-
agent-browser snapshot --json
|
|
365
|
+
agent-browser snapshot -i --json # AI parses tree and refs
|
|
321
366
|
|
|
322
367
|
# 2. AI identifies target refs from snapshot
|
|
323
368
|
# 3. Execute actions using refs
|
|
@@ -325,9 +370,39 @@ agent-browser click @e2
|
|
|
325
370
|
agent-browser fill @e3 "input text"
|
|
326
371
|
|
|
327
372
|
# 4. Get new snapshot if page changed
|
|
328
|
-
agent-browser snapshot --json
|
|
373
|
+
agent-browser snapshot -i --json
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
## Headed Mode
|
|
377
|
+
|
|
378
|
+
Show the browser window for debugging:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
agent-browser open example.com --headed
|
|
329
382
|
```
|
|
330
383
|
|
|
384
|
+
This opens a visible browser window instead of running headless.
|
|
385
|
+
|
|
386
|
+
## Architecture
|
|
387
|
+
|
|
388
|
+
agent-browser uses a client-daemon architecture:
|
|
389
|
+
|
|
390
|
+
1. **Rust CLI** (fast native binary) - Parses commands, communicates with daemon
|
|
391
|
+
2. **Node.js Daemon** - Manages Playwright browser instance
|
|
392
|
+
3. **Fallback** - If native binary unavailable, uses Node.js directly
|
|
393
|
+
|
|
394
|
+
The daemon starts automatically on first command and persists between commands for fast subsequent operations.
|
|
395
|
+
|
|
396
|
+
## Platforms
|
|
397
|
+
|
|
398
|
+
| Platform | Binary | Fallback |
|
|
399
|
+
|----------|--------|----------|
|
|
400
|
+
| macOS ARM64 | ✅ Native Rust | Node.js |
|
|
401
|
+
| macOS x64 | ✅ Native Rust | Node.js |
|
|
402
|
+
| Linux ARM64 | ✅ Native Rust | Node.js |
|
|
403
|
+
| Linux x64 | ✅ Native Rust | Node.js |
|
|
404
|
+
| Windows | - | Node.js |
|
|
405
|
+
|
|
331
406
|
## License
|
|
332
407
|
|
|
333
408
|
Apache-2.0
|
package/bin/agent-browser
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
|
+
# agent-browser CLI wrapper
|
|
3
|
+
# Detects OS/arch and runs the appropriate native binary
|
|
4
|
+
|
|
2
5
|
SCRIPT="$0"
|
|
3
6
|
while [ -L "$SCRIPT" ]; do
|
|
4
7
|
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
|
|
@@ -6,10 +9,18 @@ while [ -L "$SCRIPT" ]; do
|
|
|
6
9
|
case "$SCRIPT" in /*) ;; *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;; esac
|
|
7
10
|
done
|
|
8
11
|
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
|
|
12
|
+
|
|
9
13
|
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
10
14
|
ARCH=$(uname -m)
|
|
11
15
|
case "$OS" in darwin) OS="darwin" ;; linux) OS="linux" ;; mingw*|msys*|cygwin*) OS="win32" ;; esac
|
|
12
16
|
case "$ARCH" in x86_64|amd64) ARCH="x64" ;; aarch64|arm64) ARCH="arm64" ;; esac
|
|
17
|
+
|
|
13
18
|
BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
|
|
21
|
+
exec "$BINARY" "$@"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
echo "Error: No binary found for ${OS}-${ARCH}" >&2
|
|
25
|
+
echo "Run 'npm run build:native' to build for your platform" >&2
|
|
26
|
+
exit 1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/daemon.d.ts
CHANGED
|
@@ -7,9 +7,13 @@ export declare function setSession(session: string): void;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function getSession(): string;
|
|
9
9
|
/**
|
|
10
|
-
* Get the socket path for the current session
|
|
10
|
+
* Get the socket path for the current session (Unix) or port (Windows)
|
|
11
11
|
*/
|
|
12
12
|
export declare function getSocketPath(session?: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Get the port file path for Windows (stores the port number)
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPortFile(session?: string): string;
|
|
13
17
|
/**
|
|
14
18
|
* Get the PID file path for the current session
|
|
15
19
|
*/
|
|
@@ -18,6 +22,17 @@ export declare function getPidFile(session?: string): string;
|
|
|
18
22
|
* Check if daemon is running for the current session
|
|
19
23
|
*/
|
|
20
24
|
export declare function isDaemonRunning(session?: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get connection info for the current session
|
|
27
|
+
* Returns { type: 'unix', path: string } or { type: 'tcp', port: number }
|
|
28
|
+
*/
|
|
29
|
+
export declare function getConnectionInfo(session?: string): {
|
|
30
|
+
type: 'unix';
|
|
31
|
+
path: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'tcp';
|
|
34
|
+
port: number;
|
|
35
|
+
};
|
|
21
36
|
/**
|
|
22
37
|
* Clean up socket and PID file for the current session
|
|
23
38
|
*/
|
package/dist/daemon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../src/daemon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../src/daemon.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAgBD;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAczD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMlH;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAcpD;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAkIjD"}
|
package/dist/daemon.js
CHANGED
|
@@ -5,6 +5,8 @@ import * as os from 'os';
|
|
|
5
5
|
import { BrowserManager } from './browser.js';
|
|
6
6
|
import { parseCommand, serializeResponse, errorResponse } from './protocol.js';
|
|
7
7
|
import { executeCommand } from './actions.js';
|
|
8
|
+
// Platform detection
|
|
9
|
+
const isWindows = process.platform === 'win32';
|
|
8
10
|
// Session support - each session gets its own socket/pid
|
|
9
11
|
let currentSession = process.env.AGENT_BROWSER_SESSION || 'default';
|
|
10
12
|
/**
|
|
@@ -20,12 +22,35 @@ export function getSession() {
|
|
|
20
22
|
return currentSession;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
|
-
* Get
|
|
25
|
+
* Get port number for TCP mode (Windows)
|
|
26
|
+
* Uses a hash of the session name to get a consistent port
|
|
27
|
+
*/
|
|
28
|
+
function getPortForSession(session) {
|
|
29
|
+
let hash = 0;
|
|
30
|
+
for (let i = 0; i < session.length; i++) {
|
|
31
|
+
hash = ((hash << 5) - hash) + session.charCodeAt(i);
|
|
32
|
+
hash |= 0;
|
|
33
|
+
}
|
|
34
|
+
// Port range 49152-65535 (dynamic/private ports)
|
|
35
|
+
return 49152 + (Math.abs(hash) % 16383);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the socket path for the current session (Unix) or port (Windows)
|
|
24
39
|
*/
|
|
25
40
|
export function getSocketPath(session) {
|
|
26
41
|
const sess = session ?? currentSession;
|
|
42
|
+
if (isWindows) {
|
|
43
|
+
return String(getPortForSession(sess));
|
|
44
|
+
}
|
|
27
45
|
return path.join(os.tmpdir(), `agent-browser-${sess}.sock`);
|
|
28
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the port file path for Windows (stores the port number)
|
|
49
|
+
*/
|
|
50
|
+
export function getPortFile(session) {
|
|
51
|
+
const sess = session ?? currentSession;
|
|
52
|
+
return path.join(os.tmpdir(), `agent-browser-${sess}.port`);
|
|
53
|
+
}
|
|
29
54
|
/**
|
|
30
55
|
* Get the PID file path for the current session
|
|
31
56
|
*/
|
|
@@ -42,7 +67,7 @@ export function isDaemonRunning(session) {
|
|
|
42
67
|
return false;
|
|
43
68
|
try {
|
|
44
69
|
const pid = parseInt(fs.readFileSync(pidFile, 'utf8').trim(), 10);
|
|
45
|
-
// Check if process exists
|
|
70
|
+
// Check if process exists (works on both Unix and Windows)
|
|
46
71
|
process.kill(pid, 0);
|
|
47
72
|
return true;
|
|
48
73
|
}
|
|
@@ -52,17 +77,35 @@ export function isDaemonRunning(session) {
|
|
|
52
77
|
return false;
|
|
53
78
|
}
|
|
54
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Get connection info for the current session
|
|
82
|
+
* Returns { type: 'unix', path: string } or { type: 'tcp', port: number }
|
|
83
|
+
*/
|
|
84
|
+
export function getConnectionInfo(session) {
|
|
85
|
+
const sess = session ?? currentSession;
|
|
86
|
+
if (isWindows) {
|
|
87
|
+
return { type: 'tcp', port: getPortForSession(sess) };
|
|
88
|
+
}
|
|
89
|
+
return { type: 'unix', path: path.join(os.tmpdir(), `agent-browser-${sess}.sock`) };
|
|
90
|
+
}
|
|
55
91
|
/**
|
|
56
92
|
* Clean up socket and PID file for the current session
|
|
57
93
|
*/
|
|
58
94
|
export function cleanupSocket(session) {
|
|
59
|
-
const socketPath = getSocketPath(session);
|
|
60
95
|
const pidFile = getPidFile(session);
|
|
61
96
|
try {
|
|
62
|
-
if (fs.existsSync(socketPath))
|
|
63
|
-
fs.unlinkSync(socketPath);
|
|
64
97
|
if (fs.existsSync(pidFile))
|
|
65
98
|
fs.unlinkSync(pidFile);
|
|
99
|
+
if (isWindows) {
|
|
100
|
+
const portFile = getPortFile(session);
|
|
101
|
+
if (fs.existsSync(portFile))
|
|
102
|
+
fs.unlinkSync(portFile);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const socketPath = getSocketPath(session);
|
|
106
|
+
if (fs.existsSync(socketPath))
|
|
107
|
+
fs.unlinkSync(socketPath);
|
|
108
|
+
}
|
|
66
109
|
}
|
|
67
110
|
catch {
|
|
68
111
|
// Ignore cleanup errors
|
|
@@ -127,13 +170,25 @@ export async function startDaemon() {
|
|
|
127
170
|
// Client disconnected, ignore
|
|
128
171
|
});
|
|
129
172
|
});
|
|
130
|
-
const socketPath = getSocketPath();
|
|
131
173
|
const pidFile = getPidFile();
|
|
132
174
|
// Write PID file before listening
|
|
133
175
|
fs.writeFileSync(pidFile, process.pid.toString());
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
|
|
176
|
+
if (isWindows) {
|
|
177
|
+
// Windows: use TCP socket on localhost
|
|
178
|
+
const port = getPortForSession(currentSession);
|
|
179
|
+
const portFile = getPortFile();
|
|
180
|
+
fs.writeFileSync(portFile, port.toString());
|
|
181
|
+
server.listen(port, '127.0.0.1', () => {
|
|
182
|
+
// Daemon is ready on TCP port
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
// Unix: use Unix domain socket
|
|
187
|
+
const socketPath = getSocketPath();
|
|
188
|
+
server.listen(socketPath, () => {
|
|
189
|
+
// Daemon is ready
|
|
190
|
+
});
|
|
191
|
+
}
|
|
137
192
|
server.on('error', (err) => {
|
|
138
193
|
console.error('Server error:', err);
|
|
139
194
|
cleanupSocket();
|
|
@@ -151,6 +206,22 @@ export async function startDaemon() {
|
|
|
151
206
|
};
|
|
152
207
|
process.on('SIGINT', shutdown);
|
|
153
208
|
process.on('SIGTERM', shutdown);
|
|
209
|
+
process.on('SIGHUP', shutdown);
|
|
210
|
+
// Handle unexpected errors - always cleanup
|
|
211
|
+
process.on('uncaughtException', (err) => {
|
|
212
|
+
console.error('Uncaught exception:', err);
|
|
213
|
+
cleanupSocket();
|
|
214
|
+
process.exit(1);
|
|
215
|
+
});
|
|
216
|
+
process.on('unhandledRejection', (reason) => {
|
|
217
|
+
console.error('Unhandled rejection:', reason);
|
|
218
|
+
cleanupSocket();
|
|
219
|
+
process.exit(1);
|
|
220
|
+
});
|
|
221
|
+
// Cleanup on normal exit
|
|
222
|
+
process.on('exit', () => {
|
|
223
|
+
cleanupSocket();
|
|
224
|
+
});
|
|
154
225
|
// Keep process alive
|
|
155
226
|
process.stdin.resume();
|
|
156
227
|
}
|
package/dist/daemon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../src/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,yDAAyD;AACzD,IAAI,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,SAAS,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,cAAc,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,IAAI,GAAG,OAAO,IAAI,cAAc,CAAC;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,iBAAiB,IAAI,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;A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CAAC,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,wCAAwC;AACxC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,GAAG,EAAE,CAAC;IACvF,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QACpC,aAAa,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Headless browser automation CLI for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
6
|
+
"main": "dist/daemon.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"bin",
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
"build": "tsc",
|
|
17
17
|
"build:native": "cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js",
|
|
18
18
|
"build:linux": "docker compose -f docker/docker-compose.yml run --rm build-linux",
|
|
19
|
-
"build:macos": "cargo build --release --manifest-path cli/Cargo.toml --target aarch64-apple-darwin
|
|
20
|
-
"build:
|
|
19
|
+
"build:macos": "(cargo build --release --manifest-path cli/Cargo.toml --target aarch64-apple-darwin & cargo build --release --manifest-path cli/Cargo.toml --target x86_64-apple-darwin & wait) && cp cli/target/aarch64-apple-darwin/release/agent-browser bin/agent-browser-darwin-arm64 && cp cli/target/x86_64-apple-darwin/release/agent-browser bin/agent-browser-darwin-x64",
|
|
20
|
+
"build:windows": "docker compose -f docker/docker-compose.yml run --rm build-windows",
|
|
21
|
+
"build:all-platforms": "(npm run build:linux & npm run build:windows & wait) && npm run build:macos",
|
|
21
22
|
"build:docker": "docker build -t agent-browser-builder -f docker/Dockerfile.build .",
|
|
22
|
-
"start": "node dist/
|
|
23
|
-
"dev": "tsx src/
|
|
23
|
+
"start": "node dist/daemon.js",
|
|
24
|
+
"dev": "tsx src/daemon.ts",
|
|
24
25
|
"typecheck": "tsc --noEmit",
|
|
25
26
|
"format": "prettier --write 'src/**/*.ts'",
|
|
26
27
|
"format:check": "prettier --check 'src/**/*.ts'",
|
|
@@ -36,8 +37,15 @@
|
|
|
36
37
|
"cli",
|
|
37
38
|
"agent"
|
|
38
39
|
],
|
|
39
|
-
"author": "",
|
|
40
40
|
"license": "Apache-2.0",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/vercel-labs/agent-browser.git"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/vercel-labs/agent-browser/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/vercel-labs/agent-browser#readme",
|
|
41
49
|
"dependencies": {
|
|
42
50
|
"playwright-core": "^1.57.0",
|
|
43
51
|
"zod": "^3.22.4"
|
package/dist/cli-light.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Lightweight CLI client for agent-browser
|
|
4
|
-
*
|
|
5
|
-
* This file contains ONLY the client logic (no Playwright imports).
|
|
6
|
-
* It can be compiled with Bun for fast startup times.
|
|
7
|
-
*
|
|
8
|
-
* The actual browser automation runs in a separate daemon process.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=cli-light.d.ts.map
|
package/dist/cli-light.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-light.d.ts","sourceRoot":"","sources":["../src/cli-light.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
|