@reticlehq/core 3.9.0 → 3.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.
Files changed (55) hide show
  1. package/dist/artifacts/flow-constants.d.ts +17 -0
  2. package/dist/artifacts/flow-constants.js +15 -0
  3. package/dist/artifacts/flow-results.d.ts +27 -2
  4. package/dist/artifacts/flow-step-tool.d.ts +17 -0
  5. package/dist/artifacts/flow-step-tool.js +18 -1
  6. package/dist/artifacts/flow-types.d.ts +59 -0
  7. package/dist/artifacts/flow-types.js +51 -6
  8. package/dist/identity/github-action.d.ts +2 -2
  9. package/dist/identity/github-action.js +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/schema/event-message.json +1 -0
  13. package/dist/schema/event-payloads.json +47 -1
  14. package/dist/schema/event-type.json +1 -0
  15. package/dist/schema/reticle-event.json +1 -0
  16. package/dist/schema/reticle-message.json +1 -0
  17. package/dist/telemetry-refusal.d.ts +82 -0
  18. package/dist/telemetry-refusal.js +49 -0
  19. package/dist/telemetry-signals.d.ts +44 -0
  20. package/dist/telemetry-signals.js +17 -0
  21. package/dist/telemetry.d.ts +66 -2
  22. package/dist/telemetry.js +8 -1
  23. package/dist/verdict/findings.d.ts +34 -0
  24. package/dist/verdict/findings.js +37 -0
  25. package/dist/verdict/predicate.d.ts +1 -0
  26. package/dist/verdict/predicate.js +26 -1
  27. package/dist/verdict/verdict-attribution.js +1 -0
  28. package/dist/verdict/verified-constants.d.ts +17 -0
  29. package/dist/verdict/verified-constants.js +17 -0
  30. package/dist/wire/click-input.d.ts +26 -0
  31. package/dist/wire/click-input.js +65 -0
  32. package/dist/wire/constants/animation-command.d.ts +2 -0
  33. package/dist/wire/constants/animation-command.js +2 -0
  34. package/dist/wire/constants/console-event.d.ts +44 -0
  35. package/dist/wire/constants/console-event.js +44 -0
  36. package/dist/wire/constants/constants.d.ts +38 -13
  37. package/dist/wire/constants/constants.js +38 -13
  38. package/dist/wire/constants/determinism.d.ts +17 -0
  39. package/dist/wire/constants/determinism.js +17 -0
  40. package/dist/wire/constants/event-types.d.ts +113 -0
  41. package/dist/wire/constants/event-types.js +87 -0
  42. package/dist/wire/event-payloads.d.ts +16 -93
  43. package/dist/wire/event-payloads.js +26 -72
  44. package/dist/wire/event-priority.js +1 -0
  45. package/dist/wire/global-press.d.ts +9 -2
  46. package/dist/wire/global-press.js +39 -12
  47. package/dist/wire/messages.d.ts +3 -0
  48. package/dist/wire/net.d.ts +39 -0
  49. package/dist/wire/net.js +56 -8
  50. package/dist/wire/redaction.d.ts +18 -0
  51. package/dist/wire/redaction.js +72 -0
  52. package/dist/wire/tool-names.d.ts +4 -0
  53. package/dist/wire/tool-names.js +4 -0
  54. package/dist/wire/types.d.ts +8 -0
  55. package/package.json +1 -1
