@reticlehq/core 2.13.0 → 2.14.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.
Files changed (54) hide show
  1. package/dist/artifacts-entry.d.ts +20 -0
  2. package/dist/artifacts-entry.js +20 -0
  3. package/dist/consequence.d.ts +8 -1
  4. package/dist/consequence.js +11 -2
  5. package/dist/constants.d.ts +33 -0
  6. package/dist/constants.js +32 -0
  7. package/dist/dev-server-registry.d.ts +2 -2
  8. package/dist/event-payloads.d.ts +167 -10
  9. package/dist/event-payloads.js +40 -0
  10. package/dist/findings.d.ts +61 -0
  11. package/dist/findings.js +67 -0
  12. package/dist/flow-constants.d.ts +8 -0
  13. package/dist/flow-constants.js +8 -0
  14. package/dist/flow-types.d.ts +371 -133
  15. package/dist/flow-types.js +55 -3
  16. package/dist/global-press.d.ts +30 -0
  17. package/dist/global-press.js +54 -0
  18. package/dist/impact-savings.d.ts +7 -3
  19. package/dist/impact-savings.js +27 -4
  20. package/dist/impact.d.ts +96 -44
  21. package/dist/impact.js +21 -0
  22. package/dist/index.d.ts +16 -2
  23. package/dist/index.js +16 -2
  24. package/dist/instrumentation-gap.d.ts +15 -0
  25. package/dist/instrumentation-gap.js +16 -0
  26. package/dist/intent.d.ts +24 -24
  27. package/dist/journal.d.ts +7 -7
  28. package/dist/messages.d.ts +107 -46
  29. package/dist/messages.js +25 -0
  30. package/dist/net.d.ts +40 -0
  31. package/dist/net.js +40 -0
  32. package/dist/notices.d.ts +16 -0
  33. package/dist/notices.js +19 -0
  34. package/dist/redaction.d.ts +30 -0
  35. package/dist/redaction.js +127 -2
  36. package/dist/schema/event-message.json +1 -0
  37. package/dist/schema/event-type.json +1 -0
  38. package/dist/schema/hello-message.json +6 -0
  39. package/dist/schema/reticle-event.json +1 -0
  40. package/dist/schema/reticle-message.json +7 -0
  41. package/dist/telemetry-entry.d.ts +15 -0
  42. package/dist/telemetry-entry.js +15 -0
  43. package/dist/telemetry-feedback.d.ts +2 -2
  44. package/dist/telemetry-session.d.ts +2 -2
  45. package/dist/telemetry.d.ts +52 -50
  46. package/dist/types.d.ts +83 -44
  47. package/dist/types.js +20 -1
  48. package/dist/upgrade.d.ts +2 -2
  49. package/dist/verification-run.d.ts +36 -36
  50. package/dist/verified-constants.d.ts +11 -0
  51. package/dist/verified-constants.js +11 -0
  52. package/dist/verify-progress.d.ts +133 -0
  53. package/dist/verify-progress.js +78 -0
  54. package/package.json +9 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `@reticlehq/core/artifacts` — the on-disk and registry formats.
3
+ *
4
+ * Nothing here crosses the browser↔bridge wire. These are files the CLI, the bridge and the vite
5
+ * plugin read and write on the developer's machine: the `.reticle/` journal, the intent ledger, the
6
+ * run context, the daemon/dev-server/project registries, the self-update policy, and the
7
+ * instrumentation gaps the server reports back.
8
+ *
9
+ * Every name below is ALSO exported from the root entry point, which stays as it was — this path
10
+ * exists so a Node-side importer can say which half of core it depends on, and so
11
+ * `core-boundary.test.ts` in @reticlehq/browser can fail when the DOM side reaches for one of them.
12
+ */
13
+ export * from './daemon-registry.js';
14
+ export * from './dev-server-registry.js';
15
+ export * from './project-registry.js';
16
+ export * from './intent.js';
17
+ export * from './run-context.js';
18
+ export * from './instrumentation-gap.js';
19
+ export * from './upgrade.js';
20
+ export * from './journal.js';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `@reticlehq/core/artifacts` — the on-disk and registry formats.
3
+ *
4
+ * Nothing here crosses the browser↔bridge wire. These are files the CLI, the bridge and the vite
5
+ * plugin read and write on the developer's machine: the `.reticle/` journal, the intent ledger, the
6
+ * run context, the daemon/dev-server/project registries, the self-update policy, and the
7
+ * instrumentation gaps the server reports back.
8
+ *
9
+ * Every name below is ALSO exported from the root entry point, which stays as it was — this path
10
+ * exists so a Node-side importer can say which half of core it depends on, and so
11
+ * `core-boundary.test.ts` in @reticlehq/browser can fail when the DOM side reaches for one of them.
12
+ */
13
+ export * from './daemon-registry.js';
14
+ export * from './dev-server-registry.js';
15
+ export * from './project-registry.js';
16
+ export * from './intent.js';
17
+ export * from './run-context.js';
18
+ export * from './instrumentation-gap.js';
19
+ export * from './upgrade.js';
20
+ export * from './journal.js';
@@ -53,5 +53,12 @@ export declare function isConsequenceKind(kind: string): boolean;
53
53
  export declare function isPresenceKind(kind: string): boolean;
