pi-agent-browser-native 0.2.24 → 0.2.26

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.
@@ -5,6 +5,7 @@ Related docs:
5
5
  - [`TOOL_CONTRACT.md`](TOOL_CONTRACT.md)
6
6
  - [`ARCHITECTURE.md`](ARCHITECTURE.md)
7
7
  - [`RELEASE.md`](RELEASE.md)
8
+ - [`SUPPORT_MATRIX.md`](SUPPORT_MATRIX.md)
8
9
 
9
10
  ## Purpose
10
11
 
@@ -19,25 +20,53 @@ This project intentionally blocks normal `agent-browser` bash usage in most agen
19
20
  This reference is baselined to the locally installed `agent-browser 0.27.0` command/help surface. Upstream `agent-browser` remains the source of truth for command semantics; this file is the local fallback for Pi agent sessions where direct binary help is blocked or discouraged.
20
21
 
21
22
  The lightweight drift check is `npm run verify -- command-reference`. Run it whenever the installed upstream `agent-browser` version changes or this reference is edited.
23
+
24
+ Use `npm run benchmark:agent-browser` or `npm run verify -- benchmark` before and after agent-facing workflow abstractions to measure task success, tool calls, model-visible output size, stale-ref behavior, artifact success, failure-category coverage, and elapsed-time estimates.
22
25
  <!-- agent-browser-capability-baseline:end upstream-baseline -->
23
26
 
24
27
  ## Core mental model
25
28
 
26
- Tool parameters:
29
+ Tool parameters (use exactly one of `args`, `semanticAction`, `job`, `qa`, `sourceLookup`, or `networkSourceLookup`):
27
30
 
28
31
  ```json
29
- {
30
- "args": ["open", "https://example.com"],
31
- "stdin": "optional raw stdin content",
32
- "sessionMode": "auto"
33
- }
32
+ { "args": ["open", "https://example.com"], "sessionMode": "auto" }
33
+ ```
34
+
35
+ ```json
36
+ { "semanticAction": { "action": "click", "locator": "text", "value": "Submit" }, "sessionMode": "auto" }
37
+ ```
38
+
39
+ ```json
40
+ { "args": ["batch"], "stdin": "[[\"open\",\"https://example.com\"],[\"snapshot\",\"-i\"]]" }
41
+ ```
42
+
43
+ ```json
44
+ { "job": { "steps": [{ "action": "open", "url": "https://example.com" }, { "action": "assertText", "text": "Example Domain" }] } }
45
+ ```
46
+
47
+ ```json
48
+ { "sourceLookup": { "selector": "#save", "reactFiberId": "2", "componentName": "SaveButton" } }
49
+ ```
50
+
51
+ ```json
52
+ { "networkSourceLookup": { "requestId": "req-1", "url": "/api/fail" } }
34
53
  ```
35
54
 
