@reticlehq/core 2.14.0 → 3.1.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 (143) hide show
  1. package/dist/{artifacts-entry.d.ts → artifacts/artifacts-entry.d.ts} +7 -7
  2. package/dist/{artifacts-entry.js → artifacts/artifacts-entry.js} +7 -7
  3. package/dist/artifacts/flow-composition.d.ts +30 -0
  4. package/dist/artifacts/flow-composition.js +19 -0
  5. package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +89 -3
  6. package/dist/{flow-constants.js → artifacts/flow-constants.js} +95 -4
  7. package/dist/artifacts/flow-mutation-target.d.ts +39 -0
  8. package/dist/artifacts/flow-mutation-target.js +89 -0
  9. package/dist/artifacts/flow-order.d.ts +30 -0
  10. package/dist/artifacts/flow-order.js +49 -0
  11. package/dist/artifacts/flow-select.d.ts +56 -0
  12. package/dist/artifacts/flow-select.js +56 -0
  13. package/dist/artifacts/flow-step-tool.d.ts +31 -0
  14. package/dist/artifacts/flow-step-tool.js +31 -0
  15. package/dist/artifacts/flow-types.d.ts +3736 -0
  16. package/dist/artifacts/flow-types.js +463 -0
  17. package/dist/artifacts/flow-unreached.d.ts +12 -0
  18. package/dist/artifacts/flow-unreached.js +24 -0
  19. package/dist/{impact.d.ts → artifacts/impact.d.ts} +119 -103
  20. package/dist/{impact.js → artifacts/impact.js} +14 -5
  21. package/dist/{journal.d.ts → artifacts/journal.d.ts} +51 -7
  22. package/dist/{journal.js → artifacts/journal.js} +38 -2
  23. package/dist/artifacts/step-effect.d.ts +29 -0
  24. package/dist/artifacts/step-effect.js +28 -0
  25. package/dist/hooks/hook-events.d.ts +311 -0
  26. package/dist/hooks/hook-events.js +127 -0
  27. package/dist/hooks/hooks-entry.d.ts +9 -0
  28. package/dist/hooks/hooks-entry.js +9 -0
  29. package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
  30. package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
  31. package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
  32. package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
  33. package/dist/{document-identity.js → identity/document-identity.js} +4 -5
  34. package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
  35. package/dist/{source-constants.js → identity/source-constants.js} +4 -4
  36. package/dist/index.d.ts +56 -43
  37. package/dist/index.js +65 -45
  38. package/dist/onboarding.d.ts +114 -0
  39. package/dist/onboarding.js +141 -0
  40. package/dist/realm/registry.d.ts +212 -0
  41. package/dist/realm/registry.js +302 -0
  42. package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +6 -7
  43. package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
  44. package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
  45. package/dist/{project-registry.js → registry/project-registry.js} +5 -5
  46. package/dist/schema/command-name.json +31 -0
  47. package/dist/schema/event-payloads.json +791 -0
  48. package/dist/schema/hello-message.json +70 -2
  49. package/dist/schema/reticle-message.json +70 -2
  50. package/dist/telemetry-entry.d.ts +1 -1
  51. package/dist/telemetry-entry.js +1 -1
  52. package/dist/telemetry-feedback.d.ts +15 -16
  53. package/dist/telemetry-feedback.js +11 -12
  54. package/dist/telemetry-license.d.ts +1 -1
  55. package/dist/telemetry-license.js +1 -1
  56. package/dist/telemetry-refusal.d.ts +11 -11
  57. package/dist/telemetry-refusal.js +7 -8
  58. package/dist/telemetry-session.d.ts +51 -59
  59. package/dist/telemetry-session.js +47 -55
  60. package/dist/telemetry.d.ts +243 -214
  61. package/dist/telemetry.js +83 -98
  62. package/dist/tour-entry.d.ts +10 -0
  63. package/dist/tour-entry.js +10 -0
  64. package/dist/tour.d.ts +125 -0
  65. package/dist/tour.js +165 -0
  66. package/dist/{consequence.d.ts → verdict/consequence.d.ts} +32 -15
  67. package/dist/{consequence.js → verdict/consequence.js} +9 -31
  68. package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
  69. package/dist/{findings.d.ts → verdict/findings.d.ts} +86 -39
  70. package/dist/{findings.js → verdict/findings.js} +103 -49
  71. package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +7 -14
  72. package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +7 -15
  73. package/dist/{intent.d.ts → verdict/intent.d.ts} +35 -46
  74. package/dist/{intent.js → verdict/intent.js} +11 -22
  75. package/dist/verdict/revision.d.ts +44 -0
  76. package/dist/verdict/revision.js +53 -0
  77. package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
  78. package/dist/{run-context.js → verdict/run-context.js} +15 -36
  79. package/dist/{security.js → verdict/security.js} +12 -21
  80. package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +381 -105
  81. package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
  82. package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +25 -13
  83. package/dist/{verified-constants.js → verdict/verified-constants.js} +25 -13
  84. package/dist/{verify-progress.d.ts → verdict/verify-progress.d.ts} +18 -22
  85. package/dist/{verify-progress.js → verdict/verify-progress.js} +6 -10
  86. package/dist/wire/channel.d.ts +46 -0
  87. package/dist/wire/channel.js +95 -0
  88. package/dist/{constants.d.ts → wire/constants/constants.d.ts} +91 -28
  89. package/dist/{constants.js → wire/constants/constants.js} +105 -28
  90. package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
  91. package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
  92. package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
  93. package/dist/{event-classification.js → wire/event-classification.js} +1 -1
  94. package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +68 -13
  95. package/dist/{event-payloads.js → wire/event-payloads.js} +21 -3
  96. package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
  97. package/dist/{event-priority.js → wire/event-priority.js} +2 -5
  98. package/dist/{global-press.js → wire/global-press.js} +1 -1
  99. package/dist/{messages.d.ts → wire/messages.d.ts} +239 -48
  100. package/dist/{messages.js → wire/messages.js} +68 -5
  101. package/dist/wire/narrow.d.ts +39 -0
  102. package/dist/wire/narrow.js +45 -0
  103. package/dist/{net.d.ts → wire/net.d.ts} +12 -13
  104. package/dist/{net.js → wire/net.js} +12 -13
  105. package/dist/wire/platform.d.ts +37 -0
  106. package/dist/wire/platform.js +36 -0
  107. package/dist/{redaction.js → wire/redaction.js} +12 -12
  108. package/dist/wire/tool-names.d.ts +133 -0
  109. package/dist/wire/tool-names.js +142 -0
  110. package/dist/{toon.js → wire/toon.js} +1 -1
  111. package/dist/{types.d.ts → wire/types.d.ts} +77 -76
  112. package/dist/{types.js → wire/types.js} +4 -3
  113. package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
  114. package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
  115. package/dist/{notices.d.ts → words/notices.d.ts} +8 -12
  116. package/dist/{notices.js → words/notices.js} +8 -12
  117. package/package.json +16 -7
  118. package/dist/flow-types.d.ts +0 -1711
  119. package/dist/flow-types.js +0 -247
  120. package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +0 -0
  121. package/dist/{impact-savings.js → artifacts/impact-savings.js} +0 -0
  122. package/dist/{brand.js → identity/brand.js} +0 -0
  123. package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
  124. package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
  125. package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
  126. package/dist/{project-id.js → identity/project-id.js} +0 -0
  127. package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
  128. package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
  129. package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
  130. package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
  131. package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
  132. package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
  133. package/dist/{global-press.d.ts → wire/global-press.d.ts} +0 -0
  134. package/dist/{redaction.d.ts → wire/redaction.d.ts} +0 -0
  135. package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
  136. package/dist/{state-select.js → wire/state-select.js} +0 -0
  137. package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
  138. package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
  139. package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
  140. package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
  141. package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
  142. package/dist/{upgrade.d.ts → words/upgrade.d.ts} +2 -2
  143. /package/dist/{upgrade.js → words/upgrade.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { EventType } from './constants.js';
2
+ import { EventType } from './constants/constants.js';
3
3
  /**
4
4
  * Per-event-type payload schemas — the typed replacement for the envelope's open `data` record.
5
5
  * The envelope (`ReticleEventSchema.data`) stays open on the wire so a richer SDK is never rejected
@@ -277,15 +277,15 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
277
277
  initiator: z.ZodString;
278
278
  urlRaw: z.ZodOptional<z.ZodString>;
279
279
  }, "strip", z.ZodTypeAny, {
280
- url: string;
281
280
  id: string;
282
281
  method: string;
282
+ url: string;
283
283
  initiator: string;
284
284
  urlRaw?: string | undefined;
285
285
  }, {
286
- url: string;
287
286
  id: string;
288
287
  method: string;
288
+ url: string;
289
289
  initiator: string;
290
290
  urlRaw?: string | undefined;
291
291
  }>;
@@ -375,15 +375,15 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
375
375
  search: z.ZodString;
376
376
  hash: z.ZodString;
377
377
  }, "strip", z.ZodTypeAny, {
378
+ pathname: string;
378
379
  from: string;
379
380
  to: string;
380
- pathname: string;
381
381
  search: string;
382
382
  hash: string;
383
383
  }, {
384
+ pathname: string;
384
385
  from: string;
385
386
  to: string;
386
- pathname: string;
387
387
  search: string;
388
388
  hash: string;
389
389
  }>;
@@ -551,6 +551,24 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
551
551
  readonly SAFARI: "safari";
552
552
  readonly OTHER: "other";
553
553
  }>>;
554
+ /**
555
+ * Which shell the page is running in: `web`, `electron`, `tauri`, or something newer.
556
+ *
557
+ * The SDK has always sent this and the server has always read it, but until now the field was
558
+ * not declared here, so it travelled through `.passthrough()` and appeared in NONE of the
559
+ * generated `dist/schema/*.json` files. Anyone implementing this contract from the published
560
+ * schemas -- which is what a third-party realm does -- could not see that the field exists, let
561
+ * alone that the server depends on it.
562
+ *
563
+ * A plain string on purpose, NOT a closed list of the three shells that ship today. A realm
564
+ * that does not exist yet has to be able to name itself, and an enum here would mean one
565
+ * unknown value fails the whole health report, taking visibility, focus and the heartbeat down
566
+ * with it. The wire says the field exists and is a string; which values mean something stays
567
+ * with the reader, where it already is.
568
+ */
569
+ runtime: z.ZodOptional<z.ZodString>;
570
+ /** The rendering engine, coarse on purpose (blink / gecko / webkit). Same reasoning as `runtime`. */
571
+ engine: z.ZodOptional<z.ZodString>;
554
572
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
555
573
  hidden: z.ZodBoolean;
556
574
  focused: z.ZodBoolean;
@@ -571,6 +589,24 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
571
589
  readonly SAFARI: "safari";
572
590
  readonly OTHER: "other";
573
591
  }>>;