54
54
  /** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
55
55
  export declare function flowExpectHasConsequence(expect: FlowExpect | undefined): boolean;
56
- /** True when a FlowExpect checks ONLY element presence — no consequence field is set. */
56
+ /**
57
+ * True when a FlowExpect checks ONLY presence — an element or rendered text, no consequence field.
58
+ *
59
+ * `text` counts here for the same reason `element` does, and leaving it out would have been the
60
+ * expensive kind of omission: a text-only expect would have been neither a consequence nor
61
+ * presence-only, so it would have fallen through to `assertion-free` — a permanent green wearing
62
+ * an assertion (#811).
63
+ */
57
64
  export declare function flowExpectIsPresenceOnly(expect: FlowExpect | undefined): boolean;
@@ -64,7 +64,16 @@ export function flowExpectHasConsequence(expect) {
64
64
  }
65
65
  return false;
66
66
  }
67
- /** True when a FlowExpect checks ONLY element presence — no consequence field is set. */
67
+ /**
68
+ * True when a FlowExpect checks ONLY presence — an element or rendered text, no consequence field.
69
+ *
70
+ * `text` counts here for the same reason `element` does, and leaving it out would have been the
71
+ * expensive kind of omission: a text-only expect would have been neither a consequence nor
72
+ * presence-only, so it would have fallen through to `assertion-free` — a permanent green wearing
73
+ * an assertion (#811).
74
+ */
68
75
  export function flowExpectIsPresenceOnly(expect) {
69
- return expect !== undefined && expect.element !== undefined && !flowExpectHasConsequence(expect);
76
+ if (expect === undefined || flowExpectHasConsequence(expect))
77
+ return false;
78
+ return expect.element !== undefined || expect.text !== undefined;
70
79
  }
@@ -142,6 +142,8 @@ export declare const ReticleEnv: {
142
142
  * shortening it. A budget nobody can reach in a test is a budget nobody tests.
143
143
  */
144
144
  readonly RECONNECT_ATTEMPTS: "RETICLE_RECONNECT_ATTEMPTS";
145
+ /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
146
+ readonly MCP_PROXY_IDLE: "RETICLE_MCP_PROXY_IDLE_MS";
145
147
  };
146
148
  /** Hard transport bounds shared by the browser and bridge. */
