@reticlehq/core 3.8.2 → 3.10.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/artifacts/flow-constants.d.ts +17 -0
- package/dist/artifacts/flow-constants.js +15 -0
- package/dist/artifacts/flow-results.d.ts +27 -2
- package/dist/artifacts/flow-step-tool.d.ts +17 -0
- package/dist/artifacts/flow-step-tool.js +18 -1
- package/dist/artifacts/flow-types.d.ts +59 -0
- package/dist/artifacts/flow-types.js +51 -6
- package/dist/identity/github-action.d.ts +7 -0
- package/dist/identity/github-action.js +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/onboarding.d.ts +60 -0
- package/dist/onboarding.js +35 -0
- package/dist/schema/event-message.json +1 -0
- package/dist/schema/event-payloads.json +47 -1
- package/dist/schema/event-type.json +1 -0
- package/dist/schema/reticle-event.json +1 -0
- package/dist/schema/reticle-message.json +1 -0
- package/dist/telemetry-refusal.d.ts +83 -0
- package/dist/telemetry-refusal.js +56 -0
- package/dist/telemetry-signals.d.ts +132 -0
- package/dist/telemetry-signals.js +68 -0
- package/dist/telemetry.d.ts +89 -4
- package/dist/telemetry.js +5 -3
- package/dist/verdict/findings.d.ts +34 -0
- package/dist/verdict/findings.js +37 -0
- package/dist/verdict/predicate.d.ts +1 -0
- package/dist/verdict/predicate.js +145 -5
- package/dist/verdict/verdict-attribution.js +1 -0
- package/dist/verdict/verified-constants.d.ts +17 -0
- package/dist/verdict/verified-constants.js +17 -0
- package/dist/wire/click-input.d.ts +26 -0
- package/dist/wire/click-input.js +65 -0
- package/dist/wire/constants/animation-command.d.ts +2 -0
- package/dist/wire/constants/animation-command.js +2 -0
- package/dist/wire/constants/console-event.d.ts +44 -0
- package/dist/wire/constants/console-event.js +44 -0
- package/dist/wire/constants/constants.d.ts +45 -0
- package/dist/wire/constants/constants.js +45 -0
- package/dist/wire/constants/determinism.d.ts +17 -0
- package/dist/wire/constants/determinism.js +17 -0
- package/dist/wire/constants/event-types.d.ts +113 -0
- package/dist/wire/constants/event-types.js +87 -0
- package/dist/wire/constants/match-args.d.ts +19 -0
- package/dist/wire/constants/match-args.js +19 -0
- package/dist/wire/constants/reticle-chrome.d.ts +12 -0
- package/dist/wire/constants/reticle-chrome.js +14 -0
- package/dist/wire/constants/session-constants.d.ts +17 -0
- package/dist/wire/constants/session-constants.js +5 -0
- package/dist/wire/event-payloads.d.ts +16 -93
- package/dist/wire/event-payloads.js +26 -72
- package/dist/wire/event-priority.js +1 -0
- package/dist/wire/global-press.d.ts +9 -2
- package/dist/wire/global-press.js +39 -12
- package/dist/wire/messages.d.ts +3 -0
- package/dist/wire/net.d.ts +39 -0
- package/dist/wire/net.js +56 -8
- package/dist/wire/redaction.d.ts +18 -0
- package/dist/wire/redaction.js +72 -0
- package/dist/wire/tool-names.d.ts +4 -0
- package/dist/wire/tool-names.js +4 -0
- package/dist/wire/types.d.ts +31 -0
- package/dist/wire/types.js +10 -0
- package/dist/words/notices.d.ts +10 -0
- package/dist/words/notices.js +19 -0
- package/package.json +1 -1
package/dist/wire/click-input.js
CHANGED
|
@@ -40,3 +40,68 @@ export function clickInputProblem(action, args) {
|
|
|
40
40
|
}
|
|
41
41
|
return undefined;
|
|
42
42
|
}
|
|
43
|
+
/*
|
|
44
|
+
* A point inside the target element, for a pointer action.
|
|
45
|
+
*
|
|
46
|
+
* A canvas has no child elements, so the centre of its box was the only place a pointer action could
|
|
47
|
+
* land, and a game on a canvas could not be played. `args.at` names a point as fractions of the
|
|
48
|
+
* element's box: `{ x: 0.25, y: 0.75 }` is a quarter of the way across and three quarters of the way
|
|
49
|
+
* down. A drag also takes `args.to`, the end point as fractions of the drop target's box, or of the
|
|
50
|
+
* source's box when there is no drop target, so a drag can move inside one canvas.
|
|
51
|
+
*
|
|
52
|
+
* The page and the server read and refuse a point with these functions, so a point is never
|
|
53
|
+
* honoured on one path and dropped on the other. The check is plain code, not a zod schema: the
|
|
54
|
+
* page runs it, and a zod parse in the page adds about 420 KB to the first load of every page.
|
|
55
|
+
*/
|
|
56
|
+
/** The act argument for a point inside the target element. */
|
|
57
|
+
export const ACT_POINT_ARG = 'at';
|
|
58
|
+
/** The drag argument for the end point inside the drop target, or inside the source. */
|
|
59
|
+
export const DRAG_TO_POINT_ARG = 'to';
|
|
60
|
+
/** The actions that land at a point. */
|
|
61
|
+
const POINT_ACTIONS = new Set([
|
|
62
|
+
ActionType.CLICK,
|
|
63
|
+
ActionType.DBLCLICK,
|
|
64
|
+
ActionType.HOVER,
|
|
65
|
+
ActionType.TAP,
|
|
66
|
+
ActionType.DRAG,
|
|
67
|
+
]);
|
|
68
|
+
const isFiniteNumber = (n) => 'number' === typeof n && Number.isFinite(n);
|
|
69
|
+
/** `{ x, y }` with two finite numbers, as given, or undefined. */
|
|
70
|
+
function readBoxFraction(raw) {
|
|
71
|
+
if ('object' !== typeof raw || null === raw || Array.isArray(raw)) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
const { x, y } = raw;
|
|
75
|
+
return isFiniteNumber(x) && isFiniteNumber(y) ? { x, y } : undefined;
|
|
76
|
+
}
|
|
77
|
+
const clampFraction = (n) => Math.min(1, Math.max(0, n));
|
|
78
|
+
/** The point under `key`, each fraction clamped to 0..1, or undefined when absent or unreadable. */
|
|
79
|
+
export function boxFractionFromArgs(args, key) {
|
|
80
|
+
const point = readBoxFraction(args[key]);
|
|
81
|
+
return point === undefined ? undefined : { x: clampFraction(point.x), y: clampFraction(point.y) };
|
|
82
|
+
}
|
|
83
|
+
/** The point at `at` in `box`, in the coordinates of the box. */
|
|
84
|
+
export function pointInBox(box, at) {
|
|
85
|
+
return { x: box.x + box.width * at.x, y: box.y + box.height * at.y };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Why `at` or `to` cannot be honoured on this action, or undefined when it can or is absent. A point
|
|
89
|
+
* that is not two numbers is refused: an action at the centre is not the action that was asked for.
|
|
90
|
+
*/
|
|
91
|
+
export function actPointProblem(action, args) {
|
|
92
|
+
for (const key of [ACT_POINT_ARG, DRAG_TO_POINT_ARG]) {
|
|
93
|
+
if (args[key] === undefined) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (DRAG_TO_POINT_ARG === key && ActionType.DRAG !== action) {
|
|
97
|
+
return `\`${key}\` is the end point of a drag only: use \`${ACT_POINT_ARG}\` for a point of a ${action}`;
|
|
98
|
+
}
|
|
99
|
+
if (!POINT_ACTIONS.has(action)) {
|
|
100
|
+
return `\`${key}\` is a point for a pointer action (${[...POINT_ACTIONS].join(', ')}), not for a ${action}`;
|
|
101
|
+
}
|
|
102
|
+
if (readBoxFraction(args[key]) === undefined) {
|
|
103
|
+
return `\`${key}\` must be { x, y }: two numbers, each a fraction of the element's box from 0 to 1`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The console channel's payload vocabulary, and the global the build plugin's pre-attach error
|
|
3
|
+
* buffer lives on. Split out of `constants.ts` at its 1000-line cap (#1540).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The payload field set to `true` on an error the page raised BEFORE the SDK attached. The build
|
|
7
|
+
* plugin's error buffer held it, and the SDK reported it when it attached (see
|
|
8
|
+
* RETICLE_PRE_ATTACH_ERRORS). A name of its own, and not only a CONSOLE_EVENT member, because the
|
|
9
|
+
* SDK writes it: importing the whole object would put the server's vocabulary in every page load.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PRE_ATTACH_FIELD = "preAttach";
|
|
12
|
+
/** The payload field reporting how many pre-attach errors the buffer did not keep — loss, declared. */
|
|
13
|
+
export declare const DROPPED_PRE_ATTACH_FIELD = "droppedPreAttach";
|
|
14
|
+
/**
|
|
15
|
+
* Payload fields and `kind` values on console/error events that the AGENT reads back through
|
|
16
|
+
* `reticle_console`. The console payload is passthrough rather than closed, so these are named
|
|
17
|
+
* here instead of schema-enforced: a wire string a server writes inline is one a rename
|
|
18
|
+
* half-lands, with the agent reading a field that quietly stopped arriving.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CONSOLE_EVENT: {
|
|
21
|
+
/** The payload field naming what kind of console/error event it is (`resource`, `pageerror`, ...). */
|
|
22
|
+
readonly KIND: "kind";
|
|
23
|
+
/** The kind for an uncaught error the SERVER observed through the page's own browser handle. */
|
|
24
|
+
readonly PAGE_ERROR: "pageerror";
|
|
25
|
+
/** The payload field reporting how many buffered page errors were dropped — loss, declared. */
|
|
26
|
+
readonly DROPPED_PAGE_ERRORS: "droppedPageErrors";
|
|
27
|
+
/** See PRE_ATTACH_FIELD. */
|
|
28
|
+
readonly PRE_ATTACH: "preAttach";
|
|
29
|
+
/** See DROPPED_PRE_ATTACH_FIELD. */
|
|
30
|
+
readonly DROPPED_PRE_ATTACH: "droppedPreAttach";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Global where the build plugin's inline error buffer keeps the errors a page raises before the SDK
|
|
34
|
+
* attaches: uncaught errors, failed script and resource loads, unhandled rejections and
|
|
35
|
+
* `console.error` calls (see the vite plugin's PRE_ATTACH_ERRORS_SOURCE).
|
|
36
|
+
*
|
|
37
|
+
* Holds `{ open, drain }`. When the SDK's console observer installs it calls
|
|
38
|
+
* `drain(onError, onRejection, onConsole, dropped)` once: the buffer stops keeping and hands each
|
|
39
|
+
* entry to the SDK's own handler. The SDK marks what arrives during that call with
|
|
40
|
+
* PRE_ATTACH_FIELD itself, and takes only a positive integer count through `dropped`. A page that Reticle
|
|
41
|
+
* drives has RETICLE_EARLY_CAPTURE instead, and the buffer then does not install, so one error is
|
|
42
|
+
* never kept twice. The value is short on purpose: the SDK pays for it on every page load.
|
|
43
|
+
*/
|
|
44
|
+
export declare const RETICLE_PRE_ATTACH_ERRORS = "__reticlePreAttach";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The console channel's payload vocabulary, and the global the build plugin's pre-attach error
|
|
3
|
+
* buffer lives on. Split out of `constants.ts` at its 1000-line cap (#1540).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The payload field set to `true` on an error the page raised BEFORE the SDK attached. The build
|
|
7
|
+
* plugin's error buffer held it, and the SDK reported it when it attached (see
|
|
8
|
+
* RETICLE_PRE_ATTACH_ERRORS). A name of its own, and not only a CONSOLE_EVENT member, because the
|
|
9
|
+
* SDK writes it: importing the whole object would put the server's vocabulary in every page load.
|
|
10
|
+
*/
|
|
11
|
+
export const PRE_ATTACH_FIELD = 'preAttach';
|
|
12
|
+
/** The payload field reporting how many pre-attach errors the buffer did not keep — loss, declared. */
|
|
13
|
+
export const DROPPED_PRE_ATTACH_FIELD = 'droppedPreAttach';
|
|
14
|
+
/**
|
|
15
|
+
* Payload fields and `kind` values on console/error events that the AGENT reads back through
|
|
16
|
+
* `reticle_console`. The console payload is passthrough rather than closed, so these are named
|
|
17
|
+
* here instead of schema-enforced: a wire string a server writes inline is one a rename
|
|
18
|
+
* half-lands, with the agent reading a field that quietly stopped arriving.
|
|
19
|
+
*/
|
|
20
|
+
export const CONSOLE_EVENT = {
|
|
21
|
+
/** The payload field naming what kind of console/error event it is (`resource`, `pageerror`, ...). */
|
|
22
|
+
KIND: 'kind',
|
|
23
|
+
/** The kind for an uncaught error the SERVER observed through the page's own browser handle. */
|
|
24
|
+
PAGE_ERROR: 'pageerror',
|
|
25
|
+
/** The payload field reporting how many buffered page errors were dropped — loss, declared. */
|
|
26
|
+
DROPPED_PAGE_ERRORS: 'droppedPageErrors',
|
|
27
|
+
/** See PRE_ATTACH_FIELD. */
|
|
28
|
+
PRE_ATTACH: PRE_ATTACH_FIELD,
|
|
29
|
+
/** See DROPPED_PRE_ATTACH_FIELD. */
|
|
30
|
+
DROPPED_PRE_ATTACH: DROPPED_PRE_ATTACH_FIELD,
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Global where the build plugin's inline error buffer keeps the errors a page raises before the SDK
|
|
34
|
+
* attaches: uncaught errors, failed script and resource loads, unhandled rejections and
|
|
35
|
+
* `console.error` calls (see the vite plugin's PRE_ATTACH_ERRORS_SOURCE).
|
|
36
|
+
*
|
|
37
|
+
* Holds `{ open, drain }`. When the SDK's console observer installs it calls
|
|
38
|
+
* `drain(onError, onRejection, onConsole, dropped)` once: the buffer stops keeping and hands each
|
|
39
|
+
* entry to the SDK's own handler. The SDK marks what arrives during that call with
|
|
40
|
+
* PRE_ATTACH_FIELD itself, and takes only a positive integer count through `dropped`. A page that Reticle
|
|
41
|
+
* drives has RETICLE_EARLY_CAPTURE instead, and the buffer then does not install, so one error is
|
|
42
|
+
* never kept twice. The value is short on purpose: the SDK pays for it on every page load.
|
|
43
|
+
*/
|
|
44
|
+
export const RETICLE_PRE_ATTACH_ERRORS = '__reticlePreAttach';
|
|
@@ -105,6 +105,12 @@ export declare const RETICLE_URL_PARAM: {
|
|
|
105
105
|
*/
|
|
106
106
|
readonly HUD: "__reticle_hud";
|
|
107
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* The `sessionStorage` key that holds a tab's session id. The SDK reads it on `connect()` when no
|
|
110
|
+
* explicit id is given. A lease writes the lease id to it at document start, so a page that drops
|
|
111
|
+
* `__reticle_session` from its URL before `connect()` still registers under the lease id (#2026).
|
|
112
|
+
*/
|
|
113
|
+
export declare const RETICLE_SESSION_STORAGE_KEY = "__reticle_session";
|
|
108
114
|
/** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
|
|
109
115
|
export declare const LOOPBACK_HOST = "127.0.0.1";
|
|
110
116
|
export { ReticleEnv } from './reticle-env.js';
|
|
@@ -192,6 +198,12 @@ export declare const TRANSPORT_LIMITS: {
|
|
|
192
198
|
readonly MAX_STACK_LENGTH: 4000;
|
|
193
199
|
readonly MAX_SERIALIZE_DEPTH: 8;
|
|
194
200
|
readonly MAX_COLLECTION_ITEMS: 200;
|
|
201
|
+
/** What a descriptor carries of an element's text for an agent to READ: 80 characters and an ellipsis. */
|
|
202
|
+
readonly MAX_DESCRIBED_TEXT: 80;
|
|
203
|
+
/** What a descriptor carries when a verdict has to JUDGE the text (`MatchArg.FULL_TEXT`); a text MORE than this long was cut. */
|
|
204
|
+
readonly MAX_FULL_TEXT: 4000;
|
|
205
|
+
/** Elements a MATCH describes in full-text mode, about half the transport's character budget; `count` still reports all. */
|
|
206
|
+
readonly MAX_FULL_TEXT_ELEMENTS: 32;
|
|
195
207
|
readonly MAX_OBJECT_KEYS: 200;
|
|
196
208
|
readonly MAX_STRING_LENGTH: number;
|
|
197
209
|
/** Human review marks: the note the human types when flagging a mistake on the page. */
|
|
@@ -420,6 +432,7 @@ export declare const ContractReadError: {
|
|
|
420
432
|
export type ContractReadError = (typeof ContractReadError)[keyof typeof ContractReadError];
|
|
421
433
|
import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
|
|
422
434
|
export { CanvasTrigger, EventType, MediaEvent };
|
|
435
|
+
export { FieldChangeField, FieldChangeKind, LivePoliteness, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './event-types.js';
|
|
423
436
|
/** Bounds for the per-session ring buffer. */
|
|
424
437
|
export declare const RING_BUFFER_DEFAULTS: {
|
|
425
438
|
readonly MAX_EVENTS: 2000;
|
|
@@ -460,6 +473,13 @@ export declare const RETICLE_BUSY_SIGNAL = "reticle:busy";
|
|
|
460
473
|
export declare const RETICLE_RENDERS_STORE = "__reticle_renders";
|
|
461
474
|
/** Global the render pre-hook parks its commit buffer on (see the vite plugin's RENDER_PREHOOK_SOURCE). */
|
|
462
475
|
export declare const RETICLE_RENDER_PREHOOK = "__reticleRenderPreHook";
|
|
476
|
+
/**
|
|
477
|
+
* Global where a driven page queues console calls and error events until the SDK installs.
|
|
478
|
+
*
|
|
479
|
+
* The pool adds an init script that fills it on every navigation. The SDK reads it once, through
|
|
480
|
+
* its own console handlers, then sets it to `null` so the queue stops. Holds `{ queue, dropped }`.
|
|
481
|
+
*/
|
|
482
|
+
export declare const RETICLE_EARLY_CAPTURE = "__reticleEarlyCapture";
|
|
463
483
|
/**
|
|
464
484
|
* Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
|
|
465
485
|
* (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
|
|
@@ -620,6 +640,23 @@ export declare const ActionType: {
|
|
|
620
640
|
*/
|
|
621
641
|
readonly SCROLL: "scroll";
|
|
622
642
|
readonly DRAG: "drag";
|
|
643
|
+
/**
|
|
644
|
+
* Insert plain text into a contenteditable rich-text surface (Tiptap, ProseMirror, Quill, Slate,
|
|
645
|
+
* Lexical). `fill` and `type` refuse rich-text surfaces because writing `textContent` or `value`
|
|
646
|
+
* would desynchronise the editor's own model and report a false green. This action announces
|
|
647
|
+
* `beforeinput` first — an editor that owns its input cancels it and applies the text to its
|
|
648
|
+
* model — then runs `execCommand("insertText")`, the in-page equivalent of CDP
|
|
649
|
+
* `Input.insertText`. If that command exists and fails, the action refuses instead of writing
|
|
650
|
+
* the DOM. Where the engine has no native command (jsdom), it writes at the caret and dispatches
|
|
651
|
+
* `input` with `inputType: "insertText"`. `valueChanged` reports the surface's text delta; on an
|
|
652
|
+
* editor that took the text, `defaultPrevented: true` with `valueChanged: true` is the success
|
|
653
|
+
* path. Args are { text }.
|
|
654
|
+
*
|
|
655
|
+
* An EditContext surface (Monaco, CodeMirror 6) is REFUSED: a scripted `updateText()` fires no
|
|
656
|
+
* `textupdate`, which is the event those editors update their model from, so the call would
|
|
657
|
+
* report an edit the model never saw. Use `press` for a key until a real-browser proof exists.
|
|
658
|
+
*/
|
|
659
|
+
readonly INSERT_TEXT: "insertText";
|
|
623
660
|
/**
|
|
624
661
|
* A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
|
|
625
662
|
*
|
|
@@ -691,6 +728,14 @@ export declare const ElementState: {
|
|
|
691
728
|
* `visible`/`present` before the scroll, so act_and_wait returns already_true. (#398)
|
|
692
729
|
*/
|
|
693
730
|
readonly IN_VIEWPORT: "inViewport";
|
|
731
|
+
/**
|
|
732
|
+
* A pointer at the element's hit point reaches it: the element is visible and in the viewport, and
|
|
733
|
+
* the topmost app element there is the element, an ancestor or a descendant. Distinct from
|
|
734
|
+
* `visible`, which means rendered and in layout: a fixed header over a close button leaves it
|
|
735
|
+
* `visible` and untappable. Reticle's own UI never counts as a cover. An element with no layout box
|
|
736
|
+
* (no layout to hit-test) is judged by `visible` alone.
|
|
737
|
+
*/
|
|
738
|
+
readonly RECEIVES_POINTER: "receivesPointer";
|
|
694
739
|
};
|
|
695
740
|
export type ElementState = (typeof ElementState)[keyof typeof ElementState];
|
|
696
741
|
/** Query strategies, aligned with Testing Library semantics. */
|
|
@@ -108,6 +108,12 @@ export const RETICLE_URL_PARAM = {
|
|
|
108
108
|
*/
|
|
109
109
|
HUD: '__reticle_hud',
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* The `sessionStorage` key that holds a tab's session id. The SDK reads it on `connect()` when no
|
|
113
|
+
* explicit id is given. A lease writes the lease id to it at document start, so a page that drops
|
|
114
|
+
* `__reticle_session` from its URL before `connect()` still registers under the lease id (#2026).
|
|
115
|
+
*/
|
|
116
|
+
export const RETICLE_SESSION_STORAGE_KEY = '__reticle_session';
|
|
111
117
|
/** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
|
|
112
118
|
export const LOOPBACK_HOST = '127.0.0.1';
|
|
113
119
|
export { ReticleEnv } from './reticle-env.js';
|
|
@@ -230,6 +236,12 @@ export const TRANSPORT_LIMITS = {
|
|
|
230
236
|
MAX_STACK_LENGTH: 4000,
|
|
231
237
|
MAX_SERIALIZE_DEPTH: 8,
|
|
232
238
|
MAX_COLLECTION_ITEMS: 200,
|
|
239
|
+
/** What a descriptor carries of an element's text for an agent to READ: 80 characters and an ellipsis. */
|
|
240
|
+
MAX_DESCRIBED_TEXT: 80,
|
|
241
|
+
/** What a descriptor carries when a verdict has to JUDGE the text (`MatchArg.FULL_TEXT`); a text MORE than this long was cut. */
|
|
242
|
+
MAX_FULL_TEXT: 4000,
|
|
243
|
+
/** Elements a MATCH describes in full-text mode, about half the transport's character budget; `count` still reports all. */
|
|
244
|
+
MAX_FULL_TEXT_ELEMENTS: 32,
|
|
233
245
|
MAX_OBJECT_KEYS: 200,
|
|
234
246
|
MAX_STRING_LENGTH: 64 * 1024,
|
|
235
247
|
/** Human review marks: the note the human types when flagging a mistake on the page. */
|
|
@@ -467,6 +479,7 @@ export const ContractReadError = {
|
|
|
467
479
|
// import path for every consumer. See event-types.ts for why it moved.
|
|
468
480
|
import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
|
|
469
481
|
export { CanvasTrigger, EventType, MediaEvent };
|
|
482
|
+
export { FieldChangeField, FieldChangeKind, LivePoliteness, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './event-types.js';
|
|
470
483
|
/** Bounds for the per-session ring buffer. */
|
|
471
484
|
export const RING_BUFFER_DEFAULTS = {
|
|
472
485
|
MAX_EVENTS: 2000,
|
|
@@ -506,6 +519,13 @@ export const RETICLE_BUSY_SIGNAL = 'reticle:busy';
|
|
|
506
519
|
export const RETICLE_RENDERS_STORE = '__reticle_renders';
|
|
507
520
|
/** Global the render pre-hook parks its commit buffer on (see the vite plugin's RENDER_PREHOOK_SOURCE). */
|
|
508
521
|
export const RETICLE_RENDER_PREHOOK = '__reticleRenderPreHook';
|
|
522
|
+
/**
|
|
523
|
+
* Global where a driven page queues console calls and error events until the SDK installs.
|
|
524
|
+
*
|
|
525
|
+
* The pool adds an init script that fills it on every navigation. The SDK reads it once, through
|
|
526
|
+
* its own console handlers, then sets it to `null` so the queue stops. Holds `{ queue, dropped }`.
|
|
527
|
+
*/
|
|
528
|
+
export const RETICLE_EARLY_CAPTURE = '__reticleEarlyCapture';
|
|
509
529
|
/**
|
|
510
530
|
* Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
|
|
511
531
|
* (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
|
|
@@ -666,6 +686,23 @@ export const ActionType = {
|
|
|
666
686
|
*/
|
|
667
687
|
SCROLL: 'scroll',
|
|
668
688
|
DRAG: 'drag',
|
|
689
|
+
/**
|
|
690
|
+
* Insert plain text into a contenteditable rich-text surface (Tiptap, ProseMirror, Quill, Slate,
|
|
691
|
+
* Lexical). `fill` and `type` refuse rich-text surfaces because writing `textContent` or `value`
|
|
692
|
+
* would desynchronise the editor's own model and report a false green. This action announces
|
|
693
|
+
* `beforeinput` first — an editor that owns its input cancels it and applies the text to its
|
|
694
|
+
* model — then runs `execCommand("insertText")`, the in-page equivalent of CDP
|
|
695
|
+
* `Input.insertText`. If that command exists and fails, the action refuses instead of writing
|
|
696
|
+
* the DOM. Where the engine has no native command (jsdom), it writes at the caret and dispatches
|
|
697
|
+
* `input` with `inputType: "insertText"`. `valueChanged` reports the surface's text delta; on an
|
|
698
|
+
* editor that took the text, `defaultPrevented: true` with `valueChanged: true` is the success
|
|
699
|
+
* path. Args are { text }.
|
|
700
|
+
*
|
|
701
|
+
* An EditContext surface (Monaco, CodeMirror 6) is REFUSED: a scripted `updateText()` fires no
|
|
702
|
+
* `textupdate`, which is the event those editors update their model from, so the call would
|
|
703
|
+
* report an edit the model never saw. Use `press` for a key until a real-browser proof exists.
|
|
704
|
+
*/
|
|
705
|
+
INSERT_TEXT: 'insertText',
|
|
669
706
|
/**
|
|
670
707
|
* A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
|
|
671
708
|
*
|
|
@@ -713,6 +750,14 @@ export const ElementState = {
|
|
|
713
750
|
* `visible`/`present` before the scroll, so act_and_wait returns already_true. (#398)
|
|
714
751
|
*/
|
|
715
752
|
IN_VIEWPORT: 'inViewport',
|
|
753
|
+
/**
|
|
754
|
+
* A pointer at the element's hit point reaches it: the element is visible and in the viewport, and
|
|
755
|
+
* the topmost app element there is the element, an ancestor or a descendant. Distinct from
|
|
756
|
+
* `visible`, which means rendered and in layout: a fixed header over a close button leaves it
|
|
757
|
+
* `visible` and untappable. Reticle's own UI never counts as a cover. An element with no layout box
|
|
758
|
+
* (no layout to hit-test) is judged by `visible` alone.
|
|
759
|
+
*/
|
|
760
|
+
RECEIVES_POINTER: 'receivesPointer',
|
|
716
761
|
};
|
|
717
762
|
/** Query strategies, aligned with Testing Library semantics. */
|
|
718
763
|
export const QueryBy = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names a deterministic lease shares with the SDK in its page.
|
|
3
|
+
*
|
|
4
|
+
* A deterministic lease replaces the page's clock and random source before any page script runs.
|
|
5
|
+
* It keeps the page's real timers under this key, so the SDK can still wait, reconnect and send
|
|
6
|
+
* its heartbeat while the page's own time stands still.
|
|
7
|
+
*/
|
|
8
|
+
/** The `Symbol.for` key of the object that holds the real timers and the step function. */
|
|
9
|
+
export declare const DETERMINISM_GLOBAL_KEY = "reticle.determinism";
|
|
10
|
+
/** The length of one stepped frame, in milliseconds: 60 frames each second. */
|
|
11
|
+
export declare const DETERMINISM_FRAME_MS: number;
|
|
12
|
+
/** Where the virtual clock starts: 2026-01-01T00:00:00Z. */
|
|
13
|
+
export declare const DETERMINISM_EPOCH_MS: number;
|
|
14
|
+
/** The seed for Math.random and crypto.getRandomValues when the caller gives none. */
|
|
15
|
+
export declare const DETERMINISM_DEFAULT_SEED = 1;
|
|
16
|
+
/** The most frames one step can run. One minute of frames at 60 each second. */
|
|
17
|
+
export declare const DETERMINISM_MAX_STEP_FRAMES = 3600;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names a deterministic lease shares with the SDK in its page.
|
|
3
|
+
*
|
|
4
|
+
* A deterministic lease replaces the page's clock and random source before any page script runs.
|
|
5
|
+
* It keeps the page's real timers under this key, so the SDK can still wait, reconnect and send
|
|
6
|
+
* its heartbeat while the page's own time stands still.
|
|
7
|
+
*/
|
|
8
|
+
/** The `Symbol.for` key of the object that holds the real timers and the step function. */
|
|
9
|
+
export const DETERMINISM_GLOBAL_KEY = 'reticle.determinism';
|
|
10
|
+
/** The length of one stepped frame, in milliseconds: 60 frames each second. */
|
|
11
|
+
export const DETERMINISM_FRAME_MS = 1000 / 60;
|
|
12
|
+
/** Where the virtual clock starts: 2026-01-01T00:00:00Z. */
|
|
13
|
+
export const DETERMINISM_EPOCH_MS = Date.UTC(2026, 0, 1);
|
|
14
|
+
/** The seed for Math.random and crypto.getRandomValues when the caller gives none. */
|
|
15
|
+
export const DETERMINISM_DEFAULT_SEED = 1;
|
|
16
|
+
/** The most frames one step can run. One minute of frames at 60 each second. */
|
|
17
|
+
export const DETERMINISM_MAX_STEP_FRAMES = 3600;
|
|
@@ -15,6 +15,16 @@ export declare const EventType: {
|
|
|
15
15
|
readonly DOM_TEXT: "dom.text";
|
|
16
16
|
readonly NET_REQUEST: "net.request";
|
|
17
17
|
readonly NET_PENDING: "net.pending";
|
|
18
|
+
/**
|
|
19
|
+
* A fetch or XHR that the browser recorded in resource timing, and that no patched transport saw.
|
|
20
|
+
*
|
|
21
|
+
* The app sent it through a `fetch` reference it saved before Reticle patched `fetch`. It is NOT a
|
|
22
|
+
* `net.request`: it has no method, and its status is only a hint (0 cross-origin without
|
|
23
|
+
* `Timing-Allow-Origin`). A second record for one call would also raise a false duplicate. It
|
|
24
|
+
* exists so a `net` miss over its URL reads `unknown`, not `no`.
|
|
25
|
+
* `data: { url, urlRaw?, initiator, status? }`.
|
|
26
|
+
*/
|
|
27
|
+
readonly NET_UNPATCHED: "net.unpatched";
|
|
18
28
|
/** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
|
|
19
29
|
readonly NET_STREAM: "net.stream";
|
|
20
30
|
/** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
|
|
@@ -156,3 +166,106 @@ export declare const CanvasTrigger: {
|
|
|
156
166
|
readonly ACT: "act";
|
|
157
167
|
};
|
|
158
168
|
export type CanvasTrigger = (typeof CanvasTrigger)[keyof typeof CanvasTrigger];
|
|
169
|
+
/**
|
|
170
|
+
* Wire payload vocabularies. The browser observers EMIT these values and the schemas below VALIDATE
|
|
171
|
+
* them, so a browser-side typo (`'SSE'`) would pass tsc and fail only here, at runtime. Each is a const
|
|
172
|
+
* object — the browser imports the members, the schema derives its z.nativeEnum from the same object —
|
|
173
|
+
* so emitter and validator are one source. Kept here, not beside the schemas in `event-payloads.ts`:
|
|
174
|
+
* the browser imports only these, so a page does not download every payload schema.
|
|
175
|
+
*/
|
|
176
|
+
/**
|
|
177
|
+
* `FETCH` is a response whose BODY is still arriving after the request itself resolved.
|
|
178
|
+
*
|
|
179
|
+
* `fetch` settles at HEADERS, so a streamed response is reported complete while the server is still
|
|
180
|
+
* writing. Measured on a Next.js App Router page: the RSC payload's NET_REQUEST landed 16 ms in, the
|
|
181
|
+
* shell rendered, and the Suspense boundary's content arrived 889 ms later — a window in which
|
|
182
|
+
* nothing at all was observed, so `settled` passed while the fallback was still on screen.
|
|
183
|
+
*/
|
|
184
|
+
export declare const StreamTransport: {
|
|
185
|
+
readonly SSE: "sse";
|
|
186
|
+
readonly WS: "ws";
|
|
187
|
+
readonly FETCH: "fetch";
|
|
188
|
+
};
|
|
189
|
+
export type StreamTransport = (typeof StreamTransport)[keyof typeof StreamTransport];
|
|
190
|
+
/** `CLOSE` pairs with `OPEN`: until it arrives, the body is still being written. */
|
|
191
|
+
export declare const StreamDirection: {
|
|
192
|
+
readonly OPEN: "open";
|
|
193
|
+
readonly IN: "in";
|
|
194
|
+
readonly OUT: "out";
|
|
195
|
+
readonly CLOSE: "close";
|
|
196
|
+
};
|
|
197
|
+
export type StreamDirection = (typeof StreamDirection)[keyof typeof StreamDirection];
|
|
198
|
+
export declare const ScrollDirection: {
|
|
199
|
+
readonly UP: "up";
|
|
200
|
+
readonly DOWN: "down";
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* How urgently a live region announces its text, as ARIA defines it. `role="alert"` is assertive,
|
|
204
|
+
* and `role="status"` is polite. An explicit `aria-live` value replaces the value of the role.
|
|
205
|
+
*/
|
|
206
|
+
export declare const LivePoliteness: {
|
|
207
|
+
readonly ASSERTIVE: "assertive";
|
|
208
|
+
readonly POLITE: "polite";
|
|
209
|
+
};
|
|
210
|
+
export type LivePoliteness = (typeof LivePoliteness)[keyof typeof LivePoliteness];
|
|
211
|
+
export type ScrollDirection = (typeof ScrollDirection)[keyof typeof ScrollDirection];
|
|
212
|
+
/**
|
|
213
|
+
* How a `route.change` happened.
|
|
214
|
+
*
|
|
215
|
+
* `push` is `history.pushState`, `replace` is `history.replaceState`, and `pop` is the session
|
|
216
|
+
* history moving under the page (`popstate`, or a `hashchange` the page did not push). A
|
|
217
|
+
* same-pathname replace records UI state in the URL; it is not a navigation to a new view.
|
|
218
|
+
*/
|
|
219
|
+
export declare const RouteChangeHow: {
|
|
220
|
+
readonly PUSH: "push";
|
|
221
|
+
readonly REPLACE: "replace";
|
|
222
|
+
readonly POP: "pop";
|
|
223
|
+
};
|
|
224
|
+
export type RouteChangeHow = (typeof RouteChangeHow)[keyof typeof RouteChangeHow];
|
|
225
|
+
/** Wire field on `route.change` carrying a `RouteChangeHow`. */
|
|
226
|
+
export declare const ROUTE_CHANGE_HOW_FIELD = "how";
|
|
227
|
+
/**
|
|
228
|
+
* Why a `field.change` was emitted.
|
|
229
|
+
*
|
|
230
|
+
* `input` is a burst of keystrokes and `change` is the commit that ends one — both are the user's
|
|
231
|
+
* own event, fired before a controlled component restores its DOM property. `settled` is a read of
|
|
232
|
+
* that property on the frame after the handlers ran. Only a settled read that differs from the
|
|
233
|
+
* pre-action value is evidence the screen moved.
|
|
234
|
+
*/
|
|
235
|
+
export declare const FieldChangeKind: {
|
|
236
|
+
readonly INPUT: "input";
|
|
237
|
+
readonly CHANGE: "change";
|
|
238
|
+
readonly SETTLED: "settled";
|
|
239
|
+
};
|
|
240
|
+
export type FieldChangeKind = (typeof FieldChangeKind)[keyof typeof FieldChangeKind];
|
|
241
|
+
/**
|
|
242
|
+
* Wire fields on `field.change` beyond `field` / `kind` / `value` / `length`.
|
|
243
|
+
*
|
|
244
|
+
* `checked` is the property a checkbox or radio actually renders; `value` on those is the HTML
|
|
245
|
+
* value (`"on"`), which does not move when the box is toggled. `previous` and `previousChecked`
|
|
246
|
+
* are the same reading from before the action, present on a settled event so a consumer can tell
|
|
247
|
+
* a render from a restore.
|
|
248
|
+
*/
|
|
249
|
+
export declare const FieldChangeField: {
|
|
250
|
+
readonly FIELD: "field";
|
|
251
|
+
readonly KIND: "kind";
|
|
252
|
+
readonly LENGTH: "length";
|
|
253
|
+
readonly VALUE: "value";
|
|
254
|
+
readonly REDACTED: "redacted";
|
|
255
|
+
readonly CHECKED: "checked";
|
|
256
|
+
readonly PREVIOUS: "previous";
|
|
257
|
+
readonly PREVIOUS_CHECKED: "previousChecked";
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* The three readable client-side storage areas.
|
|
261
|
+
*
|
|
262
|
+
* `cookies` is plural because that is what the storage tool accepts, what the browser returns and
|
|
263
|
+
* what the docs publish. This member read `cookie` for as long as it had no callers, which is
|
|
264
|
+
* exactly how long a name can disagree with every use of it for free.
|
|
265
|
+
*/
|
|
266
|
+
export declare const StorageArea: {
|
|
267
|
+
readonly LOCAL: "local";
|
|
268
|
+
readonly SESSION: "session";
|
|
269
|
+
readonly COOKIE: "cookies";
|
|
270
|
+
};
|
|
271
|
+
export type StorageArea = (typeof StorageArea)[keyof typeof StorageArea];
|
|
@@ -15,6 +15,16 @@ export const EventType = {
|
|
|
15
15
|
DOM_TEXT: 'dom.text',
|
|
16
16
|
NET_REQUEST: 'net.request',
|
|
17
17
|
NET_PENDING: 'net.pending',
|
|
18
|
+
/**
|
|
19
|
+
* A fetch or XHR that the browser recorded in resource timing, and that no patched transport saw.
|
|
20
|
+
*
|
|
21
|
+
* The app sent it through a `fetch` reference it saved before Reticle patched `fetch`. It is NOT a
|
|
22
|
+
* `net.request`: it has no method, and its status is only a hint (0 cross-origin without
|
|
23
|
+
* `Timing-Allow-Origin`). A second record for one call would also raise a false duplicate. It
|
|
24
|
+
* exists so a `net` miss over its URL reads `unknown`, not `no`.
|
|
25
|
+
* `data: { url, urlRaw?, initiator, status? }`.
|
|
26
|
+
*/
|
|
27
|
+
NET_UNPATCHED: 'net.unpatched',
|
|
18
28
|
/** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
|
|
19
29
|
NET_STREAM: 'net.stream',
|
|
20
30
|
/** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
|
|
@@ -153,3 +163,80 @@ export const CanvasTrigger = {
|
|
|
153
163
|
POLL: 'poll',
|
|
154
164
|
ACT: 'act',
|
|
155
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* Wire payload vocabularies. The browser observers EMIT these values and the schemas below VALIDATE
|
|
168
|
+
* them, so a browser-side typo (`'SSE'`) would pass tsc and fail only here, at runtime. Each is a const
|
|
169
|
+
* object — the browser imports the members, the schema derives its z.nativeEnum from the same object —
|
|
170
|
+
* so emitter and validator are one source. Kept here, not beside the schemas in `event-payloads.ts`:
|
|
171
|
+
* the browser imports only these, so a page does not download every payload schema.
|
|
172
|
+
*/
|
|
173
|
+
/**
|
|
174
|
+
* `FETCH` is a response whose BODY is still arriving after the request itself resolved.
|
|
175
|
+
*
|
|
176
|
+
* `fetch` settles at HEADERS, so a streamed response is reported complete while the server is still
|
|
177
|
+
* writing. Measured on a Next.js App Router page: the RSC payload's NET_REQUEST landed 16 ms in, the
|
|
178
|
+
* shell rendered, and the Suspense boundary's content arrived 889 ms later — a window in which
|
|
179
|
+
* nothing at all was observed, so `settled` passed while the fallback was still on screen.
|
|
180
|
+
*/
|
|
181
|
+
export const StreamTransport = { SSE: 'sse', WS: 'ws', FETCH: 'fetch' };
|
|
182
|
+
/** `CLOSE` pairs with `OPEN`: until it arrives, the body is still being written. */
|
|
183
|
+
export const StreamDirection = { OPEN: 'open', IN: 'in', OUT: 'out', CLOSE: 'close' };
|
|
184
|
+
export const ScrollDirection = { UP: 'up', DOWN: 'down' };
|
|
185
|
+
/**
|
|
186
|
+
* How urgently a live region announces its text, as ARIA defines it. `role="alert"` is assertive,
|
|
187
|
+
* and `role="status"` is polite. An explicit `aria-live` value replaces the value of the role.
|
|
188
|
+
*/
|
|
189
|
+
export const LivePoliteness = { ASSERTIVE: 'assertive', POLITE: 'polite' };
|
|
190
|
+
/**
|
|
191
|
+
* How a `route.change` happened.
|
|
192
|
+
*
|
|
193
|
+
* `push` is `history.pushState`, `replace` is `history.replaceState`, and `pop` is the session
|
|
194
|
+
* history moving under the page (`popstate`, or a `hashchange` the page did not push). A
|
|
195
|
+
* same-pathname replace records UI state in the URL; it is not a navigation to a new view.
|
|
196
|
+
*/
|
|
197
|
+
export const RouteChangeHow = {
|
|
198
|
+
PUSH: 'push',
|
|
199
|
+
REPLACE: 'replace',
|
|
200
|
+
POP: 'pop',
|
|
201
|
+
};
|
|
202
|
+
/** Wire field on `route.change` carrying a `RouteChangeHow`. */
|
|
203
|
+
export const ROUTE_CHANGE_HOW_FIELD = 'how';
|
|
204
|
+
/**
|
|
205
|
+
* Why a `field.change` was emitted.
|
|
206
|
+
*
|
|
207
|
+
* `input` is a burst of keystrokes and `change` is the commit that ends one — both are the user's
|
|
208
|
+
* own event, fired before a controlled component restores its DOM property. `settled` is a read of
|
|
209
|
+
* that property on the frame after the handlers ran. Only a settled read that differs from the
|
|
210
|
+
* pre-action value is evidence the screen moved.
|
|
211
|
+
*/
|
|
212
|
+
export const FieldChangeKind = {
|
|
213
|
+
INPUT: 'input',
|
|
214
|
+
CHANGE: 'change',
|
|
215
|
+
SETTLED: 'settled',
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Wire fields on `field.change` beyond `field` / `kind` / `value` / `length`.
|
|
219
|
+
*
|
|
220
|
+
* `checked` is the property a checkbox or radio actually renders; `value` on those is the HTML
|
|
221
|
+
* value (`"on"`), which does not move when the box is toggled. `previous` and `previousChecked`
|
|
222
|
+
* are the same reading from before the action, present on a settled event so a consumer can tell
|
|
223
|
+
* a render from a restore.
|
|
224
|
+
*/
|
|
225
|
+
export const FieldChangeField = {
|
|
226
|
+
FIELD: 'field',
|
|
227
|
+
KIND: 'kind',
|
|
228
|
+
LENGTH: 'length',
|
|
229
|
+
VALUE: 'value',
|
|
230
|
+
REDACTED: 'redacted',
|
|
231
|
+
CHECKED: 'checked',
|
|
232
|
+
PREVIOUS: 'previous',
|
|
233
|
+
PREVIOUS_CHECKED: 'previousChecked',
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* The three readable client-side storage areas.
|
|
237
|
+
*
|
|
238
|
+
* `cookies` is plural because that is what the storage tool accepts, what the browser returns and
|
|
239
|
+
* what the docs publish. This member read `cookie` for as long as it had no callers, which is
|
|
240
|
+
* exactly how long a name can disagree with every use of it for free.
|
|
241
|
+
*/
|
|
242
|
+
export const StorageArea = { LOCAL: 'local', SESSION: 'session', COOKIE: 'cookies' };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments of the `match` command beyond its `query` and `state`.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `constants.ts`: one small group with a reader on each side of the wire, and
|
|
5
|
+
* nothing else in that file depends on it.
|
|
6
|
+
*
|
|
7
|
+
* The display form of an element's text is 80 characters and an ellipsis (`MAX_DESCRIBED_TEXT`),
|
|
8
|
+
* which is right for output an agent reads and wrong for a verdict: it fails an exact `oneOf` or an
|
|
9
|
+
* end-anchored pattern on anything longer. A verdict asks for `FULL_TEXT`, and the page answers with
|
|
10
|
+
* up to `MAX_FULL_TEXT` characters for at most `MAX_FULL_TEXT_ELEMENTS` elements. Both are bounded
|
|
11
|
+
* because the transport spends ONE budget of `MAX_MESSAGE_BYTES / 4` characters per response and
|
|
12
|
+
* silently replaces the overflow; 32 elements of 4000 characters is about half of it, leaving the
|
|
13
|
+
* rest for every other descriptor field. `count` still reports every match, and a text cut at the
|
|
14
|
+
* bound is `MAX_FULL_TEXT` characters plus an ellipsis, so only a cut text is ever longer than it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MatchArg: {
|
|
17
|
+
/** `true` describes each match with up to `TRANSPORT_LIMITS.MAX_FULL_TEXT` characters of text, not the display-sized 80. */
|
|
18
|
+
readonly FULL_TEXT: "fullText";
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments of the `match` command beyond its `query` and `state`.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `constants.ts`: one small group with a reader on each side of the wire, and
|
|
5
|
+
* nothing else in that file depends on it.
|
|
6
|
+
*
|
|
7
|
+
* The display form of an element's text is 80 characters and an ellipsis (`MAX_DESCRIBED_TEXT`),
|
|
8
|
+
* which is right for output an agent reads and wrong for a verdict: it fails an exact `oneOf` or an
|
|
9
|
+
* end-anchored pattern on anything longer. A verdict asks for `FULL_TEXT`, and the page answers with
|
|
10
|
+
* up to `MAX_FULL_TEXT` characters for at most `MAX_FULL_TEXT_ELEMENTS` elements. Both are bounded
|
|
11
|
+
* because the transport spends ONE budget of `MAX_MESSAGE_BYTES / 4` characters per response and
|
|
12
|
+
* silently replaces the overflow; 32 elements of 4000 characters is about half of it, leaving the
|
|
13
|
+
* rest for every other descriptor field. `count` still reports every match, and a text cut at the
|
|
14
|
+
* bound is `MAX_FULL_TEXT` characters plus an ellipsis, so only a cut text is ever longer than it.
|
|
15
|
+
*/
|
|
16
|
+
export const MatchArg = {
|
|
17
|
+
/** `true` describes each match with up to `TRANSPORT_LIMITS.MAX_FULL_TEXT` characters of text, not the display-sized 80. */
|
|
18
|
+
FULL_TEXT: 'fullText',
|
|
19
|
+
};
|
|
@@ -17,3 +17,15 @@ export declare const RETICLE_OVERLAY_SELECTOR = "[data-reticle-overlay],[data-re
|
|
|
17
17
|
* page without Reticle would have looked like.
|
|
18
18
|
*/
|
|
19
19
|
export declare const HIDE_RETICLE_CHROME_CSS = "[data-reticle-overlay],[data-reticle-cursor],[data-reticle-hud],[data-reticle-glow],[data-reticle-mark],[data-reticle-blocker],[data-reticle-tour]{display:none !important}";
|
|
20
|
+
/**
|
|
21
|
+
* A page script that takes Reticle's own UI out of the hit test for one real pointer gesture.
|
|
22
|
+
*
|
|
23
|
+
* A real click goes to the topmost element that takes pointer events. When a HUD control sat over
|
|
24
|
+
* the app's button, the HUD took the daemon's click, and the verdict said the app did nothing
|
|
25
|
+
* (#992). Each Reticle node gets an inline `pointer-events: none !important`, because a control
|
|
26
|
+
* sets `pointer-events: auto` on itself and a value on the host alone does not reach it. Inline
|
|
27
|
+
* style is not blocked by a page's CSP, and an injected stylesheet can be. Nothing moves or flickers.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RETICLE_CHROME_PASS_THROUGH_SCRIPT: string;
|
|
30
|
+
/** Puts back what `RETICLE_CHROME_PASS_THROUGH_SCRIPT` changed, so a person can click the HUD again. */
|
|
31
|
+
export declare const RETICLE_CHROME_RESTORE_POINTER_SCRIPT = "(() => { for (const [el, value, priority] of window.__reticlePointerHeld ?? []) { if (value) el.style.setProperty('pointer-events', value, priority); else el.style.removeProperty('pointer-events'); } delete window.__reticlePointerHeld; })()";
|