592
+ /**
593
+ * Which shell the page is running in: `web`, `electron`, `tauri`, or something newer.
594
+ *
595
+ * The SDK has always sent this and the server has always read it, but until now the field was
596
+ * not declared here, so it travelled through `.passthrough()` and appeared in NONE of the
597
+ * generated `dist/schema/*.json` files. Anyone implementing this contract from the published
598
+ * schemas -- which is what a third-party realm does -- could not see that the field exists, let
599
+ * alone that the server depends on it.
600
+ *
601
+ * A plain string on purpose, NOT a closed list of the three shells that ship today. A realm
602
+ * that does not exist yet has to be able to name itself, and an enum here would mean one
603
+ * unknown value fails the whole health report, taking visibility, focus and the heartbeat down
604
+ * with it. The wire says the field exists and is a string; which values mean something stays
605
+ * with the reader, where it already is.
606
+ */
607
+ runtime: z.ZodOptional<z.ZodString>;
608
+ /** The rendering engine, coarse on purpose (blink / gecko / webkit). Same reasoning as `runtime`. */
609
+ engine: z.ZodOptional<z.ZodString>;
574
610
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
575
611
  hidden: z.ZodBoolean;
576
612
  focused: z.ZodBoolean;
@@ -591,6 +627,24 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
591
627
  readonly SAFARI: "safari";
