browser-agent-server 1.0.0__py3-none-any.whl
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.
- browser_agent/__init__.py +128 -0
- browser_agent/chrome.py +591 -0
- browser_agent/cli.py +414 -0
- browser_agent/data/browser-agent.service +26 -0
- browser_agent/server.py +250 -0
- browser_agent/vision_agent.py +165 -0
- browser_agent/x11_input.py +273 -0
- browser_agent_server-1.0.0.dist-info/METADATA +98 -0
- browser_agent_server-1.0.0.dist-info/RECORD +12 -0
- browser_agent_server-1.0.0.dist-info/WHEEL +4 -0
- browser_agent_server-1.0.0.dist-info/entry_points.txt +2 -0
- browser_agent_server-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: browser-agent-server
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Real headful Chrome on Xvfb with a hardware-level X11 mouse, Cloudflare Turnstile auto-solve and zero-leak CDP. Localhost HTTP API + CLI + Python SDK.
|
|
5
|
+
Project-URL: Homepage, https://github.com/vernikr/browser-agent
|
|
6
|
+
Project-URL: Repository, https://github.com/vernikr/browser-agent
|
|
7
|
+
Project-URL: Issues, https://github.com/vernikr/browser-agent/issues
|
|
8
|
+
Author: vernikr
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: automation,browser,chrome,cloudflare,mcp,stealth,turnstile,x11
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: trafilatura<3,>=1.12
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# browser-agent
|
|
25
|
+
|
|
26
|
+
> 🔗 **Companion project:** [`@vernikr/browser-agent-mcp`](https://github.com/vernikr/browser-agent-mcp) — the MCP server that exposes this daemon to LLM agents (Claude Code, Cursor, Freebuff…). The two projects are developed together and speak the HTTP contract in [`docs/api.md`](docs/api.md).
|
|
27
|
+
|
|
28
|
+
**Real headful Chrome on Xvfb with a hardware-level X11 mouse.** One localhost daemon gives any project, script, or AI agent on a Linux box a genuine desktop browser: steered over real XTEST input events on randomized Bézier paths, with zero-leak CDP (no `Runtime.enable`), Cloudflare Turnstile auto-solve, and RAM discipline for tiny VPSes (auto-hibernates to ~12 MB idle).
|
|
29
|
+
|
|
30
|
+
Why not Playwright/CDP directly: mainstream automation stacks call `Runtime.enable` / `Debugger.enable` on connect — the primary headless-detection vector. This daemon's CDP client refuses those methods by construction and reads the DOM via `DOM.getOuterHTML`; all mouse/keyboard input goes through the X server, so clicks are `isTrusted: true` hardware events.
|
|
31
|
+
|
|
32
|
+
## Install & provision (server, Ubuntu 24.04)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # if uv is missing
|
|
36
|
+
uv tool install browser-agent-server
|
|
37
|
+
sudo browser-agent setup --with-chrome # apt deps + google-chrome-stable + systemd unit
|
|
38
|
+
sudo browser-agent doctor # self-check
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use it three ways:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
browser-agent fetch "https://example.com" --text # CLI
|
|
45
|
+
curl -s 127.0.0.1:8765/status # HTTP API (any language)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from browser_agent import BrowserClient # Python SDK
|
|
50
|
+
|
|
51
|
+
client = BrowserClient()
|
|
52
|
+
page = client.fetch("https://example.com")
|
|
53
|
+
print(page["title"], len(page["text"]))
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Connect from your workstation (agents)
|
|
57
|
+
|
|
58
|
+
Point the MCP bridge at this daemon — details and ready-made agent configs live in the companion repo:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm dlx @vernikr/browser-agent-mcp init --client claude-code
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## What you get
|
|
65
|
+
|
|
66
|
+
| Capability | Detail |
|
|
67
|
+
|---|---|
|
|
68
|
+
| Real Chrome, never headless | `google-chrome-stable` headed on on-demand `Xvfb` (1280×720x24) + `openbox` |
|
|
69
|
+
| Stealth CDP | Hand-rolled RFC-6455 client; `Runtime.enable`/`Console.enable`/`Debugger.enable` refused by construction |
|
|
70
|
+
| Human-like input | X11 XTEST mouse on randomized cubic Bézier curves with ease-in/out pacing and Gaussian micro-jitter; human hold delays 55–125 ms |
|
|
71
|
+
| Cloudflare Turnstile | Detects the interstitial, locates the checkbox via the DOM and clicks it with the real X11 mouse |
|
|
72
|
+
| RAM discipline | `--renderer-process-limit=1`, JS heap capped at 256 MB, tab reset after each fetch, auto-hibernation after idle (default 60 s) ⇒ ~12 MB resting |
|
|
73
|
+
| One at a time | Global mutex: 1 tab across all callers |
|
|
74
|
+
| Interfaces | CLI `browser-agent`, HTTP API `127.0.0.1:8765`, Python SDK `browser_agent.BrowserClient` |
|
|
75
|
+
| Live view | `browser-agent vnc start` + SSH-forwarded VNC |
|
|
76
|
+
| Optional WARP route | Auto-retry blocked pages through a local SOCKS5 proxy (`127.0.0.1:40000`) |
|
|
77
|
+
|
|
78
|
+
## Docs
|
|
79
|
+
|
|
80
|
+
- [`docs/deployment.md`](docs/deployment.md) — provisioning, systemd, memory limits, WARP, VNC logins
|
|
81
|
+
- [`docs/api.md`](docs/api.md) — HTTP contract (v1)
|
|
82
|
+
- [`docs/architecture.md`](docs/architecture.md) — how and why it works
|
|
83
|
+
- [`docs/security.md`](docs/security.md) — trust boundaries (loopback-only, no auth)
|
|
84
|
+
- [`docs/troubleshooting.md`](docs/troubleshooting.md) — symptom → cause → action
|
|
85
|
+
|
|
86
|
+
## For AI agents
|
|
87
|
+
|
|
88
|
+
Install one-liner: `uv tool install browser-agent-server && sudo browser-agent setup --with-chrome && browser-agent doctor`
|
|
89
|
+
Self-check: `browser-agent doctor --json` (exit 0 = host ready).
|
|
90
|
+
Companion MCP for agent hosts: [`vernikr/browser-agent-mcp`](https://github.com/vernikr/browser-agent-mcp).
|
|
91
|
+
|
|
92
|
+
## Platform support
|
|
93
|
+
|
|
94
|
+
Linux/X11 only (Xvfb, XTEST). Works great on a 1 vCPU / 1 GB RAM VPS. macOS/Windows workstations should run the [MCP bridge](https://github.com/vernikr/browser-agent-mcp) and talk to a Linux host running this daemon.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
browser_agent/__init__.py,sha256=YPQ6SBFXoAni-FWe1zwyvZjYkIv2SAbMjqVJ_9qhDUM,4570
|
|
2
|
+
browser_agent/chrome.py,sha256=J8XNMZ-WZnh37Ms7jdzaNXz_kBh1XaKCpxuknornM78,23429
|
|
3
|
+
browser_agent/cli.py,sha256=DNJzJednC0UkMKC8oz6TpIu6SG-kFo4ba3-0399lLJ0,18618
|
|
4
|
+
browser_agent/server.py,sha256=ELGebWieDjwOv2GBOKuPV-n2R_aaevJPanvCQgUDRTs,10013
|
|
5
|
+
browser_agent/vision_agent.py,sha256=g0r68mXiT5Yj4lMQVNpNny5TeGyqPeQRoQsCrjuemQo,6576
|
|
6
|
+
browser_agent/x11_input.py,sha256=gIcqTVI5G-PCVQSII3Hblr2p9ZYPukkOhrphyCGlDqI,9542
|
|
7
|
+
browser_agent/data/browser-agent.service,sha256=UVwkaJ6PulivAh09bCeWaPtdiVtfnERZWxe6zB2weJ8,803
|
|
8
|
+
browser_agent_server-1.0.0.dist-info/METADATA,sha256=qBzpcQOhCz6jU1uQLNBd61gFG3GitQ__tDnZGFUC4Eg,5093
|
|
9
|
+
browser_agent_server-1.0.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
10
|
+
browser_agent_server-1.0.0.dist-info/entry_points.txt,sha256=UAxTht6mKig6IcWZ5VzGzhIauEB11Kn0-5LopJkArTM,57
|
|
11
|
+
browser_agent_server-1.0.0.dist-info/licenses/LICENSE,sha256=Ac7u3EmsgsGa5fEVltTYwg9FD1DzqDontGH6o8X0WWM,1064
|
|
12
|
+
browser_agent_server-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vernikr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|