@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
package/dist/types.d.ts CHANGED
@@ -54,7 +54,8 @@ export declare const ElementQuerySchema: z.ZodObject<{
54
54
  /** CSS selector or ref to scope the search. */
55
55
  scope: z.ZodOptional<z.ZodString>;
56
56
  /**
57
- * Return the `scope` element ITSELF rather than searching inside it.
57
+ * Return the `scope` element ITSELF rather than searching inside it. When `text` is also given,
58
+ * the scope root must contain that text across its full subtree.
58
59
  *
59
60
  * Every other path excludes the scope root by construction, so a layout container with no role,
60
61
  * name, testid or text of its own was unreachable — and that is routinely the element carrying the
@@ -64,6 +65,12 @@ export declare const ElementQuerySchema: z.ZodObject<{
64
65
  */
65
66
  self: z.ZodOptional<z.ZodBoolean>;
66
67
  }, "strict", z.ZodTypeAny, {
68
+ value?: string | undefined;
69
+ source?: {
70
+ file: string;
71
+ line: number;
72
+ column?: number | undefined;
73
+ } | undefined;
67
74
  testid?: string | undefined;
68
75
  role?: string | undefined;
69
76
  component?: string | undefined;
@@ -71,18 +78,18 @@ export declare const ElementQuerySchema: z.ZodObject<{
71
78
  label?: string | undefined;
72
79
  placeholder?: string | undefined;
73
80
  alt?: string | undefined;
81
+ name?: string | undefined;
82
+ scope?: string | undefined;
83
+ by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
84
+ attrs?: string[] | undefined;
85
+ self?: boolean | undefined;
86
+ }, {
74
87
  value?: string | undefined;
75
88
  source?: {
76
89
  file: string;
77
90
  line: number;
78
91
  column?: number | undefined;
79
92
  } | undefined;
80
- name?: string | undefined;
81
- by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
82
- attrs?: string[] | undefined;
83
- scope?: string | undefined;
84
- self?: boolean | undefined;
85
- }, {
86
93
  testid?: string | undefined;
87
94
  role?: string | undefined;
88
95
  component?: string | undefined;
@@ -90,16 +97,10 @@ export declare const ElementQuerySchema: z.ZodObject<{
90
97
  label?: string | undefined;
91
98
  placeholder?: string | undefined;
92
99
  alt?: string | undefined;
93
- value?: string | undefined;
94
- source?: {
95
- file: string;
96
- line: number;
97
- column?: number | undefined;
98
- } | undefined;
99
100
  name?: string | undefined;
101
+ scope?: string | undefined;
100
102
  by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
101
103
  attrs?: string[] | undefined;
102
- scope?: string | undefined;
103
104
  self?: boolean | undefined;
104
105
  }>;
105
106
  export type ElementQuery = z.infer<typeof ElementQuerySchema>;
@@ -197,6 +198,16 @@ export interface QueryEmptyHint {
197
198
  * the recovery is `{ scope: <ref>, self: true }` rather than another guess at the text.
198
199
  */
199
200
  splitText?: ElementDescriptor;
201
+ /**
202
+ * Present only when a ROLE+NAME search missed and that role DOES carry a nearly-matching name.
203
+ *
204
+ * Role+name matching is exact, deliberately: substring matching on `name` would let a query for
205
+ * "Save" select "Save and close", and acting on the wrong control is a worse failure than not
206
+ * finding the right one. But an exact miss used to say nothing about a label the caller was one
207
+ * word away from — reported from the field as a query for the button "Mesh" against a page whose
208
+ * button read "2 Mesh", costing a snapshot to discover. The match stays exact; the miss answers.
209
+ */
210
+ nameNearMiss?: string[];
200
211
  }
201
212
  /** Result of the QUERY command / reticle_query tool. `hint` present ONLY on zero matches. */
202
213
  export interface QueryResult {
@@ -285,22 +296,22 @@ export declare const ManifestGovernanceSchema: z.ZodObject<{
285
296
  paths?: string[] | undefined;
286
297
  }>, "many">>;
287
298
  }, "strip", z.ZodTypeAny, {
299
+ scope?: string[] | undefined;
288
300
  risk?: {
289
301
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
290
302
  note?: string | undefined;
291
303
  paths?: string[] | undefined;
292
304
  }[] | undefined;
293
- scope?: string[] | undefined;
294
305
  owner?: string | undefined;
295
306
  safety?: string[] | undefined;
296
307
  redact?: string[] | undefined;
297
308
  }, {
309
+ scope?: string[] | undefined;
298
310
  risk?: {
299
311
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
300
312
  note?: string | undefined;
301
313
  paths?: string[] | undefined;
302
314
  }[] | undefined;
303
- scope?: string[] | undefined;
304
315
  owner?: string | undefined;
305
316
  safety?: string[] | undefined;
306
317
  redact?: string[] | undefined;
@@ -350,22 +361,22 @@ export declare const CapabilitiesSchema: z.ZodObject<{
350
361
  paths?: string[] | undefined;
351
362
  }>, "many">>;
352
363
  }, "strip", z.ZodTypeAny, {
364
+ scope?: string[] | undefined;
353
365
  risk?: {
354
366
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
355
367
  note?: string | undefined;
356
368
  paths?: string[] | undefined;
357
369
  }[] | undefined;
358
- scope?: string[] | undefined;
359
370
  owner?: string | undefined;
360
371
  safety?: string[] | undefined;
361
372
  redact?: string[] | undefined;
362
373
  }, {
374
+ scope?: string[] | undefined;
363
375
  risk?: {
364
376
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
365
377
  note?: string | undefined;
366
378
  paths?: string[] | undefined;
367
379
  }[] | undefined;
368
- scope?: string[] | undefined;
369
380
  owner?: string | undefined;
370
381
  safety?: string[] | undefined;
371
382
  redact?: string[] | undefined;
@@ -379,12 +390,12 @@ export declare const CapabilitiesSchema: z.ZodObject<{
379
390
  signals: string[];
380
391
  stores: string[];
381
392
  governance?: {
393
+ scope?: string[] | undefined;
382
394
  risk?: {
383
395
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
384
396
  note?: string | undefined;
385
397
  paths?: string[] | undefined;
386
398
  }[] | undefined;
387
- scope?: string[] | undefined;
388
399
  owner?: string | undefined;
389
400
  safety?: string[] | undefined;
390
401
  redact?: string[] | undefined;
@@ -398,12 +409,12 @@ export declare const CapabilitiesSchema: z.ZodObject<{
398
409
  signals: string[];
399
410
  stores: string[];
400
411
  governance?: {
412
+ scope?: string[] | undefined;
401
413
  risk?: {
402
414
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
403
415
  note?: string | undefined;
404
416
  paths?: string[] | undefined;
405
417
  }[] | undefined;
406
- scope?: string[] | undefined;
407
418
  owner?: string | undefined;
408
419
  safety?: string[] | undefined;
409
420
  redact?: string[] | undefined;
@@ -457,22 +468,22 @@ export declare const ContractFileSchema: z.ZodObject<{
457
468
  paths?: string[] | undefined;
458
469
  }>, "many">>;
459
470
  }, "strip", z.ZodTypeAny, {
471
+ scope?: string[] | undefined;
460
472
  risk?: {
461
473
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
462
474
  note?: string | undefined;
463
475
  paths?: string[] | undefined;
464
476
  }[] | undefined;
465
- scope?: string[] | undefined;
466
477
  owner?: string | undefined;
467
478
  safety?: string[] | undefined;
468
479
  redact?: string[] | undefined;
469
480
  }, {
481
+ scope?: string[] | undefined;
470
482
  risk?: {
471
483
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
472
484
  note?: string | undefined;
473
485
  paths?: string[] | undefined;
474
486
  }[] | undefined;
475
- scope?: string[] | undefined;
476
487
  owner?: string | undefined;
477
488
  safety?: string[] | undefined;
478
489
  redact?: string[] | undefined;
@@ -486,12 +497,12 @@ export declare const ContractFileSchema: z.ZodObject<{
486
497
  signals: string[];
487
498
  stores: string[];
488
499
  governance?: {
500
+ scope?: string[] | undefined;
489
501
  risk?: {
490
502
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
491
503
  note?: string | undefined;
492
504
  paths?: string[] | undefined;
493
505
  }[] | undefined;
494
- scope?: string[] | undefined;
495
506
  owner?: string | undefined;
496
507
  safety?: string[] | undefined;
497
508
  redact?: string[] | undefined;
@@ -505,18 +516,19 @@ export declare const ContractFileSchema: z.ZodObject<{
505
516
  signals: string[];
506
517
  stores: string[];
507
518
  governance?: {
519
+ scope?: string[] | undefined;
508
520
  risk?: {
509
521
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
510
522
  note?: string | undefined;
511
523
  paths?: string[] | undefined;
512
524
  }[] | undefined;
513
- scope?: string[] | undefined;
514
525
  owner?: string | undefined;
515
526
  safety?: string[] | undefined;
516
527
  redact?: string[] | undefined;
517
528
  } | undefined;
518
529
  }>;
519
530
  }, "strip", z.ZodTypeAny, {
531
+ version: 1;
520
532
  capabilities: {
521
533
  flows: {
522
534
  name: string;
@@ -526,20 +538,20 @@ export declare const ContractFileSchema: z.ZodObject<{
526
538
  signals: string[];
527
539
  stores: string[];
528
540
  governance?: {
541
+ scope?: string[] | undefined;
529
542
  risk?: {
530
543
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
531
544
  note?: string | undefined;
532
545
  paths?: string[] | undefined;
533
546
  }[] | undefined;
534
- scope?: string[] | undefined;
535
547
  owner?: string | undefined;
536
548
  safety?: string[] | undefined;
537
549
  redact?: string[] | undefined;
538
550
  } | undefined;
539
551
  };
540
- version: 1;
541
552
  generatedAt: number;
542
553
  }, {
554
+ version: 1;
543
555
  capabilities: {
544
556
  flows: {
545
557
  name: string;
@@ -549,18 +561,17 @@ export declare const ContractFileSchema: z.ZodObject<{
549
561
  signals: string[];
550
562
  stores: string[];
551
563
  governance?: {
564
+ scope?: string[] | undefined;
552
565
  risk?: {
553
566
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
554
567
  note?: string | undefined;
555
568
  paths?: string[] | undefined;
556
569
  }[] | undefined;
557
- scope?: string[] | undefined;
558
570
  owner?: string | undefined;
559
571
  safety?: string[] | undefined;
560
572
  redact?: string[] | undefined;
561
573
  } | undefined;
562
574
  };
563
- version: 1;
564
575
  generatedAt: number;
565
576
  }>;
566
577
  /**
@@ -610,10 +621,10 @@ export declare const RunRecordSchema: z.ZodObject<{
610
621
  }>>;
611
622
  durationMs: z.ZodOptional<z.ZodNumber>;
612
623
  }, "strip", z.ZodTypeAny, {
613
- status: "pass" | "drift" | "error" | "fail";
614
624
  at: number;
615
- kind: "flow_replay" | "manual";
625
+ status: "pass" | "drift" | "error" | "fail";
616
626
  name: string;
627
+ kind: "flow_replay" | "manual";
617
628
  durationMs?: number | undefined;
618
629
  evidence?: {
619
630
  consoleErrors?: number | undefined;
@@ -622,10 +633,10 @@ export declare const RunRecordSchema: z.ZodObject<{
622
633
  } | undefined;
623
634
  summary?: string | undefined;
624
635
  }, {
625
- status: "pass" | "drift" | "error" | "fail";
626
636
  at: number;
627
- kind: "flow_replay" | "manual";
637
+ status: "pass" | "drift" | "error" | "fail";
628
638
  name: string;
639
+ kind: "flow_replay" | "manual";
629
640
  durationMs?: number | undefined;
630
641
  evidence?: {
631
642
  consoleErrors?: number | undefined;
@@ -751,10 +762,10 @@ export declare const ProjectFileSchema: z.ZodObject<{
751
762
  }>>;
752
763
  durationMs: z.ZodOptional<z.ZodNumber>;
753
764
  }, "strip", z.ZodTypeAny, {
754
- status: "pass" | "drift" | "error" | "fail";
755
765
  at: number;
756
- kind: "flow_replay" | "manual";
766
+ status: "pass" | "drift" | "error" | "fail";
757
767
  name: string;
768
+ kind: "flow_replay" | "manual";
758
769
  durationMs?: number | undefined;
759
770
  evidence?: {
760
771
  consoleErrors?: number | undefined;
@@ -763,10 +774,10 @@ export declare const ProjectFileSchema: z.ZodObject<{
763
774
  } | undefined;
764
775
  summary?: string | undefined;
765
776
  }, {
766
- status: "pass" | "drift" | "error" | "fail";
767
777
  at: number;
768
- kind: "flow_replay" | "manual";
778
+ status: "pass" | "drift" | "error" | "fail";
769
779
  name: string;
780
+ kind: "flow_replay" | "manual";
770
781
  durationMs?: number | undefined;
771
782
  evidence?: {
772
783
  consoleErrors?: number | undefined;
@@ -776,11 +787,12 @@ export declare const ProjectFileSchema: z.ZodObject<{
776
787
  summary?: string | undefined;
777
788
  }>, "many">;
778
789
  }, "strip", z.ZodTypeAny, {
790
+ version: 1;
779
791
  runs: {
780
- status: "pass" | "drift" | "error" | "fail";
781
792
  at: number;
782
- kind: "flow_replay" | "manual";
793
+ status: "pass" | "drift" | "error" | "fail";
783
794
  name: string;
795
+ kind: "flow_replay" | "manual";
784
796
  durationMs?: number | undefined;
785
797
  evidence?: {
786
798
  consoleErrors?: number | undefined;
@@ -789,7 +801,6 @@ export declare const ProjectFileSchema: z.ZodObject<{
789
801
  } | undefined;
790
802
  summary?: string | undefined;
791
803
  }[];
792
- version: 1;
793
804
  learned?: {
794
805
  flows?: string[] | undefined;
795
806
  routes?: string[] | undefined;
@@ -799,11 +810,12 @@ export declare const ProjectFileSchema: z.ZodObject<{
799
810
  } | undefined;
800
811
  } | undefined;
801
812
  }, {
813
+ version: 1;
802
814
  runs: {
803
- status: "pass" | "drift" | "error" | "fail";
804
815
  at: number;
805
- kind: "flow_replay" | "manual";
816
+ status: "pass" | "drift" | "error" | "fail";
806
817
  name: string;
818
+ kind: "flow_replay" | "manual";
807
819
  durationMs?: number | undefined;
808
820
  evidence?: {
809
821
  consoleErrors?: number | undefined;
@@ -812,7 +824,6 @@ export declare const ProjectFileSchema: z.ZodObject<{
812
824
  } | undefined;
813
825
  summary?: string | undefined;
814
826
  }[];
815
- version: 1;
816
827
  learned?: {
817
828
  flows?: string[] | undefined;
818
829
  routes?: string[] | undefined;
@@ -839,12 +850,12 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
839
850
  name: z.ZodString;
840
851
  dataMatches: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
841
852
  }, "strip", z.ZodTypeAny, {
842
- kind: "assert-signal";
843
853
  name: string;
854
+ kind: "assert-signal";
844
855
  dataMatches?: Record<string, unknown> | undefined;
845
856
  }, {
846
- kind: "assert-signal";
847
857
  name: string;
858
+ kind: "assert-signal";
848
859
  dataMatches?: Record<string, unknown> | undefined;
849
860
  }>, z.ZodObject<{
850
861
  kind: z.ZodLiteral<"assert-visible">;
@@ -947,10 +958,32 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
947
958
  level?: string | undefined;
948
959
  absent?: boolean | undefined;
949
960
  }>>;
961
+ text: z.ZodOptional<z.ZodObject<{
962
+ contains: z.ZodString;
963
+ scope: z.ZodOptional<z.ZodString>;
964
+ absent: z.ZodOptional<z.ZodBoolean>;
965
+ visible: z.ZodOptional<z.ZodBoolean>;
966
+ }, "strip", z.ZodTypeAny, {
967
+ contains: string;
968
+ visible?: boolean | undefined;
969
+ absent?: boolean | undefined;
970
+ scope?: string | undefined;
971
+ }, {
972
+ contains: string;
973
+ visible?: boolean | undefined;
974
+ absent?: boolean | undefined;
975
+ scope?: string | undefined;
976
+ }>>;
950
977
  }, "strip", z.ZodTypeAny, {
951
978
  kind: "success-state";
952
979
  testid?: string | undefined;
953
980
  signal?: string | undefined;
981
+ text?: {
982
+ contains: string;
983
+ visible?: boolean | undefined;
984
+ absent?: boolean | undefined;
985
+ scope?: string | undefined;
986
+ } | undefined;
954
987
  net?: {
955
988
  status?: number | undefined;
956
989
  method?: string | undefined;
@@ -969,6 +1002,12 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
969
1002
  kind: "success-state";
970
1003
  testid?: string | undefined;
971
1004
  signal?: string | undefined;
1005
+ text?: {
1006
+ contains: string;
1007
+ visible?: boolean | undefined;
1008
+ absent?: boolean | undefined;
1009
+ scope?: string | undefined;
1010
+ } | undefined;
972
1011
  net?: {
973
1012
  status?: number | undefined;
974
1013
  method?: string | undefined;
package/dist/types.js CHANGED
@@ -38,7 +38,8 @@ export const ElementQuerySchema = z
38
38
  /** CSS selector or ref to scope the search. */
39
39
  scope: z.string().optional(),
40
40
  /**
41
- * Return the `scope` element ITSELF rather than searching inside it.
41
+ * Return the `scope` element ITSELF rather than searching inside it. When `text` is also given,
42
+ * the scope root must contain that text across its full subtree.
42
43
  *
43
44
  * Every other path excludes the scope root by construction, so a layout container with no role,
44
45
  * name, testid or text of its own was unreachable — and that is routinely the element carrying the
@@ -210,6 +211,24 @@ export const AnnotationSchema = z.discriminatedUnion('kind', [
210
211
  absent: z.boolean().optional(),
211
212
  })
212
213
  .optional(),
214
+ // A rendered-text golden end-condition, in the shapes the assert surface already accepts.
215
+ //
216
+ // The app this exists for has no testids, no `reticle.signal`, no registrable store and no
217
+ // network call on the interaction under test: a discount price computed and rendered, a
218
+ // formatted total, a derived label. Every other kind here needs a channel that app does not
219
+ // have, so it could not produce an asserted flow AT ALL -- and a flow with no assertion is a
220
+ // permanent green (#811).
221
+ //
222
+ // Ranked below `testid` in the precedence order: an element is a locator, text is content, and
223
+ // where a caller offered both the locator is the more stable anchor.
224
+ text: z
225
+ .object({
226
+ contains: z.string().min(1),
227
+ scope: z.string().min(1).optional(),
228
+ absent: z.boolean().optional(),
229
+ visible: z.boolean().optional(),
230
+ })
231
+ .optional(),
213
232
  }),
214
233
  z.object({
215
234
  kind: z.literal(AnnotationKind.INTENT),
package/dist/upgrade.d.ts CHANGED
@@ -70,13 +70,13 @@ export declare const UpgradeHintSchema: z.ZodObject<{
70
70
  unlockedBy: z.ZodString;
71
71
  learnMoreUrl: z.ZodString;
72
72
  }, "strip", z.ZodTypeAny, {
73
- reason: string;
74
73
  capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
74
+ reason: string;
75
75
  unlockedBy: string;
76
76
  learnMoreUrl: string;
77
77
  }, {
78
- reason: string;
79
78
  capability: "share_proof" | "run_history" | "team_review" | "corpus_heal" | "ci_gate" | "hosted_runner";
79
+ reason: string;
80
80
  unlockedBy: string;
81
81
  learnMoreUrl: string;
82
82
  }>;