592
628
  readonly OTHER: "other";
593
629
  }>>;
630
+ /**
631
+ * Which shell the page is running in: `web`, `electron`, `tauri`, or something newer.
632
+ *
633
+ * The SDK has always sent this and the server has always read it, but until now the field was
634
+ * not declared here, so it travelled through `.passthrough()` and appeared in NONE of the
635
+ * generated `dist/schema/*.json` files. Anyone implementing this contract from the published
636
+ * schemas -- which is what a third-party realm does -- could not see that the field exists, let
637
+ * alone that the server depends on it.
638
+ *
639
+ * A plain string on purpose, NOT a closed list of the three shells that ship today. A realm
640
+ * that does not exist yet has to be able to name itself, and an enum here would mean one
641
+ * unknown value fails the whole health report, taking visibility, focus and the heartbeat down
642
+ * with it. The wire says the field exists and is a string; which values mean something stays
643
+ * with the reader, where it already is.
644
+ */
645
+ runtime: z.ZodOptional<z.ZodString>;
646
+ /** The rendering engine, coarse on purpose (blink / gecko / webkit). Same reasoning as `runtime`. */
647
+ engine: z.ZodOptional<z.ZodString>;
594
648
  }, z.ZodTypeAny, "passthrough">>;
595
649
  "context.opened": z.ZodObject<{
596
650
  href: z.ZodOptional<z.ZodString>;
@@ -729,13 +783,14 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
729
783
  readonly END: "end";
730
784
  readonly MESSAGE: "message";
731
785
  readonly REPLAY: "replay";
786
+ readonly SYNC: "sync";
732
787
  }>;
