@petukhovart/agent-view 0.13.0 → 0.14.0
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +52 -1
- package/dist/cdp/transport.d.ts.map +1 -1
- package/dist/cdp/transport.js +128 -4
- package/dist/cdp/transport.js.map +1 -1
- package/dist/cdp/types.d.ts +51 -0
- package/dist/cdp/types.d.ts.map +1 -1
- package/dist/cdp/types.js.map +1 -1
- package/dist/cli/commands/click.d.ts +1 -0
- package/dist/cli/commands/click.d.ts.map +1 -1
- package/dist/cli/commands/click.js +2 -0
- package/dist/cli/commands/click.js.map +1 -1
- package/dist/cli/commands/coverage.d.ts +14 -0
- package/dist/cli/commands/coverage.d.ts.map +1 -0
- package/dist/cli/commands/coverage.js +34 -0
- package/dist/cli/commands/coverage.js.map +1 -0
- package/dist/cli/commands/listeners.d.ts +11 -0
- package/dist/cli/commands/listeners.d.ts.map +1 -0
- package/dist/cli/commands/listeners.js +34 -0
- package/dist/cli/commands/listeners.js.map +1 -0
- package/dist/cli/index.js +30 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/inspectors/coverage/index.d.ts +17 -0
- package/dist/inspectors/coverage/index.d.ts.map +1 -0
- package/dist/inspectors/coverage/index.js +65 -0
- package/dist/inspectors/coverage/index.js.map +1 -0
- package/dist/inspectors/listeners/index.d.ts +4 -0
- package/dist/inspectors/listeners/index.d.ts.map +1 -0
- package/dist/inspectors/listeners/index.js +30 -0
- package/dist/inspectors/listeners/index.js.map +1 -0
- package/dist/server/server.d.ts +13 -5
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +174 -64
- package/dist/server/server.js.map +1 -1
- package/package.json +1 -1
- package/skills/verify/SKILL.md +157 -421
- package/skills/verify/references/commands.md +358 -0
- package/skills/verify/references/design-conformance.md +23 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
# agent-view command reference
|
|
2
|
+
|
|
3
|
+
Every command accepts `--window <id|name>`. Output is plain text, except `discover` (JSON) and
|
|
4
|
+
`screenshot` (a file path). Refs (`[ref=N]`) and req handles (`[req=N]`) are reallocated on every
|
|
5
|
+
listing call — always expand from the most recent one.
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
- [Discovery & launch](#discovery--launch) — `launch`, `discover`, `stop`
|
|
10
|
+
- [DOM inspection](#dom-inspection) — `dom`
|
|
11
|
+
- [Interaction](#interaction) — `click`, `fill`, `drag`
|
|
12
|
+
- [Modals & file pickers](#modals--file-pickers-dialog-upload) — `dialog`, `upload`
|
|
13
|
+
- [Waiting](#waiting-wait) — `wait`
|
|
14
|
+
- [Screenshots](#screenshots) — `screenshot`
|
|
15
|
+
- [Runtime state](#runtime-state-eval) — `eval`
|
|
16
|
+
- [Reactive state](#reactive-state-watch) — `watch`
|
|
17
|
+
- [Console](#console-console) — `console`
|
|
18
|
+
- [Log feed](#log-feed-logs) — `logs`
|
|
19
|
+
- [Network](#network-network) — `network`
|
|
20
|
+
- [Reachability](#reachability-coverage-listeners) — `coverage`, `listeners`
|
|
21
|
+
- [Targets](#targets-targets) — `targets`
|
|
22
|
+
- [Scene / canvas / WebGL](#scene--canvas--webgl-only-when-webgl-is-configured-in-agent-viewconfigjson) — `scene`, `snap`
|
|
23
|
+
|
|
24
|
+
### Discovery & Launch
|
|
25
|
+
```bash
|
|
26
|
+
agent-view launch # Start app from config, wait for CDP readiness (all runtimes incl. Tauri)
|
|
27
|
+
agent-view discover # List windows (JSON) — get window IDs
|
|
28
|
+
agent-view stop # Stop the lazy server
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Port conflict**: if the configured port is held by a non-CDP process (e.g. a stray webpack-dev on the same port), `agent-view launch` exits non-zero with `code: PORT_CONFLICT` and reports the owning PID/process name.
|
|
32
|
+
|
|
33
|
+
**Tauri**: launch works the same as Electron, but the wait timeout is 10 min (cargo builds are slow). A port conflict on the Tauri devUrl port is almost always a parallel browser-dev.
|
|
34
|
+
|
|
35
|
+
### DOM Inspection
|
|
36
|
+
```bash
|
|
37
|
+
agent-view dom # DOM accessibility tree (default window)
|
|
38
|
+
agent-view dom --window <id|name> # Specific window
|
|
39
|
+
agent-view dom --filter "button" # Filter by text/role
|
|
40
|
+
agent-view dom --depth 3 # Limit tree depth
|
|
41
|
+
agent-view dom --compact # Merge single-child chains onto one line (~40-60% fewer tokens)
|
|
42
|
+
agent-view dom --count # Count of all visible nodes (single integer line)
|
|
43
|
+
agent-view dom --filter "row" --count # Count matching nodes — e.g. "does this table have 5 rows?"
|
|
44
|
+
agent-view dom --max-lines 200 # Hard line budget; refs for truncated nodes still stored
|
|
45
|
+
agent-view dom --diff # Lines changed since last dom call (+ added / - removed)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`--count` skips tree output and ref mutations — cheapest way to assert "element exists N times" without loading the full tree into context.
|
|
49
|
+
|
|
50
|
+
### Interaction
|
|
51
|
+
```bash
|
|
52
|
+
agent-view click <ref> # Click element by ref from dom output
|
|
53
|
+
agent-view click --filter "Save" # Find element by text and click
|
|
54
|
+
agent-view click --pos 100,200 # Click by coordinates — CANVAS ONLY, see below
|
|
55
|
+
agent-view click <ref> --double # Double-click (fires dblclick handlers); works with --filter / --pos too
|
|
56
|
+
agent-view click <ref> --right # Right-click (fires contextmenu); works with --filter / --pos too
|
|
57
|
+
agent-view fill <ref> "text" # Type into input field
|
|
58
|
+
agent-view drag --from <ref> --to <ref> # Drag element to another element by ref
|
|
59
|
+
agent-view drag --from-pos 50,80 --to-pos 200,300 # Drag by coordinates (for canvas / Pixi)
|
|
60
|
+
agent-view drag --from <ref> --to <ref> --steps 25 --hold-ms 60 # Smoother movement, longer hold
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`drag` dispatches `mousePressed` → N × `mouseMoved` → `mouseReleased` via CDP. Endpoints can mix
|
|
64
|
+
ref and coordinate (e.g. `--from <ref> --to-pos 400,300`). For canvas/Pixi targets always use
|
|
65
|
+
`--from-pos`/`--to-pos` — derive the centroid via `agent-view eval` from the scene graph.
|
|
66
|
+
Refs are resolved fresh on each call, so window resizes between snapshots are tolerated.
|
|
67
|
+
Increase `--steps` for handlers using `globalpointermove` so intermediate frames are not skipped.
|
|
68
|
+
|
|
69
|
+
**Coordinates are a last resort.** `--pos` / `--from-pos` / `--to-pos` exist for canvas and WebGL,
|
|
70
|
+
where no ref exists. On DOM the correct order is `dom --filter "<text>"` → take the `[ref=N]` →
|
|
71
|
+
`click <ref>`, or `click --filter "<text>"` in one step. A coordinate pair breaks on any layout
|
|
72
|
+
shift, scroll, zoom, or window resize, and it clicks whatever now sits at that point — silently.
|
|
73
|
+
If you reach for `--pos` on a DOM element, first say why the ref was not usable.
|
|
74
|
+
|
|
75
|
+
### Modals & file pickers (`dialog`, `upload`)
|
|
76
|
+
|
|
77
|
+
A modal that agent-view cannot answer stops a run dead: the window looks frozen, every
|
|
78
|
+
later command times out, and nothing says why. Two kinds, handled differently.
|
|
79
|
+
|
|
80
|
+
**JS modals — `alert` / `confirm` / `prompt` / `beforeunload` — are answered for you.**
|
|
81
|
+
Nothing to set up. While agent-view is attached these never block the page: the default
|
|
82
|
+
standing answer is *dismiss*, and each one is recorded. `agent-view dialog` is the
|
|
83
|
+
reliable place to read that record; the console feed carries the same line
|
|
84
|
+
(`[agent-view] confirm auto-dismissed: <message>`) but only from the moment console
|
|
85
|
+
attaches, so a modal answered before your first `console` call reaches `dialog` alone.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
agent-view dialog # standing answer + every modal this window has seen
|
|
89
|
+
agent-view dialog policy accept # confirm() → true from now on
|
|
90
|
+
agent-view dialog policy accept --text "name" # prompt() → "name"
|
|
91
|
+
agent-view dialog policy dismiss # back to the default
|
|
92
|
+
agent-view dialog dismiss # answer one that is open right now
|
|
93
|
+
agent-view dialog accept --text "x" # …ditto, accepting
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`dialog accept` / `dialog dismiss` exist for a modal that was already open **before**
|
|
97
|
+
agent-view attached — that one produced no event, so no policy applied to it.
|
|
98
|
+
|
|
99
|
+
**Native file pickers never open — you answer them in advance.** Which mechanism applies
|
|
100
|
+
depends on how the app opens the picker, and `dialog arm` sets up all of them at once,
|
|
101
|
+
so you do not have to know:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# The input already exists in the DOM (even hidden) — no picker at all, cheapest path
|
|
105
|
+
agent-view upload --selector "#file-input" --file ./fixtures/a.png
|
|
106
|
+
agent-view upload --selector "#imgs" --file ./a.png --file ./b.png # multi-select
|
|
107
|
+
agent-view upload --ref 12 --file ./a.png # if the AX tree exposes it
|
|
108
|
+
|
|
109
|
+
# The input is created inside the click handler, or the app calls a native dialog API
|
|
110
|
+
agent-view dialog arm --file ./fixtures/a.png # then click the button that opens it
|
|
111
|
+
agent-view dialog arm --cancel # act as if the user pressed Cancel
|
|
112
|
+
agent-view dialog disarm # let real pickers open again
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Rules that actually bite:
|
|
116
|
+
|
|
117
|
+
- **Arm before the click.** A picker cannot be caught once it is open. `arm` is one-shot —
|
|
118
|
+
it is spent by the first picker and interception turns itself off, so a later click
|
|
119
|
+
opens a real OS dialog.
|
|
120
|
+
- **Click through `agent-view click`, never `eval "el.click()"`.** Chromium refuses to
|
|
121
|
+
open a file picker without user activation, and an eval-driven click carries none: the
|
|
122
|
+
picker is silently dropped and never intercepted.
|
|
123
|
+
- **Hidden inputs have no ref.** `display:none` / `v-show="false"` keeps them out of the
|
|
124
|
+
AX tree, so `dom` never prints one. Use `--selector`. `upload` has no `--filter` on
|
|
125
|
+
purpose: an accessible name lands on the label, not on the input behind it.
|
|
126
|
+
- **`beforeunload` is always dismissed**, whatever the policy — accepting it navigates
|
|
127
|
+
away and loses the state you are checking.
|
|
128
|
+
- Paths are resolved against your cwd and must exist — CDP accepts a bad path silently and
|
|
129
|
+
the app then reads an empty file.
|
|
130
|
+
- `agent-view dialog` after the fact shows what was intercepted and what was answered.
|
|
131
|
+
|
|
132
|
+
Known limits: `showOpenFilePicker()` (File System Access API) exposes no input to fill, so
|
|
133
|
+
it can only be cancelled. Electron does not implement `window.prompt` at all. Native
|
|
134
|
+
dialogs opened straight from an Electron **main** process (`dialog.showOpenDialog` behind
|
|
135
|
+
an IPC channel) are out of reach — CDP does not see the main process.
|
|
136
|
+
|
|
137
|
+
### Waiting (`wait`)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
agent-view wait --filter "Saved" # until the text appears in the AX tree
|
|
141
|
+
agent-view wait --filter "Saved" --timeout 20 # max wait in seconds (default 10)
|
|
142
|
+
agent-view wait --filter "Row 5" --window "Main" # specific window
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Exits as soon as the element appears; exits non-zero on timeout — so `&&` after it is a real gate.
|
|
146
|
+
|
|
147
|
+
**Never sleep for a fixed time** — see the waiting-signal table in `SKILL.md`. If no condition-based
|
|
148
|
+
wait fits, poll `dom --filter X --count` with an explicit attempt cap and report the attempt count.
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Screenshots
|
|
152
|
+
```bash
|
|
153
|
+
agent-view screenshot --scale 0.5 # Recommended: JPEG at half-res (~3× fewer vision tokens)
|
|
154
|
+
agent-view screenshot --scale 0.5 --window <id> # Specific window
|
|
155
|
+
agent-view screenshot --crop "Sidebar" # Crop to element bounding box (~1.6k tokens — 12× win)
|
|
156
|
+
agent-view screenshot --crop "Chart" --scale 0.5 # Crop + scale (stacks)
|
|
157
|
+
agent-view screenshot --crop "Active bookings" --crop-up 1 # Crop the card, not just its heading
|
|
158
|
+
agent-view screenshot # Full-res PNG (expensive: ~19k tokens at 1920×1080)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`--crop <filter>` resolves the element with the same filter syntax as `dom --filter`, then crops the screenshot to its bounding box. Prefer `--crop` over full-window screenshots whenever you only need to inspect a specific section. Falls back to full-window with a stderr warning if the filter matches nothing.
|
|
162
|
+
|
|
163
|
+
A text filter usually matches the text-bearing node, so cropping on a section title returns a thin strip of that title. `--crop-up <n>` climbs `n` element ancestors before cropping — use `1` (sometimes `2`) to get the surrounding card/section. When a crop comes back text-sized, the command says so on stderr.
|
|
164
|
+
|
|
165
|
+
### Runtime State (`eval`)
|
|
166
|
+
|
|
167
|
+
Reads runtime values DOM/screenshot can't reveal — store contents, computed flags, worker internals.
|
|
168
|
+
**Requires `"allowEval": true` in `agent-view.config.json`** — if the call returns "eval is disabled", tell the user to add the flag rather than working around it.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
agent-view eval "store.state.user.role" # default page target
|
|
172
|
+
agent-view eval --window "Settings" "router.currentRoute.path"
|
|
173
|
+
agent-view eval --target sync-worker "self.queue.length" # SharedWorker / ServiceWorker by id or substring
|
|
174
|
+
agent-view eval --await "fetch('/api/health').then(r => r.status)"
|
|
175
|
+
agent-view eval --json "({ buttons: document.querySelectorAll('button').length })"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
When to reach for `eval` instead of `dom`:
|
|
179
|
+
- The truth lives in JS state, not the DOM (Pinia/Vuex/Redux/Zustand store, Vue refs, computed values, app singletons).
|
|
180
|
+
- The target is a worker (`shared_worker`, `service_worker`, `worker`) — DOM doesn't exist there.
|
|
181
|
+
- You need a precise number/string answer, not a tree to scan.
|
|
182
|
+
- Verifying a `window.*` API or globally-exposed object exists. `eval` runs in the page's **main world**, so anything set on `window` directly or exposed via `contextBridge.exposeInMainWorld` is reachable. APIs placed only in an isolated-world preload (without `contextBridge`) will NOT be visible — that is not an agent bug, that is the host app's wiring.
|
|
183
|
+
|
|
184
|
+
### Reactive State (`watch`)
|
|
185
|
+
|
|
186
|
+
Streams JSON-patch diffs of an expression over time. Use when you need to see *what changed* between an action and a final state — `eval` shows the snapshot, `watch` shows the trajectory. **Requires `"allowEval": true`.**
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
agent-view watch "store.cart.total" # 250ms poll, default 10 changes or 30s
|
|
190
|
+
agent-view watch "appState" --until "appState.status === 'ready'" # wait-for-condition with diff log
|
|
191
|
+
agent-view watch "store.user" --max-changes 1 # capture exactly one change after a click
|
|
192
|
+
agent-view watch "appState" --json # NDJSON, machine-readable
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
When to reach for `watch` instead of `eval`:
|
|
196
|
+
- Debugging "the click did X but state shows Y — what happened in between?"
|
|
197
|
+
- Time-based assertions ("wait until store.status === 'ready'") — `--until` exits cleanly when truthy.
|
|
198
|
+
- Confirming an action triggered the *expected* sequence of mutations, not just the final state.
|
|
199
|
+
|
|
200
|
+
Output: `init` line (baseline), one line per RFC 6902 op (`replace /path old → new`, `add /items/0 ...`), final `stop` line with reason. Snapshot size cap 256 KB — narrow the expression (`store.x.y`, not `store`) for large objects.
|
|
201
|
+
|
|
202
|
+
### Console (`console`)
|
|
203
|
+
|
|
204
|
+
Streams `Runtime.consoleAPICalled` + `Log.entryAdded`. Use to confirm a flow finished without errors, or to surface a specific warning after an interaction.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
agent-view console # buffered messages from auto-attached targets
|
|
208
|
+
agent-view console --level error,warn # filter
|
|
209
|
+
agent-view console --target sync-worker # one target (title/URL substring, same fuzzy semantics as eval --target)
|
|
210
|
+
agent-view console --target IJ56KL # one target (exact id)
|
|
211
|
+
agent-view console --follow --timeout 10 # stream window (use sparingly — 10s of waiting)
|
|
212
|
+
agent-view console --follow --until "ready" # exit as soon as a message contains "ready"
|
|
213
|
+
agent-view console --follow --until "/error/i" # exit on regex match (case-insensitive)
|
|
214
|
+
agent-view console --clear # baseline before an interaction
|
|
215
|
+
agent-view console --since "2026-04-26T10:00:00Z"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`--until` requires `--follow`. Exits immediately when a message matches (substring or `/regex/flags`). On timeout without match exits non-zero.
|
|
219
|
+
|
|
220
|
+
Standard pattern for "did this action error?":
|
|
221
|
+
```bash
|
|
222
|
+
agent-view console --clear
|
|
223
|
+
agent-view click --filter "Save"
|
|
224
|
+
agent-view wait --filter "Saved"
|
|
225
|
+
agent-view console --level error # expect "(no console messages)"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Default attached target types: `page`, `shared_worker`, `service_worker` (override via `consoleTargets` in config).
|
|
229
|
+
|
|
230
|
+
### Log feed (`logs`)
|
|
231
|
+
|
|
232
|
+
`console` reads a ring buffer that dies with the server; `logs` records the same messages — page *and* every worker — into one file you can grep later. Reach for it when a bug needs a timeline instead of a snapshot: intermittent failures, long scenarios, anything spanning reloads or worker restarts.
|
|
233
|
+
|
|
234
|
+
Feeds are scoped to the CDP port, so parallel worktrees each record their own app; give each one its own feed path (the default relative `.agent-view/console.log` already does, one per checkout).
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
agent-view logs start --truncate # start clean; keeps recording across reloads
|
|
238
|
+
agent-view logs # tail last 200 records (alias of `logs tail`)
|
|
239
|
+
agent-view logs tail --grep "ws closed" # substring or /regex/
|
|
240
|
+
agent-view logs tail --since -2m # -30s | -5m | -2h | 09:31 | 09:31:02.500 | ISO
|
|
241
|
+
agent-view logs tail --level error,warn -n 50
|
|
242
|
+
agent-view logs clear # truncate feed + drop console buffer (baseline)
|
|
243
|
+
agent-view logs status # attached targets, feed size, tick count
|
|
244
|
+
agent-view logs stop
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Feed format — one record per line, always `HH:MM:SS.mmm [level] [type:id8] text`, local time, embedded newlines escaped as `\n`. That makes external `grep`/`awk` safe on it; a wrapped stack or JSON payload never breaks line-oriented filtering.
|
|
248
|
+
|
|
249
|
+
Default file `.agent-view/console.log` in the project root (override with `logFile` in config or `--file`). Caps at 8 MB, then rotates once to `<file>.prev` (`logMaxBytes` to change). Recording suspends the server's 5-min idle shutdown, so a long scenario keeps writing.
|
|
250
|
+
|
|
251
|
+
Standard pattern for "it fails once every N runs":
|
|
252
|
+
```bash
|
|
253
|
+
agent-view logs start --truncate
|
|
254
|
+
# … drive the scenario, reload, retry as many times as needed …
|
|
255
|
+
agent-view logs tail --level error,warn
|
|
256
|
+
agent-view logs tail --grep "/socket|retry/" --since -5m
|
|
257
|
+
agent-view logs stop
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Probes** (`--probe <file.js>[@target]`, requires `allowEval`) inject JS that logs into the same feed — use it when the evidence you need isn't logged by the app (wrap a method, count events, dump a scheduler). The probe is re-injected automatically whenever its context is gone: page reload, worker restart. Write it idempotent and let it report via plain `console.log`.
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
agent-view logs start --probe ./probes/orchestrator.js@shared_worker --probe ./probes/audio.js@index.html
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Network (`network`)
|
|
267
|
+
|
|
268
|
+
Request/response timeline, headers, timing, bodies, and WebSocket/SSE frames. Use to confirm an expected API call fired, diagnose a silent 404 / CORS block / missing auth header, or verify "button disabled until the network completes".
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
agent-view network # recent requests, newest at the bottom
|
|
272
|
+
agent-view network --req 3 # expand one: headers, timing, body / WS frame log
|
|
273
|
+
agent-view network --status 4xx,5xx # only failures (class or exact code, e.g. 404)
|
|
274
|
+
agent-view network --method POST # mutations among reads
|
|
275
|
+
agent-view network --type xhr,fetch # drop document/image/font noise
|
|
276
|
+
agent-view network --url "*/api/save*" # URL substring or * glob
|
|
277
|
+
agent-view network --follow --until "/api/save" # stream until a matching request fires
|
|
278
|
+
agent-view network --clear # baseline before an interaction
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Eager, unlike `console`.** `network` captures from app launch, so page-load traffic (initial XHR/fetch, auth handshakes, boot 404s) is usually already buffered by the time you call it — in most cases you don't need to reload. `console` is the opposite (lazy: attaches on first call, loses earlier output). Call this asymmetry out so it isn't mistaken for a bug. Caveat: for very fast apps the earliest request can fire before capture attaches. If boot traffic looks missing, don't conclude "no request fired" — reload (`agent-view eval "location.reload()"`) and re-check before deciding.
|
|
282
|
+
|
|
283
|
+
`[req=N]` handles are reallocated on every list call (like `dom` refs) — expand from the most recent list. Sensitive headers are redacted by default (`--raw-headers` reveals them). Response/request **bodies** require `"captureBody": true` in config; WebSocket frame payloads are visible by default.
|
|
284
|
+
|
|
285
|
+
Standard pattern for "did the save call fire and succeed?":
|
|
286
|
+
```bash
|
|
287
|
+
agent-view network --clear
|
|
288
|
+
agent-view click --filter "Save"
|
|
289
|
+
agent-view wait --filter "Saved"
|
|
290
|
+
agent-view network --url "*/api/save*" # expect one POST with status 200
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Reachability (`coverage`, `listeners`)
|
|
294
|
+
|
|
295
|
+
Use these before writing "no user action reaches this code" in a review. Reading a diff cannot prove reachability; running the app can.
|
|
296
|
+
|
|
297
|
+
**Only positive answers are cheap.** Proving a path exists costs one run of that path. Proving no path exists costs every path, so it is never bought. Both commands therefore treat an empty result as a valid answer with exit 0 — never as a failure — and neither ever proves unreachability.
|
|
298
|
+
|
|
299
|
+
`coverage` reports which functions ran since the last `--clear`, grouped by script URL:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
agent-view coverage --clear # open the window: counters reset
|
|
303
|
+
agent-view coverage # what ran since --clear (and reset again)
|
|
304
|
+
agent-view coverage --file "OrderForm" # scripts whose URL contains this
|
|
305
|
+
agent-view coverage --filter "onSubmit" # function name or script URL contains this
|
|
306
|
+
agent-view coverage --count # just the number of executed functions
|
|
307
|
+
agent-view coverage --all # include node_modules / runtime / url-less scripts
|
|
308
|
+
agent-view coverage --max-lines 40 # cap the output, tail `… N more lines`
|
|
309
|
+
agent-view coverage --target sync-worker # a worker's own window
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Standard pattern for "does clicking Save reach the code I changed?" — `clear → act → check`:
|
|
313
|
+
```bash
|
|
314
|
+
agent-view coverage --clear \
|
|
315
|
+
&& agent-view click --filter "Save" \
|
|
316
|
+
&& agent-view coverage --file "OrderForm" # expect the handler by name
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Every read is also a reset**, so two `coverage` calls in a row report different things — that is what makes one click attributable. Empty output is `(no code executed since --clear)`: it means *this* action did not reach the code, not that nothing can. Granularity is the function; unnamed functions print as `<anonymous>@<offset>`. Coverage lives in the V8 isolate, so a reload wipes it — `--clear` again after `location.reload()`. Reading before any `--clear` is an error telling you to run `--clear` first. `node_modules`, runtime bundles and url-less (`eval`'d) scripts are hidden unless `--all`.
|
|
320
|
+
|
|
321
|
+
`listeners` reports what is bound to one node and where each handler was declared:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
agent-view listeners --filter "Save" # node by accessible name, as in `click --filter`
|
|
325
|
+
agent-view listeners --ref 12 # node by ref from `dom`
|
|
326
|
+
agent-view listeners --selector "#save" # node by CSS — for nodes the AX tree never exposes
|
|
327
|
+
agent-view listeners --depth -1 # whole subtree (CDP depth; default 0)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Positions are 1-based (`file.vue:88:14`) and paste straight into a review comment. `(no listeners on this node)` means the node itself has none — the handler may still be delegated from an ancestor, so try `--depth -1` from a parent before concluding anything. An unresolvable script falls back to `scriptId:7:88:14`. Reach for `--selector` only when the node has no `[ref=N]` — hidden and `aria-hidden` elements never enter the AX tree.
|
|
331
|
+
|
|
332
|
+
### Targets (`targets`)
|
|
333
|
+
|
|
334
|
+
When `--window` doesn't show what you expected, or you need a worker target id for `eval`/`console`:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
agent-view targets # everything connectable
|
|
338
|
+
agent-view targets --type shared_worker,service_worker # filter
|
|
339
|
+
agent-view targets --json # machine-readable
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
You usually don't need this — `eval --target <substring>` and `--window <name>` both do fuzzy matching. Reach for `targets` when the substring is ambiguous.
|
|
343
|
+
|
|
344
|
+
`targets` prints ids truncated to 8 chars, and `--target` / `--window` accept that printed handle (case-insensitive id prefix, ≥4 chars) as well as a full id or a title/URL substring. An ambiguous prefix is reported as ambiguous rather than resolved to an arbitrary target. Worker targets often share a blank title, so the printed id prefix is the reliable handle for them.
|
|
345
|
+
|
|
346
|
+
### Scene / Canvas / WebGL (only when `webgl` is configured in agent-view.config.json)
|
|
347
|
+
|
|
348
|
+
These commands read the scene graph from canvas-based rendering engines. Skip this section if the project has no `webgl` field in config.
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
agent-view scene # Scene graph from configured engine
|
|
352
|
+
agent-view scene --filter "player" # Filter by object name/type
|
|
353
|
+
agent-view scene --verbose # Extended props (scale, alpha, rotation)
|
|
354
|
+
agent-view scene --diff # Changes since last call
|
|
355
|
+
agent-view scene --compact # Merge single-child chains onto one line (reduces output)
|
|
356
|
+
agent-view snap # DOM + Scene combined
|
|
357
|
+
agent-view snap --scale 0.5 # DOM + Scene + Screenshot (path appended as === Screenshot === section)
|
|
358
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Design conformance
|
|
2
|
+
|
|
3
|
+
Comparing captured screenshots against design references. Triggered when you are handed
|
|
4
|
+
`(label, screenshot command, expected reference path)` rows — from a plan, or from the developer
|
|
5
|
+
directly. Execute them yourself, inline, no subagent.
|
|
6
|
+
|
|
7
|
+
For each row:
|
|
8
|
+
|
|
9
|
+
1. Run the screenshot command; capture the saved file path from stdout.
|
|
10
|
+
2. Open both images for visual comparison — the capture and the `expected_path`. (Any harness
|
|
11
|
+
capability that loads an image into context; in Claude Code that is the file-read tool.) If
|
|
12
|
+
`expected_path` does not exist or cannot be read, mark the pair `skipped (expected_missing)`
|
|
13
|
+
and move on.
|
|
14
|
+
3. Compare for: layout (relative position, alignment), sizing, color (dominant color family),
|
|
15
|
+
typography (weight/size broadly), content presence (anything missing or extra), decorations
|
|
16
|
+
(borders, shadows, dashed/solid lines, icons).
|
|
17
|
+
4. Report each pair as `match` / `minor_mismatch` / `major_mismatch` with a one-sentence deviation.
|
|
18
|
+
- **Major** — missing or wrong component, broken layout, wrong color family, wrong text content.
|
|
19
|
+
- **Minor** — <10px spacing drift, slight color shade, small decoration difference.
|
|
20
|
+
|
|
21
|
+
Tolerance default is a designer's code-review level: flag what they would notice, ignore
|
|
22
|
+
anti-aliasing noise. Do not speculate about CSS causes — describe what looks different and let the
|
|
23
|
+
developer decide.
|