@@ -99,6 +99,12 @@ export const VerifiedReason = {
99
99
  * forbid. See #669.
100
100
  */
101
101
  WINDOW_CLOSED_EARLY: 'window_closed_early',
102
+ /**
103
+ * The app opened a `confirm` or `prompt` during the action, and Reticle declined it so that the
104
+ * tab cannot wedge. The app then took the path for "no", so a consequence that needed "yes" was
105
+ * not judged. NEVER `"no"`: the answer that decided the path was Reticle's, not the app's.
106
+ */
107
+ DIALOG_DECLINED: 'dialog_declined',
102
108
  /** The declared consequence did not hold. */
103
109
  ASSERTION_FAILED: 'assertion_failed',
104
110
  /** Channels disagreed about the action — the false green this product exists to catch. */
@@ -282,6 +288,17 @@ export const BlindSpotKind = {
282
288
  * subscribable store registers, which is when the SDK emits this kind with count 0.
283
289
  */
284
290
  UNWATCHED_STATE: 'unwatched-state',
291
+ /**
292
+ * The store committed, no DOM node moved, and a `<canvas>` on screen showed no change that the
293
+ * canvas digest could see.
294
+ *
295
+ * A canvas renders as pixels, so a repaint makes no DOM mutation. The digest is a 16x16 sample, so
296
+ * a small repaint can leave it the same, and a WebGL canvas without `preserveDrawingBuffer` reads
297
+ * back blank. `state-vs-render` does not fire then, and this says why: the render may be in pixels
298
+ * this window could not compare (#1525). Computed by the daemon for one act window; no SDK sends
299
+ * it. BOUNDING, never impeaching: what WAS observed is observed completely.
300
+ */
301
+ CANVAS_PAINT_UNOBSERVED: 'canvas-paint-unobserved',
285
302
  };
286
303
  /**
287
304
  * Blind spots that only exist in an Electron renderer.
@@ -13,3 +13,29 @@ export declare function clickButtonFromArgs(args: Record<string, unknown>): Clic
13
13
  * server both refuse with this sentence, so an argument is never dropped without a word.
14
14
  */
15
15
  export declare function clickInputProblem(action: ActionType, args: Record<string, unknown>): string | undefined;
16
+ /** The act argument for a point inside the target element. */
17
+ export declare const ACT_POINT_ARG = "at";
18
+ /** The drag argument for the end point inside the drop target, or inside the source. */
19
+ export declare const DRAG_TO_POINT_ARG = "to";
20
+ /** A point as fractions of a box: 0 is the left or top edge, 1 the right or bottom edge. */
21
+ export interface BoxFraction {
22
+ x: number;
23
+ y: number;
24
+ }
25
+ /** The point under `key`, each fraction clamped to 0..1, or undefined when absent or unreadable. */
26
+ export declare function boxFractionFromArgs(args: Record<string, unknown>, key: typeof ACT_POINT_ARG | typeof DRAG_TO_POINT_ARG): BoxFraction | undefined;
27
+ /** The point at `at` in `box`, in the coordinates of the box. */
28
+ export declare function pointInBox(box: {
29
+ x: number;
30
+ y: number;
31
+ width: number;
32
+ height: number;
33
+ }, at: BoxFraction): {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ /**
38
+ * Why `at` or `to` cannot be honoured on this action, or undefined when it can or is absent. A point
39
+ * that is not two numbers is refused: an action at the centre is not the action that was asked for.
40
+ */
41
+ export declare function actPointProblem(action: string, args: Record<string, unknown>): string | undefined;
@@ -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,2 @@
1
+ /** reticle_animations element filter argument. */
2
+ export declare const ANIMATION_TARGET_ARG = "target";
@@ -0,0 +1,2 @@
1
+ /** reticle_animations element filter argument. */
2
+ export const ANIMATION_TARGET_ARG = 'target';
@@ -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';
@@ -106,19 +106,11 @@ export declare const RETICLE_URL_PARAM: {
106
106
  readonly HUD: "__reticle_hud";
107
107
  };
108
108
  /**
109
- * Payload fields and `kind` values on console/error events that the AGENT reads back through
110
- * `reticle_console`. The console payload is passthrough rather than closed, so these are named
111
- * here instead of schema-enforced: a wire string a server writes inline is one a rename
112
- * half-lands, with the agent reading a field that quietly stopped arriving.
113
- */
114
- export declare const CONSOLE_EVENT: {
115
- /** The payload field naming what kind of console/error event it is (`resource`, `pageerror`, ...). */
116
- readonly KIND: "kind";
117
- /** The kind for an uncaught error the SERVER observed through the page's own browser handle. */
118
- readonly PAGE_ERROR: "pageerror";
119
- /** The payload field reporting how many buffered page errors were dropped — loss, declared. */
120
- readonly DROPPED_PAGE_ERRORS: "droppedPageErrors";
121
- };
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";
122
114
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
123
115
  export declare const LOOPBACK_HOST = "127.0.0.1";
124
116
  export { ReticleEnv } from './reticle-env.js';
@@ -440,6 +432,7 @@ export declare const ContractReadError: {
440
432
  export type ContractReadError = (typeof ContractReadError)[keyof typeof ContractReadError];
441
433
  import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
442
434
  export { CanvasTrigger, EventType, MediaEvent };
435
+ export { FieldChangeField, FieldChangeKind, LivePoliteness, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './event-types.js';
443
436
  /** Bounds for the per-session ring buffer. */
444
437
  export declare const RING_BUFFER_DEFAULTS: {
445
438
  readonly MAX_EVENTS: 2000;
@@ -480,6 +473,13 @@ export declare const RETICLE_BUSY_SIGNAL = "reticle:busy";
480
473
  export declare const RETICLE_RENDERS_STORE = "__reticle_renders";
481
474
  /** Global the render pre-hook parks its commit buffer on (see the vite plugin's RENDER_PREHOOK_SOURCE). */
482
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";
483
483
  /**
484
484
  * Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
485
485
  * (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
@@ -640,6 +640,23 @@ export declare const ActionType: {
640
640
  */
641
641
  readonly SCROLL: "scroll";
642
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";
643
660
  /**
644
661
  * A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
645
662
  *
@@ -711,6 +728,14 @@ export declare const ElementState: {
711
728
  * `visible`/`present` before the scroll, so act_and_wait returns already_true. (#398)
712
729
  */
713
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";
714
739
  };
715
740
  export type ElementState = (typeof ElementState)[keyof typeof ElementState];
716
741
  /** Query strategies, aligned with Testing Library semantics. */
@@ -109,19 +109,11 @@ export const RETICLE_URL_PARAM = {
109
109
  HUD: '__reticle_hud',
110
110
  };
111
111
  /**
112
- * Payload fields and `kind` values on console/error events that the AGENT reads back through
113
- * `reticle_console`. The console payload is passthrough rather than closed, so these are named
114
- * here instead of schema-enforced: a wire string a server writes inline is one a rename
115
- * half-lands, with the agent reading a field that quietly stopped arriving.
116
- */
117
- export const CONSOLE_EVENT = {
118
- /** The payload field naming what kind of console/error event it is (`resource`, `pageerror`, ...). */
119
- KIND: 'kind',
120
- /** The kind for an uncaught error the SERVER observed through the page's own browser handle. */
121
- PAGE_ERROR: 'pageerror',
122
- /** The payload field reporting how many buffered page errors were dropped — loss, declared. */
123
- DROPPED_PAGE_ERRORS: 'droppedPageErrors',
124
- };
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';
125
117
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
126
118
  export const LOOPBACK_HOST = '127.0.0.1';
127
119
  export { ReticleEnv } from './reticle-env.js';
@@ -487,6 +479,7 @@ export const ContractReadError = {
487
479
  // import path for every consumer. See event-types.ts for why it moved.
488
480
  import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
489
481
  export { CanvasTrigger, EventType, MediaEvent };
482
+ export { FieldChangeField, FieldChangeKind, LivePoliteness, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './event-types.js';
490
483
  /** Bounds for the per-session ring buffer. */
491
484
  export const RING_BUFFER_DEFAULTS = {
492
485
  MAX_EVENTS: 2000,
@@ -526,6 +519,13 @@ export const RETICLE_BUSY_SIGNAL = 'reticle:busy';
526
519
  export const RETICLE_RENDERS_STORE = '__reticle_renders';
527
520
  /** Global the render pre-hook parks its commit buffer on (see the vite plugin's RENDER_PREHOOK_SOURCE). */
528
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';
529
529
  /**
530
530
  * Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
531
531
  * (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
@@ -686,6 +686,23 @@ export const ActionType = {
686
686
  */
687
687
  SCROLL: 'scroll',
688
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',
689
706
  /**
690
707
  * A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
691
708
  *
@@ -733,6 +750,14 @@ export const ElementState = {
733
750
  * `visible`/`present` before the scroll, so act_and_wait returns already_true. (#398)
734
751
  */
735
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',
736
761
  };
737
762
  /** Query strategies, aligned with Testing Library semantics. */
738
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];