@petukhovart/agent-view 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +563 -548
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,548 +1,563 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
#
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
###
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"
|
|
304
|
-
"
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
agent-view
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
agent-view
|
|
365
|
-
agent-view
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
agent-view
|
|
402
|
-
agent-view
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
agent-view
|
|
430
|
-
agent-view
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
agent-view
|
|
463
|
-
agent-view
|
|
464
|
-
agent-view
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/logo.svg" alt="agent-view logo" width="160" height="160">
|
|
3
|
+
<h1>agent-view</h1>
|
|
4
|
+
<p><b>DevTools-level access for AI agents. Electron, Tauri, Chromium.</b></p>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@petukhovart/agent-view"><img src="https://img.shields.io/npm/v/@petukhovart/agent-view?color=yellow" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@petukhovart/agent-view"><img src="https://img.shields.io/npm/dt/@petukhovart/agent-view?color=blue" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/@petukhovart/agent-view"><img src="https://img.shields.io/npm/unpacked-size/@petukhovart/agent-view?color=purple&label=size" alt="package size" /></a>
|
|
11
|
+
<a href="https://github.com/PetukhovArt/agent-view/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@petukhovart/agent-view?color=green" alt="license" /></a>
|
|
12
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/node/v/@petukhovart/agent-view" alt="node" /></a>
|
|
13
|
+
<a href="https://github.com/PetukhovArt/agent-view/stargazers"><img src="https://img.shields.io/github/stars/PetukhovArt/agent-view?style=flat&color=orange" alt="github stars" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="#quickstart-claude-code">Quickstart</a> ·
|
|
18
|
+
<a href="#features">Features</a> ·
|
|
19
|
+
<a href="#commands">Commands</a> ·
|
|
20
|
+
<a href="#workflow-with-claude-code">Workflow</a> ·
|
|
21
|
+
<a href="CHANGELOG.md">Changelog</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
> Agents can read your code and your tests. What they can't see: whether the button is actually disabled, whether the modal opened, whether the store mutated. **agent-view** is one CLI that talks to your Electron, Tauri, or Chromium app over Chrome DevTools Protocol so the agent can answer those questions itself.
|
|
25
|
+
|
|
26
|
+
Works with any agent that can run shell commands. There's a Claude Code plugin if you want the smoothest path.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Why agent-view
|
|
31
|
+
|
|
32
|
+
- Reads state inside `SharedWorker`, `ServiceWorker`, and dedicated workers. Half of a modern app's state lives there, and most browser-automation tools don't follow it.
|
|
33
|
+
- Every command takes `--window <id>`. Settings, tray, and detached windows in Electron and Tauri apps work the same as the main window.
|
|
34
|
+
- Electron, Tauri (WebView2 and WebKit), and plain Chromium. One CLI, same commands.
|
|
35
|
+
- `click`, `fill`, and `drag` fire real CDP input events. Vue `v-model`, React controlled inputs, and native fields actually accept the value; synthetic DOM events fail silently there.
|
|
36
|
+
- `watch` emits RFC-6902 JSON-patches of any JS expression between two events. Answers "what mutated after the click?" without parsing screenshots.
|
|
37
|
+
- `dom` returns the accessibility tree with `[ref=N]` handles. `--compact` cuts deep trees by 40–60%; `--diff`, `--count`, and `--max-lines` keep output bounded. `screenshot --crop` and WebP scaling do the same for vision tokens.
|
|
38
|
+
- Lazy CDP daemon, one persistent socket, 300 ms AX-tree cache. `dom → click → dom` in about 17 ms.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Quickstart (Claude Code)
|
|
43
|
+
|
|
44
|
+
> Using Cursor / Aider / Cline / CI? Jump to [Other agents](#using-agent-view-with-other-agents-cursor-aider-cline-copilot-ci).
|
|
45
|
+
|
|
46
|
+
**1. Install the CLI and create a config:**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install -g @petukhovart/agent-view # one-time, global
|
|
50
|
+
cd your-project
|
|
51
|
+
agent-view init # writes agent-view.config.json (runtime, port, launch script)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`init` auto-detects most projects. Review the generated `launch` field if your dev command is non-standard, and set `"allowEval": true` if you want recipes to use `eval`/`watch`. Prefer to write the config by hand? See [Config](#config) for the field list.
|
|
55
|
+
|
|
56
|
+
**2. Install the Claude Code plugin** (adds the `verify` and `verify-recipe` skills):
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
/plugin marketplace add PetukhovArt/agent-view
|
|
60
|
+
/plugin install agent-view@agent-view
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**3. Open a CDP debug port** in your app, matching the `port` in your config. Pick your runtime:
|
|
64
|
+
|
|
65
|
+
<details open>
|
|
66
|
+
<summary><b>Electron</b> — top of <code>main.ts</code>, before <code>app.whenReady()</code></summary>
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import { app } from 'electron';
|
|
70
|
+
if (!app.isPackaged) {
|
|
71
|
+
app.commandLine.appendSwitch('remote-debugging-port', '9876');
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
</details>
|
|
75
|
+
|
|
76
|
+
<details>
|
|
77
|
+
<summary><b>Tauri 2</b> (WebView2 / Windows) — env var passed to <code>tauri dev</code></summary>
|
|
78
|
+
|
|
79
|
+
In `package.json`, wrap the dev script with [`cross-env`](https://www.npmjs.com/package/cross-env) so it works on Windows, macOS and Linux shells:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"scripts": {
|
|
84
|
+
"dev": "cross-env WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9876 tauri dev"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then `npm run dev` as usual. Devtools must be enabled in `tauri.conf.json` (default in `tauri dev`; for release builds, enable the `devtools` Cargo feature). macOS/Linux WebKit use different env vars; see [Enabling CDP](#enabling-cdp).
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary><b>Plain Chromium app</b> — launch flag</summary>
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
chromium --remote-debugging-port=9876
|
|
97
|
+
```
|
|
98
|
+
</details>
|
|
99
|
+
|
|
100
|
+
**4. In Claude Code, describe what you want verified:**
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
Verify: after clicking Save, the button must be disabled until network completes.
|
|
104
|
+
No console errors.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The `verify` skill starts your app via `agent-view launch`, runs the cheapest checks first (`eval` before `dom` before `screenshot`), and reports pass/fail. For repeatable checks, ask it to author a recipe first; see [Workflow with Claude Code](#workflow-with-claude-code).
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Manual CLI usage
|
|
112
|
+
|
|
113
|
+
When you want to drive the CLI yourself (other agents, CI, or just to poke around):
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
agent-view init # writes agent-view.config.json; auto-detects runtime/port/launch
|
|
117
|
+
agent-view launch # starts the app, waits for CDP, idempotent
|
|
118
|
+
agent-view dom --filter "Submit" # AX tree, with [ref=N] handles
|
|
119
|
+
agent-view click 12 # use a ref from the dom output
|
|
120
|
+
agent-view eval "store.state.user" # requires allowEval
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Full command surface in [Commands](#commands). For non-Claude-Code agents, see also [Other agents](#using-agent-view-with-other-agents-cursor-aider-cline-copilot-ci).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## How it works
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
┌──────────────┐ JSON over TCP ┌─────────────────┐ ┌──────────────┐
|
|
131
|
+
│ agent-view │ (token-auth, local) │ Lazy daemon │ CDP │ Your app │
|
|
132
|
+
│ CLI │ ──────────────────────▶ │ 127.0.0.1:47922│ ──────────────▶ │ (Electron / │
|
|
133
|
+
│ │ │ │ WebSocket │ Tauri / │
|
|
134
|
+
│ one shot │ ◀────────────────────── │ cache + reuse │ ◀────────────── │ Chromium) │
|
|
135
|
+
└──────────────┘ compact text └─────────────────┘ └──────────────┘
|
|
136
|
+
▲ spawned on first call
|
|
137
|
+
│ shuts down after 5 min idle
|
|
138
|
+
│ reuses one CDP socket across commands
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The daemon is why `dom → click → dom` runs in ~17ms total: one persistent CDP socket, a 300ms AX-tree cache, parallel CDP calls inside `click`. CLI commands themselves are stateless. Each one is a single shell call you can drop into a script or a recipe.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Features
|
|
146
|
+
|
|
147
|
+
| Command | What it gives the agent |
|
|
148
|
+
|---------------|-----------------------------------------------------------------------------------------|
|
|
149
|
+
| `dom` | Accessibility tree with `[ref=N]` handles. Flags: `--filter`, `--compact`, `--count`, `--max-lines`, `--diff`. |
|
|
150
|
+
| `screenshot` | PNG, or scaled WebP, or `--crop <element>` for one element only. Cuts vision tokens. |
|
|
151
|
+
| `click` / `fill` / `drag` | Real CDP input events. Works with Vue/React/native and HTML5/pointer DnD. |
|
|
152
|
+
| `eval` | Run JS in the page's main world. Read store/state directly instead of scraping DOM. |
|
|
153
|
+
| `watch` | Stream JSON-patch diffs of any expression. Answers "what changed between click and final state?". |
|
|
154
|
+
| `console` | `console.log` + `Log.entryAdded` per page **and per worker**, with `--follow --until <pattern>`. |
|
|
155
|
+
| `wait` | Block until an element appears (default 10s). |
|
|
156
|
+
| `scene` | WebGL scene graph (PixiJS today, engine-pluggable). `--compact` and `--diff` mirror `dom`. |
|
|
157
|
+
| `snap` | DOM + scene + optional screenshot in one call. |
|
|
158
|
+
| `targets` | Enumerate pages, iframes, shared/service/dedicated workers. |
|
|
159
|
+
| `discover` / `launch` / `init` / `stop` | Lifecycle and setup. |
|
|
160
|
+
|
|
161
|
+
Full flag reference in [Commands](#commands).
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Workflow with Claude Code
|
|
166
|
+
|
|
167
|
+
The plugin adds two skills built around an author-once / re-run loop:
|
|
168
|
+
|
|
169
|
+
- `verify-recipe` interviews you about a feature or fix, then writes `.claude/verify-recipes/<slug>.md` with Repro Steps, Evidence Commands (cheapest first: `eval` before `dom` before `screenshot`), and an optional Design Conformance table mapping screenshots to local reference images.
|
|
170
|
+
- `verify` reads a recipe (or runs ad-hoc), executes the commands against the live app, and reports pass/fail.
|
|
171
|
+
|
|
172
|
+
```mermaid
|
|
173
|
+
flowchart LR
|
|
174
|
+
subgraph Author["Phase 1 — author once"]
|
|
175
|
+
direction TB
|
|
176
|
+
Dev1["Developer"] -->|prompt + plan/commits| Recipe["verify-recipe<br/>skill"]
|
|
177
|
+
Recipe -->|writes| File[".claude/verify-recipes/<br/><slug>.md"]
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
subgraph Run["Phase 2 — run after every iteration"]
|
|
181
|
+
direction TB
|
|
182
|
+
Dev2["Developer"] -->|"run the recipe"| Verify["verify skill"]
|
|
183
|
+
File -.->|read| Verify
|
|
184
|
+
Verify -->|"dom / eval / click /<br/>screenshot / watch"| CLI["agent-view CLI"]
|
|
185
|
+
CLI -->|CDP| App["Live app"]
|
|
186
|
+
App -->|results| Verify
|
|
187
|
+
Verify -->|pass/fail + design verdict| Dev2
|
|
188
|
+
end
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Phase 1: author
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
Generate a verify-recipe for commits <hash1>..<hash2>.
|
|
195
|
+
Source plan: .claude/plans/2026-04-27-login-redirect.md
|
|
196
|
+
Symptom: after login, redirect went to /home instead of /dashboard.
|
|
197
|
+
|
|
198
|
+
Design references (optional):
|
|
199
|
+
- /abs/path/figma-exports/post-login.png → "post-login dashboard"
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Phase 2: run
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
Run the verify-recipe at .claude/verify-recipes/login-redirect.md.
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
When something fails:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
Step 4 failed (zone filter not mutating store). Fix and re-run that step plus step 7.
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### One-shot (no plan, no persistent recipe)
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
Verify: after clicking Save, the button must be disabled until network completes. No console errors.
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Anti-patterns
|
|
221
|
+
|
|
222
|
+
- "Just verify the feature" with no symptom. The recipe author can't pick the cheapest signal without knowing what "works" means.
|
|
223
|
+
- Pasting Figma URLs. agent-view doesn't fetch from Figma; export to PNG and pass the local path.
|
|
224
|
+
- 50 assertions in one recipe. Split per-feature; a recipe should run in under 2 minutes.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Using agent-view with other agents (Cursor, Aider, Cline, Copilot, CI)
|
|
229
|
+
|
|
230
|
+
The CLI is the whole product. Any agent that can run shell commands can use it:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
agent-view discover # JSON: window IDs, titles, URLs
|
|
234
|
+
agent-view dom --filter "Submit" # AX tree, with refs
|
|
235
|
+
agent-view fill 3 "hello@example.com"
|
|
236
|
+
agent-view click 7
|
|
237
|
+
agent-view eval "store.state.user.role"
|
|
238
|
+
agent-view screenshot --crop "Sidebar" --scale 0.5
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
For agents that benefit from a system-prompt shim, copy the gist of [`skills/verify/SKILL.md`](skills/verify/SKILL.md) into your agent's instructions. The DOM-first workflow and tool-selection table are framework-agnostic.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Enabling CDP
|
|
246
|
+
|
|
247
|
+
agent-view talks to your app over Chrome DevTools Protocol. Your app must be launched with a debugging port open.
|
|
248
|
+
|
|
249
|
+
### Recommended: in code (reliable, works with any build tool)
|
|
250
|
+
|
|
251
|
+
Add to your Electron main process, **before `app.whenReady()`** (top of `main.ts`/`main.js`, right after the `electron` import; switches set after the app is ready are ignored):
|
|
252
|
+
|
|
253
|
+
```js
|
|
254
|
+
import { app } from 'electron';
|
|
255
|
+
|
|
256
|
+
app.commandLine.appendSwitch('remote-debugging-port', '9876');
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
> Any free port works; `9876` is just an example. Avoid `9222` (Chrome's own default remote-debugging port) to prevent collisions when Chrome is open.
|
|
260
|
+
|
|
261
|
+
**Production safety:** an open CDP port in a signed/notarized build is a remote-code-execution surface. Gate it on `!app.isPackaged` so it only opens in dev:
|
|
262
|
+
|
|
263
|
+
```js
|
|
264
|
+
if (!app.isPackaged) {
|
|
265
|
+
app.commandLine.appendSwitch('remote-debugging-port', '9876');
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Alternative: via CLI flag (no code changes)
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Plain Electron
|
|
273
|
+
electron . --remote-debugging-port=9876
|
|
274
|
+
|
|
275
|
+
# electron-vite (note the -- to forward the flag past the build tool)
|
|
276
|
+
npx electron-vite dev -- --remote-debugging-port=9876
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Other runtimes
|
|
280
|
+
|
|
281
|
+
| Runtime | Setup |
|
|
282
|
+
|----------------------|--------------------------------------------|
|
|
283
|
+
| **Tauri** | CDP via devtools configuration |
|
|
284
|
+
| **Any Chromium app** | `--remote-debugging-port=9876` launch flag |
|
|
285
|
+
|
|
286
|
+
### Verify CDP is working
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
curl -s http://localhost:9876/json/version
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
A JSON response with process info means CDP is reachable.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Config
|
|
297
|
+
|
|
298
|
+
Running `agent-view init` in your project root generates `agent-view.config.json`. Minimal form:
|
|
299
|
+
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"runtime": "electron",
|
|
303
|
+
"port": 9876,
|
|
304
|
+
"launch": "npm run dev"
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Full form with all optional fields:
|
|
309
|
+
|
|
310
|
+
```json
|
|
311
|
+
{
|
|
312
|
+
"runtime": "electron",
|
|
313
|
+
"port": 9876,
|
|
314
|
+
"launch": "npm run dev",
|
|
315
|
+
"allowEval": true,
|
|
316
|
+
"webgl": {
|
|
317
|
+
"engine": "pixi"
|
|
318
|
+
},
|
|
319
|
+
"consoleBufferSize": 500,
|
|
320
|
+
"consoleTargets": ["page", "shared_worker", "service_worker"]
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
| Field | Required | Description |
|
|
325
|
+
|---------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
326
|
+
| `runtime` | yes | `"electron"`, `"tauri"`, or `"browser"` |
|
|
327
|
+
| `port` | yes | CDP debugging port. Integer in range `1`–`65535` |
|
|
328
|
+
| `launch` | yes | Shell command used by `agent-view launch` to start the app (e.g. `"npm run dev"`). Pass an empty string if you always start the app yourself |
|
|
329
|
+
| `webgl.engine` | no | Scene-graph engine. Currently `"pixi"` ships an adapter; the architecture is pluggable for adding more engines |
|
|
330
|
+
| `allowEval` | no | `true` to enable `agent-view eval` and `watch`. Off by default; opt-in for arbitrary JS execution |
|
|
331
|
+
| `consoleBufferSize` | no | Per-target console ring capacity. Positive integer. Default `500` |
|
|
332
|
+
| `consoleTargets` | no | Target types `agent-view console` auto-attaches to on first call. Any subset of `["page", "iframe", "shared_worker", "service_worker", "worker"]`. Default `["page", "shared_worker", "service_worker"]` |
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Commands
|
|
337
|
+
|
|
338
|
+
Every command targeting a window accepts `--window <id|title-substring>` (IDs come from `discover`). Examples below omit it for brevity.
|
|
339
|
+
|
|
340
|
+
### `init`
|
|
341
|
+
|
|
342
|
+
Auto-generates config by reading `package.json`.
|
|
343
|
+
|
|
344
|
+
### `discover`
|
|
345
|
+
|
|
346
|
+
Lists running app windows as JSON: window IDs, titles, URLs.
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
agent-view discover
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### `dom`
|
|
353
|
+
|
|
354
|
+
Dumps the accessibility tree in compact text format. Each element gets a session ref ID for interaction.
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
agent-view dom
|
|
358
|
+
agent-view dom --filter "Submit" # Filter by text/role
|
|
359
|
+
agent-view dom --depth 3 # Limit tree depth
|
|
360
|
+
agent-view dom --max-lines 200 # Hard line budget (refs for hidden nodes still stored)
|
|
361
|
+
agent-view dom --text # Fall back to DOM textContent search when AX returns no match
|
|
362
|
+
agent-view dom --compact # Merge single-child chains onto one line (saves ~40-60% tokens)
|
|
363
|
+
agent-view dom --count # Return only the count of matching nodes (e.g. "5")
|
|
364
|
+
agent-view dom --filter "row" --count # Count how many rows match
|
|
365
|
+
agent-view dom --diff # Show only lines that changed since last call
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
When `--filter` is set, depth defaults to unlimited so deep matches aren't truncated.
|
|
369
|
+
|
|
370
|
+
`--count` skips tree formatting and ref-store mutations entirely; useful for assertions like "does this section have N rows?" without the token cost of a full tree dump.
|
|
371
|
+
|
|
372
|
+
`--max-lines <n>` caps the number of output lines. When the tree exceeds the budget, output is truncated after `n-1` lines and a summary tail `… M more nodes` is appended. Refs for all nodes, including those past the cutoff, are still registered in the ref store, so a follow-up `dom --filter` or `click <ref>` works without re-running.
|
|
373
|
+
|
|
374
|
+
`--diff` computes a line-level diff against the previous `dom` call for the same target. The first call always returns the full tree (no prior snapshot). Subsequent calls emit only added (`+ `) and removed (`- `) lines. Returns `No changes` when the tree is identical.
|
|
375
|
+
|
|
376
|
+
### `click`
|
|
377
|
+
|
|
378
|
+
Clicks a DOM element by ref ID or coordinates.
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
agent-view click 5 # By ref from dom output
|
|
382
|
+
agent-view click --pos 100,200 # By coordinates (for canvas)
|
|
383
|
+
agent-view click 5 --double # Double-click (fires dblclick handlers)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### `fill`
|
|
387
|
+
|
|
388
|
+
Types text into an input. Uses native value setter + dispatches input/change events (works with Vue, React, and other frameworks).
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
agent-view fill 3 "hello@example.com"
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### `drag`
|
|
395
|
+
|
|
396
|
+
HTML5 / pointer-driven drag-and-drop via CDP `Input.dispatchMouseEvent` (`mousePressed` → N × `mouseMoved` → `mouseReleased`). Real mouse events, not synthesized JS events; works with `vue-draggable-resizable`, `react-grid-layout`, gridstack, kanban boards, file drop zones, map pin drags, resize handles.
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
agent-view drag --from 42 --to 88 # ref → ref
|
|
400
|
+
agent-view drag --from-pos 86,792 --to-pos 640,200 # coord → coord (canvas, custom DnD)
|
|
401
|
+
agent-view drag --from 42 --to-pos 640,200 # mixed
|
|
402
|
+
agent-view drag --from 5 --to 9 --steps 20 --hold-ms 150
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
`--steps` (default 10) controls intermediate `mouseMoved` events so libraries that throttle on movement deltas still see continuous motion. `--hold-ms` inserts a pause between press and the first move (some libs require >100ms for touch-style activation). `--button` accepts `left|right|middle`.
|
|
406
|
+
|
|
407
|
+
### `screenshot`
|
|
408
|
+
|
|
409
|
+
Captures a screenshot, saves to temp dir, prints the file path. PNG by default; WebP (q=80) when `--scale` is set (JPEG fallback for older Chrome/Electron).
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
agent-view screenshot
|
|
413
|
+
agent-view screenshot --scale 0.5 # Half-res WebP (~3× fewer vision tokens)
|
|
414
|
+
agent-view screenshot --scale 0.25 # Quarter-res WebP (~12× fewer, 1 tile)
|
|
415
|
+
agent-view screenshot --crop "Sidebar" # Crop to element bounding box (~12× fewer in best case)
|
|
416
|
+
agent-view screenshot --crop "Chart" --scale 0.5 # Crop + scale (stacks)
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
`--scale` accepts a factor in `(0, 1]`. CDP-side clip + WebP encode; recommended for agent loops where vision tokens dominate cost.
|
|
420
|
+
|
|
421
|
+
`--crop <filter>` resolves a DOM element by the same filter syntax as `dom --filter`, then crops the screenshot to its bounding box before encoding. One tile (~1.6k vision tokens) instead of twelve (~19k) in the best case. If the filter matches nothing a warning is emitted to stderr and the full window is captured instead. Combines naturally with `--scale`.
|
|
422
|
+
|
|
423
|
+
### `scene`
|
|
424
|
+
|
|
425
|
+
Reads the WebGL scene graph for canvas-based apps. Currently supports PixiJS via `window.__PIXI_DEVTOOLS__`.
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
agent-view scene # Full scene graph
|
|
429
|
+
agent-view scene --diff # Changes since last call
|
|
430
|
+
agent-view scene --filter "player" # Filter by name/type
|
|
431
|
+
agent-view scene --verbose # Extended props (alpha, scale, bounds)
|
|
432
|
+
agent-view scene --compact # Merge single-child chains onto one line
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### `snap`
|
|
436
|
+
|
|
437
|
+
Combined DOM + scene graph in one call. Shows DOM always; scene section appears when a WebGL engine is detected. Pass `--scale` to also capture a screenshot and append it as a third section.
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
agent-view snap
|
|
441
|
+
agent-view snap --scale 0.5 # DOM + Scene + Screenshot (path written to tmp)
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### `wait`
|
|
445
|
+
|
|
446
|
+
Waits for a DOM element matching the filter to appear. Useful after navigation or async operations.
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
agent-view wait --filter "Dashboard" # Wait for element (default 10s)
|
|
450
|
+
agent-view wait --filter "Dashboard" --timeout 30 # Custom timeout in seconds
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### `launch`
|
|
454
|
+
|
|
455
|
+
Starts the app using the `launch` command from config. Polls CDP until ready (60s timeout). Idempotent; skips if already running.
|
|
456
|
+
|
|
457
|
+
### `targets`
|
|
458
|
+
|
|
459
|
+
Lists every CDP target: pages, iframes, shared/service/dedicated workers. Use this when you need access to non-page targets (e.g. an Electron app with a `SharedWorker`).
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
agent-view targets # all supported types
|
|
463
|
+
agent-view targets --type shared_worker,service_worker # filter
|
|
464
|
+
agent-view targets --json # machine-readable
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### `eval`
|
|
468
|
+
|
|
469
|
+
Runs `Runtime.evaluate` in any connectable target. **Requires `"allowEval": true` in `agent-view.config.json`**; the local socket is shared and this is the project-owner opt-in.
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
agent-view eval "document.title"
|
|
473
|
+
agent-view eval --target IJ56KL "self.constructor.name" # by id (or title/url substring)
|
|
474
|
+
agent-view eval --window "Monitor 1" --await "fetch('/api/health').then(r => r.status)"
|
|
475
|
+
agent-view eval --json "({ buttons: document.querySelectorAll('button').length })"
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Output is capped at 64 KB. Thrown exceptions and syntax errors propagate as non-zero exit with the CDP error message.
|
|
479
|
+
|
|
480
|
+
> **Note on execution context.** `agent-view eval` runs in the page's **main world** via `Runtime.evaluate`. Only values reachable from the main-world `window` are visible. To expose your API for `eval` (and `watch`), attach it to `window`:
|
|
481
|
+
> - Vanilla / browser: `window.myApi = { ... }`
|
|
482
|
+
> - Electron preload with `contextIsolation: true`: `contextBridge.exposeInMainWorld('myApi', { ... })`
|
|
483
|
+
> - Tauri / WebView2: same; assign to `window` from your bootstrap script
|
|
484
|
+
>
|
|
485
|
+
> Anything kept inside an isolated-world preload without `contextBridge` will be invisible to `eval`; `eval "typeof window.myApi"` will return `"undefined"` even though the value exists in the preload context.
|
|
486
|
+
|
|
487
|
+
### `console`
|
|
488
|
+
|
|
489
|
+
Streams or dumps console output (`Runtime.consoleAPICalled` + `Log.entryAdded`) from auto-attached targets. Lazy: first call attaches matching targets, subsequent calls reuse them.
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
agent-view console # buffered messages since attach
|
|
493
|
+
agent-view console --follow --timeout 10 # stream for 10s
|
|
494
|
+
agent-view console --follow --until "ready" # exit as soon as a message contains "ready"
|
|
495
|
+
agent-view console --follow --until "/error/i" # exit on regex match (case-insensitive)
|
|
496
|
+
agent-view console --target IJ56KL # restrict to one target (exact id)
|
|
497
|
+
agent-view console --target sync-worker # restrict to one target (title/URL substring)
|
|
498
|
+
agent-view console --level error,warn # level filter
|
|
499
|
+
agent-view console --since "2026-04-26T10:00:00Z"
|
|
500
|
+
agent-view console --clear # drop in-memory ring
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
`--until <pattern>` requires `--follow`. Exits as soon as a message matches the pattern (substring or `/regex/flags`). On timeout without match exits non-zero with `Timeout: pattern not seen in <N>s`.
|
|
504
|
+
|
|
505
|
+
`--target` resolves the same way as `eval --target`: exact id wins, then title substring, then URL substring. If no match is found, an error is returned.
|
|
506
|
+
|
|
507
|
+
Default attached target types: `page`, `shared_worker`, `service_worker`. Override with `consoleTargets` in config.
|
|
508
|
+
|
|
509
|
+
### `watch`
|
|
510
|
+
|
|
511
|
+
Polls a JS expression and streams JSON-patch (RFC 6902) diffs as it changes. Closes the "what changed between click and final state?" gap that screenshots and DOM dumps can't cover. **Requires `"allowEval": true`** (same gate as `eval`).
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
agent-view watch "store.cart.total" # 250ms poll, exits at 10 changes or 30s
|
|
515
|
+
agent-view watch "appState" --interval 100 --duration 60 # tighter cadence, longer window
|
|
516
|
+
agent-view watch "store.status" --until "store.status === 'ready'" # wait-for assertion
|
|
517
|
+
agent-view watch "appState" --max-changes 1 # snapshot first change after a click
|
|
518
|
+
agent-view watch "appState" --json # NDJSON, one frame per line
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Output frames: `init` (baseline value), `diff` (RFC 6902 ops since last frame), `error`, `stop`. SIGINT exits cleanly. Snapshot size cap 256 KB; narrow the expression (e.g. `store.cart.items.length`) when watching large objects.
|
|
522
|
+
|
|
523
|
+
### `stop`
|
|
524
|
+
|
|
525
|
+
Stops the background lazy server.
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## Performance
|
|
530
|
+
|
|
531
|
+
Built for tight `dom → click → dom` loops. Typical Electron app, ~200 AX nodes:
|
|
532
|
+
|
|
533
|
+
| Scenario | agent-view | Playwright (estimate) |
|
|
534
|
+
|--------------------------------|------------|-----------------------|
|
|
535
|
+
| `dom` cold fetch | 2ms | ~30–80ms |
|
|
536
|
+
| `dom` warm (cache hit) | 1ms | ~30–80ms |
|
|
537
|
+
| Full cycle `dom → click → dom` | 17ms | ~75ms |
|
|
538
|
+
|
|
539
|
+
What makes it fast: 300ms AX-tree cache (invalidated on `click`/`fill`/navigation; cached responses prefixed with `[cache]`), parallel CDP calls in `click`, `Accessibility.queryAXTree` for filter lookups, and a single persistent CDP WebSocket reused across commands (no relay).
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
## Troubleshooting
|
|
544
|
+
|
|
545
|
+
### CDP not responding
|
|
546
|
+
|
|
547
|
+
1. Check the port is listening: `curl -s http://localhost:9876/json/version`
|
|
548
|
+
2. For electron-vite: make sure you use `--` before the flag: `npx electron-vite dev -- --remote-debugging-port=9876`
|
|
549
|
+
3. Restart the app; HMR doesn't restart the main process
|
|
550
|
+
|
|
551
|
+
### Stale refs after HMR
|
|
552
|
+
|
|
553
|
+
After hot reload, refs from previous `dom` calls become invalid. Run `agent-view dom` again to get fresh refs.
|
|
554
|
+
|
|
555
|
+
### Launch timeout
|
|
556
|
+
|
|
557
|
+
Complex Electron apps may take >60s on cold start. If `agent-view launch` times out, start the app manually and use `agent-view discover` to verify.
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## License
|
|
562
|
+
|
|
563
|
+
MIT. See [LICENSE](LICENSE).
|
package/package.json
CHANGED