@hasna/browser 0.3.6 → 0.3.7
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 +27 -55
- package/dist/cli/index.js +3750 -3190
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/index.js +3477 -2922
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/mcp/index.js +3689 -3129
- package/dist/server/index.js +3497 -2942
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,78 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hasna/browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
General-purpose browser agent toolkit — Playwright, Chrome DevTools Protocol, Lightpanda with auto engine selection. CLI + MCP + REST + SDK.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@hasna/browser)
|
|
6
|
+
[](LICENSE)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- `take_screenshot` returns raw PNG that can exceed 20MB, breaking MCP protocol
|
|
9
|
-
- No compression/resize before returning
|
|
10
|
-
- No backend flexibility (only Chrome)
|
|
11
|
-
- No smart routing (always spins up full Chrome even for simple fetches)
|
|
8
|
+
## Install
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Unified tool interface** — same tools work across all backends
|
|
17
|
-
- **Automatic screenshot compression** — max 1200px, JPEG 70%, guaranteed <500KB
|
|
18
|
-
- **Switchable backends** — Chrome DevTools, Playwright, Lightpanda
|
|
19
|
-
- **Smart auto-selection** — light pages → Lightpanda, JS apps → Chrome, cross-browser → Playwright
|
|
20
|
-
- **All the tools** — navigate, click, fill, snapshot, screenshot, upload, evaluate, wait
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @hasna/browser
|
|
12
|
+
```
|
|
21
13
|
|
|
22
|
-
##
|
|
14
|
+
## CLI Usage
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
| **Playwright** | Medium | Full | Cross-browser, PDF, reliable selectors |
|
|
28
|
-
| **Lightpanda** | Fast (~10x) | Partial | Static pages, scraping, DOM inspection |
|
|
16
|
+
```bash
|
|
17
|
+
browser --help
|
|
18
|
+
```
|
|
29
19
|
|
|
30
|
-
##
|
|
20
|
+
## MCP Server
|
|
31
21
|
|
|
32
22
|
```bash
|
|
33
|
-
|
|
23
|
+
browser-mcp
|
|
34
24
|
```
|
|
35
25
|
|
|
36
|
-
|
|
26
|
+
1 tools available.
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Usage
|
|
28
|
+
## REST API
|
|
41
29
|
|
|
42
30
|
```bash
|
|
43
|
-
|
|
44
|
-
browser serve
|
|
45
|
-
|
|
46
|
-
# Playwright backend
|
|
47
|
-
BROWSER_BACKEND=playwright browser serve
|
|
48
|
-
|
|
49
|
-
# Lightpanda backend
|
|
50
|
-
BROWSER_BACKEND=lightpanda browser serve
|
|
31
|
+
browser-serve
|
|
51
32
|
```
|
|
52
33
|
|
|
53
|
-
##
|
|
34
|
+
## Cloud Sync
|
|
54
35
|
|
|
55
|
-
|
|
36
|
+
This package supports cloud sync via `@hasna/cloud`:
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `type_text` — Type text
|
|
63
|
-
- `press_key` — Press keyboard key
|
|
64
|
-
- `upload_file` — Upload file to input
|
|
65
|
-
- `evaluate_script` — Execute JavaScript
|
|
66
|
-
- `wait_for` — Wait for element/condition
|
|
67
|
-
- `new_page` — Open new tab
|
|
68
|
-
- `close_page` — Close tab
|
|
69
|
-
- `list_pages` — List open tabs
|
|
70
|
-
- `get_network_requests` — Inspect network traffic
|
|
38
|
+
```bash
|
|
39
|
+
cloud setup
|
|
40
|
+
cloud sync push --service browser
|
|
41
|
+
cloud sync pull --service browser
|
|
42
|
+
```
|
|
71
43
|
|
|
72
|
-
##
|
|
44
|
+
## Data Directory
|
|
73
45
|
|
|
74
|
-
|
|
46
|
+
Data is stored in `~/.hasna/browser/`.
|
|
75
47
|
|
|
76
48
|
## License
|
|
77
49
|
|
|
78
|
-
Apache-2.0
|
|
50
|
+
Apache-2.0 -- see [LICENSE](LICENSE)
|