147
149
  export declare const TRANSPORT_LIMITS: {
@@ -370,6 +372,16 @@ export declare const EventType: {
370
372
  * `data: { href }` — the URL the page asked to open, when it named one.
371
373
  */
372
374
  readonly CONTEXT_OPENED: "context.opened";
375
+ /**
376
+ * The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
377
+ *
378
+ * Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
379
+ * the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
380
+ * driven click made the tab permanently unresponsive with no recovery from inside the session.
381
+ * Answering silently would trade a wedge for an invisible one, so the question the app asked, and
382
+ * the answer given, ride out as an event.
383
+ */
384
+ readonly DIALOG_OPENED: "dialog.opened";
373
385
  /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
374
386
  * wasted re-renders show up here without a per-render flood. */
375
387
  readonly RENDER_COMMIT: "render.commit";
@@ -531,6 +543,11 @@ export declare const ActionWarning: {
531
543
  * actionable. Scroll it into a clear area or dismiss the overlay on top.
532
544
  */
533
545
  readonly CLICK_OCCLUDED: "target is visually occluded by another element; a real user could not click it (synthetic dispatch still delivered the event) — dismiss the overlay or scroll the target clear";
546
+ /**
547
+ * A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
548
+ * element or the document. No named target was given, so the effect must not claim one.
549
+ */
550
+ readonly GLOBAL_PRESS: "press landed on the focused element or document — no named target was given, so this effect does not claim one";
534
551
  };
535
552
  export type ActionWarning = (typeof ActionWarning)[keyof typeof ActionWarning];
536
553
  /** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
@@ -709,3 +726,19 @@ export declare const MessageKind: {
709
726
  readonly EVENT: "event";
710
727
  };
711
728
  export type MessageKind = (typeof MessageKind)[keyof typeof MessageKind];
729
+ /**
730
+ * WHY a lease came back `ready: false` — the two situations that were one word.
731
+ *
732
+ * `ready: false` meant exactly one thing on the mint path: the SDK never dialled in, so the app
733
+ * probably does not embed `@reticlehq/core`. A REUSED lease can fail readiness a second way, and it
734
+ * is the opposite problem: an SDK did dial in, and has since stopped answering. The next action
735
+ * differs — check the install versus recover the tab — so the two get names rather than sharing a
736
+ * bare `false`.
737
+ */
738
+ export declare const LeaseNotReadyReason: {
739
+ /** No SDK dialled in within the wait. The install is the thing to look at. */
740
+ readonly SDK_NEVER_DIALLED: "sdk_never_dialled";
741
+ /** One dialled in and stopped answering: the tab is attached but wedged. */
742
+ readonly SDK_STOPPED_ANSWERING: "sdk_stopped_answering";
743
+ };
744
+ export type LeaseNotReadyReason = (typeof LeaseNotReadyReason)[keyof typeof LeaseNotReadyReason];
package/dist/constants.js CHANGED
@@ -144,6 +144,8 @@ export const ReticleEnv = {
144
144
  * shortening it. A budget nobody can reach in a test is a budget nobody tests.
145
145
  */
146
146
  RECONNECT_ATTEMPTS: 'RETICLE_RECONNECT_ATTEMPTS',
147
+ /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
148
+ MCP_PROXY_IDLE: 'RETICLE_MCP_PROXY_IDLE_MS',
147
149
  };
148
150
  /** Hard transport bounds shared by the browser and bridge. */
149
151
  export const TRANSPORT_LIMITS = {
@@ -378,6 +380,16 @@ export const EventType = {
378
380
  * `data: { href }` — the URL the page asked to open, when it named one.
379
381
  */
380
382
  CONTEXT_OPENED: 'context.opened',
383
+ /**
384
+ * The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
385
+ *
386
+ * Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
387
+ * the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
388
+ * driven click made the tab permanently unresponsive with no recovery from inside the session.
389
+ * Answering silently would trade a wedge for an invisible one, so the question the app asked, and
390
+ * the answer given, ride out as an event.
391
+ */
392
+ DIALOG_OPENED: 'dialog.opened',
381
393
  /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
382
394
  * wasted re-renders show up here without a per-render flood. */
383
395
  RENDER_COMMIT: 'render.commit',
@@ -534,6 +546,11 @@ export const ActionWarning = {
534
546
  * actionable. Scroll it into a clear area or dismiss the overlay on top.
535
547
  */
536
548
  CLICK_OCCLUDED: 'target is visually occluded by another element; a real user could not click it (synthetic dispatch still delivered the event) — dismiss the overlay or scroll the target clear',
549
+ /**
550
+ * A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
551
+ * element or the document. No named target was given, so the effect must not claim one.
552
+ */
553
+ GLOBAL_PRESS: 'press landed on the focused element or document — no named target was given, so this effect does not claim one',
537
554
  };
538
555
  /** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
539
556
  export const DriveErrorCode = {
@@ -685,3 +702,18 @@ export const MessageKind = {
685
702
  COMMAND_RESULT: 'command_result',
686
703
  EVENT: 'event',
687
704
  };
705
+ /**
706
+ * WHY a lease came back `ready: false` — the two situations that were one word.
707
+ *
708
+ * `ready: false` meant exactly one thing on the mint path: the SDK never dialled in, so the app
709
+ * probably does not embed `@reticlehq/core`. A REUSED lease can fail readiness a second way, and it
710
+ * is the opposite problem: an SDK did dial in, and has since stopped answering. The next action
711
+ * differs — check the install versus recover the tab — so the two get names rather than sharing a
712
+ * bare `false`.
713
+ */
714
+ export const LeaseNotReadyReason = {
715
+ /** No SDK dialled in within the wait. The install is the thing to look at. */
716
+ SDK_NEVER_DIALLED: 'sdk_never_dialled',
717
+ /** One dialled in and stopped answering: the tab is attached but wedged. */
718
+ SDK_STOPPED_ANSWERING: 'sdk_stopped_answering',
719
+ };
@@ -32,19 +32,19 @@ export declare const DevServerEntrySchema: z.ZodObject<{
32
32
  */
33
33
  projectId: z.ZodOptional<z.ZodString>;
34
34
  }, "strip", z.ZodTypeAny, {
35
- url: string;
36
35
  port: number;
37
36
  pid: number;
38
37
  startedAt: number;
39
38
  root: string;
39
+ url: string;
40
40
  projectId?: string | undefined;
41
41
  sdkVersion?: string | undefined;
42
42
  }, {
43
- url: string;
44
43
  port: number;
45
44
  pid: number;
46
45
  startedAt: number;
47
46
  root: string;
47
+ url: string;
48
48
  projectId?: string | undefined;
49
49
  sdkVersion?: string | undefined;
50
50
  }>;
@@ -59,6 +59,141 @@ export declare const StorageArea: {
59
59
  readonly COOKIE: "cookies";
60
60
  };
61
61
  export type StorageArea = (typeof StorageArea)[keyof typeof StorageArea];
62
+ /**
63
+ * A single cookie to seed before initial navigation.
64
+ */
65
+ export declare const SeedCookieSchema: z.ZodObject<{
66
+ name: z.ZodString;
67
+ value: z.ZodString;
68
+ domain: z.ZodOptional<z.ZodString>;
69
+ path: z.ZodOptional<z.ZodString>;
70
+ url: z.ZodOptional<z.ZodString>;
71
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
72
+ secure: z.ZodOptional<z.ZodBoolean>;
73
+ sameSite: z.ZodOptional<z.ZodEnum<["Strict", "Lax", "None"]>>;
74
+ expires: z.ZodOptional<z.ZodNumber>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ value: string;
77
+ name: string;
78
+ path?: string | undefined;
79
+ url?: string | undefined;
80
+ domain?: string | undefined;
81
+ httpOnly?: boolean | undefined;
82
+ secure?: boolean | undefined;
83
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
84
+ expires?: number | undefined;
85
+ }, {
86
+ value: string;
87
+ name: string;
88
+ path?: string | undefined;
89
+ url?: string | undefined;
90
+ domain?: string | undefined;
91
+ httpOnly?: boolean | undefined;
92
+ secure?: boolean | undefined;
93
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
94
+ expires?: number | undefined;
95
+ }>;
96
+ export type SeedCookie = z.infer<typeof SeedCookieSchema>;
97
+ export declare const SeedCookiesSchema: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodObject<{
98
+ name: z.ZodString;
99
+ value: z.ZodString;
100
+ domain: z.ZodOptional<z.ZodString>;
101
+ path: z.ZodOptional<z.ZodString>;
102
+ url: z.ZodOptional<z.ZodString>;
103
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
104
+ secure: z.ZodOptional<z.ZodBoolean>;
105
+ sameSite: z.ZodOptional<z.ZodEnum<["Strict", "Lax", "None"]>>;
106
+ expires: z.ZodOptional<z.ZodNumber>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ value: string;
109
+ name: string;
110
+ path?: string | undefined;
111
+ url?: string | undefined;
112
+ domain?: string | undefined;
113
+ httpOnly?: boolean | undefined;
114
+ secure?: boolean | undefined;
115
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
116
+ expires?: number | undefined;
117
+ }, {
118
+ value: string;
119
+ name: string;
120
+ path?: string | undefined;
121
+ url?: string | undefined;
122
+ domain?: string | undefined;
123
+ httpOnly?: boolean | undefined;
124
+ secure?: boolean | undefined;
125
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
126
+ expires?: number | undefined;
127
+ }>, "many">]>;
128
+ export type SeedCookies = z.infer<typeof SeedCookiesSchema>;
129
+ /**
130
+ * Client storage and session state to seed into an isolated context before the first navigation.
131
+ * Matches the three storage areas Reticle already observes (localStorage, sessionStorage, cookies).
132
+ */
133
+ export declare const SeedStorageSchema: z.ZodObject<{
134
+ local: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
135
+ session: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
136
+ cookies: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodObject<{
137
+ name: z.ZodString;
138
+ value: z.ZodString;
139
+ domain: z.ZodOptional<z.ZodString>;
140
+ path: z.ZodOptional<z.ZodString>;
141
+ url: z.ZodOptional<z.ZodString>;
142
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
143
+ secure: z.ZodOptional<z.ZodBoolean>;
144
+ sameSite: z.ZodOptional<z.ZodEnum<["Strict", "Lax", "None"]>>;
145
+ expires: z.ZodOptional<z.ZodNumber>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ value: string;
148
+ name: string;
149
+ path?: string | undefined;
150
+ url?: string | undefined;
151
+ domain?: string | undefined;
152
+ httpOnly?: boolean | undefined;
153
+ secure?: boolean | undefined;
154
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
155
+ expires?: number | undefined;
156
+ }, {
157
+ value: string;
158
+ name: string;
159
+ path?: string | undefined;
160
+ url?: string | undefined;
161
+ domain?: string | undefined;
162
+ httpOnly?: boolean | undefined;
163
+ secure?: boolean | undefined;
164
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
165
+ expires?: number | undefined;
166
+ }>, "many">]>>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ local?: Record<string, string> | undefined;
169
+ session?: Record<string, string> | undefined;
170
+ cookies?: Record<string, string> | {
171
+ value: string;
172
+ name: string;
173
+ path?: string | undefined;
174
+ url?: string | undefined;
175
+ domain?: string | undefined;
176
+ httpOnly?: boolean | undefined;
177
+ secure?: boolean | undefined;
178
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
179
+ expires?: number | undefined;
180
+ }[] | undefined;
181
+ }, {
182
+ local?: Record<string, string> | undefined;
183
+ session?: Record<string, string> | undefined;
184
+ cookies?: Record<string, string> | {
185
+ value: string;
186
+ name: string;
187
+ path?: string | undefined;
188
+ url?: string | undefined;
189
+ domain?: string | undefined;
190
+ httpOnly?: boolean | undefined;
191
+ secure?: boolean | undefined;
192
+ sameSite?: "Strict" | "Lax" | "None" | undefined;
193
+ expires?: number | undefined;
194
+ }[] | undefined;
195
+ }>;
196
+ export type SeedStorage = z.infer<typeof SeedStorageSchema>;
62
197
  /**
63
198
  * The registry. `satisfies Record<EventType,...>` makes a missing event type a *compile* error —
64
199
  * the wire can never carry a type without a payload contract.
@@ -225,12 +360,12 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
225
360
  value: z.ZodNumber;
226
361
  at: z.ZodNumber;
227
362
  }, "strip", z.ZodTypeAny, {
228
- at: number;
229
363
  value: number;
364
+ at: number;
230
365
  metric: "lcp" | "cls" | "longtask";
231
366
  }, {
232
- at: number;
233
367
  value: number;
368
+ at: number;
234
369
  metric: "lcp" | "cls" | "longtask";
235
370
  }>;
236
371
  "route.change": z.ZodObject<{
@@ -386,13 +521,13 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
386
521
  old: z.ZodOptional<z.ZodString>;
387
522
  new: z.ZodOptional<z.ZodString>;
388
523
  }, "strip", z.ZodTypeAny, {
389
- area: "local" | "session" | "cookies";
390
524
  key: string;
525
+ area: "local" | "session" | "cookies";
391
526
  old?: string | undefined;
392
527
  new?: string | undefined;
393
528
  }, {
394
- area: "local" | "session" | "cookies";
395
529
  key: string;
530
+ area: "local" | "session" | "cookies";
396
531
  old?: string | undefined;
397
532
  new?: string | undefined;
398
533
  }>;
@@ -464,6 +599,28 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
464
599
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
465
600
  href: z.ZodOptional<z.ZodString>;
466
601
  }, z.ZodTypeAny, "passthrough">>;
602
+ "dialog.opened": z.ZodObject<{
603
+ /** Which of the three, so a caller can tell a blocking question from a blocking notice. */
604
+ kind: z.ZodEnum<["alert", "confirm", "prompt"]>;
605
+ /** What the app asked. The whole point: a cancelled action is only legible with the question. */
606
+ message: z.ZodOptional<z.ZodString>;
607
+ /** What Reticle answered on the app's behalf. `false`/`null` are the non-destructive replies. */
608
+ answered: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
609
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
610
+ /** Which of the three, so a caller can tell a blocking question from a blocking notice. */
611
+ kind: z.ZodEnum<["alert", "confirm", "prompt"]>;
612
+ /** What the app asked. The whole point: a cancelled action is only legible with the question. */
613
+ message: z.ZodOptional<z.ZodString>;
614
+ /** What Reticle answered on the app's behalf. `false`/`null` are the non-destructive replies. */
615
+ answered: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
616
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
617
+ /** Which of the three, so a caller can tell a blocking question from a blocking notice. */
618
+ kind: z.ZodEnum<["alert", "confirm", "prompt"]>;
619
+ /** What the app asked. The whole point: a cancelled action is only legible with the question. */
620
+ message: z.ZodOptional<z.ZodString>;
621
+ /** What Reticle answered on the app's behalf. `false`/`null` are the non-destructive replies. */
622
+ answered: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
623
+ }, z.ZodTypeAny, "passthrough">>;
467
624
  "render.commit": z.ZodObject<{
468
625
  commits: z.ZodNumber;
469
626
  }, "strip", z.ZodTypeAny, {
@@ -575,10 +732,10 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
575
732
  }>;
576
733
  text: z.ZodOptional<z.ZodString>;
577
734
  }, "strip", z.ZodTypeAny, {
578
- kind: "pause" | "resume" | "end" | "message" | "replay";
735
+ kind: "message" | "pause" | "resume" | "end" | "replay";
579
736
  text?: string | undefined;
580
737
  }, {
581
- kind: "pause" | "resume" | "end" | "message" | "replay";
738
+ kind: "message" | "pause" | "resume" | "end" | "replay";
582
739
  text?: string | undefined;
583
740
  }>;
