@53able/pi-agent-browser 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +50 -65
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Changed
6
+
7
+ - Reworked README for package users: benefits, workflows, safety guidance, and troubleshooting.
8
+ - Removed maintainer-specific publishing instructions from the npm-facing README.
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  ### Added
package/README.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # pi-agent-browser
2
2
 
3
- Pi extension wrapping [`vercel-labs/agent-browser`](https://github.com/vercel-labs/agent-browser) for browser automation, rendered-page interaction, screenshots, saved browser state, and agent-readable context extraction.
3
+ Typed browser automation tools for Pi, powered by [`agent-browser`](https://github.com/vercel-labs/agent-browser).
4
4
 
5
- This package exposes `agent-browser` CLI capabilities as typed Pi tools, so Pi can use browser sessions without hand-writing shell commands.
5
+ Use this package when Pi needs to operate real web pages, extract rendered context, keep login sessions, or capture visual evidence without falling back to ad-hoc shell commands.
6
+
7
+ ## What you get
8
+
9
+ - **Rendered-page context extraction** — read text from public pages or the active authenticated browser tab.
10
+ - **Reliable interaction handles** — use accessibility snapshots with stable `@ref` targets for clicks and form fills.
11
+ - **Evidence capture** — save screenshots and extracted text to predictable artifact paths.
12
+ - **Session persistence** — reuse login state with named `agent-browser` sessions and restore support.
13
+ - **Safer browsing controls** — constrain work with `allowedDomains`, `maxOutput`, and explicit state management.
14
+ - **Typed Pi tools** — each browser action has its own schema instead of one free-form command string.
6
15
 
7
16
  ## Requirements
8
17
 
@@ -10,13 +19,13 @@ This package exposes `agent-browser` CLI capabilities as typed Pi tools, so Pi c
10
19
  - [`agent-browser`](https://github.com/vercel-labs/agent-browser) installed and available on `PATH`
11
20
  - Chrome for Testing installed through `agent-browser install`
12
21
 
13
- Quick check:
22
+ Check your local setup:
14
23
 
15
24
  ```bash
16
25
  agent-browser doctor
17
26
  ```
18
27
 
19
- If `agent-browser` is not on `PATH`, set:
28
+ If `agent-browser` is installed outside `PATH`, set:
20
29
 
21
30
  ```bash
22
31
  export AGENT_BROWSER_BIN=/absolute/path/to/agent-browser
@@ -24,39 +33,29 @@ export AGENT_BROWSER_BIN=/absolute/path/to/agent-browser
24
33
 
25
34
  ## Installation
26
35
 
27
- From GitHub:
36
+ Install from npm:
28
37
 
29
38
  ```bash
30
- pi install https://github.com/53able/pi-agent-browser
39
+ pi install npm:@53able/pi-agent-browser
31
40
  ```
32
41
 
33
- From npm after publish:
42
+ Install from GitHub:
34
43
 
35
44
  ```bash
36
- pi install npm:@53able/pi-agent-browser
45
+ pi install https://github.com/53able/pi-agent-browser
37
46
  ```
38
47
 
39
- From a local checkout:
48
+ Install from a local checkout:
40
49
 
41
50
  ```bash
42
51
  git clone https://github.com/53able/pi-agent-browser.git
43
52
  pi install ./pi-agent-browser
44
53
  ```
45
54
 
46
- Or add the package source to Pi settings manually:
47
-
48
- ```json
49
- {
50
- "packages": ["npm:@53able/pi-agent-browser"]
51
- }
52
- ```
53
-
54
- ## Tools
55
-
56
- The extension registers these Pi tools:
55
+ ## Registered tools
57
56
 
58
57
  - `agent_browser_open` — open a URL or launch `about:blank`
59
- - `agent_browser_read` — extract agent-readable text or JSON from a URL or active rendered tab
58
+ - `agent_browser_read` — extract text or JSON from a URL or active rendered tab
60
59
  - `agent_browser_snapshot` — get accessibility tree refs for interaction
61
60
  - `agent_browser_click` — click by `@ref` or CSS selector
62
61
  - `agent_browser_fill` — fill an input by `@ref` or CSS selector
@@ -66,15 +65,17 @@ The extension registers these Pi tools:
66
65
  - `agent_browser_close` — close a browser session
67
66
  - `agent_browser_doctor` — run `agent-browser doctor`
68
67
 
69
- ## Basic usage
68
+ ## Common workflows
69
+
70
+ ### Read a page and save the extracted source
70
71
 
71
- Ask Pi naturally:
72
+ Ask Pi:
72
73
 
73
74
  ```text
74
- https://example.com を browser 経由で読んで、outputs/browser/example.md に保存して
75
+ https://example.com をブラウザ経由で読み、outputs/browser/example.md に保存して
75
76
  ```
76
77
 
77
- Equivalent tool arguments for `agent_browser_read`:
78
+ Equivalent `agent_browser_read` arguments:
78
79
 
79
80
  ```json
80
81
  {
@@ -84,9 +85,9 @@ Equivalent tool arguments for `agent_browser_read`:
84
85
  }
85
86
  ```
86
87
 
87
- ## Browser interaction workflow
88
+ ### Interact with a rendered page
88
89
 
89
- 1. Open or navigate:
90
+ 1. Open the page.
90
91
 
91
92
  ```json
92
93
  {
@@ -98,12 +99,12 @@ Equivalent tool arguments for `agent_browser_read`:
98
99
 
99
100
  2. Call `agent_browser_snapshot` to get fresh `@ref` values.
100
101
  3. Use `agent_browser_click` or `agent_browser_fill` with those refs.
101
- 4. Use `agent_browser_read` for text extraction or `agent_browser_screenshot` for visual evidence.
102
+ 4. Call `agent_browser_read` for text or `agent_browser_screenshot` for visual evidence.
102
103
  5. Close the session with `agent_browser_close` when finished.
103
104
 
104
- ## Login/session state
105
+ ### Keep login state across runs
105
106
 
106
- To keep login state automatically, use a stable `session` and `restore: true` on `agent_browser_open`:
107
+ Use a stable session name and `restore: true`:
107
108
 
108
109
  ```json
109
110
  {
@@ -114,6 +115,10 @@ To keep login state automatically, use a stable `session` and `restore: true` on
114
115
  }
115
116
  ```
116
117
 
118
+ After logging in once, future opens with the same `session` and `restore` can reuse saved browser state.
119
+
120
+ ### Inspect or clear saved state
121
+
117
122
  List saved states:
118
123
 
119
124
  ```json
@@ -131,7 +136,7 @@ Clear one saved session state:
131
136
  }
132
137
  ```
133
138
 
134
- Clear all saved states only when explicitly intended:
139
+ Clear all saved states only when intentionally resetting everything:
135
140
 
136
141
  ```json
137
142
  {
@@ -140,52 +145,32 @@ Clear all saved states only when explicitly intended:
140
145
  }
141
146
  ```
142
147
 
143
- ## Safety notes
148
+ ## Safety guidance
144
149
 
145
- - Prefer `allowedDomains` for task-scoped browsing.
146
- - Use `outputPath` for durable source artifacts that support reports.
147
- - Take a fresh snapshot after navigation, form submission, modal dismissal, or failed clicks.
150
+ - Pass `allowedDomains` whenever the browsing scope is known.
151
+ - Use `outputPath` when extracted content supports a report, audit, or later verification.
152
+ - Take a fresh snapshot after navigation, form submission, modal dismissal, or a failed click.
148
153
  - Prefer `agent_browser_read` for textual evidence and `agent_browser_screenshot` for visual evidence.
149
- - Use `agent_browser_eval` only when `read`/`snapshot` cannot expose the required state.
154
+ - Use `agent_browser_eval` only when `read` or `snapshot` cannot expose the required state.
155
+ - Review saved browser state before clearing broadly.
150
156
 
151
- ## Development
157
+ ## Troubleshooting
152
158
 
153
- Dry-run the npm package contents:
159
+ Run:
154
160
 
155
161
  ```bash
156
- npm run pack:dry
162
+ agent-browser doctor
157
163
  ```
158
164
 
159
- Local Pi test example:
165
+ Or ask Pi to run `agent_browser_doctor`.
166
+
167
+ Common fixes:
160
168
 
161
169
  ```bash
162
- PI_OFFLINE=1 pi --no-builtin-tools --tools agent_browser_doctor -p "Use agent_browser_doctor and report output"
170
+ npm install -g agent-browser
171
+ agent-browser install
163
172
  ```
164
173
 
165
174
  ## License
166
175
 
167
176
  MIT
168
-
169
- ## Publishing
170
-
171
- This repository is intended to publish through npm Trusted Publishing from GitHub Actions, not through long-lived npm tokens.
172
-
173
- ### npm Trusted Publisher setup
174
-
175
- In npm, configure a trusted publisher for the package:
176
-
177
- - Package: `@53able/pi-agent-browser`
178
- - Publisher type: GitHub Actions
179
- - GitHub owner: `53able`
180
- - Repository: `pi-agent-browser`
181
- - Workflow filename: `publish.yml`
182
- - Allowed action: `npm publish`
183
-
184
- Then publish a release by pushing a semver tag:
185
-
186
- ```bash
187
- git tag v0.1.0
188
- git push origin v0.1.0
189
- ```
190
-
191
- The workflow uses GitHub OIDC with `id-token: write`, so no `NPM_TOKEN` secret is required.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@53able/pi-agent-browser",
3
- "version": "0.1.0",
4
- "description": "Pi extension wrapping vercel-labs/agent-browser for browser automation and context extraction.",
3
+ "version": "0.1.1",
4
+ "description": "Typed Pi tools for browser automation, rendered-page context extraction, screenshots, and saved session state via agent-browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "keywords": [