733
788
  text: z.ZodOptional<z.ZodString>;
734
789
  }, "strip", z.ZodTypeAny, {
735
- kind: "message" | "pause" | "resume" | "end" | "replay";
790
+ kind: "message" | "pause" | "resume" | "end" | "replay" | "sync";
736
791
  text?: string | undefined;
737
792
  }, {
738
- kind: "message" | "pause" | "resume" | "end" | "replay";
793
+ kind: "message" | "pause" | "resume" | "end" | "replay" | "sync";
739
794
  text?: string | undefined;
740
795
  }>;
741
796
  "human.mark": z.ZodObject<{
@@ -760,25 +815,25 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
760
815
  }>>;
761
816
  route: z.ZodOptional<z.ZodString>;
762
817
  }, "strip", z.ZodTypeAny, {
763
- note: string;
764
818
  anchor: string;
765
- strategy: "testid" | "role" | "component" | "position";
819
+ note: string;
820
+ strategy: "role" | "testid" | "component" | "position";
821
+ label?: string | undefined;
766
822
  route?: string | undefined;
767
823
  source?: {
768
824
  file: string;
769
825
  line: number;
770
826
  } | undefined;
771
- label?: string | undefined;
772
827
  }, {
773
- note: string;
774
828
  anchor: string;
775
- strategy: "testid" | "role" | "component" | "position";
829
+ note: string;
830
+ strategy: "role" | "testid" | "component" | "position";
831
+ label?: string | undefined;
776
832
  route?: string | undefined;
777
833
  source?: {
778
834
  file: string;
779
835
  line: number;
780
836
  } | undefined;
781
- label?: string | undefined;
782
837
  }>;
783
838
  };
784
839
  /** Narrow an event's `data` against its type's payload schema. Unknown in, typed-or-error out. */
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { EventType, PerfMetric } from './constants.js';
3
- import { BlindSpotKind } from './verified-constants.js';
4
- import { BrowserBrand } from './telemetry-feedback.js';
2
+ import { EventType, PerfMetric } from './constants/constants.js';
3
+ import { BlindSpotKind } from '../verdict/verified-constants.js';
4
+ import { BrowserBrand } from '../telemetry-feedback.js';
5
5
  import { HumanControlDataSchema, HumanMarkDataSchema } from './messages.js';