584
741
  "human.mark": z.ZodObject<{
@@ -606,22 +763,22 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
606
763
  note: string;
607
764
  anchor: string;
608
765
  strategy: "testid" | "role" | "component" | "position";
609
- label?: string | undefined;
766
+ route?: string | undefined;
610
767
  source?: {
611
768
  file: string;
612
769
  line: number;
613
770
  } | undefined;
614
- route?: string | undefined;
771
+ label?: string | undefined;
615
772
  }, {
616
773
  note: string;
617
774
  anchor: string;
618
775
  strategy: "testid" | "role" | "component" | "position";
619
- label?: string | undefined;
776
+ route?: string | undefined;
620
777
  source?: {
621
778
  file: string;
622
779
  line: number;
623
780
  } | undefined;
624
- route?: string | undefined;
781
+ label?: string | undefined;
625
782
  }>;
626
783
  };
627
784
  /** Narrow an event's `data` against its type's payload schema. Unknown in, typed-or-error out. */
@@ -42,6 +42,36 @@ export const ScrollDirection = { UP: 'up', DOWN: 'down' };
42
42
  * exactly how long a name can disagree with every use of it for free.
43
43
  */
44
44
  export const StorageArea = { LOCAL: 'local', SESSION: 'session', COOKIE: 'cookies' };
