@petukhovart/agent-view 0.9.2 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +21 -21
- package/LICENSE +21 -21
- package/README.md +26 -1
- package/dist/adapters/browser.d.ts.map +1 -1
- package/dist/adapters/browser.js +2 -2
- package/dist/adapters/browser.js.map +1 -1
- package/dist/adapters/electron.d.ts.map +1 -1
- package/dist/adapters/electron.js +2 -2
- package/dist/adapters/electron.js.map +1 -1
- package/dist/adapters/target-filter.d.ts +11 -0
- package/dist/adapters/target-filter.d.ts.map +1 -0
- package/dist/adapters/target-filter.js +19 -0
- package/dist/adapters/target-filter.js.map +1 -0
- package/dist/adapters/tauri.d.ts +2 -5
- package/dist/adapters/tauri.d.ts.map +1 -1
- package/dist/adapters/tauri.js +2 -13
- package/dist/adapters/tauri.js.map +1 -1
- package/dist/cdp/network-stream.d.ts +27 -0
- package/dist/cdp/network-stream.d.ts.map +1 -0
- package/dist/cdp/network-stream.js +336 -0
- package/dist/cdp/network-stream.js.map +1 -0
- package/dist/cdp/transport.d.ts.map +1 -1
- package/dist/cdp/transport.js +167 -8
- package/dist/cdp/transport.js.map +1 -1
- package/dist/cdp/types.d.ts +187 -0
- package/dist/cdp/types.d.ts.map +1 -1
- package/dist/cdp/types.js +55 -0
- package/dist/cdp/types.js.map +1 -1
- package/dist/cli/commands/network.d.ts +19 -0
- package/dist/cli/commands/network.d.ts.map +1 -0
- package/dist/cli/commands/network.js +55 -0
- package/dist/cli/commands/network.js.map +1 -0
- package/dist/cli/index.js +23 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +6 -0
- package/dist/config/manager.js.map +1 -1
- package/dist/config/types.d.ts +8 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/inspectors/network/index.d.ts +19 -0
- package/dist/inspectors/network/index.d.ts.map +1 -0
- package/dist/inspectors/network/index.js +169 -0
- package/dist/inspectors/network/index.js.map +1 -0
- package/dist/server/server.d.ts +12 -0
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +193 -18
- package/dist/server/server.js.map +1 -1
- package/package.json +9 -8
- package/skills/verify/SKILL.md +319 -292
- package/skills/verify-recipe/SKILL.md +286 -286
- package/dist/cdp/console-stream.d.ts +0 -35
- package/dist/cdp/console-stream.d.ts.map +0 -1
- package/dist/cdp/console-stream.js +0 -103
- package/dist/cdp/console-stream.js.map +0 -1
- package/dist/inspectors/dom.d.ts +0 -17
- package/dist/inspectors/dom.d.ts.map +0 -1
- package/dist/inspectors/dom.js +0 -131
- package/dist/inspectors/dom.js.map +0 -1
- package/dist/inspectors/scene/pixi.d.ts +0 -3
- package/dist/inspectors/scene/pixi.d.ts.map +0 -1
- package/dist/inspectors/scene/pixi.js +0 -52
- package/dist/inspectors/scene/pixi.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agent-view",
|
|
3
|
-
"description": "Visual verification CLI for desktop apps (Electron/Tauri/Browser) via Chrome DevTools Protocol. Ships two skills: verify (run DOM, screenshot, eval, watch, console checks against a live app) and verify-recipe (author a reusable verification plan as a .md file).",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"keywords": [
|
|
6
|
-
"cdp",
|
|
7
|
-
"electron",
|
|
8
|
-
"tauri",
|
|
9
|
-
"desktop",
|
|
10
|
-
"testing",
|
|
11
|
-
"accessibility",
|
|
12
|
-
"screenshot",
|
|
13
|
-
"automation"
|
|
14
|
-
],
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "PetukhovArt"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/PetukhovArt/agent-view",
|
|
19
|
-
"repository": "https://github.com/PetukhovArt/agent-view",
|
|
20
|
-
"license": "MIT"
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-view",
|
|
3
|
+
"description": "Visual verification CLI for desktop apps (Electron/Tauri/Browser) via Chrome DevTools Protocol. Ships two skills: verify (run DOM, screenshot, eval, watch, console checks against a live app) and verify-recipe (author a reusable verification plan as a .md file).",
|
|
4
|
+
"version": "0.10.1",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cdp",
|
|
7
|
+
"electron",
|
|
8
|
+
"tauri",
|
|
9
|
+
"desktop",
|
|
10
|
+
"testing",
|
|
11
|
+
"accessibility",
|
|
12
|
+
"screenshot",
|
|
13
|
+
"automation"
|
|
14
|
+
],
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "PetukhovArt"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/PetukhovArt/agent-view",
|
|
19
|
+
"repository": "https://github.com/PetukhovArt/agent-view",
|
|
20
|
+
"license": "MIT"
|
|
21
|
+
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Artem Petukhov
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Artem Petukhov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -152,6 +152,7 @@ The daemon is why `dom → click → dom` runs in ~17ms total: one persistent CD
|
|
|
152
152
|
| `eval` | Run JS in the page's main world. Read store/state directly instead of scraping DOM. |
|
|
153
153
|
| `watch` | Stream JSON-patch diffs of any expression. Answers "what changed between click and final state?". |
|
|
154
154
|
| `console` | `console.log` + `Log.entryAdded` per page **and per worker**, with `--follow --until <pattern>`. |
|
|
155
|
+
| `network` | Request/response timeline, headers, timing, bodies, and WebSocket/SSE frames. Filters: `--url`, `--method`, `--status`, `--type`. Captures page-load traffic. |
|
|
155
156
|
| `wait` | Block until an element appears (default 10s). |
|
|
156
157
|
| `scene` | WebGL scene graph (PixiJS today, engine-pluggable). `--compact` and `--diff` mirror `dom`. |
|
|
157
158
|
| `snap` | DOM + scene + optional screenshot in one call. |
|
|
@@ -317,7 +318,9 @@ Full form with all optional fields:
|
|
|
317
318
|
"engine": "pixi"
|
|
318
319
|
},
|
|
319
320
|
"consoleBufferSize": 500,
|
|
320
|
-
"consoleTargets": ["page", "shared_worker", "service_worker"]
|
|
321
|
+
"consoleTargets": ["page", "shared_worker", "service_worker"],
|
|
322
|
+
"captureBody": false,
|
|
323
|
+
"networkBufferSize": 200
|
|
321
324
|
}
|
|
322
325
|
```
|
|
323
326
|
|
|
@@ -330,6 +333,8 @@ Full form with all optional fields:
|
|
|
330
333
|
| `allowEval` | no | `true` to enable `agent-view eval` and `watch`. Off by default; opt-in for arbitrary JS execution |
|
|
331
334
|
| `consoleBufferSize` | no | Per-target console ring capacity. Positive integer. Default `500` |
|
|
332
335
|
| `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"]` |
|
|
336
|
+
| `captureBody` | no | `true` to capture response bodies and request payloads for `agent-view network`. Off by default; opt-in since bodies can carry tokens/PII. WebSocket frame payloads are visible regardless |
|
|
337
|
+
| `networkBufferSize` | no | Per-target network ring capacity. Positive integer. Default `200` (smaller than console — entries are heavier) |
|
|
333
338
|
|
|
334
339
|
---
|
|
335
340
|
|
|
@@ -506,6 +511,26 @@ agent-view console --clear # drop in-memory ring
|
|
|
506
511
|
|
|
507
512
|
Default attached target types: `page`, `shared_worker`, `service_worker`. Override with `consoleTargets` in config.
|
|
508
513
|
|
|
514
|
+
### `network`
|
|
515
|
+
|
|
516
|
+
Lists captured network requests, one compact line each with a short `[req=N]` handle. Expand one with `--req N` for headers, timing, body, or the WebSocket frame log. Surfaces the silent failures DOM and console can't: a 404 that never throws, a CORS block, a missing `Authorization` header, a realtime socket that never receives its message.
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
agent-view network # recent requests, newest at the bottom
|
|
520
|
+
agent-view network --req 3 # expand one: headers, timing, body / WS frames
|
|
521
|
+
agent-view network --status 4xx,5xx,failed # class, exact code (404), or `failed` (no HTTP response — CORS/conn refused)
|
|
522
|
+
agent-view network --method POST # find mutations among reads
|
|
523
|
+
agent-view network --type xhr,fetch # drop document/image/font noise
|
|
524
|
+
agent-view network --url "*/api/users*" # URL substring, or glob with *
|
|
525
|
+
agent-view network --follow --until "/api/save" # stream until a matching request fires
|
|
526
|
+
agent-view network --raw-headers --req 3 # reveal redacted header values
|
|
527
|
+
agent-view network --clear # drop in-memory ring
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Eager, not lazy — the one asymmetry with `console`.** `network` capture starts when the app launches, so page-load traffic (initial XHR/fetch, auth handshakes, boot 404s) is usually buffered by the time you call it. `console`, by contrast, attaches on its first call and loses anything emitted earlier. This is deliberate: network's value is front-loaded. The one caveat: a very fast app can fire its first request before capture attaches — if boot traffic looks missing, reload and re-check rather than assuming nothing fired.
|
|
531
|
+
|
|
532
|
+
Sensitive headers (`Authorization`, `Cookie`, `Set-Cookie`, `X-Api-Key`, …) are redacted by default; `--raw-headers` reveals them. Request/response **bodies** stay off until the project owner sets `"captureBody": true` (bodies can carry tokens/PII). WebSocket frame payloads are visible by default — seeing them is the point — capped per frame. `--follow` and `--until` mirror `console`. `--target` / `--window` scope to one target.
|
|
533
|
+
|
|
509
534
|
### `watch`
|
|
510
535
|
|
|
511
536
|
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`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/adapters/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/adapters/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMhD,eAAO,MAAM,cAAc,EAAE,cAgB5B,CAAA"}
|
package/dist/adapters/browser.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { listSupportedTargets, connectToPage } from '../cdp/transport.js';
|
|
2
2
|
import { RuntimeType } from '../types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { isAppTarget } from './target-filter.js';
|
|
4
4
|
export const browserAdapter = {
|
|
5
5
|
runtime: RuntimeType.Browser,
|
|
6
6
|
async discover(port) {
|
|
7
7
|
const targets = await listSupportedTargets(port);
|
|
8
8
|
return targets
|
|
9
|
-
.filter(
|
|
9
|
+
.filter(isAppTarget)
|
|
10
10
|
.map(t => ({ id: t.id, title: t.title, url: t.url, type: t.type }));
|
|
11
11
|
},
|
|
12
12
|
async connect(port, windowId, cache) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/adapters/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/adapters/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,OAAO,EAAE,WAAW,CAAC,OAAO;IAE5B,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,OAAO,OAAO;aACX,MAAM,CAAC,WAAW,CAAC;aACnB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,QAAgB,EAAE,KAAkB;QAC9D,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAA;QAC7D,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electron.d.ts","sourceRoot":"","sources":["../../src/adapters/electron.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"electron.d.ts","sourceRoot":"","sources":["../../src/adapters/electron.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMhD,eAAO,MAAM,eAAe,EAAE,cAgB7B,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { listSupportedTargets, connectToPage } from '../cdp/transport.js';
|
|
2
2
|
import { RuntimeType } from '../types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { isAppTarget } from './target-filter.js';
|
|
4
4
|
export const electronAdapter = {
|
|
5
5
|
runtime: RuntimeType.Electron,
|
|
6
6
|
async discover(port) {
|
|
7
7
|
const targets = await listSupportedTargets(port);
|
|
8
8
|
return targets
|
|
9
|
-
.filter(
|
|
9
|
+
.filter(isAppTarget)
|
|
10
10
|
.map(t => ({ id: t.id, title: t.title, url: t.url, type: t.type }));
|
|
11
11
|
},
|
|
12
12
|
async connect(port, windowId, cache) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electron.js","sourceRoot":"","sources":["../../src/adapters/electron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"electron.js","sourceRoot":"","sources":["../../src/adapters/electron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,OAAO,EAAE,WAAW,CAAC,QAAQ;IAE7B,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,OAAO,OAAO;aACX,MAAM,CAAC,WAAW,CAAC;aACnB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,QAAgB,EAAE,KAAkB;QAC9D,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAA;QAC7D,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True for a page-target that is an actual app window — filters out the DevTools
|
|
3
|
+
* frontend (`devtools://`), which registers as a first-in-list `page` target the
|
|
4
|
+
* moment a user opens DevTools and would otherwise be picked as the default window.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isAppTarget(target: {
|
|
7
|
+
type: string;
|
|
8
|
+
url: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}): boolean;
|
|
11
|
+
//# sourceMappingURL=target-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-filter.d.ts","sourceRoot":"","sources":["../../src/adapters/target-filter.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAIzF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TargetType } from '../cdp/types.js';
|
|
2
|
+
/** URLs a Chromium runtime exposes as CDP page-targets but that aren't app windows. */
|
|
3
|
+
const INTERNAL_URL_PATTERNS = [
|
|
4
|
+
'about:blank',
|
|
5
|
+
'devtools://',
|
|
6
|
+
'chrome-extension://',
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* True for a page-target that is an actual app window — filters out the DevTools
|
|
10
|
+
* frontend (`devtools://`), which registers as a first-in-list `page` target the
|
|
11
|
+
* moment a user opens DevTools and would otherwise be picked as the default window.
|
|
12
|
+
*/
|
|
13
|
+
export function isAppTarget(target) {
|
|
14
|
+
if (target.type !== TargetType.Page)
|
|
15
|
+
return false;
|
|
16
|
+
const url = target.url.toLowerCase();
|
|
17
|
+
return !INTERNAL_URL_PATTERNS.some(pattern => url.startsWith(pattern));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=target-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-filter.js","sourceRoot":"","sources":["../../src/adapters/target-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,uFAAuF;AACvF,MAAM,qBAAqB,GAAG;IAC5B,aAAa;IACb,aAAa;IACb,qBAAqB;CACtB,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAoD;IAC9E,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IACjD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA;IACpC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;AACxE,CAAC"}
|
package/dist/adapters/tauri.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { RuntimeAdapter } from './types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
url: string;
|
|
5
|
-
title: string;
|
|
6
|
-
}): boolean;
|
|
2
|
+
import { isAppTarget } from './target-filter.js';
|
|
3
|
+
export { isAppTarget };
|
|
7
4
|
export declare const tauriAdapter: RuntimeAdapter;
|
|
8
5
|
//# sourceMappingURL=tauri.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tauri.d.ts","sourceRoot":"","sources":["../../src/adapters/tauri.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"tauri.d.ts","sourceRoot":"","sources":["../../src/adapters/tauri.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,eAAO,MAAM,YAAY,EAAE,cAgB1B,CAAA"}
|
package/dist/adapters/tauri.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { listSupportedTargets, connectToPage } from '../cdp/transport.js';
|
|
2
2
|
import { RuntimeType } from '../types.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const INTERNAL_URL_PATTERNS = [
|
|
6
|
-
'about:blank',
|
|
7
|
-
'devtools://',
|
|
8
|
-
'chrome-extension://',
|
|
9
|
-
];
|
|
10
|
-
export function isAppTarget(target) {
|
|
11
|
-
if (target.type !== TargetType.Page)
|
|
12
|
-
return false;
|
|
13
|
-
const url = target.url.toLowerCase();
|
|
14
|
-
return !INTERNAL_URL_PATTERNS.some(pattern => url.startsWith(pattern));
|
|
15
|
-
}
|
|
3
|
+
import { isAppTarget } from './target-filter.js';
|
|
4
|
+
export { isAppTarget };
|
|
16
5
|
export const tauriAdapter = {
|
|
17
6
|
runtime: RuntimeType.Tauri,
|
|
18
7
|
async discover(port) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tauri.js","sourceRoot":"","sources":["../../src/adapters/tauri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"tauri.js","sourceRoot":"","sources":["../../src/adapters/tauri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,OAAO,EAAE,WAAW,CAAC,KAAK;IAE1B,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,OAAO,OAAO;aACX,MAAM,CAAC,WAAW,CAAC;aACnB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,QAAgB,EAAE,KAAkB;QAC9D,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAA;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAA;QAC7D,OAAO,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RuntimeSession, TargetType } from './types.js';
|
|
2
|
+
import { type NetworkEntry, type NetworkFilter } from './types.js';
|
|
3
|
+
export type StampedNetworkEntry = NetworkEntry & {
|
|
4
|
+
targetId: string;
|
|
5
|
+
targetType: TargetType;
|
|
6
|
+
};
|
|
7
|
+
export declare class NetworkStream {
|
|
8
|
+
private readonly capacity;
|
|
9
|
+
private readonly captureBody;
|
|
10
|
+
private readonly targets;
|
|
11
|
+
private readonly subscribers;
|
|
12
|
+
constructor(opts?: {
|
|
13
|
+
capacity?: number;
|
|
14
|
+
captureBody?: boolean;
|
|
15
|
+
});
|
|
16
|
+
get attachedCount(): number;
|
|
17
|
+
attach(session: RuntimeSession): Promise<void>;
|
|
18
|
+
detach(targetId?: string): void;
|
|
19
|
+
clear(targetId?: string): void;
|
|
20
|
+
subscribe(handler: (entry: StampedNetworkEntry) => void): () => void;
|
|
21
|
+
drain(filter?: NetworkFilter): StampedNetworkEntry[];
|
|
22
|
+
getEntry(targetId: string, requestId: string): StampedNetworkEntry | undefined;
|
|
23
|
+
private notify;
|
|
24
|
+
private upsertEntry;
|
|
25
|
+
private handleEvent;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=network-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-stream.d.ts","sourceRoot":"","sources":["../../src/cdp/network-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAML,KAAK,YAAY,EAEjB,KAAK,aAAa,EAGnB,MAAM,YAAY,CAAA;AAOnB,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAA;AAkB7F,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkD;gBAElE,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO;IAKnE,IAAI,aAAa,IAAI,MAAM,CAE1B;IAEK,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAapD,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAY/B,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ9B,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,MAAM,IAAI;IAKpE,KAAK,CAAC,MAAM,GAAE,aAAkB,GAAG,mBAAmB,EAAE;IAmDxD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAQ9E,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,WAAW;CA4MpB"}
|