@hasna/browser 0.3.6 → 0.3.8

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 CHANGED
@@ -1,78 +1,50 @@
1
- # open-browser
1
+ # @hasna/browser
2
2
 
3
- Unified browser automation MCP for AI agents wraps Chrome DevTools, Playwright, and Lightpanda with a common interface, screenshot compression, and switchable backends.
3
+ General-purpose browser agent toolkitPlaywright, Chrome DevTools Protocol, Lightpanda with auto engine selection. CLI + MCP + REST + SDK.
4
4
 
5
- ## Problem
5
+ [![npm](https://img.shields.io/npm/v/@hasna/browser)](https://www.npmjs.com/package/@hasna/browser)
6
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
6
7
 
7
- `chrome-devtools-mcp` is great but has critical issues:
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
- ## Solution
14
-
15
- `open-browser` provides:
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
- ## Backends
14
+ ## CLI Usage
23
15
 
24
- | Backend | Speed | JS Support | Use case |
25
- |---------|-------|------------|----------|
26
- | **Chrome DevTools** | Medium | Full | Complex SPAs, auth flows, file uploads |
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
- ## Installation
20
+ ## MCP Server
31
21
 
32
22
  ```bash
33
- bun install -g @hasna/browser
23
+ browser-mcp
34
24
  ```
35
25
 
36
- ## Requirements
26
+ 1 tools available.
37
27
 
38
- > **Note:** The Bun.WebView engine requires [Bun canary](https://bun.sh/docs/installation#canary) until WebView support lands in a stable release. Install with: `bun upgrade --canary`. Other engines (Playwright, CDP, Lightpanda) work with stable Bun.
39
-
40
- ## Usage
28
+ ## REST API
41
29
 
42
30
  ```bash
43
- # Default (Chrome DevTools backend)
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
- ## MCP Tools
34
+ ## Cloud Sync
54
35
 
55
- All tools work identically across backends:
36
+ This package supports cloud sync via `@hasna/cloud`:
56
37
 
57
- - `navigate_page` — Go to URL
58
- - `take_snapshot` — Get accessibility tree (text, no size issues)
59
- - `take_screenshot` **Compressed** screenshot (max 1200px, JPEG 70%)
60
- - `click` Click element by UID
61
- - `fill` — Fill input
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
- ## Status
44
+ ## Data Directory
73
45
 
74
- 🚧 In development. See [tasks](https://github.com/hasna/browser/issues) for progress.
46
+ Data is stored in `~/.hasna/browser/`.
75
47
 
76
48
  ## License
77
49
 
78
- Apache-2.0 see [LICENSE](./LICENSE)
50
+ Apache-2.0 -- see [LICENSE](LICENSE)