45
+ /**
46
+ * A single cookie to seed before initial navigation.
47
+ */
48
+ export const SeedCookieSchema = z.object({
49
+ name: z.string().describe('Cookie name.'),
50
+ value: z.string().describe('Cookie value.'),
51
+ domain: z.string().optional().describe('Cookie domain. Defaults to the navigation URL domain.'),
52
+ path: z.string().optional().describe('Cookie path. Defaults to "/".'),
53
+ url: z.string().optional().describe('Cookie URL. Defaults to the navigation URL.'),
54
+ httpOnly: z.boolean().optional().describe('Whether the cookie is httpOnly.'),
55
+ secure: z.boolean().optional().describe('Whether the cookie is secure.'),
56
+ sameSite: z.enum(['Strict', 'Lax', 'None']).optional().describe('SameSite policy.'),
57
+ expires: z.number().optional().describe('Unix timestamp in seconds for cookie expiration.'),
58
+ });
59
+ export const SeedCookiesSchema = z.union([z.record(z.string()), z.array(SeedCookieSchema)]);
60
+ /**
61
+ * Client storage and session state to seed into an isolated context before the first navigation.
62
+ * Matches the three storage areas Reticle already observes (localStorage, sessionStorage, cookies).
63
+ */
64
+ export const SeedStorageSchema = z.object({
65
+ local: z
66
+ .record(z.string())
67
+ .optional()
68
+ .describe('Key-value pairs to seed into window.localStorage before first navigation.'),
69
+ session: z
70
+ .record(z.string())
71
+ .optional()
72
+ .describe('Key-value pairs to seed into window.sessionStorage before first navigation.'),
73
+ cookies: SeedCookiesSchema.optional().describe('Cookies to seed before first navigation: a name-value record scoped to the lease URL or an array of cookie objects.'),
74
+ });
45
75
  const elementLabel = z.object({ role: z.string().optional(), name: z.string().optional() });
