arise-browser 0.1.0 → 0.1.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.
@@ -248,26 +248,19 @@ else
248
248
  log "Neko client files already at ${NEKO_WWW}"
249
249
  fi
250
250
 
251
- # ─── Neko X11 drivers ────────────────────────────────────────────
252
-
253
- XORG_MODULES="/usr/lib/xorg/modules"
254
- if [[ -d "$XORG_MODULES" ]]; then
255
- NEKO_DRIVERS_URL="https://github.com/m1k1o/neko/releases/download/${NEKO_VERSION}/xf86-input-neko-${NEKO_ARCH}.tar.gz"
256
-
257
- if [[ ! -f "${XORG_MODULES}/input/neko_drv.so" ]]; then
258
- log "Installing Neko X11 input driver..."
259
- wget -q -O /tmp/neko-drivers.tar.gz "$NEKO_DRIVERS_URL" || true
260
- if [[ -f /tmp/neko-drivers.tar.gz ]]; then
261
- tar -xzf /tmp/neko-drivers.tar.gz -C "$XORG_MODULES" || true
262
- rm -f /tmp/neko-drivers.tar.gz
263
- log "Neko X11 drivers installed"
264
- else
265
- warn "Could not download Neko X11 drivers (non-critical)"
266
- fi
267
- else
268
- log "Neko X11 drivers already installed"
269
- fi
270
- fi
251
+ # ─── Neko X11 input driver (optional, build from source) ─────────
252
+ #
253
+ # neko_drv.so provides low-latency mouse input for Neko WebRTC.
254
+ # No prebuilt binary exists — must be compiled from source.
255
+ # Without it, Neko uses xdotool fallback (slightly higher latency).
256
+ #
257
+ # To build manually:
258
+ # apt install gcc pkgconf autoconf automake libtool make xorg-dev xutils-dev
259
+ # git clone https://github.com/m1k1o/neko.git /tmp/neko-src
260
+ # cd /tmp/neko-src/utils/xorg-deps/xf86-input-neko
261
+ # ./autogen.sh --prefix=/usr && ./configure && make && make install
262
+ #
263
+ warn "Neko X11 input driver (neko_drv.so) not installed — using xdotool fallback. See setup.sh comments to build from source."
271
264
 
272
265
  # ─── Playwright browser deps ─────────────────────────────────────
273
266
 
@@ -23,12 +23,13 @@ Section "InputDevice"
23
23
  Driver "void"
24
24
  EndSection
25
25
 
26
- Section "InputDevice"
27
- Identifier "dummy_touchscreen"
28
- Option "SendCoreEvents" "On"
29
- Option "SocketName" "/tmp/xf86-input-neko.sock"
30
- Driver "neko"
31
- EndSection
26
+ ## Neko touchscreen (requires neko_drv.so — uncomment if installed)
27
+ #Section "InputDevice"
28
+ # Identifier "dummy_touchscreen"
29
+ # Option "SendCoreEvents" "On"
30
+ # Option "SocketName" "/tmp/xf86-input-neko.sock"
31
+ # Driver "neko"
32
+ #EndSection
32
33
 
33
34
  Section "Device"
34
35
  Identifier "dummy_videocard"
@@ -114,5 +115,4 @@ Section "ServerLayout"
114
115
  Screen "dummy_screen"
115
116
  InputDevice "dummy_mouse"
116
117
  InputDevice "dummy_keyboard"