6
6
  /**
7
7
  * Per-event-type payload schemas — the typed replacement for the envelope's open `data` record.
@@ -182,6 +182,24 @@ export const EVENT_PAYLOAD_SCHEMAS = {
182
182
  * one, and a desktop webview has no brand to report.
183
183
  */
184
184
  brand: z.nativeEnum(BrowserBrand).optional(),
185
+ /**
186
+ * Which shell the page is running in: `web`, `electron`, `tauri`, or something newer.
187
+ *
188
+ * The SDK has always sent this and the server has always read it, but until now the field was
189
+ * not declared here, so it travelled through `.passthrough()` and appeared in NONE of the
190
+ * generated `dist/schema/*.json` files. Anyone implementing this contract from the published
191
+ * schemas -- which is what a third-party realm does -- could not see that the field exists, let
192
+ * alone that the server depends on it.
193
+ *
194
+ * A plain string on purpose, NOT a closed list of the three shells that ship today. A realm
195
+ * that does not exist yet has to be able to name itself, and an enum here would mean one
196
+ * unknown value fails the whole health report, taking visibility, focus and the heartbeat down
197
+ * with it. The wire says the field exists and is a string; which values mean something stays
198
+ * with the reader, where it already is.
199
+ */
200
+ runtime: z.string().optional(),
201
+ /** The rendering engine, coarse on purpose (blink / gecko / webkit). Same reasoning as `runtime`. */
202
+ engine: z.string().optional(),
185
203
  })
186
204
  .passthrough(),
187
205
  // The page called window.open — the clicked consequence may continue in a context the SDK cannot
@@ -8,10 +8,7 @@
8
8
  * First-come-first-dropped therefore spends the whole budget on churn and loses exactly the signal
9
9
  * the agent asked about.
10
10
  *
11
- * Measured on a react-admin renderer with a render loop: 11,138 events dropped in one window, and the
12
- * single IPC call under test was among them. The assertion came back `unknown` — honest, but blind.
13
- *
14
- * So over the cap we drop the high-volume/low-value kinds first and keep a reserve for these. The
11
+ * So over the cap the high-volume/low-value kinds drop first and these keep a reserve. The
15
12
  * reserve is bounded (see RATE_CAP_HIGH_VALUE_RESERVE_RATIO) — a flood of errors is still a flood,
16
13
  * and going unbounded here would just move the overload rather than shed it.
17
14
  */
@@ -1,4 +1,4 @@
1
- import { EventType } from './constants.js';
1
+ import { EventType } from './constants/constants.js';
2
2
  /**
3
3
  * Which events survive the bridge's rate cap.
4
4
  *
@@ -9,10 +9,7 @@ import { EventType } from './constants.js';
9
9
  * First-come-first-dropped therefore spends the whole budget on churn and loses exactly the signal
10
10
  * the agent asked about.
11
11
  *
12
- * Measured on a react-admin renderer with a render loop: 11,138 events dropped in one window, and the
13
- * single IPC call under test was among them. The assertion came back `unknown` — honest, but blind.
14
- *
15
- * So over the cap we drop the high-volume/low-value kinds first and keep a reserve for these. The
12
+ * So over the cap the high-volume/low-value kinds drop first and these keep a reserve. The
16
13
  * reserve is bounded (see RATE_CAP_HIGH_VALUE_RESERVE_RATIO) — a flood of errors is still a flood,
17
14
  * and going unbounded here would just move the overload rather than shed it.
18
15
  */
@@ -1,4 +1,4 @@
1
- import { ActionType } from './constants.js';
1
+ import { ActionType } from './constants/constants.js';
2
2
  /**
3
3
  * The key a `press` sends when neither `text` nor `key` was named.
4
4
  *