46
76
  /**
47
77
  * A file the app produced. `preview`/`lines` are present only when body capture is on, for the same
@@ -157,6 +187,16 @@ export const EVENT_PAYLOAD_SCHEMAS = {
157
187
  // The page called window.open — the clicked consequence may continue in a context the SDK cannot
158
188
  // enter (#508). `href` is what the page asked to open, omitted for the blank-tab form.
159
189
  [EventType.CONTEXT_OPENED]: z.object({ href: z.string().optional() }).passthrough(),
190
+ [EventType.DIALOG_OPENED]: z
191
+ .object({
192
+ /** Which of the three, so a caller can tell a blocking question from a blocking notice. */
193
+ kind: z.enum(['alert', 'confirm', 'prompt']),
194
+ /** What the app asked. The whole point: a cancelled action is only legible with the question. */
195
+ message: z.string().optional(),
196
+ /** What Reticle answered on the app's behalf. `false`/`null` are the non-destructive replies. */
197
+ answered: z.union([z.boolean(), z.null()]).optional(),
198
+ })
199
+ .passthrough(),
160
200
  [EventType.RENDER_COMMIT]: z.object({ commits: z.number() }),
161
201
  [EventType.FOCUS_CHANGE]: z.object({
162
202
  to: z.string().optional(),
@@ -46,6 +46,18 @@ export declare const ContradictionKind: {
46
46
  readonly CONSEQUENCE_ELSEWHERE: "consequence-elsewhere";
47
47
  /** The same write fired more than once in one action — double-submit / retry storm. */
48
48
  readonly DUPLICATE_REQUEST: "duplicate-request";
49
+ /**
50
+ * The same write fired repeatedly on an endpoint the assertion never named.
51
+ *
52
+ * A poll that bursts, a batched analytics beacon, a retry loop the caller was not asking about.
53
+ * The finding is real and worth reporting; what it is NOT is evidence about the consequence the
54
+ * caller declared. An app that polls could not produce a verdict at all -- every assertion that
55
+ * had already seen its consequence came back `unknown` behind writes it never mentioned (#673).
56
+ *
57
+ * ADVISORY, so it rides out in `contradictions` and decides nothing. `DUPLICATE_REQUEST` proper
58
+ * -- a burst on an endpoint the assertion DID name -- keeps its downgrade.
59
+ */
60
+ readonly DUPLICATE_REQUEST_UNRELATED: "duplicate-request-unrelated";
49
61
  /**
50
62
  * Two reads of the same endpoint were in flight together and settled OUT OF ORDER, so the one the
51
63
  * user asked for first is the one that landed last — and the screen is showing it.
@@ -131,6 +143,26 @@ export declare const ContradictionKind: {
131
143
  * working does not), so it is reported with that ceiling stated rather than tuned into silence.
132
144
  */
133
145
  readonly ROUTE_RENDERED_NOTHING: "route-rendered-nothing";
146
+ /**
147
+ * The route changed, nothing was rendered for it, AND the window holds a console error — the same
148
+ * shape as `ROUTE_RENDERED_NOTHING`, but with positive evidence of WHY the destination is blank,
149
+ * not merely its absence.
150
+ *
151
+ * `ROUTE_RENDERED_NOTHING` is deliberately absence-derived: a route that renders nothing might be a
152
+ * false positive (a view revealed from DOM that already existed — the 1-in-11 case measured on its
153
+ * own doc comment), so it downgrades to UNKNOWN rather than assert a fault nobody proved. That
154
+ * caution is wrong for THIS case. A console error in the same window is not an absence of
155
+ * evidence, it is a specific, positive claim — the destination crashed, and the app's own error
156
+ * boundary or console said so. Reported `unknown` anyway once, when a route-rendered-nothing
157
+ * window also carried a React hooks error: the console errors and the empty destination were both
158
+ * in hand, and the honest answer was available and not given.
159
+ *
160
+ * NOT in `ABSENCE_DERIVED_CONTRADICTIONS` — this is exactly the "evidence AGAINST the action"
161
+ * category that set exists to distinguish itself from, and it is graded `NO` for the same reason
162
+ * `ui-advanced-request-failed` is: a definitive verdict is available and inconclusive is a weaker,
163
+ * wrong answer to give when it is.
164
+ */
165
+ readonly ROUTE_RENDERED_NOTHING_CRASHED: "route-rendered-nothing-crashed";
134
166
  /**
135
167
  * Everything this window held belongs to a document that has SINCE been replaced.
136
168
  *
@@ -203,6 +235,27 @@ export type ContradictionKind = (typeof ContradictionKind)[keyof typeof Contradi
203
235
  export declare const ABSENCE_DERIVED_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
204
236
  /** True when this kind was inferred from absence rather than positively observed. */
205
237
  export declare function isAbsenceDerived(kind: string): boolean;
238
+ /**
239
+ * Findings that are REPORTED and decide nothing.
240
+ *
241
+ * The two existing tiers both move a verdict: OBSERVED answers `no`, ABSENCE_DERIVED downgrades to
242
+ * `unknown`. Neither fits a fact that is true, worth telling the caller, and simply not about the
243
+ * question the caller asked.
244
+ *
245
+ * That gap had a cost. An app that polls on an interval could not produce a verdict at all: a camera
246
+ * scan loop POSTing until it acquired a lock had every assertion -- ones that had already seen the
247
+ * person recognised, the heading, the 200s -- come back `unknown`, because writes the assertion
248
+ * never mentioned counted against it. The caller then reports `pass: true` with correct evidence and
249
+ * has to explain in prose that Reticle's own verdict is wrong, which erodes the reason to have a
250
+ * verdict (#673).
251
+ *
252
+ * The bar for adding a kind here is high, and it is not "this rule is noisy". It is that the finding
253
+ * cannot, even in principle, be evidence about the declared consequence -- because it concerns
254
+ * traffic the assertion did not name.
255
+ */
256
+ export declare const ADVISORY_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
257
+ /** True when this kind is reported alongside a verdict without changing it. */
258
+ export declare function isAdvisory(kind: string): boolean;
206
259
  /**
207
260
  * How much authority a finding carries — the distinction above, said out loud on the finding itself.
208
261
  *
@@ -223,6 +276,14 @@ export declare const FindingTier: {
223
276
  * become true a moment later. It is a statement about our timing at least as much as about the app.
224
277
  */
225
278
  readonly ABSENCE_DERIVED: "absence-derived";
279
+ /**
280
+ * True, reported, and not about the question asked. Traffic the assertion never named.
281
+ *
282
+ * Distinct from ABSENCE_DERIVED, which IS about the declared consequence and says our timing was
283
+ * inconclusive about it. This one is about something else entirely, so downgrading on it answers a
284
+ * question nobody put.
285
+ */
286
+ readonly ADVISORY: "advisory";
226
287
  };
227
288
  export type FindingTier = (typeof FindingTier)[keyof typeof FindingTier];
228
289
  /**