117
- InputDevice "dummy_touchscreen" "CorePointer"
118
118
  EndSection
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/virtual-display/manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,eAAe,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAmCD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;gBAEnC,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAOlD,IAAI,MAAM,IAAI,oBAAoB,CAEjC;IAED,SAAS,IAAI,OAAO;IAId,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC5B"}
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/virtual-display/manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,eAAe,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAmCD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;gBAEnC,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAOlD,IAAI,MAAM,IAAI,oBAAoB,CAEjC;IAED,SAAS,IAAI,OAAO;IAId,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC5B"}
@@ -80,12 +80,9 @@ export class VirtualDisplayManager {
80
80
  const displayEnv = { DISPLAY: display };
81
81
  log.info(`Starting virtual display environment (display=${display}, chrome=${chromePath}, neko=:${nekoPort})`);
82
82
  try {
83
- // 1. Xvfb
84
- const xorgConf = deployPath("xorg.conf");
83
+ // 1. Xvfb — does NOT support -config (that's Xorg, not Xvfb)
84
+ // Xvfb has a built-in dummy driver, no xorg.conf needed
85
85
  const xvfbArgs = [display, "-screen", "0", screen, "-nolisten", "tcp"];
86
- if (existsSync(xorgConf)) {
87
- xvfbArgs.push("-config", xorgConf);
88
- }
89
86
  this._xvfb = new ProcessRunner({
90
87
  name: "xvfb",
91
88
  command: "/usr/bin/Xvfb",
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/virtual-display/manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;;GAGG;AACH,SAAS,eAAe;IACtB,IAAI,GAAG,GAAG,SAAS,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,oFAAoF;IACpF,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAmBD,MAAM,cAAc,GAAyB;IAC3C,O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G,EAAE,CAAC;oBACb,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,wBAAwB,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;IAClD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arise-browser",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "AI browser automation engine — persistent refs, multi-strategy actions, behavior recording",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,145 +1,85 @@
1
1
  ---
2
2
  name: arise-browser
3
3
  description: >
4
- Control a headless or headed Chromium browser via AriseBrowser's HTTP API. Use for web automation,
5
- scraping, form filling, navigation, and multi-tab workflows. AriseBrowser exposes a YAML accessibility
6
- tree with persistent refs (WeakMap + aria-ref + signature), multi-strategy click fallbacks, and
7
- behavior recording with Learn protocol export built for AI agents that need reliable browser control.
8
- Use when the task involves: browsing websites, filling forms, clicking buttons, extracting
9
- page text, taking screenshots, recording workflows, or any browser-based automation.
10
- Supports virtual display mode on Linux servers — runs a real headed Chrome with Xvfb + Neko WebRTC
11
- streaming, allowing users to watch and interact with the AI-controlled browser in real time.
4
+ Control a Chromium browser via HTTP API for web automation — browsing, form filling, clicking,
5
+ text extraction, screenshots, and workflow recording. Uses persistent element refs that survive
6
+ across snapshots, multi-strategy click fallbacks, and YAML accessibility tree snapshots optimized
7
+ for low token usage. Supports headless mode (any platform) and headed virtual display mode with
8
+ WebRTC live streaming (Linux servers). Use when the task involves any browser-based interaction.
12
9
  homepage: https://github.com/AriseOS/arise-browser
13
10
  metadata:
14
11
  openclaw:
15
12
  emoji: "🚀"
16
13
  requires:
17
14
  bins: ["npx"]
18
- env: |
19
- ARISE_BROWSER_TOKEN (optional, secret) - Bearer auth token
20
- ARISE_BROWSER_PORT (optional) - HTTP port, default 9867
21
- ARISE_BROWSER_HEADLESS (optional) - true/false, default true
22
- ARISE_BROWSER_PROFILE (optional) - Chromium profile directory
23
- ARISE_BROWSER_BIND (optional) - Bind address, default 127.0.0.1
24
- ARISE_BROWSER_VIRTUAL_DISPLAY (optional) - Enable headed mode with Xvfb + Neko (Linux only)
25
- ARISE_BROWSER_NEKO_PORT (optional) - Neko WebRTC port, default 6090
26
- ARISE_BROWSER_NEKO_PASSWORD (optional, secret) - Neko user password, default "neko"
27
- ARISE_BROWSER_NEKO_ADMIN_PASSWORD (optional, secret) - Neko admin password, default "admin"
28
15
  ---
29
16
 
30
17
  # AriseBrowser
31
18
 
32
- Industrial-grade browser automation for AI agents. Persistent refs, multi-strategy clicks, behavior recording.
19
+ Browser automation for AI agents via HTTP API. Persistent refs, multi-strategy clicks, behavior recording.
33
20
 
34
- **Security Note:** AriseBrowser runs entirely locally. It does not contact external services or send telemetry. It controls a real Chromium instance — if pointed at a profile with saved logins, agents can access authenticated sites. Always use a dedicated empty profile and set ARISE_BROWSER_TOKEN when exposing the API. See [TRUST.md](TRUST.md) for the full security model.
35
-
36
- ## Quick Start (Agent Workflow)
21
+ ## Step 1: Install
37
22
 
38
23
  ```bash
39
- # 1. Start AriseBrowser (local on :9867)
40
- npx arise-browser &
41
-
42
- # 2. In your agent, follow this loop:
43
- # a) Navigate to a URL
44
- # b) Snapshot the page (get refs like e0, e5, e12)
45
- # c) Act on a ref (click e5, type e12 "search text")
46
- # d) Snapshot again to see the result
47
- # e) Repeat until done
24
+ # Install globally (makes `arise-browser` command available)
25
+ npm install -g arise-browser
48
26
  ```
49
27
 
50
- **Refs are persistent** — AriseBrowser's 3-layer ref system (WeakMap + aria-ref + signature) means refs survive across snapshots. You don't need to re-snapshot before every action.
51
-
52
- ### Recommended Secure Setup
28
+ Or use `npx arise-browser` to run without global install npm downloads it automatically.
53
29
 
54
- ```bash
55
- ARISE_BROWSER_BIND=127.0.0.1 \
56
- ARISE_BROWSER_TOKEN="your-strong-secret" \
57
- ARISE_BROWSER_PROFILE=~/.arise-browser/automation-profile \
58
- npx arise-browser &
59
- ```
30
+ ### Virtual Display Mode (optional, Linux servers only)
60
31
 
61
- **Never expose to 0.0.0.0 without a token. Never point at your daily browser profile.**
62
-
63
- ## Setup
64
-
65
- ### Headless Mode (default, any platform)
32
+ If you need **headed mode** on a headless Linux server (real Chrome with Xvfb + WebRTC streaming so users can watch), install system dependencies first:
66
33
 
67
34
  ```bash
68
- # Headless (default)
69
- npx arise-browser &
35
+ # Check if we're on Linux and headed mode is needed
36
+ uname -s # Must be "Linux"
70
37
 
71
- # Headed visible browser for debugging
72
- npx arise-browser --no-headless &
38
+ # Install Xvfb, Chrome, Neko, PulseAudio, Openbox, GStreamer, fonts
39
+ sudo bash <(curl -fsSL https://raw.githubusercontent.com/AriseOS/arise-browser/main/deploy/neko/setup.sh)
40
+ ```
73
41
 
74
- # With auth token
75
- ARISE_BROWSER_TOKEN="your-secret-token" npx arise-browser &
42
+ This is only needed once per server. Skip this for headless mode.
76
43
 
77
- # Custom port
78
- npx arise-browser --port 8080 &
44
+ ## Step 2: Start the Server
79
45
 
80
- # Connect to existing browser via CDP
81
- npx arise-browser --cdp http://localhost:9222 &
46
+ ```bash
47
+ # Headless mode (default, works everywhere)
48
+ npx arise-browser --port 9867 &
82
49
 
83
- # Persistent profile
84
- npx arise-browser --profile ~/.arise-browser/my-profile &
50
+ # Headed virtual display mode (Linux only, after setup.sh)
51
+ npx arise-browser --virtual-display --port 9867 --host 0.0.0.0 \
52
+ --neko-port 6090 --neko-password "neko" --neko-admin-password "admin" &
85
53
  ```
86
54
 
87
- Default: **port 9867**, no auth required (local). Set `ARISE_BROWSER_TOKEN` for remote access.
88
-
89
- ### Virtual Display Mode (Linux servers — headed + WebRTC streaming)
90
-
91
- Run a real headed Chrome on a headless Linux server. Users watch and interact via Neko WebRTC UI.
55
+ Wait for the server to be ready:
92
56
 
93
57
  ```bash
94
- # 1. Install system dependencies (once, requires root)
95
- # From npm package:
96
- sudo bash $(dirname $(which arise-browser))/../lib/node_modules/arise-browser/deploy/neko/setup.sh
97
- # Or from git clone:
98
- # sudo bash deploy/neko/setup.sh
99
- # Or directly from GitHub:
100
- sudo bash <(curl -fsSL https://raw.githubusercontent.com/AriseOS/arise-browser/main/deploy/neko/setup.sh)
101
-
102
- # 2. Start with virtual display
103
- npx arise-browser --virtual-display --port 9867 --host 0.0.0.0 &
58
+ until curl -s http://localhost:9867/health > /dev/null 2>&1; do sleep 1; done
59
+ ```
104
60
 
105
- # 3. AI agent uses the API as usual:
106
- curl -X POST http://localhost:9867/navigate -H 'Content-Type: application/json' -d '{"url":"https://example.com"}'
61
+ Verify:
107
62
 
108
- # 4. Users open Neko in a browser to watch/interact:
109
- # http://<server-ip>:6090 (password: neko)
63
+ ```bash
64
+ curl http://localhost:9867/health
65
+ # → {"status":"ok","connected":true,"version":"0.1.0"}
110
66
  ```
111
67
 
112
- Virtual display mode automatically:
113
- - Starts Xvfb (virtual X11 display)
114
- - Starts PulseAudio (virtual audio)
115
- - Starts Openbox (window manager, maximizes Chrome)
116
- - Launches Chrome with CDP on localhost:9222
117
- - Starts Neko server for WebRTC streaming
118
- - Connects arise-browser to Chrome via CDP
119
-
120
- All processes are managed as children of arise-browser — no supervisord needed.
68
+ In virtual display mode, users can open `http://<server>:6090` in their browser to watch and interact with Chrome via WebRTC (password: "neko").
121
69
 
122
- **Ports in virtual display mode:**
70
+ ## Step 3: Use the API
123
71
 
124
- | Port | Service | Access |
125
- |------|---------|--------|
126
- | 9867 | arise-browser API | AI agent |
127
- | 6090 | Neko WebRTC UI | User browser |
128
- | 52000-52100/udp | WebRTC data | User browser |
129
- | 9222 | Chrome CDP | localhost only |
72
+ Base URL: `http://localhost:9867`
130
73
 
131
- **Virtual display options:**
74
+ Every browser task follows this loop:
132
75
 
133
- ```bash
134
- --virtual-display # Enable virtual display mode
135
- --neko-port <port> # Neko port (default: 6090)
136
- --neko-password <pwd> # Neko user password (default: "neko")
137
- --neko-admin-password <pwd> # Neko admin password (default: "admin")
76
+ ```
77
+ Navigate Snapshot Act → Snapshot → Act → ... → Done
138
78
  ```
139
79
 
140
- ## Core Workflow
80
+ Refs (e0, e5, e12...) are **persistent** across snapshots. No need to re-snapshot before every action.
141
81
 
142
- ### 1. Navigate
82
+ ### Navigate
143
83
 
144
84
  ```bash
145
85
  curl -X POST http://localhost:9867/navigate \
@@ -147,129 +87,139 @@ curl -X POST http://localhost:9867/navigate \
147
87
  -d '{"url": "https://example.com"}'
148
88
  ```
149
89
 
150
- ### 2. Snapshot
90
+ ### Snapshot (Get Page State)
151
91
 
152
92
  ```bash
153
- # YAML format (default, best for AI agents)
93
+ # YAML (default, lowest token cost)
154
94
  curl http://localhost:9867/snapshot
155
95
 
156
- # JSON format (structured)
157
- curl "http://localhost:9867/snapshot?format=json"
158
-
159
- # Diff mode (only changes since last snapshot)
96
+ # Diff mode — only changes since last snapshot
160
97
  curl "http://localhost:9867/snapshot?diff=true"
98
+
99
+ # JSON format
100
+ curl "http://localhost:9867/snapshot?format=json"
161
101
  ```
162
102
 
163
- ### 3. Act
103
+ ### Actions
164
104
 
165
105
  ```bash
166
- # Click by ref
167
- curl -X POST http://localhost:9867/action \
168
- -H "Content-Type: application/json" \
169
- -d '{"kind": "click", "ref": "e5"}'
106
+ # Click
107
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
108
+ -d '{"type": "click", "ref": "e5"}'
170
109
 
171
- # Type into field
172
- curl -X POST http://localhost:9867/action \
173
- -H "Content-Type: application/json" \
174
- -d '{"kind": "type", "ref": "e12", "text": "hello world"}'
110
+ # Type
111
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
112
+ -d '{"type": "type", "ref": "e12", "text": "search query"}'
175
113
 
176
114
  # Press key
177
- curl -X POST http://localhost:9867/action \
178
- -H "Content-Type: application/json" \
179
- -d '{"kind": "press", "key": "Enter"}'
115
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
116
+ -d '{"type": "press_key", "key": "Enter"}'
180
117
 
181
- # Scroll down
182
- curl -X POST http://localhost:9867/action \
183
- -H "Content-Type: application/json" \
184
- -d '{"kind": "scroll", "scrollY": 300}'
118
+ # Scroll
119
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
120
+ -d '{"type": "scroll", "direction": "down", "amount": 500}'
185
121
 
186
122
  # Hover
187
- curl -X POST http://localhost:9867/action \
188
- -H "Content-Type: application/json" \
189
- -d '{"kind": "hover", "ref": "e7"}'
123
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
124
+ -d '{"type": "hover", "ref": "e7"}'
190
125
 
191
- # Select option
192
- curl -X POST http://localhost:9867/action \
193
- -H "Content-Type: application/json" \
194
- -d '{"kind": "select", "ref": "e3", "value": "option1"}'
126
+ # Select dropdown
127
+ curl -X POST http://localhost:9867/action -H "Content-Type: application/json" \
128
+ -d '{"type": "select", "ref": "e3", "value": "option1"}'
195
129
  ```
196
130
 
197
- ### 4. Record & Export
131
+ ### Batch Actions
198
132
 
199
133
  ```bash
200
- # Start recording
134
+ curl -X POST http://localhost:9867/actions -H "Content-Type: application/json" \
135
+ -d '{"actions": [
136
+ {"type": "click", "ref": "e5"},
137
+ {"type": "type", "ref": "e12", "text": "hello"},
138
+ {"type": "press_key", "key": "Enter"}
139
+ ], "stopOnError": true}'
140
+ ```
141
+
142
+ ### Tabs
143
+
144
+ ```bash
145
+ # List
146
+ curl http://localhost:9867/tabs
147
+
148
+ # Create
149
+ curl -X POST http://localhost:9867/tab -H "Content-Type: application/json" \
150
+ -d '{"action": "create", "url": "https://example.com"}'
151
+
152
+ # Switch
153
+ curl -X POST http://localhost:9867/tab -H "Content-Type: application/json" \
154
+ -d '{"action": "switch", "tabId": "tab-001"}'
155
+
156
+ # Close
157
+ curl -X POST http://localhost:9867/tab -H "Content-Type: application/json" \
158
+ -d '{"action": "close", "tabId": "tab-001"}'
159
+ ```
160
+
161
+ ### Content Extraction
162
+
163
+ ```bash
164
+ # Page text
165
+ curl http://localhost:9867/text
166
+
167
+ # Screenshot (JPEG)
168
+ curl http://localhost:9867/screenshot > screenshot.jpg
169
+
170
+ # PDF
171
+ curl http://localhost:9867/pdf > page.pdf
172
+
173
+ # Execute JavaScript
174
+ curl -X POST http://localhost:9867/evaluate -H "Content-Type: application/json" \
175
+ -d '{"expression": "document.title"}'
176
+ ```
177
+
178
+ ### Recording (Capture Workflow)
179
+
180
+ ```bash
181
+ # Start
201
182
  curl -X POST http://localhost:9867/recording/start
202
- # => {"recordingId": "session_20260303T180000"}
183
+ # {"recordingId": "session_..."}
203
184
 
204
185
  # ... perform actions ...
205
186
 
206
- # Stop recording
207
- curl -X POST http://localhost:9867/recording/stop \
208
- -d '{"recordingId": "session_20260303T180000"}'
187
+ # Stop
188
+ curl -X POST http://localhost:9867/recording/stop -H "Content-Type: application/json" \
189
+ -d '{"recordingId": "session_..."}'
190
+
191
+ # Export as structured trace
192
+ curl -X POST http://localhost:9867/recording/export -H "Content-Type: application/json" \
193
+ -d '{"recordingId": "session_...", "task": "Book a meeting room"}'
194
+ ```
195
+
196
+ ## Step 4: Stop the Server
209
197
 
210
- # Export as Learn protocol
211
- curl -X POST http://localhost:9867/recording/export \
212
- -d '{"recordingId": "session_20260303T180000", "task": "Search for AI products"}'
198
+ ```bash
199
+ # Find and stop
200
+ kill $(pgrep -f "arise-browser")
213
201
  ```
214
202
 
215
- Stopped recordings remain exportable for a limited retention window, so `stop -> export` is a supported flow.
216
-
217
- ## API Reference
218
-
219
- | Endpoint | Method | Description |
220
- |----------|--------|-------------|
221
- | `/health` | GET | Health check |
222
- | `/tabs` | GET | List all tabs |
223
- | `/navigate` | POST | Navigate to URL |
224
- | `/snapshot` | GET | Accessibility tree snapshot |
225
- | `/action` | POST | Execute single action |
226
- | `/actions` | POST | Execute batch actions |
227
- | `/text` | GET | Extract page text |
228
- | `/screenshot` | GET | JPEG screenshot |
229
- | `/pdf` | GET | PDF export |
230
- | `/evaluate` | POST | Execute JavaScript |
231
- | `/tab` | POST | Create/close/switch tabs |
232
- | `/tab/lock` | POST | Lock tab (multi-agent) |
233
- | `/tab/unlock` | POST | Unlock tab |
234
- | `/cookies` | GET/POST | Read/write cookies |
235
- | `/recording/start` | POST | Start recording |
236
- | `/recording/stop` | POST | Stop recording |
237
- | `/recording/status` | GET | Recording status |
238
- | `/recording/export` | POST | Export Learn format |
239
-
240
- Notes:
241
- - Read routes support optional `tabId` where applicable.
242
- - Write routes targeting a locked tab accept optional `owner`; mismatches return `423 Locked`.
243
- - `/navigate` accepts optional `tabId` and `timeout` (milliseconds).
244
-
245
- ## Why AriseBrowser over Pinchtab?
246
-
247
- | Feature | AriseBrowser | Pinchtab |
248
- |---------|----------|----------|
249
- | Persistent Refs | 3-layer (WeakMap + aria-ref + signature) | Single pass |
250
- | Click Strategy | Ctrl+Click → Force Click fallback | Single attempt |
251
- | Select support | Full implementation | Empty stub |
252
- | Behavior Recording | Built-in + Learn protocol export | Not available |
253
- | Coordinate handling | Viewport-validated | Hardcoded (0,0) |
254
- | Virtual Display | Xvfb + Neko WebRTC (headed on servers) | Not available |
255
- | Runtime | Node.js + Playwright | Go + CDP |
256
-
257
- ## Token Cost Guide
258
-
259
- - Snapshot (YAML): ~500-2000 tokens depending on page complexity
260
- - Snapshot (JSON): ~300-1500 tokens
261
- - Action response: ~50-100 tokens
262
- - Recording export: ~100-500 tokens per workflow
263
-
264
- ## Pinchtab Compatibility
265
-
266
- AriseBrowser accepts Pinchtab's `kind` field in `/action`:
267
- - `kind: "click"` → click
268
- - `kind: "type"` / `kind: "fill"` → type
269
- - `kind: "press"` → press_key
270
- - `kind: "scroll"` (with `scrollY`) → scroll
271
- - `kind: "hover"` → hover
272
- - `kind: "select"` → select
273
- - `kind: "focus"` → focus
274
-
275
- Environment variables `BRIDGE_*` are also accepted as aliases for `ARISE_BROWSER_*`.
203
+ Or send SIGTERM to the process. All child processes (Xvfb, Chrome, Neko...) are cleaned up automatically.
204
+
205
+ ## Troubleshooting
206
+
207
+ | Problem | Fix |
208
+ |---------|-----|
209
+ | `npx arise-browser` hangs | Playwright downloading Chromium — wait, first run takes ~1 min |
210
+ | Health returns `connected: false` | Chrome crashed or hasn't started — restart arise-browser |
211
+ | Virtual display: "Chrome not found" | Run `setup.sh` first, or install Chrome/Chromium |
212
+ | Virtual display: Neko timeout | Check that ports 6090 and 52000-52100/udp are open |
213
+ | Action returns error | Snapshot first to get valid refs, then act on them |
214
+
215
+ ## Tips
216
+
217
+ - Use `?diff=true` after the first snapshot to save tokens.
218
+ - Refs persist across snapshots don't re-snapshot just to reuse a ref.
219
+ - Use `tabId` on any endpoint to target a specific tab without switching.
220
+ - Batch actions when you have a sequence that doesn't need intermediate snapshots.
221
+ - Actions accept both `type` and `kind` field names (`kind: "click"` also works).
222
+
223
+ ## Full API Reference
224
+
225
+ See [references/api.md](references/api.md) for complete endpoint documentation with all parameters.