36
- - `args`: exact `agent-browser` CLI tokens after the binary name.
37
- - `stdin`: only for `batch`, `eval --stdin`, and `auth save --password-stdin`; other command/stdin combinations are rejected before `agent-browser` is launched.
55
+ - `args`: exact `agent-browser` CLI tokens after the binary name. Omit when using `semanticAction`, `job`, `qa`, `sourceLookup`, or `networkSourceLookup` instead (mutually exclusive).
56
+ - `semanticAction`: optional shorthand for common `find` flows; compiles to `find` argv and is rejected together with `args`, `job`, `qa`, `sourceLookup`, or `networkSourceLookup` on the same call.
57
+ - `job`: optional constrained short-workflow schema; compiles to existing upstream `batch` args/stdin and reports the compiled plan in `details.compiledJob`.
58
+ - `qa`: optional lightweight QA preset; compiles to the same batch path and reports `details.compiledQaPreset` plus `details.qaPreset` pass/fail evidence.
59
+ - `sourceLookup`: optional experimental helper for local UI-to-source *candidates*; compiles to the same `batch` path, reports `details.compiledSourceLookup` and `details.sourceLookup`, and never reclassifies a fully successful upstream batch as failed the way `qa` can (see [`TOOL_CONTRACT.md`](TOOL_CONTRACT.md#sourcelookup) and the longer notes below).
60
+ - `networkSourceLookup`: optional experimental helper for failed request-to-source *candidates*; compiles to generated `batch`, reports `details.compiledNetworkSourceLookup` and `details.networkSourceLookup`, and never assigns blame or edits files.
61
+ - `stdin`: only for `batch`, `eval --stdin`, and `auth save --password-stdin`; other command/stdin combinations are rejected before `agent-browser` is launched. `job`, `qa`, `sourceLookup`, and `networkSourceLookup` generate their own `batch` stdin.
38
62
  - `sessionMode`:
39
63
  - `"auto"` reuses the extension-managed session when possible.
40
- - `"fresh"` rotates that managed session to a fresh upstream launch so launch-scoped flags like `--profile`, `--session-name`, `--cdp`, `--state`, `--auto-connect`, `--init-script`, or `--enable` apply.
64
+ - `"fresh"` rotates that managed session to a fresh upstream launch so launch-scoped flags like `--profile`, `--session-name`, `--cdp`, `--state`, `--auto-connect`, `--init-script`, `--enable`, `-p` / `--provider`, or iOS `--device` apply.
65
+ - If a fresh launch fails or times out, read `details.managedSessionOutcome` for `preserved` vs `abandoned` (and related fields). A model-visible `Managed session outcome: …` line is appended only for failing calls that used `sessionMode: "fresh"`; `"auto"` failures can still populate the struct without that extra line.
66
+
67
+ ### Debug, diff, stream, dashboard, and chat families
68
+
69
+ Upstream also exposes non-core families (`network`, `diff`, `trace` / `profiler` / `record`, `console` / `errors` / `highlight` / `inspect` / `clipboard`, `stream`, `dashboard`, `chat`, and related subcommands). The wrapper still owns argv planning, `--json`, managed sessions where applicable, artifact metadata, and model-facing presentation: structured results are compacted and scrubbed in `extensions/agent-browser/lib/results/presentation.ts`, and echoed argv uses the same `redactInvocationArgs` rules as core commands (see [`TOOL_CONTRACT.md`](TOOL_CONTRACT.md#details) for the field contract). Deterministic fake-upstream coverage for representative JSON shapes and redaction lives in `test/agent-browser.extension-validation.test.ts` under `agentBrowserExtension passes through non-core network debug diff stream dashboard and chat families`.
41
70
 
42
71
  ## Recommended workflow
43
72
 
@@ -96,12 +125,22 @@ Examples:
96
125
  { "args": ["find", "role", "button", "click", "--name", "Close"] }
97
126
  { "args": ["find", "text", "Close", "click"] }
98
127
  { "args": ["find", "label", "Email", "fill", "user@example.com"] }
128
+ { "semanticAction": { "action": "click", "locator": "role", "value": "button", "name": "Close" } }
129
+ { "semanticAction": { "action": "fill", "locator": "label", "value": "Email", "text": "user@example.com" } }
130
+ { "semanticAction": { "action": "click", "locator": "text", "value": "Close", "session": "named-browser" } }
131
+ { "semanticAction": { "action": "uncheck", "locator": "label", "value": "Remember me" } }
99
132
  { "args": ["scrollintoview", "@e12"] }
100
133
  { "args": ["snapshot", "-i"] }
101
134
  ```
102
135
 
136
+ The optional native `semanticAction` object is only a thin schema for common locator-based actions; it compiles to existing upstream `find` commands and reports the compiled argv in `details.compiledSemanticAction` (see [`TOOL_CONTRACT.md`](TOOL_CONTRACT.md#semanticaction) for the full field rules). It is a top-level alternative to `args`, `job`, `qa`, `sourceLookup`, and `networkSourceLookup`, not a nested shape inside `batch` stdin arrays. Add `session` inside `semanticAction` when the shorthand should target a named upstream browser session; the compiled argv prepends `--session <name>` before `find`, and fallback candidate actions preserve that prefix. If a semantic action misses with `selector-not-found`, visible output may include `Agent-browser candidate fallbacks`, while `details.nextActions` first recommends a fresh `snapshot -i` and may include bounded role/name retries—for example `searchbox`/`textbox` for a missed `placeholder` fill, `button`/`link` for a missed `text` click, or a `textbox` retry for a missed `label` fill—each as a `try-*-candidate` entry carrying redacted `find role …` argv.
137
+
103
138
  Do not assume Playwright selector dialects such as `text=Close` or `button:has-text('Close')` are supported wrapper syntax. If you need those forms, verify current upstream `agent-browser` behavior first; otherwise use refs, `find`, or known CSS selectors.
104
139
 
140
+ Treat `@e…` refs as page-scoped. After a successful `snapshot`, the wrapper records the latest refs and page target for that session; mutation-prone ref commands such as `click @e4` or batch steps with old refs fail with `failureCategory: "stale-ref"` when the page target changed or the ref is absent from the latest same-page snapshot. Inside `batch` stdin JSON, the wrapper also walks steps in order before spawn: steps whose first token can navigate or mutate set a latch; a later step whose first token is `snapshot` clears that latch for following rows; guarded steps that still mention `@e…` after an uncleared latch fail with the same `stale-ref` bucket without launching upstream. Follow the `refresh-interactive-refs` next action (it includes `--session <name>` when needed) and prefer stable `find` or `semanticAction` locators when navigation or rerendering is likely. Contract detail: [`TOOL_CONTRACT.md`](TOOL_CONTRACT.md#details) (`refSnapshot`).
141
+
142
+ When a **top-level** `click` succeeds (not a `click` hidden inside a `batch`/`job` tool call—the unified command must be `click`), the upstream payload includes `data.clicked`, and the wrapper sees the active tab URL unchanged after the same normalization it uses for ref guards (**`#fragment` ignored**), it may run one extra `snapshot -i` and surface `Possible overlay blockers` plus `details.overlayBlockers` (`candidates`, `summary`, and a `snapshot` map that can refresh `refSnapshot`) when that snapshot shows overlay/banner/dialog context **and** up to three close/dismiss-like controls. The URL check compares the session’s prior pinned tab target to `details.navigationSummary.url` after the click; that summary is gathered with extra `get url` / `get title` calls only when the click JSON omits **both** string `data.url` and `data.title`—if upstream already echoes either field, overlay diagnostics are skipped on this path. The diagnostic is skipped if the wrapper already applied tab-focus correction or about-blank recovery on that result. Appended `inspect-overlay-state` / `try-overlay-blocker-candidate-*` entries in `details.nextActions` include `--session <name>` when the session is named, same as other session-scoped follow-ups. Treat `inspect-overlay-state` as the safe first follow-up; only use a `try-overlay-blocker-candidate-*` next action when the candidate is clearly the control you intend to close.
143
+
105
144
  ### Extract page data
106
145
 
107
146
  ```json
@@ -111,7 +150,11 @@ Do not assume Playwright selector dialects such as `text=Close` or `button:has-t
111
150
  { "args": ["eval", "--stdin"], "stdin": "document.title" }
112
151
  ```
113
152
 
114
- Prefer `get` and scoped `eval --stdin` for read-only extraction. Return the intended JavaScript value instead of relying on `console.log`.
153
+ Prefer `get` and scoped `eval --stdin` for read-only extraction. Getter names are grouped under `get`: use `get title`, `get url`, or `get text <selector>`, not shortcut commands such as `title` or `url`. When upstream reports an unknown command, unknown subcommand, or unrecognized command for a single-token shortcut (`attr`, `count`, `html`, `text`, `title`, `url`, or `value`), the wrapper adds a visible grouped-`get` hint; only `title` and `url` also get exact read-only `details.nextActions` (`use-get-title` / `use-get-url`, with `--session` preserved when the failed call named a session). If another `Agent-browser hint:` (selector dialect or stale-ref recovery) was already appended to the same error text, the getter hint is omitted.
154
+
155
+ Return the intended JavaScript value from `eval --stdin` instead of relying on `console.log`. For object-shaped extraction, pass a plain expression such as `({ title: document.title, url: location.href })`; if you send a function-shaped snippet, invoke it explicitly, for example `(() => ({ title: document.title }))()`. When upstream serializes a function result to `{}`, the wrapper can append `Eval stdin hint` and `details.evalStdinHint`.
156
+
157
+ On tabbed or hidden-DOM pages, `get text <selector>` reads the upstream-selected match, which may be hidden even when a later match is visible. For non-`@ref` CSS selectors with multiple matches, including successful `batch` steps, the wrapper may add `Selector text visibility warning`, `details.selectorTextVisibility` (and `details.selectorTextVisibilityAll` for multiple batched warnings), and `inspect-visible-text-candidates` next actions so agents know to use a fresher `snapshot -i`, a visible `@ref`, or a more specific selector instead of trusting hidden tab content.
115
158
 
116
159
  ### Run a multi-step flow in one browser invocation
117
160
 
@@ -121,6 +164,46 @@ Prefer `get` and scoped `eval --stdin` for read-only extraction. Return the inte
121
164
 
122
165
  Use `batch --bail` when later steps should stop after the first failed command.
123
166
 
167
+ For short constrained flows, use top-level `job` instead of hand-writing `batch` stdin. Supported job steps are `open`, `click`, `fill`, `wait`, `assertText`, `assertUrl`, `waitForDownload`, and `screenshot`; the wrapper compiles them to upstream `batch` and records `details.compiledJob.steps[]`. There is still no separate first-class catalog of reusable named browser recipes above `job`, the `qa` preset, and raw `batch`; see [`ARCHITECTURE.md`](ARCHITECTURE.md#no-reusable-recipe-layer-yet) for the closed `RQ-0068` decision and revisit bar.
168
+
169
+ ```json
170
+ {
171
+ "job": {
172
+ "steps": [
173
+ { "action": "open", "url": "https://example.com" },
174
+ { "action": "assertText", "text": "Example Domain" },
175
+ { "action": "screenshot", "path": ".dogfood/example.png" }
176
+ ]
177
+ }
178
+ }
179
+ ```
180
+
181
+ Use raw `args: ["batch"]` with `stdin` when you need arbitrary upstream commands, flags, or batch failure policies outside the constrained schema. Do not pass `stdin` with `job`, `qa`, `sourceLookup`, or `networkSourceLookup`; those modes generate the batch stdin themselves.
182
+
183
+ For quick smoke/QA checks, use top-level `qa`. It clears enabled network/console/page-error buffers before opening the target URL, waits for page readiness, checks expected text/selector, inspects fresh network requests, console messages, and page errors, and can capture an evidence screenshot. QA network diagnostics classify failed requests by likely impact: actionable document/script/API-style failures fail the preset, while common low-impact browser icon misses such as `favicon.ico` are surfaced as warnings (`qaPreset.warnings`) so they do not fail an otherwise healthy page.
184
+
185
+ The same classification drives plain `network requests` presentation: when any row counts as failed (HTTP status ≥ 400, `failed: true`, or a string `error`), model-facing text starts with a line like `Network failure summary: 0 actionable, 1 benign low-impact (1 total).`, and each preview line can end with an impact tag such as `[benign: low-impact browser icon asset]` or `[actionable: document, script, API, or non-benign request failure]`. Rules live in `classifyNetworkRequestFailure` / `summarizeNetworkFailures` in `extensions/agent-browser/lib/results/shared.ts`; QA aggregation is `analyzeQaPresetResults` in `extensions/agent-browser/index.ts`.
186
+
187
+ ```json
188
+ { "qa": { "url": "https://example.com", "expectedText": "Example Domain", "screenshotPath": ".dogfood/qa-example.png" } }
189
+ ```
190
+
191
+ Optional `checkNetwork`, `checkConsole`, and `checkErrors` default to `true`; set one to `false` to skip that diagnostic. Omit `expectedText` and `expectedSelector` when you only need load plus diagnostics.
192
+
193
+ Use custom `job` or raw `batch` when you need a different check sequence.
194
+
195
+ For local app debugging, top-level `sourceLookup` can gather candidate component/file locations for a visible element from selector DOM hints, React DevTools inspection, and a bounded workspace component-name search rooted at the Pi session working directory (`maxWorkspaceFiles` defaults to 2000 and cannot exceed 5000; the scan records at most ten `workspace-search` candidates). With a `selector`, the wrapper runs `is visible` and, unless `includeDomHints` is `false`, `get html` so DOM data attributes and embedded source-like paths can become `dom-attribute` candidates. It reports evidence and confidence in `details.sourceLookup` instead of claiming a guaranteed source file. React hints require a session opened with `--enable react-devtools`. The `details.sourceLookup.status` field reads `unsupported` only when no candidates were collected **and** a `react` batch step failed (inspect errors, missing renderer, and similar); it reads `no-candidates` when the batch succeeded but nothing matched. If selector or workspace hints still yield candidates, `status` remains `candidates-found` even when React inspection failed. Unlike `qa`, the wrapper does not downgrade a **fully successful** upstream batch to `isError` solely because those statuses appear—though failed batch steps still produce normal tool errors.
196
+
197
+ ```json
198
+ { "sourceLookup": { "selector": "#save", "reactFiberId": "2", "componentName": "SaveButton" } }
199
+ ```
200
+
201
+ Top-level `networkSourceLookup` does the same for failed browser requests. When `requestId` is set it adds `network request <requestId>`; when `filter` or `url` is set it also adds `network requests --filter …`, using `url` as the filter pattern when `filter` is omitted. With `requestId` only, the compiled batch is just that request step; failed-request detection still walks the returned batch JSON and treats HTTP status ≥ 400, `failed: true`, or an `error` field as failure. When `filter` or `url` is present, the same heuristics apply but requests are correlated only if their URL matches that substring (either direction). Workspace URL literal search under the Pi session cwd reuses the `sourceLookup` scan rules (`maxWorkspaceFiles` defaults to 2000, hard cap 5000, at most ten `workspace-search` rows, up to eight URL/path needles from the query plus failed request URLs). It reports `details.networkSourceLookup.status` as `failed-requests-found`, `no-failed-requests`, or `no-candidates` and never assigns definitive blame.
202
+
203
+ ```json
204
+ { "networkSourceLookup": { "requestId": "req-1", "url": "/api/fail" } }
205
+ ```
206
+
124
207
  ### Wait for page readiness or downloads
125
208
 
126
209
  ```json
@@ -151,17 +234,23 @@ A successful wait-based download renders a readable summary such as `Download co
151
234
  ```json
152
235
  { "args": ["download", "@e5", "/tmp/report.pdf"] }
153
236
  { "args": ["screenshot", "/tmp/page.png"] }
237
+ { "args": ["screenshot", "--full", "/tmp/full-page.png"] }
238
+ { "args": ["screenshot", "--annotate", "/tmp/annotated.png"] }
154
239
  { "args": ["pdf", "/tmp/page.pdf"] }
155
240
  ```
156
241
 
242
+ The upstream screenshot aliases are `screenshot --full` for full-page capture and `screenshot --annotate` for labeled screenshots.
243
+
157
244
  Prefer `download <selector> <path>` when the target element itself is the downloadable link/control. Use `click` plus `wait --download [path]` when a previous action starts the download indirectly.
158
245
 
159
246
  Wrapper result rendering is metadata-first for saved files:
160
247
  - screenshots return a saved-path summary, visible artifact metadata, structured `details.artifacts` metadata, and an inline image attachment when safe; the visible block includes artifact type, requested path, absolute path, existence, size, cwd, session, and repair/copy status when applicable
161
- - downloads, PDFs, `wait --download` files, traces, CPU profiles, completed WebM recordings from `record stop`, and path-bearing HAR captures return concise saved-path summaries plus structured `details.artifacts` metadata without inlining large files
248
+ - downloads, PDFs, `wait --download` files, `state save` state files, diff screenshot output images, traces, CPU profiles, completed WebM recordings from `record stop`, and path-bearing HAR captures return concise saved-path summaries plus structured `details.artifacts` metadata without inlining large files
162
249
  - `record start <path>` reports that recording started and that output will be written on `record stop`; the target file may not exist until recording stops
163
250
  - `batch` keeps each step's artifacts in `details.batchSteps[].artifacts` and aggregates them in top-level `details.artifacts` in step order
164
251
 
252
+ `diff screenshot` follows the file-artifact path above for the **diff** image: model-visible text and `details.artifacts` focus on that output, while baseline paths stay out of the artifact summary block, and Pi does **not** auto-inline the diff the way it inlines trusted `screenshot` captures. `state load` may print the loaded path in prose but does not add a saved-file artifact entry the way `state save` does.
253
+
165
254
  For screenshot paths under dot-directories such as `.dogfood/run/foo.png`, the wrapper normalizes the requested path to an absolute path before invoking upstream `agent-browser`, verifies the requested file exists, and repairs from an upstream temp screenshot when possible. The requested path remains visible as `Requested path`, while `Absolute path` shows the actual on-disk location.
166
255
 
167
256
  For annotated screenshots in `batch`, put `--annotate` in top-level args instead of inside the screenshot step:
@@ -176,6 +265,8 @@ The wrapper keeps a bounded, metadata-only `details.artifactManifest` of recent
176
265
 
177
266
  This manifest cap controls what appears in `details.artifactManifest` and in summaries such as `Session artifacts: 42 live, 0 evicted (42/100 recent)`. It does not delete explicit files that upstream saved to paths you chose, such as screenshots, PDFs, downloads, traces, HAR files, or WebM recordings.
178
267
 
268
+ Browser `close` is also not file cleanup. If `details.artifactManifest` is present with a non-empty `entries` list, a successful `close` appends an `Artifact lifecycle` note and reports `details.artifactCleanup` with the current retention summary and the same host-owned cleanup `note` as the contract (`extensions/agent-browser/index.ts`, `getArtifactCleanupGuidance`). Up to ten distinct user-chosen paths appear in `explicitArtifactPaths` when matching `explicit-path` manifest rows exist in the recent window; otherwise that array is empty and visible text may omit the “Explicit artifact paths” line even though the lifecycle block still reminds you that close does not delete saved files. Delete any paths you care about with host file tools after inspection; the native browser tool intentionally does not remove arbitrary user-chosen filesystem paths.
269
+
179
270
  Oversized snapshots and oversized generic outputs are different: when a persisted pi session is available, their wrapper-managed spill files are stored under the private session artifact directory and are governed by the byte budget `PI_AGENT_BROWSER_SESSION_ARTIFACT_MAX_BYTES` (default 32 MiB). Raise that byte budget as well for long QA sessions that need many full raw snapshots or large text spills to survive reload/resume.
180
271
 
181
272
  ### Switch from an already-active implicit session to a fresh profiled launch
@@ -214,6 +305,32 @@ If the result says `Pending confirmation id: c_8f3a1234`, choose one follow-up:
214
305
 
215
306
  Confirmation context may be redacted when it contains credentials, tokens, cookies, or auth-bearing URLs. Use the id exactly as printed.
216
307
 
308
+ ### Use stateful browser-context commands safely
309
+
310
+ Stateful commands are native `agent_browser` calls, not shell commands. Keep secrets out of `args` whenever upstream supports stdin, and expect model-facing summaries to redact auth, cookie, password, secret, session, and token-like values.
311
+
312
+ ```json
313
+ { "args": ["auth", "save", "demo", "--password-stdin"], "stdin": "password from the user-approved secret source" }
314
+ { "args": ["auth", "login", "demo"] }
315
+ { "args": ["state", "save", "/tmp/demo-state.json"] }
316
+ { "args": ["state", "load", "/tmp/demo-state.json"], "sessionMode": "fresh" }
317
+ { "args": ["cookies", "set", "theme", "dark", "--url", "https://example.com"] }
318
+ { "args": ["storage", "local", "get", "theme"] }
319
+ { "args": ["dialog", "status"] }
320
+ { "args": ["dialog", "accept", "prompt text"] }
321
+ { "args": ["frame", "main"] }
322
+ ```
323
+
324
+ Operational notes:
325
+
326
+ - `stdin` is accepted only for `batch`, `eval --stdin`, and `auth save --password-stdin`; other stdin-bearing calls are rejected before launch.
327
+ - `auth list/show/save/login/delete` summaries avoid expanding profile secrets. Prefer `auth save --password-stdin` over `--password <value>`.
328
+ - `state save <path>` is a verified file-artifact workflow; inspect `details.artifactVerification` before relying on the file. `state load <path>` is not treated as a newly saved artifact.
329
+ - `cookies get` can expose real authenticated-profile cookies; prefer task-specific page actions and only inspect cookies when the user needs cookie data.
330
+ - `storage local|session` summaries redact sensitive keys and values; still avoid broad storage dumps unless necessary.
331
+ - `dialog accept/dismiss/status`, `frame <selector|main>`, and guarded-action `confirm <id>` / `deny <id>` pass through the native tool. Prefer `details.nextActions` for exact confirmation recovery payloads.
332
+ - `batch` mirrors the same redaction on every step: top-level `details.data` is a compact `{ success, command, result?, error? }[]` matrix (argv-redacted `command`, stateful `result`, scrubbed `error` text). Use `details.batchSteps[]` when you need per-step artifacts, categories, spill paths, or full structured errors beyond the roll-up.
333
+
217
334
  ## Full supported surface
218
335
 
219
336
  The tables below intentionally list more than the recommended workflow. Rare commands are included so agents can discover that the installed upstream supports them without direct `agent-browser --help` access.
@@ -222,12 +339,14 @@ The tables below intentionally list more than the recommended workflow. Rare com
222
339
 
223
340
  Native-tool note: upstream skills are written for the standalone `agent-browser` CLI and may show bash/heredoc examples. In pi, convert those examples to `agent_browser` calls: pass CLI tokens in `args`, and pass heredoc/stdin bodies through the tool `stdin` field for `batch`, `eval --stdin`, or `auth save --password-stdin`.
224
341
 
342
+ Session note: `skills list`, `skills get …`, and `skills path …` are **stateless** in this wrapper. Even with default `sessionMode: "auto"`, the extension does not prepend the implicit managed `--session` for those commands, so reading bundled skills does not attach to or rotate the active browser session (same intent as plain-text `--help` / `--version` inspection). Other `skills` subcommands follow normal session rules until explicitly allowlisted in `extensions/agent-browser/lib/runtime.ts` alongside regression coverage in `test/agent-browser.runtime.test.ts`.
343
+
225
344
  | Command | Purpose |
226
345
  | --- | --- |
227
346
  | `skills list` | List available CLI-bundled skills. |
228
347
  | `skills get core` | Print the core usage guide. |
229
348
  | `skills get core --full` | Print the full version-matched core command reference and templates. |
230
- | `skills get <name>` | Load a specialized skill such as `electron` or `slack`. |
349
+ | `skills get <name>` | Load a specialized skill such as `electron` or `slack`. Common specialized calls include `skills get electron`, `skills get slack`, `skills get dogfood`, `skills get vercel-sandbox`, and `skills get agentcore`. |
231
350
  | `skills path [name]` | Print a skill directory path. |
232
351
 
233
352
  ### Core page and element commands
@@ -239,7 +358,7 @@ Native-tool note: upstream skills are written for the standalone `agent-browser`
239
358
  | `dblclick <sel>` | Double-click an element. |
240
359
  | `type <sel> <text>` | Type into an element. |
241
360
  | `fill <sel> <text>` | Clear and fill an element. |
242
- | `press <key>` | Press a key such as `Enter`, `Tab`, or `Control+a`. |
361
+ | `press <key>` | Press a key such as `Enter`, `Tab`, or `Control+a`. Related key-hold aliases include `keydown Shift` and `keyup Shift`. |
243
362
  | `keyboard type <text>` | Type text with real keystrokes and no selector. |
244
363
  | `keyboard inserttext <text>` | Insert text without key events. |
245
364
  | `hover <sel>` | Hover an element. |
@@ -268,12 +387,19 @@ Native-tool note: upstream skills are written for the standalone `agent-browser`
268
387
  | `forward` | Go forward. |
269
388
  | `reload` | Reload the current page. |
270
389
 
271
- ### Session and inspection commands
390
+ ### Session, state, frames, dialogs, windows, and inspection commands
272
391
 
273
392
  | Command | Purpose |
274
393
  | --- | --- |
275
394
  | `session` | Show current session name. |
276
395
  | `session list` | List active sessions. |
396
+ | `state save <path>` | Save cookies, local storage, and session storage to a state file. |
397
+ | `state load <path>` | Load cookies and storage from a state file. |
398
+ | `frame <selector|main>` | Switch iframe context by selector/ref/name/URL, or return to the main frame. |
399
+ | `dialog accept [text]` | Accept an alert, confirm, or prompt dialog, optionally supplying prompt text. |
400
+ | `dialog dismiss` | Dismiss or cancel the current dialog. |
401
+ | `dialog status` | Check whether a dialog is pending. |
402
+ | `window new` | Open a new browser window. |
277
403
  | `close` | Close the current browser session. |
278
404
  | `close --all` | Close every session. |
279
405
 
@@ -284,7 +410,7 @@ Native inspection calls use the `agent_browser` tool shape, not shell-like direc
284
410
  - { "args": ["--help"] }
285
411
  - { "args": ["--version"] }
286
412
 
287
- These calls return plain text and stay stateless: the extension does not inject its implicit session and does not let inspection consume the managed-session slot needed for later profile, session, CDP, state, or auto-connect launches.
413
+ These calls return plain text and stay stateless: the extension does not inject its implicit session and does not let inspection consume the managed-session slot needed for later profile, session, CDP, state, auto-connect, or provider-backed launches.
288
414
  <!-- agent-browser-playbook:end inspection -->
289
415
 
290
416
  ### Page state, finding, mouse, settings, network, and storage
@@ -327,6 +453,8 @@ Stable tab ids look like `t1`, `t2`, and `t3`. Optional user labels such as `doc
327
453
  | `snapshot -d <n>` / `snapshot --depth <n>` | Limit tree depth. |
328
454
  | `snapshot -s <sel>` / `snapshot --selector <sel>` | Scope to a CSS selector. |
329
455
 
456
+ When a snapshot is too large for inline output, the Pi wrapper renders a compact view before spilling the full raw snapshot to `details.fullOutputPath`. Compact snapshots are main-content-first, but dense pages can still hide actionable controls in omitted content; in that case, look for `Omitted high-value controls` to find bounded searchboxes, textboxes, comboboxes, buttons, tabs, checkboxes, radios, options, and menuitems that were not already listed under key refs or other refs. When that section appears, `details.data.highValueControlRefIds` repeats the same ref ids for programmatic follow-up alongside fields such as `previewMode`, `previewSections`, and counts on `details.data` (see [`docs/TOOL_CONTRACT.md`](docs/TOOL_CONTRACT.md#details)).
457
+
330
458
  ### Wait
331
459
 
332
460
  | Mode | Purpose |
@@ -353,6 +481,7 @@ Stable tab ids look like `t1`, `t2`, and `t3`. Optional user labels such as `doc
353
481
  | `profiler start|stop [path]` | Record a Chrome DevTools profile. |
354
482
  | `record start <path> [url]` | Start WebM video recording; output is written on `record stop`. |
355
483
  | `record stop` | Stop and save video. |
484
+ | `record restart <path> [url]` | Stop any current recording and start a new WebM recording. |
356
485
  | `console [--clear]` | View or clear console logs. |
357
486
  | `errors [--clear]` | View or clear page errors. |
358
487
  | `highlight <sel>` | Highlight an element. |
@@ -370,7 +499,9 @@ Stable tab ids look like `t1`, `t2`, and `t3`. Optional user labels such as `doc
370
499
  | `pushstate <url>` | Perform SPA client-side navigation; detects Next.js router pushes and falls back to history navigation events. |
371
500
  | `removeinitscript <id>` | Remove an init script registered through upstream init-script mechanisms. |
372
501
 
373
- When these diagnostic commands are invoked through the native `agent_browser` tool, structured console, page-error, React, Web Vitals, and SPA outputs render as compact summaries when possible, with large outputs previewed and spilled instead of dumped into context. Large outputs are previewed with a `Full output path:` spill file instead of dumping the entire payload into context.
502
+ When these diagnostic commands are invoked through the native `agent_browser` tool, structured console, page-error, React, Web Vitals, and SPA outputs render as compact summaries when possible, with large outputs previewed and spilled instead of dumped into context. Large outputs are previewed with a `Full output path:` spill file instead of dumping the entire payload into context. Artifact-producing commands such as `network har stop`, `diff screenshot`, `trace stop`, `profiler stop`, and `record stop` report `details.artifacts[]` plus `details.artifactVerification`; `record start` is reported as pending until `record stop` completes.
503
+
504
+ Long-running or lifecycle commands should be explicitly paired with cleanup calls: `stream enable` → `stream disable`, `dashboard start` → `dashboard stop`, `trace start` → `trace stop`, `profiler start` → `profiler stop`, and `record start` → `record stop`. The wrapper keeps each subprocess bounded by its normal timeout; it does not keep an interactive `chat` REPL open, so prefer `chat <message>` with `--model` or `AI_GATEWAY_MODEL` for single-shot AI use.
374
505
 
375
506
  `trace` and `profiler` share upstream Chrome tracing machinery. Do not run them at the same time. The wrapper tracks owner state it observes in the current Pi session and blocks conflicting starts/stops with "wrapper believes ..." wording because direct upstream CLI use or browser restarts can desynchronize wrapper-local state.
376
507
 
@@ -379,7 +510,7 @@ When these diagnostic commands are invoked through the native `agent_browser` to
379
510
  | Command | Purpose |
380
511
  | --- | --- |
381
512
  | `batch [--bail] ["cmd" ...]` | Execute multiple commands sequentially from args or stdin. |
382
- | `auth save <name> [opts]` | Save an auth profile with options such as `--url`, `--username`, `--password`, or `--password-stdin`. Prefer `--password-stdin` with the tool `stdin` field; avoid putting passwords in `args`. |
513
+ | `auth save <name> [opts]` | Save an auth profile with options such as `--url`, `--username`, `--password`, or `--password-stdin`. Prefer `auth save <name> --password-stdin` with the tool `stdin` field; avoid putting passwords in `args`. |
383
514
  | `auth login <name>` | Login using saved credentials. |
384
515
  | `auth list` | List saved auth profiles. |
385
516
  | `auth show <name>` | Show auth profile metadata. |
@@ -396,10 +527,10 @@ When these diagnostic commands are invoked through the native `agent_browser` to
396
527
  | `install` | Install browser binaries. |
397
528
  | `install --with-deps` | Install browser binaries plus Linux system dependencies. |
398
529
  | `upgrade` | Upgrade `agent-browser` to the latest version. |
399
- | `doctor [--fix]` | Diagnose install issues and optionally auto-clean stale files. |
530
+ | `doctor [--fix]` | Diagnose install issues and optionally auto-clean stale files. Use `doctor --offline --quick` for a fast local-only check and `doctor --json` for structured output. |
400
531
  | `profiles` | List available Chrome profiles. |
401
532
 
402
- When these commands are invoked through the native `agent_browser` tool, structured diagnostic/status outputs are rendered as compact summaries. List-like outputs such as sessions, Chrome profiles, auth profiles, network requests, console messages, and page errors include counts and key fields; large outputs are previewed with a `Full output path:` spill file instead of dumping the entire payload into context. For `network requests`, the wrapper shows status, method, URL, resource/mime type, request id, and, when the installed upstream output includes body-like fields, bounded redacted payload, response, and failure/error snippets. `network request <requestId>` can expose upstream full-detail body fields such as response bodies using the same bounded model-facing preview. Header, cookie, auth, token, and other secret-like fields are not expanded in model-facing text; use upstream HAR or full raw details only when complete data is required.
533
+ When these commands are invoked through the native `agent_browser` tool, structured diagnostic/status outputs are rendered as compact summaries. List-like outputs such as sessions, Chrome profiles, auth profiles, network requests, console messages, and page errors include counts and key fields; large outputs are previewed with a `Full output path:` spill file instead of dumping the entire payload into context. For `network requests`, the wrapper shows a failed-request summary split into actionable versus benign low-impact rows, then status, method, URL, resource/mime type, request id, and, when the installed upstream output includes body-like fields, bounded redacted payload, response, and failure/error snippets. `network request <requestId>` can expose upstream full-detail body fields such as response bodies using the same bounded model-facing preview. Header, cookie, auth, token, and other secret-like fields are not expanded in model-facing text or `details.data`; command echoes also redact `--body`, `--headers`, `--password`, proxy credentials, auth-bearing URLs, cookie/storage values, and bearer/basic credential text in positional arguments. Use upstream HAR or full raw details only when complete data is required.
403
534
 
404
535
  ## Important global flags, config, and environment
405
536
 
@@ -433,7 +564,7 @@ When these commands are invoked through the native `agent_browser` tool, structu
433
564
 
434
565
  ### Output, provider, policy, and AI flags
435
566
 
436
- - `--json`: JSON output. The wrapper injects this automatically for normal tool execution.
567
+ - `--json`: JSON output. The wrapper injects this automatically for normal tool execution. Environment: `AGENT_BROWSER_JSON`.
437
568
  - `--annotate`: annotated screenshot with numbered labels and legend. Environment: `AGENT_BROWSER_ANNOTATE`.
438
569
  - `--screenshot-dir <path>`: default screenshot output directory. Environment: `AGENT_BROWSER_SCREENSHOT_DIR`.
439
570
  - `--screenshot-quality <n>`: JPEG quality `0-100`. Environment: `AGENT_BROWSER_SCREENSHOT_QUALITY`.
@@ -446,6 +577,7 @@ When these commands are invoked through the native `agent_browser` tool, structu
446
577
  - `--confirm-interactive`: interactive confirmations; auto-denies when stdin is not a TTY. Environment: `AGENT_BROWSER_CONFIRM_INTERACTIVE`.
447
578
  - `-p, --provider <name>`: provider such as `ios`, `browserbase`, `kernel`, `browseruse`, `browserless`, or `agentcore`. Environment: `AGENT_BROWSER_PROVIDER`.
448
579
  - `--device <name>`: iOS device name. Environment: `AGENT_BROWSER_IOS_DEVICE`.
580
+ - Provider-specific iOS examples from upstream include `agent-browser -p ios device list`, `agent-browser -p ios swipe up`, and `agent-browser -p ios tap @e1`; in pi, pass those tokens through `args` rather than bash. iOS requires external Xcode/Appium setup, and cloud providers (`browserbase`, `kernel`, `browseruse`, `browserless`, `agentcore`) require their upstream accounts, credentials, and provider-specific environment variables. The wrapper forwards provider flags/env and stays thin; it does not emulate provider setup or cloud browser behavior.
449
581
  - `--model <name>`: AI model for `chat`. Environment: `AI_GATEWAY_MODEL`.
450
582
  - `-v, --verbose`: show tool commands and raw output.
451
583
  - `-q, --quiet`: show only AI text responses.
@@ -463,12 +595,13 @@ When these commands are invoked through the native `agent_browser` tool, structu
463
595
 
464
596
  Use `--config <path>` to load a specific config file. Boolean flags accept optional `true` or `false` values, such as `--headed false`, to override config. Browser extensions from user and project configs are merged rather than replaced.
465
597
 
466
- Other useful environment variables include `AGENT_BROWSER_DEFAULT_TIMEOUT`, `AGENT_BROWSER_STREAM_PORT`, `AGENT_BROWSER_IDLE_TIMEOUT_MS`, `AGENT_BROWSER_ENCRYPTION_KEY`, `AGENT_BROWSER_STATE_EXPIRE_DAYS`, `AGENT_BROWSER_IOS_UDID`, `AI_GATEWAY_URL`, and `AI_GATEWAY_API_KEY`.
598
+ Other useful environment variables include `AGENT_BROWSER_DEFAULT_TIMEOUT`, `AGENT_BROWSER_STREAM_PORT`, `AGENT_BROWSER_IDLE_TIMEOUT_MS`, `AGENT_BROWSER_ENCRYPTION_KEY`, `AGENT_BROWSER_STATE_EXPIRE_DAYS`, `AGENT_BROWSER_IOS_DEVICE`, `AGENT_BROWSER_IOS_UDID`, `AI_GATEWAY_URL`, and `AI_GATEWAY_API_KEY`. The upstream child also receives every parent variable whose name starts with `AGENT_BROWSER_`, `AGENTCORE_`, `AI_GATEWAY_`, `BROWSERBASE_`, `BROWSERLESS_`, `BROWSER_USE_`, `KERNEL_`, or `XDG_`, plus the explicit inherited-name allowlist in `buildAgentBrowserProcessEnv` (`extensions/agent-browser/lib/process.ts`).
467
599
 
468
600
  ## Wrapper-specific behavior worth knowing
469
601
 
470
602
  - The extension may keep following one implicit managed session across later tool calls.
471
- - If launch-scoped flags like `--profile`, `--session-name`, `--cdp`, `--state`, `--auto-connect`, `--init-script`, or `--enable` would be ignored because that implicit session is already active, retry with `sessionMode: "fresh"`.
603
+ - If launch-scoped flags like `--profile`, `--session-name`, `--cdp`, `--state`, `--auto-connect`, `--init-script`, `--enable`, `--provider` / `-p`, or provider device flags like `--device` would be ignored because that implicit session is already active, retry with `sessionMode: "fresh"`.
604
+ - If a `sessionMode: "fresh"` call fails (including upstream failure, timeout, missing binary, or **`qa`** reclassification after a nominally successful batch), read `details.managedSessionOutcome` before assuming where the next default call will go: `preserved` means the prior managed session remains current, while `abandoned` means no managed session became current. When the failure reason is not the fresh launch itself—for example `failureCategory: "qa-failure"`—`status`/`summary` may still describe the managed-session transition while `succeeded` on this object matches the final tool outcome.
472
605
  <!-- agent-browser-playbook:start wrapper-tab-recovery -->
473
606
  <!-- Generated from extensions/agent-browser/lib/playbook.ts. Run `npm run docs -- playbook write` to update. -->
474
607
  - After launch-scoped open/goto/navigate calls that can restore existing tabs (for example --profile, --session-name, or --state), agent_browser best-effort re-selects the tab whose URL matches the returned page when restored tabs steal focus during launch.
@@ -476,7 +609,7 @@ Other useful environment variables include `AGENT_BROWSER_DEFAULT_TIMEOUT`, `AGE
476
609
  - After a successful command on a known target tab, agent_browser also best-effort restores that intended tab if a restored/background tab steals focus after the command completes.
477
610
  - If a known session target unexpectedly reports about:blank, agent_browser preserves the prior intended target, best-effort re-selects it when it still exists, and reports exact recovery guidance when it cannot be re-selected.
478
611
  <!-- agent-browser-playbook:end wrapper-tab-recovery -->
479
- - Wrapper-spawned commands clamp `AGENT_BROWSER_DEFAULT_TIMEOUT` to 25 seconds and use a 28-second child-process watchdog so one upstream CLI call does not cross the upstream 30-second IPC read-timeout/retry path.
612
+ - Wrapper-spawned commands clamp `AGENT_BROWSER_DEFAULT_TIMEOUT` to 25 seconds and use a 28-second child-process watchdog (`PI_AGENT_BROWSER_PROCESS_TIMEOUT_MS` overrides the default 28s budget) so one upstream CLI call does not cross the upstream 30-second IPC read-timeout/retry path. When that watchdog fires, `details.timeoutPartialProgress` may include a planned step list for compiled `job` / `qa` plans or caller `batch` stdin, current page title/URL from best-effort session `get url` / `get title` (or a planned URL inferred from the step list when the session cannot answer), and declared artifact paths such as `screenshot`, `pdf`, `download`, or `wait --download` outputs with existence/size checks; the same evidence is appended under `Timeout partial progress` in visible text with URL/path redaction.
480
613
  - Oversized snapshots and oversized generic outputs may be compacted in tool content, with the full raw output written to a spill file path shown directly in the tool result. Recent artifact metadata is bounded by `PI_AGENT_BROWSER_SESSION_ARTIFACT_MANIFEST_MAX_ENTRIES` (default 100); persisted spill files are separately bounded by `PI_AGENT_BROWSER_SESSION_ARTIFACT_MAX_BYTES` (default 32 MiB).
481
614
  - The wrapper keeps `--help` and `--version` stateless so they do not consume the implicit managed-session slot.
482
615
 
@@ -491,46 +624,362 @@ This generated block is review data for maintainers. The human-authored referenc
491
624
 
492
625
  #### Upstream help commands sampled
493
626
  - root help: `agent-browser --help`
627
+ - skills help: `agent-browser skills --help`
628
+ - skills list: `agent-browser skills list`
629
+ - core skill full: `agent-browser skills get core --full`
494
630
  - tab help: `agent-browser tab --help`
495
631
  - snapshot help: `agent-browser snapshot --help`
496
632
  - wait help: `agent-browser wait --help`
633
+ - screenshot help: `agent-browser screenshot --help`
634
+ - find help: `agent-browser find --help`
635
+ - network help: `agent-browser network --help`
636
+ - cookies help: `agent-browser cookies --help`
637
+ - storage help: `agent-browser storage --help`
638
+ - state help: `agent-browser state --help`
639
+ - frame help: `agent-browser frame --help`
640
+ - dialog help: `agent-browser dialog --help`
641
+ - window help: `agent-browser window --help`
642
+ - keyboard help: `agent-browser keyboard --help`
643
+ - batch help: `agent-browser batch --help`
644
+ - auth help: `agent-browser auth --help`
645
+ - stream help: `agent-browser stream --help`
646
+ - dashboard help: `agent-browser dashboard --help`
647
+ - chat help: `agent-browser chat --help`
648
+ - doctor help: `agent-browser doctor --help`
649
+ - diff help: `agent-browser diff --help`
650
+ - trace help: `agent-browser trace --help`
651
+ - profiler help: `agent-browser profiler --help`
652
+ - record help: `agent-browser record --help`
653
+
654
+ #### Inventory sections
655
+ - Built-in skills: 10 human-doc token(s), 11 upstream token(s)
656
+ - Core page, element, navigation, and extraction commands: 38 human-doc token(s), 40 upstream token(s)
657
+ - Sessions, state, tabs, frames, dialogs, and windows: 12 human-doc token(s), 8 upstream token(s)
658
+ - Network, storage, artifacts, diagnostics, and performance: 29 human-doc token(s), 33 upstream token(s)
659
+ - Batch, auth, confirmations, setup, dashboard, and AI commands: 19 human-doc token(s), 17 upstream token(s)
660
+ - Global flags, config, providers, policy, and environment: 95 human-doc token(s), 90 upstream token(s)
661
+
662
+ #### Human-authored doc tokens required
663
+ ##### Built-in skills
664
+ - `skills list`
665
+ - `skills get core`
666
+ - `skills get core --full`
667
+ - `skills get <name>`
668
+ - `skills get electron`
669
+ - `skills get slack`
670
+ - `skills get dogfood`
671
+ - `skills get vercel-sandbox`
672
+ - `skills get agentcore`
673
+ - `skills path [name]`
674
+
675
+ ##### Core page, element, navigation, and extraction commands
676
+ - `open <url>`
677
+ - `click <sel>`
678
+ - `dblclick <sel>`
679
+ - `type <sel> <text>`
680
+ - `fill <sel> <text>`
681
+ - `press <key>`
682
+ - `keyboard type <text>`
683
+ - `keyboard inserttext <text>`
684
+ - `keydown Shift`
685
+ - `keyup Shift`
686
+ - `hover <sel>`
687
+ - `focus <sel>`
688
+ - `check <sel>`
689
+ - `uncheck <sel>`
690
+ - `select <sel> <val...>`
691
+ - `drag <src> <dst>`
692
+ - `upload <sel> <files...>`
693
+ - `download <sel> <path>`
694
+ - `scroll <dir> [px]`
695
+ - `scrollintoview <sel>`
696
+ - `wait <sel|ms>`
697
+ - `screenshot [path]`
698
+ - `screenshot --full`
699
+ - `screenshot --annotate`
700
+ - `pdf <path>`
701
+ - `snapshot`
702
+ - `eval <js>`
703
+ - `connect <port|url>`
704
+ - `close [--all]`
705
+ - `back`
706
+ - `forward`
707
+ - `reload`
708
+ - `pushstate <url>`
709
+ - `get <what> [selector]`
710
+ - `is <what> <selector>`
711
+ - `find <locator> <value> <action>`
712
+ - `mouse <action> [args]`
713
+ - `set <setting> [value]`
714
+
715
+ ##### Sessions, state, tabs, frames, dialogs, and windows
716
+ - `session`
717
+ - `session list`
718
+ - `state save <path>`
719
+ - `state load <path>`
720
+ - `tab list`
721
+ - `tab new --label <name> [url]`
722
+ - `tab <t<N>|label>`
723
+ - `frame <selector|main>`
724
+ - `dialog accept [text]`
725
+ - `dialog dismiss`
726
+ - `dialog status`
727
+ - `window new`
728
+
729
+ ##### Network, storage, artifacts, diagnostics, and performance
730
+ - `network <action>`
731
+ - `network route <url> [--abort|--body <json>] [--resource-type <csv>]`
732
+ - `network request <requestId>`
733
+ - `cookies [get|set|clear]`
734
+ - `cookies set --curl <file>`
735
+ - `storage <local|session>`
736
+ - `diff snapshot`
737
+ - `diff screenshot --baseline`
738
+ - `diff url <u1> <u2>`
739
+ - `trace start|stop [path]`
740
+ - `profiler start|stop [path]`
741
+ - `record start <path> [url]`
742
+ - `record restart <path> [url]`
743
+ - `record stop`
744
+ - `console [--clear]`
745
+ - `errors [--clear]`
746
+ - `highlight <sel>`
747
+ - `inspect`
748
+ - `clipboard <op> [text]`
749
+ - `stream enable [--port <n>]`
750
+ - `stream disable`
751
+ - `stream status`
752
+ - `react tree`
753
+ - `react inspect <id>`
754
+ - `react renders start`
755
+ - `react renders stop [--json]`
756
+ - `react suspense [--only-dynamic] [--json]`
757
+ - `vitals [url] [--json]`
758
+ - `removeinitscript <id>`
759
+
760
+ ##### Batch, auth, confirmations, setup, dashboard, and AI commands
761
+ - `batch [--bail]`
762
+ - `auth save <name>`
763
+ - `auth save <name> --password-stdin`
764
+ - `auth login <name>`
765
+ - `auth list`
766
+ - `auth show <name>`
767
+ - `auth delete <name>`
768
+ - `confirm <id>`
769
+ - `deny <id>`
770
+ - `chat <message>`
771
+ - `dashboard start --port <n>`
772
+ - `dashboard stop`
773
+ - `install`
774
+ - `install --with-deps`
775
+ - `upgrade`
776
+ - `doctor [--fix]`
777
+ - `doctor --offline --quick`
778
+ - `doctor --json`
779
+ - `profiles`
780
+
781
+ ##### Global flags, config, providers, policy, and environment
782
+ - `--profile <name|path>`
783
+ - `AGENT_BROWSER_PROFILE`
784
+ - `--session <name>`
785
+ - `AGENT_BROWSER_SESSION`
786
+ - `--session-name <name>`
787
+ - `AGENT_BROWSER_SESSION_NAME`
788
+ - `--state <path>`
789
+ - `AGENT_BROWSER_STATE`
790
+ - `--auto-connect`
791
+ - `AGENT_BROWSER_AUTO_CONNECT`
792
+ - `--headers <json>`
793
+ - `--init-script <path>`
794
+ - `AGENT_BROWSER_INIT_SCRIPTS`
795
+ - `--enable <feature>`
796
+ - `AGENT_BROWSER_ENABLE`
797
+ - `--executable-path <path>`
798
+ - `AGENT_BROWSER_EXECUTABLE_PATH`
799
+ - `--extension <path>`
800
+ - `AGENT_BROWSER_EXTENSIONS`
801
+ - `--args <args>`
802
+ - `AGENT_BROWSER_ARGS`
803
+ - `--user-agent <ua>`
804
+ - `AGENT_BROWSER_USER_AGENT`
805
+ - `--proxy <server>`
806
+ - `AGENT_BROWSER_PROXY`
807
+ - `HTTP_PROXY`
808
+ - `HTTPS_PROXY`
809
+ - `ALL_PROXY`
810
+ - `--proxy-bypass <hosts>`
811
+ - `AGENT_BROWSER_PROXY_BYPASS`
812
+ - `NO_PROXY`
813
+ - `--ignore-https-errors`
814
+ - `AGENT_BROWSER_IGNORE_HTTPS_ERRORS`
815
+ - `--allow-file-access`
816
+ - `AGENT_BROWSER_ALLOW_FILE_ACCESS`
817
+ - `--headed`
818
+ - `AGENT_BROWSER_HEADED`
819
+ - `--cdp <port>`
820
+ - `--color-scheme <scheme>`
821
+ - `AGENT_BROWSER_COLOR_SCHEME`
822
+ - `--download-path <path>`
823
+ - `AGENT_BROWSER_DOWNLOAD_PATH`
824
+ - `--engine <name>`
825
+ - `AGENT_BROWSER_ENGINE`
826
+ - `--no-auto-dialog`
827
+ - `AGENT_BROWSER_NO_AUTO_DIALOG`
828
+ - `--json`
829
+ - `AGENT_BROWSER_JSON`
830
+ - `--annotate`
831
+ - `AGENT_BROWSER_ANNOTATE`
832
+ - `--screenshot-dir <path>`
833
+ - `AGENT_BROWSER_SCREENSHOT_DIR`
834
+ - `--screenshot-quality <n>`
835
+ - `AGENT_BROWSER_SCREENSHOT_QUALITY`
836
+ - `--screenshot-format <fmt>`
837
+ - `AGENT_BROWSER_SCREENSHOT_FORMAT`
838
+ - `--content-boundaries`
839
+ - `AGENT_BROWSER_CONTENT_BOUNDARIES`
840
+ - `--max-output <chars>`
841
+ - `AGENT_BROWSER_MAX_OUTPUT`
842
+ - `--allowed-domains <list>`
843
+ - `AGENT_BROWSER_ALLOWED_DOMAINS`
844
+ - `--action-policy <path>`
845
+ - `AGENT_BROWSER_ACTION_POLICY`
846
+ - `--confirm-actions <list>`
847
+ - `AGENT_BROWSER_CONFIRM_ACTIONS`
848
+ - `--confirm-interactive`
849
+ - `AGENT_BROWSER_CONFIRM_INTERACTIVE`
850
+ - `-p, --provider <name>`
851
+ - `AGENT_BROWSER_PROVIDER`
852
+ - `browserbase`
853
+ - `kernel`
854
+ - `browseruse`
855
+ - `browserless`
856
+ - `agentcore`
857
+ - `--device <name>`
858
+ - `AGENT_BROWSER_IOS_DEVICE`
859
+ - `agent-browser -p ios device list`
860
+ - `agent-browser -p ios swipe up`
861
+ - `agent-browser -p ios tap @e1`
862
+ - `--model <name>`
863
+ - `AI_GATEWAY_MODEL`
864
+ - `-v, --verbose`
865
+ - `-q, --quiet`
866
+ - `--debug`
867
+ - `AGENT_BROWSER_DEBUG`
868
+ - `AGENT_BROWSER_CONFIG`
869
+ - `AGENT_BROWSER_DEFAULT_TIMEOUT`
870
+ - `AGENT_BROWSER_STREAM_PORT`
871
+ - `AGENT_BROWSER_IDLE_TIMEOUT_MS`
872
+ - `AGENT_BROWSER_ENCRYPTION_KEY`
873
+ - `AGENT_BROWSER_STATE_EXPIRE_DAYS`
874
+ - `AGENT_BROWSER_IOS_UDID`
875
+ - `AI_GATEWAY_URL`
876
+ - `AI_GATEWAY_API_KEY`
497
877
 
498
878
  #### Upstream help tokens expected
499
- - root help: `skills`
500
- - root help: `keyboard`
501
- - root help: `scroll`
502
- - root help: `scrollintoview`
503
- - root help: `connect`
504
- - root help: `is`
505
- - root help: `find`
506
- - root help: `mouse`
507
- - root help: `set`
508
- - root help: `network`
879
+ ##### Built-in skills
880
+ - root help: `skills get core --full`
881
+ - skills help: `get <name> --full`
882
+ - skills list: `core`
883
+ - skills list: `electron`
884
+ - skills list: `slack`
885
+ - skills list: `dogfood`
886
+ - skills list: `vercel-sandbox`
887
+ - skills list: `agentcore`
888
+ - core skill full: `agent-browser frame @e3`
889
+ - core skill full: `agent-browser dialog accept`
890
+ - core skill full: `agent-browser state save ./auth.json`
891
+
892
+ ##### Core page, element, navigation, and extraction commands
893
+ - root help: `open <url>`
894
+ - root help: `click <sel>`
895
+ - root help: `dblclick <sel>`
896
+ - root help: `type <sel> <text>`
897
+ - root help: `fill <sel> <text>`
898
+ - root help: `press <key>`
899
+ - root help: `keyboard type <text>`
900
+ - root help: `keyboard inserttext <text>`
901
+ - root help: `hover <sel>`
902
+ - root help: `focus <sel>`
903
+ - root help: `check <sel>`
904
+ - root help: `uncheck <sel>`
905
+ - root help: `select <sel> <val...>`
906
+ - root help: `drag <src> <dst>`
907
+ - root help: `upload <sel> <files...>`
908
+ - root help: `download <sel> <path>`
909
+ - root help: `scroll <dir> [px]`
910
+ - root help: `scrollintoview <sel>`
911
+ - root help: `wait <sel|ms>`
912
+ - root help: `screenshot [path]`
913
+ - root help: `pdf <path>`
914
+ - root help: `snapshot`
915
+ - root help: `eval <js>`
916
+ - root help: `connect <port|url>`
917
+ - root help: `close [--all]`
918
+ - root help: `back`
919
+ - root help: `forward`
920
+ - root help: `reload`
921
+ - root help: `pushstate <url>`
922
+ - root help: `Get Info: agent-browser get <what> [selector]`
923
+ - root help: `Check State: agent-browser is <what> <selector>`
924
+ - root help: `Find Elements: agent-browser find <locator> <value> <action> [text]`
925
+ - root help: `Mouse: agent-browser mouse <action> [args]`
926
+ - root help: `Browser Settings: agent-browser set <setting> [value]`
927
+ - keyboard help: `type <text>`
928
+ - keyboard help: `inserttext <text>`
929
+ - screenshot help: `--full, -f`
930
+ - screenshot help: `--annotate`
931
+ - find help: `role <role>`
932
+ - find help: `testid <id>`
933
+
934
+ ##### Sessions, state, tabs, frames, dialogs, and windows
935
+ - root help: `session list`
936
+ - state help: `save <path>`
937
+ - state help: `load <path>`
938
+ - tab help: `new --label <name> [url]`
939
+ - tab help: `Stable tab ids`
940
+ - frame help: `frame <selector|main>`
941
+ - dialog help: `dialog <accept|dismiss|status> [text]`
942
+ - window help: `window <operation>`
943
+
944
+ ##### Network, storage, artifacts, diagnostics, and performance
945
+ - root help: `network <action>`
946
+ - root help: `--resource-type <csv>`
509
947
  - root help: `cookies [get|set|clear]`
510
- - root help: `storage`
948
+ - root help: `cookies set --curl <file>`
949
+ - root help: `storage <local|session>`
511
950
  - root help: `diff snapshot`
951
+ - root help: `diff screenshot --baseline`
512
952
  - root help: `trace start|stop [path]`
513
953
  - root help: `profiler start|stop [path]`
514
954
  - root help: `record start <path> [url]`
955
+ - root help: `record stop`
515
956
  - root help: `console [--clear]`
516
957
  - root help: `errors [--clear]`
517
958
  - root help: `highlight <sel>`
518
959
  - root help: `inspect`
519
960
  - root help: `clipboard <op> [text]`
520
961
  - root help: `stream enable [--port <n>]`
962
+ - root help: `stream disable`
963
+ - root help: `stream status`
521
964
  - root help: `react tree`
522
965
  - root help: `react inspect <id>`
523
966
  - root help: `react renders start`
524
967
  - root help: `react renders stop [--json]`
525
968
  - root help: `react suspense [--only-dynamic] [--json]`
526
969
  - root help: `vitals [url] [--json]`
527
- - root help: `pushstate <url>`
528
970
  - root help: `removeinitscript <id>`
529
- - root help: `--init-script <path>`
530
- - root help: `--enable <feature>`
531
- - root help: `--resource-type <csv>`
532
- - root help: `cookies set --curl <file>`
971
+ - network help: `request <requestId>`
972
+ - network help: `har <start|stop>`
973
+ - storage help: `set <key> <value>`
974
+ - diff help: `diff screenshot --baseline <f>`
975
+ - trace help: `trace <operation> [path]`
976
+ - profiler help: `--categories <list>`
977
+ - record help: `record restart <path.webm> [url]`
978
+
979
+ ##### Batch, auth, confirmations, setup, dashboard, and AI commands
980
+ - root help: `batch [--bail]`
533
981
  - root help: `auth save <name>`
982
+ - root help: `auth login <name>`
534
983
  - root help: `confirm <id>`
535
984
  - root help: `deny <id>`
536
985
  - root help: `chat <message>`
@@ -539,9 +988,104 @@ This generated block is review data for maintainers. The human-authored referenc
539
988
  - root help: `upgrade`
540
989
  - root help: `doctor [--fix]`
541
990
  - root help: `profiles`
542
- - snapshot help: `-u, --urls`
543
- - wait help: `--download [path]`
544
- - tab help: `new --label <name> [url]`
991
+ - batch help: `--bail`
992
+ - auth help: `--password-stdin`
993
+ - dashboard help: `dashboard [start|stop] [options]`
994
+ - chat help: `chat <message>`
995
+ - doctor help: `--offline`
996
+ - doctor help: `--json`
997
+
998
+ ##### Global flags, config, providers, policy, and environment
999
+ - root help: `--profile <name|path>`
1000
+ - root help: `AGENT_BROWSER_PROFILE`
1001
+ - root help: `--session <name>`
1002
+ - root help: `AGENT_BROWSER_SESSION`
1003
+ - root help: `--session-name <name>`
1004
+ - root help: `AGENT_BROWSER_SESSION_NAME`
1005
+ - root help: `--state <path>`
1006
+ - root help: `AGENT_BROWSER_STATE`
1007
+ - root help: `--auto-connect`
1008
+ - root help: `AGENT_BROWSER_AUTO_CONNECT`
1009
+ - root help: `--headers <json>`
1010
+ - root help: `--init-script <path>`
1011
+ - root help: `AGENT_BROWSER_INIT_SCRIPTS`
1012
+ - root help: `--enable <feature>`
1013
+ - root help: `AGENT_BROWSER_ENABLE`
1014
+ - root help: `--executable-path <path>`
1015
+ - root help: `AGENT_BROWSER_EXECUTABLE_PATH`
1016
+ - root help: `--extension <path>`
1017
+ - root help: `AGENT_BROWSER_EXTENSIONS`
1018
+ - root help: `--args <args>`
1019
+ - root help: `AGENT_BROWSER_ARGS`
1020
+ - root help: `--user-agent <ua>`
1021
+ - root help: `AGENT_BROWSER_USER_AGENT`
1022
+ - root help: `--proxy <server>`
1023
+ - root help: `AGENT_BROWSER_PROXY`
1024
+ - root help: `HTTP_PROXY / HTTPS_PROXY`
1025
+ - root help: `ALL_PROXY`
1026
+ - root help: `--proxy-bypass <hosts>`
1027
+ - root help: `AGENT_BROWSER_PROXY_BYPASS`
1028
+ - root help: `NO_PROXY`
1029
+ - root help: `--ignore-https-errors`
1030
+ - root help: `AGENT_BROWSER_IGNORE_HTTPS_ERRORS`
1031
+ - root help: `--allow-file-access`
1032
+ - root help: `AGENT_BROWSER_ALLOW_FILE_ACCESS`
1033
+ - root help: `--headed`
1034
+ - root help: `AGENT_BROWSER_HEADED`
1035
+ - root help: `--cdp <port>`
1036
+ - root help: `--color-scheme <scheme>`
1037
+ - root help: `AGENT_BROWSER_COLOR_SCHEME`
1038
+ - root help: `--download-path <path>`
1039
+ - root help: `AGENT_BROWSER_DOWNLOAD_PATH`
1040
+ - root help: `--engine <name>`
1041
+ - root help: `AGENT_BROWSER_ENGINE`
1042
+ - root help: `--no-auto-dialog`
1043
+ - root help: `AGENT_BROWSER_NO_AUTO_DIALOG`
1044
+ - root help: `--json`
1045
+ - root help: `AGENT_BROWSER_JSON`
1046
+ - root help: `--annotate`
1047
+ - root help: `AGENT_BROWSER_ANNOTATE`
1048
+ - root help: `--screenshot-dir <path>`
1049
+ - root help: `AGENT_BROWSER_SCREENSHOT_DIR`
1050
+ - root help: `--screenshot-quality <n>`
1051
+ - root help: `AGENT_BROWSER_SCREENSHOT_QUALITY`
1052
+ - root help: `--screenshot-format <fmt>`
1053
+ - root help: `AGENT_BROWSER_SCREENSHOT_FORMAT`
1054
+ - root help: `--content-boundaries`
1055
+ - root help: `AGENT_BROWSER_CONTENT_BOUNDARIES`
1056
+ - root help: `--max-output <chars>`
1057
+ - root help: `AGENT_BROWSER_MAX_OUTPUT`
1058
+ - root help: `--allowed-domains <list>`
1059
+ - root help: `AGENT_BROWSER_ALLOWED_DOMAINS`
1060
+ - root help: `--action-policy <path>`
1061
+ - root help: `AGENT_BROWSER_ACTION_POLICY`
1062
+ - root help: `--confirm-actions <list>`
1063
+ - root help: `AGENT_BROWSER_CONFIRM_ACTIONS`
1064
+ - root help: `--confirm-interactive`
1065
+ - root help: `AGENT_BROWSER_CONFIRM_INTERACTIVE`
1066
+ - root help: `--provider <name>`
1067
+ - root help: `AGENT_BROWSER_PROVIDER`
1068
+ - root help: `agent-browser -p ios device list`
1069
+ - root help: `agent-browser -p ios swipe up`
1070
+ - root help: `agent-browser -p ios tap @e1`
1071
+ - root help: `--device <name>`
1072
+ - root help: `AGENT_BROWSER_IOS_DEVICE`
1073
+ - root help: `--model <name>`
1074
+ - root help: `AI_GATEWAY_MODEL`
1075
+ - root help: `--verbose`
1076
+ - root help: `--quiet`
1077
+ - root help: `--debug`
1078
+ - root help: `AGENT_BROWSER_DEBUG`
1079
+ - root help: `--config <path>`
1080
+ - root help: `AGENT_BROWSER_CONFIG`
1081
+ - root help: `AGENT_BROWSER_DEFAULT_TIMEOUT`
1082
+ - root help: `AGENT_BROWSER_STREAM_PORT`
1083
+ - root help: `AGENT_BROWSER_IDLE_TIMEOUT_MS`
1084
+ - root help: `AGENT_BROWSER_ENCRYPTION_KEY`
1085
+ - root help: `AGENT_BROWSER_STATE_EXPIRE_DAYS`
1086
+ - root help: `AGENT_BROWSER_IOS_UDID`
1087
+ - root help: `AI_GATEWAY_URL`
1088
+ - root help: `AI_GATEWAY_API_KEY`
545
1089
 
546
1090
  </details>
547
1091
  <!-- agent-browser-capability-baseline:end capability-token-baseline -->