@reticlehq/browser 2.11.0 → 2.13.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/dist/actions/actions-dom.js +41 -3
- package/dist/actions/actions.js +43 -11
- package/dist/commands/commands.js +6 -2
- package/dist/connect-options.d.ts +18 -1
- package/dist/dom/a11y.js +92 -9
- package/dist/dom/dom-ignore.d.ts +9 -0
- package/dist/dom/dom-ignore.js +32 -3
- package/dist/dom/query.js +168 -97
- package/dist/dom/refs.d.ts +11 -0
- package/dist/dom/refs.js +30 -1
- package/dist/dom/snapshot.d.ts +37 -0
- package/dist/dom/snapshot.js +141 -37
- package/dist/edit-epoch.d.ts +32 -0
- package/dist/edit-epoch.js +108 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/observers/animation.js +6 -8
- package/dist/observers/context-open.d.ts +12 -0
- package/dist/observers/context-open.js +25 -0
- package/dist/observers/focus.js +5 -6
- package/dist/observers/health.js +6 -9
- package/dist/observers/install-all.js +2 -0
- package/dist/observers/network-redact.d.ts +13 -0
- package/dist/observers/network-redact.js +12 -1
- package/dist/observers/network.d.ts +2 -2
- package/dist/observers/network.js +24 -17
- package/dist/observers/scroll.js +4 -2
- package/dist/observers/storage.js +1 -1
- package/dist/presenter/presenter-brand.d.ts +4 -18
- package/dist/presenter/presenter-brand.js +6 -18
- package/dist/presenter/presenter-config.d.ts +11 -8
- package/dist/presenter/presenter-config.js +9 -3
- package/dist/presenter/presenter-controls.d.ts +0 -3
- package/dist/presenter/presenter-controls.js +0 -3
- package/dist/presenter/presenter-hud-chrome.d.ts +1 -1
- package/dist/presenter/presenter-report-copy.d.ts +30 -1
- package/dist/presenter/presenter-report-copy.js +31 -2
- package/dist/presenter/presenter-report-styles.js +24 -0
- package/dist/presenter/presenter-report.d.ts +2 -2
- package/dist/presenter/presenter-report.js +95 -3
- package/dist/presenter/presenter-settings.js +10 -2
- package/dist/presenter/presenter-shell-styles.js +20 -1
- package/dist/presenter/presenter-shell.d.ts +0 -2
- package/dist/presenter/presenter-shell.js +1 -6
- package/dist/presenter/presenter.d.ts +13 -0
- package/dist/presenter/presenter.js +37 -2
- package/dist/registry/auto-testids.d.ts +21 -0
- package/dist/registry/auto-testids.js +48 -0
- package/dist/registry/capabilities.d.ts +28 -1
- package/dist/registry/capabilities.js +59 -7
- package/dist/registry/store-adapters.d.ts +1 -1
- package/dist/registry/store-adapters.js +6 -1
- package/dist/registry/stores.d.ts +4 -0
- package/dist/registry/stores.js +35 -0
- package/dist/reticle.d.ts +12 -0
- package/dist/reticle.js +40 -1
- package/dist/transport/unreachable-message.d.ts +7 -0
- package/dist/transport/unreachable-message.js +11 -1
- package/package.json +4 -7
- package/dist/dom/blind-spots.d.ts +0 -13
- package/dist/dom/blind-spots.js +0 -29
- package/dist/observers/subresources.d.ts +0 -10
- package/dist/observers/subresources.js +0 -63
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/browser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "Reticle browser SDK — installs observers, builds semantic snapshots, executes actions, talks to the bridge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,22 +13,19 @@
|
|
|
13
13
|
"./package.json": "./package.json"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@reticlehq/core": "2.11.0"
|
|
16
|
+
"@reticlehq/core": "2.13.0"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
19
|
"@iconify-json/heroicons-outline": "^1.2.1",
|
|
21
20
|
"@iconify-json/heroicons-solid": "^1.2.1",
|
|
22
21
|
"@tanstack/query-core": "^5.101.4",
|
|
23
|
-
"@types/jsdom": "^30.0.0",
|
|
24
22
|
"jotai": "^2.20.2",
|
|
25
23
|
"jsdom": "^30.0.1",
|
|
26
|
-
"mobx": "^7.0.
|
|
24
|
+
"mobx": "^7.0.3",
|
|
27
25
|
"pinia": "^4.0.3",
|
|
28
26
|
"react": "^19.2.8",
|
|
29
27
|
"recoil": "^0.7.7",
|
|
30
|
-
"
|
|
31
|
-
"svelte": "^5.56.8",
|
|
28
|
+
"svelte": "^5.56.10",
|
|
32
29
|
"valtio": "^2.3.2",
|
|
33
30
|
"vue": "^3.5.41",
|
|
34
31
|
"xstate": "^5.32.5"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blind-spot detection, the detectable half). Cross-origin iframes are a real observation gap — the
|
|
3
|
-
* SDK cannot see inside them (same-origin policy). We COUNT them so a result can say "coverage: partial —
|
|
4
|
-
* 2 cross-origin frames unobserved" instead of implying it saw the whole page. Closed shadow roots are a
|
|
5
|
-
* blind spot too, but undetectable by design (element.shadowRoot === null), so they are not counted here.
|
|
6
|
-
*/
|
|
7
|
-
/** Pure: how many frames are cross-origin, given each frame's same-origin flag + whether it has a src. */
|
|
8
|
-
export declare function classifyCrossOriginFrames(frames: ReadonlyArray<{
|
|
9
|
-
sameOrigin: boolean;
|
|
10
|
-
hasSrc: boolean;
|
|
11
|
-
}>): number;
|
|
12
|
-
/** Probe the live document: count iframes whose document is unreachable (cross-origin). */
|
|
13
|
-
export declare function countCrossOriginFrames(): number;
|
package/dist/dom/blind-spots.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blind-spot detection, the detectable half). Cross-origin iframes are a real observation gap — the
|
|
3
|
-
* SDK cannot see inside them (same-origin policy). We COUNT them so a result can say "coverage: partial —
|
|
4
|
-
* 2 cross-origin frames unobserved" instead of implying it saw the whole page. Closed shadow roots are a
|
|
5
|
-
* blind spot too, but undetectable by design (element.shadowRoot === null), so they are not counted here.
|
|
6
|
-
*/
|
|
7
|
-
/** Pure: how many frames are cross-origin, given each frame's same-origin flag + whether it has a src. */
|
|
8
|
-
export function classifyCrossOriginFrames(frames) {
|
|
9
|
-
return frames.filter((f) => f.hasSrc && !f.sameOrigin).length;
|
|
10
|
-
}
|
|
11
|
-
/** Probe the live document: count iframes whose document is unreachable (cross-origin). */
|
|
12
|
-
export function countCrossOriginFrames() {
|
|
13
|
-
if ('undefined' === typeof document)
|
|
14
|
-
return 0;
|
|
15
|
-
const frames = [];
|
|
16
|
-
for (const frame of document.querySelectorAll('iframe')) {
|
|
17
|
-
const hasSrc = frame.getAttribute('src') !== null && frame.getAttribute('src') !== '';
|
|
18
|
-
let sameOrigin;
|
|
19
|
-
try {
|
|
20
|
-
// Reaching contentDocument throws (or yields null) for a cross-origin frame.
|
|
21
|
-
sameOrigin = frame.contentDocument !== null;
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
sameOrigin = false;
|
|
25
|
-
}
|
|
26
|
-
frames.push({ sameOrigin, hasSrc });
|
|
27
|
-
}
|
|
28
|
-
return classifyCrossOriginFrames(frames);
|
|
29
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface SubresourceObservation {
|
|
2
|
-
url: string;
|
|
3
|
-
method: string;
|
|
4
|
-
status?: number;
|
|
5
|
-
ok?: boolean;
|
|
6
|
-
durationMs: number;
|
|
7
|
-
transferSize?: number;
|
|
8
|
-
initiatorType: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function collectSubresources(seenUrls: ReadonlySet<string>, nowMs: number, sinceMs: number): SubresourceObservation[];
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { redactUrl } from './network-redact.js';
|
|
2
|
-
/**
|
|
3
|
-
* Document-initiated subresource observation.
|
|
4
|
-
*
|
|
5
|
-
* fetch/XHR patches never see requests the DOCUMENT makes on its own: `<link rel=icon>`,
|
|
6
|
-
* `<link rel=manifest>`, stylesheets, `<img src>`, `<script src>`. Those are exactly the loads a
|
|
7
|
-
* branding change touches, so a `{net}` predicate over them used to return `assertion_failed`
|
|
8
|
-
* ("your change is broken") when the truthful answer was "not observable" — and an agent trusting
|
|
9
|
-
* that verdict goes and "fixes" working code.
|
|
10
|
-
*
|
|
11
|
-
* `performance.getEntriesByType('resource')` reports these with no CDP and no patching: URL (name),
|
|
12
|
-
* initiator type (`link`, `css`, `img`, `script`, …), duration, transfer size. The known limitation
|
|
13
|
-
* is the status code — resource timing does not expose one directly (`responseStatus` exists only
|
|
14
|
-
* in newer Chromium). Entries carry `status` ONLY when it could be read; predicates asserting a
|
|
15
|
-
* status over unreadable data are handled at the evaluation seam, which downgrades rather than
|
|
16
|
-
* guesses.
|
|
17
|
-
*
|
|
18
|
-
* Deduplication matters: a fetch/XHR-initiated request ALSO lands in resource timing. Every entry
|
|
19
|
-
* is checked against the URLs the patched transports already reported this page, and only genuinely
|
|
20
|
-
* document-initiated loads survive.
|
|
21
|
-
*/
|
|
22
|
-
/** Resource-timing initiator types that mean "the document itself asked", not a patched transport. */
|
|
23
|
-
const DOCUMENT_INITIATORS = new Set(['link', 'css', 'img', 'script', 'manifest', 'other']);
|
|
24
|
-
/** Cap per call — a pathological page must not blow the event budget. */
|
|
25
|
-
const MAX_SUBRESOURCE_EVENTS = 200;
|
|
26
|
-
export function collectSubresources(seenUrls, nowMs, sinceMs) {
|
|
27
|
-
const out = [];
|
|
28
|
-
try {
|
|
29
|
-
const entries = performance.getEntriesByType('resource');
|
|
30
|
-
for (const entry of entries) {
|
|
31
|
-
const initiatorType = entry.initiatorType || 'other';
|
|
32
|
-
// fetch/XHR already have richer records from their own patches.
|
|
33
|
-
if (!DOCUMENT_INITIATORS.has(initiatorType))
|
|
34
|
-
continue;
|
|
35
|
-
const raw = entry.name;
|
|
36
|
-
if (seenUrls.has(raw))
|
|
37
|
-
continue;
|
|
38
|
-
const startMs = nowMs - entry.duration;
|
|
39
|
-
if (startMs < sinceMs)
|
|
40
|
-
continue;
|
|
41
|
-
const obs = {
|
|
42
|
-
url: redactUrl(raw),
|
|
43
|
-
method: 'GET',
|
|
44
|
-
durationMs: Math.round(entry.duration),
|
|
45
|
-
initiatorType,
|
|
46
|
-
...(entry.transferSize > 0 ? { transferSize: entry.transferSize } : {}),
|
|
47
|
-
};
|
|
48
|
-
// responseStatus is Chromium-only and may be 0 when unreadable. Present ONLY when it says
|
|
49
|
-
// something real, so the wire never carries a guessed status.
|
|
50
|
-
const rs = entry.responseStatus;
|
|
51
|
-
if ('number' === typeof rs && rs > 0) {
|
|
52
|
-
obs.status = rs;
|
|
53
|
-
obs.ok = rs >= 200 && rs < 400;
|
|
54
|
-
}
|
|
55
|
-
out.push(obs);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// No resource-timing support / security error: report nothing, honestly.
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
return out.slice(0, MAX_SUBRESOURCE_EVENTS);
|
|
63
|
-
}
|