@reticlehq/core 3.7.0 → 3.8.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 (138) hide show
  1. package/dist/activation-entry.d.ts +9 -0
  2. package/dist/activation-entry.js +9 -0
  3. package/dist/artifacts/drive-script.d.ts +84 -1217
  4. package/dist/artifacts/drive-script.js +1 -1
  5. package/dist/artifacts/flow-constants.d.ts +15 -0
  6. package/dist/artifacts/flow-constants.js +15 -0
  7. package/dist/artifacts/flow-expect-flat.d.ts +8 -192
  8. package/dist/artifacts/flow-expect-flat.js +2 -2
  9. package/dist/artifacts/flow-results.d.ts +26 -0
  10. package/dist/artifacts/flow-types.d.ts +212 -2295
  11. package/dist/artifacts/flow-types.js +14 -2
  12. package/dist/artifacts/harness-credits.d.ts +6 -3
  13. package/dist/artifacts/harness-credits.js +9 -6
  14. package/dist/artifacts/harness-map.d.ts +8 -69
  15. package/dist/artifacts/harness-map.js +1 -1
  16. package/dist/artifacts/hud-notices.d.ts +8 -82
  17. package/dist/artifacts/hud-notices.js +1 -1
  18. package/dist/artifacts/impact.d.ts +104 -1665
  19. package/dist/artifacts/impact.js +38 -21
  20. package/dist/artifacts/journal.d.ts +15 -231
  21. package/dist/artifacts/journal.js +15 -2
  22. package/dist/artifacts/prompt-context.d.ts +7 -33
  23. package/dist/artifacts/prompt-context.js +15 -4
  24. package/dist/artifacts/screenshot-upload.d.ts +3 -26
  25. package/dist/artifacts/screenshot-upload.js +1 -1
  26. package/dist/graph/app-graph.d.ts +137 -0
  27. package/dist/graph/app-graph.js +498 -0
  28. package/dist/hooks/hook-events.d.ts +15 -171
  29. package/dist/hooks/hook-events.js +1 -1
  30. package/dist/hud-entry.js +1 -1
  31. package/dist/identity/checkout.d.ts +41 -0
  32. package/dist/identity/checkout.js +118 -0
  33. package/dist/identity/state-dir.d.ts +23 -0
  34. package/dist/identity/state-dir.js +43 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.js +10 -0
  37. package/dist/onboarding.d.ts +23 -52
  38. package/dist/onboarding.js +20 -1
  39. package/dist/registry/daemon-registry.d.ts +2 -14
  40. package/dist/registry/daemon-registry.js +1 -1
  41. package/dist/registry/dev-server-registry.d.ts +2 -31
  42. package/dist/registry/dev-server-registry.js +1 -1
  43. package/dist/registry/project-registry.d.ts +4 -32
  44. package/dist/registry/project-registry.js +1 -1
  45. package/dist/schema/command-message.json +65 -68
  46. package/dist/schema/command-name.json +29 -33
  47. package/dist/schema/command-result.json +25 -30
  48. package/dist/schema/event-message.json +104 -101
  49. package/dist/schema/event-payloads.json +246 -108
  50. package/dist/schema/event-type.json +47 -48
  51. package/dist/schema/hello-message.json +150 -133
  52. package/dist/schema/reticle-event.json +98 -94
  53. package/dist/schema/reticle-message.json +338 -310
  54. package/dist/telemetry-bug.d.ts +4 -75
  55. package/dist/telemetry-bug.js +1 -1
  56. package/dist/telemetry-entry.d.ts +1 -1
  57. package/dist/telemetry-entry.js +1 -1
  58. package/dist/telemetry-feedback.d.ts +17 -91
  59. package/dist/telemetry-feedback.js +20 -1
  60. package/dist/telemetry-refusal.d.ts +4 -31
  61. package/dist/telemetry-refusal.js +1 -1
  62. package/dist/telemetry-session.d.ts +45 -624
  63. package/dist/telemetry-session.js +25 -12
  64. package/dist/telemetry-signals.d.ts +211 -86
  65. package/dist/telemetry-signals.js +100 -2
  66. package/dist/telemetry.d.ts +321 -1691
  67. package/dist/telemetry.js +72 -6
  68. package/dist/verdict/check-sentence.d.ts +34 -0
  69. package/dist/verdict/check-sentence.js +228 -0
  70. package/dist/verdict/compare-source.d.ts +1 -1
  71. package/dist/verdict/compare-source.js +1 -1
  72. package/dist/verdict/consequence.d.ts +15 -0
  73. package/dist/verdict/consequence.js +11 -0
  74. package/dist/verdict/disparity.d.ts +8 -56
  75. package/dist/verdict/disparity.js +1 -1
  76. package/dist/verdict/findings.d.ts +10 -0
  77. package/dist/verdict/findings.js +13 -0
  78. package/dist/verdict/instrumentation-coverage.d.ts +6 -37
  79. package/dist/verdict/instrumentation-coverage.js +15 -59
  80. package/dist/verdict/instrumentation-gap.d.ts +72 -0
  81. package/dist/verdict/instrumentation-gap.js +64 -0
  82. package/dist/verdict/intent.d.ts +25 -224
  83. package/dist/verdict/intent.js +1 -1
  84. package/dist/verdict/predicate-tree.d.ts +2 -0
  85. package/dist/verdict/predicate-tree.js +16 -0
  86. package/dist/verdict/predicate.d.ts +3 -2
  87. package/dist/verdict/predicate.js +107 -16
  88. package/dist/verdict/property-assertion.d.ts +23 -101
  89. package/dist/verdict/property-assertion.js +1 -1
  90. package/dist/verdict/run-report.d.ts +71 -0
  91. package/dist/verdict/run-report.js +53 -0
  92. package/dist/verdict/security.d.ts +48 -2
  93. package/dist/verdict/security.js +185 -18
  94. package/dist/verdict/verification-run.d.ts +124 -1623
  95. package/dist/verdict/verification-run.js +37 -6
  96. package/dist/verdict/verify-progress.d.ts +22 -64
  97. package/dist/verdict/verify-progress.js +1 -1
  98. package/dist/wire/constants/constants.d.ts +56 -141
  99. package/dist/wire/constants/constants.js +64 -144
  100. package/dist/wire/constants/discovery.d.ts +4 -4
  101. package/dist/wire/constants/discovery.js +4 -4
  102. package/dist/wire/constants/event-types.d.ts +37 -1
  103. package/dist/wire/constants/event-types.js +35 -1
  104. package/dist/wire/constants/hud-controls.js +0 -2
  105. package/dist/wire/constants/hud-use.d.ts +4 -0
  106. package/dist/wire/constants/hud-use.js +4 -0
  107. package/dist/wire/constants/mcp-wire.d.ts +16 -0
  108. package/dist/wire/constants/mcp-wire.js +16 -0
  109. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  110. package/dist/wire/constants/response-body-reason.js +18 -0
  111. package/dist/wire/constants/reticle-env.d.ts +140 -0
  112. package/dist/wire/constants/reticle-env.js +140 -0
  113. package/dist/wire/constants/session-constants.d.ts +11 -0
  114. package/dist/wire/constants/session-constants.js +11 -0
  115. package/dist/wire/event-payloads.d.ts +173 -629
  116. package/dist/wire/event-payloads.js +107 -23
  117. package/dist/wire/event-priority.js +1 -0
  118. package/dist/wire/messages.d.ts +90 -713
  119. package/dist/wire/messages.js +19 -3
  120. package/dist/wire/narrow.d.ts +6 -0
  121. package/dist/wire/narrow.js +26 -0
  122. package/dist/wire/next-step.d.ts +50 -0
  123. package/dist/wire/next-step.js +37 -0
  124. package/dist/wire/platform-link.d.ts +7 -0
  125. package/dist/wire/platform-link.js +14 -8
  126. package/dist/wire/production/activation-ticket.d.ts +64 -0
  127. package/dist/wire/production/activation-ticket.js +148 -0
  128. package/dist/wire/production/hello-mode.d.ts +35 -0
  129. package/dist/wire/production/hello-mode.js +32 -0
  130. package/dist/wire/production/production-policy.d.ts +92 -0
  131. package/dist/wire/production/production-policy.js +133 -0
  132. package/dist/wire/tool-names.d.ts +2 -0
  133. package/dist/wire/tool-names.js +2 -0
  134. package/dist/wire/types.d.ts +102 -700
  135. package/dist/wire/types.js +5 -5
  136. package/dist/words/upgrade.d.ts +3 -13
  137. package/dist/words/upgrade.js +1 -1
  138. package/package.json +7 -4
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
  import { CROSS_STEP_ADDRESS } from './flow-step-tool.js';
3
3
  import { READABLE_FLOW_VERSIONS } from './flow-constants.js';
4
4
  import { StepEffect } from './step-effect.js';
@@ -38,6 +38,9 @@ export const FlowAnchorSchema = z.discriminatedUnion('kind', [
38
38
  z.object({
39
39
  kind: z.literal(AnchorKind.TESTID),
40
40
  value: z.string().min(1),
41
+ // How many elements carried this test id when the step was recorded, when more than one did.
42
+ // A replay takes the first, so a shared test id is named at save instead of found as a drift.
43
+ of: z.number().int().min(2).optional(),
41
44
  source: z
42
45
  .object({ file: z.string(), line: z.number(), column: z.number().optional() })
43
46
  .optional(),
@@ -142,8 +145,10 @@ const baseFlowStep = z.object({
142
145
  effect: z.nativeEnum(StepEffect).optional(),
143
146
  /** Rebound by `heal` rather than recorded — see FlowStep.healed. */
144
147
  healed: z.object({ from: z.string(), at: z.number() }).optional(),
148
+ /** See FlowStep.writes. */
149
+ writes: z.boolean().optional(),
145
150
  action: z.nativeEnum(ActionType).optional(),
146
- args: z.record(z.unknown()).optional(),
151
+ args: z.record(z.string(), z.unknown()).optional(),
147
152
  expect: ExpectSchema.optional(),
148
153
  degraded: z.boolean().optional(),
149
154
  timeoutMs: z.number().int().nonnegative().optional(),
@@ -178,6 +183,13 @@ export const FlowFileSchema = z.object({
178
183
  * cannot actually check — flow-classify flags that gap.
179
184
  */
180
185
  intent: z.string().optional(),
186
+ /**
187
+ * True when `intent` was built from the steps' expects, not declared by anybody. An auto-saved
188
+ * drive with no declared intent was named by its request path and read as nothing. A built
189
+ * sentence names it, and this flag keeps it out of the intent ledger: it describes the steps, so
190
+ * it can never be a goal the steps then prove.
191
+ */
192
+ intentDerived: z.boolean().optional(),
181
193
  /**
182
194
  * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
183
195
  *
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Harness credits, as the platform grants them and as every surface says them.
2
+ * Credits, as the platform grants them and as every surface says them. They pay for the whole
3
+ * platform, not only the Harness, so every surface calls them credits.
3
4
  *
4
5
  * One file because the HUD's row and the daemon's refusal must say the same sentence: when the two
5
6
  * were written apart, the HUD offered "a free monthly allowance" the platform no longer grants.
@@ -10,8 +11,10 @@
10
11
  import { CreditKind } from './impact.js';
11
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
12
13
  export declare const TRIAL_DAYS = 14;
13
- /** What a new account is granted, and what a card's trial grants. The platform's numbers, said. */
14
- export declare const FREE_CREDITS = 10;
14
+ /**
15
+ * What a card's trial grants. No sign-up number: free credit is granted once per person, so the
16
+ * engine cannot know whether the reader still has any. Only the platform's `limit` says a count.
17
+ */
15
18
  export declare const TRIAL_CREDITS = 500;
16
19
  /** What a signed-out HUD says the Harness costs to try. */
17
20
  export declare const SIGN_UP_PITCH: string;
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Harness credits, as the platform grants them and as every surface says them.
2
+ * Credits, as the platform grants them and as every surface says them. They pay for the whole
3
+ * platform, not only the Harness, so every surface calls them credits.
3
4
  *
4
5
  * One file because the HUD's row and the daemon's refusal must say the same sentence: when the two
5
6
  * were written apart, the HUD offered "a free monthly allowance" the platform no longer grants.
@@ -10,15 +11,17 @@
10
11
  import { CreditKind } from './impact.js';
11
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
12
13
  export const TRIAL_DAYS = 14;
13
- /** What a new account is granted, and what a card's trial grants. The platform's numbers, said. */
14
- export const FREE_CREDITS = 10;
14
+ /**
15
+ * What a card's trial grants. No sign-up number: free credit is granted once per person, so the
16
+ * engine cannot know whether the reader still has any. Only the platform's `limit` says a count.
17
+ */
15
18
  export const TRIAL_CREDITS = 500;
16
19
  /** What a signed-out HUD says the Harness costs to try. */
17
- export const SIGN_UP_PITCH = `Sign up: ${String(FREE_CREDITS)} free credits to try Reticle Harness · ` +
20
+ export const SIGN_UP_PITCH = 'Sign up: free credits to try Reticle · ' +
18
21
  `add a card for a ${String(TRIAL_CREDITS)}-credit, ${String(TRIAL_DAYS)}-day trial`;
19
22
  /** The platform's offer, worded once: what a card starts, and what an account gets without one. */
20
- export const TRIAL_OFFER = `a card starts a ${String(TRIAL_DAYS)}-day trial with ${String(TRIAL_CREDITS)} Harness credits; ` +
21
- `without one, ${String(FREE_CREDITS)} sign-up credits`;
23
+ export const TRIAL_OFFER = `a card starts a ${String(TRIAL_DAYS)}-day trial with ${String(TRIAL_CREDITS)} credits; ` +
24
+ 'without one, free sign-up credits';
22
25
  /** A credit count: each model call is charged its exact share, so up to two decimals, never floored. */
23
26
  const count = (n) => n.toLocaleString('en-US', { maximumFractionDigits: 2 });
24
27
  /** Nothing left. An unbounded plan (no credits reported) never is. */
@@ -6,7 +6,7 @@
6
6
  * platform when a drive starts. A drive that misses its goal on one page looks it up here instead of
7
7
  * guessing, and the search before grading starts from it.
8
8
  */
9
- import { z } from 'zod';
9
+ import * as z from 'zod';
10
10
  /** Bounds on what one map holds: a dashboard's pages, not its rows. */
11
11
  export declare const HarnessMapLimit: {
12
12
  readonly PAGES: 40;
@@ -15,84 +15,23 @@ export declare const HarnessMapLimit: {
15
15
  readonly TEXT: 200;
16
16
  };
17
17
  export declare const HarnessMapPageSchema: z.ZodObject<{
18
- /** The page's path (and hash), without its query or Reticle's own parameters. */
19
18
  route: z.ZodString;
20
- /** Its first heading, when it has one. */
21
19
  heading: z.ZodOptional<z.ZodString>;
22
- /** The words it showed: headings, labels and text, in reading order. */
23
- texts: z.ZodArray<z.ZodString, "many">;
24
- /** Its controls, as `role "name"`. */
25
- controls: z.ZodArray<z.ZodString, "many">;
26
- /** How the survey got here: the control on the start page, or absent for the start page. */
20
+ texts: z.ZodArray<z.ZodString>;
21
+ controls: z.ZodArray<z.ZodString>;
27
22
  reachedBy: z.ZodOptional<z.ZodString>;
28
- /** When this page was last read (epoch ms, injected). */
29
23
  at: z.ZodNumber;
30
- }, "strip", z.ZodTypeAny, {
31
- route: string;
32
- at: number;
33
- texts: string[];
34
- controls: string[];
35
- heading?: string | undefined;
36
- reachedBy?: string | undefined;
37
- }, {
38
- route: string;
39
- at: number;
40
- texts: string[];
41
- controls: string[];
42
- heading?: string | undefined;
43
- reachedBy?: string | undefined;
44
- }>;
24
+ }, z.core.$strip>;
45
25
  export type HarnessMapPage = z.infer<typeof HarnessMapPageSchema>;
46
26
  export declare const HarnessMapSchema: z.ZodObject<{
47
- /** When the survey last ran (epoch ms, injected); a drive's own reads refresh pages, not this. */
48
27
  surveyedAt: z.ZodNumber;
49
28
  pages: z.ZodArray<z.ZodObject<{
50
- /** The page's path (and hash), without its query or Reticle's own parameters. */
51
29
  route: z.ZodString;
52
- /** Its first heading, when it has one. */
53
30
  heading: z.ZodOptional<z.ZodString>;
54
- /** The words it showed: headings, labels and text, in reading order. */
55
- texts: z.ZodArray<z.ZodString, "many">;
56
- /** Its controls, as `role "name"`. */
57
- controls: z.ZodArray<z.ZodString, "many">;
58
- /** How the survey got here: the control on the start page, or absent for the start page. */
31
+ texts: z.ZodArray<z.ZodString>;
32
+ controls: z.ZodArray<z.ZodString>;
59
33
  reachedBy: z.ZodOptional<z.ZodString>;
60
- /** When this page was last read (epoch ms, injected). */
61
34
  at: z.ZodNumber;
62
- }, "strip", z.ZodTypeAny, {
63
- route: string;
64
- at: number;
65
- texts: string[];
66
- controls: string[];
67
- heading?: string | undefined;
68
- reachedBy?: string | undefined;
69
- }, {
70
- route: string;
71
- at: number;
72
- texts: string[];
73
- controls: string[];
74
- heading?: string | undefined;
75
- reachedBy?: string | undefined;
76
- }>, "many">;
77
- }, "strip", z.ZodTypeAny, {
78
- surveyedAt: number;
79
- pages: {
80
- route: string;
81
- at: number;
82
- texts: string[];
83
- controls: string[];
84
- heading?: string | undefined;
85
- reachedBy?: string | undefined;
86
- }[];
87
- }, {
88
- surveyedAt: number;
89
- pages: {
90
- route: string;
91
- at: number;
92
- texts: string[];
93
- controls: string[];
94
- heading?: string | undefined;
95
- reachedBy?: string | undefined;
96
- }[];
97
- }>;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>;
98
37
  export type HarnessMap = z.infer<typeof HarnessMapSchema>;
@@ -6,7 +6,7 @@
6
6
  * platform when a drive starts. A drive that misses its goal on one page looks it up here instead of
7
7
  * guessing, and the search before grading starts from it.
8
8
  */
9
- import { z } from 'zod';
9
+ import * as z from 'zod';
10
10
  /** Bounds on what one map holds: a dashboard's pages, not its rows. */
11
11
  export const HarnessMapLimit = {
12
12
  PAGES: 40,
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Everything here is pure. Fetching and caching live in the daemon; the clock arrives as an argument.
10
10
  */
11
- import { z } from 'zod';
11
+ import * as z from 'zod';
12
12
  /** Where the daemon reads the notices from. Overridable for self-hosting and tests. */
13
13
  export declare const HUD_NOTICES_URL = "https://reticle.sh/hud/notices.v1.json";
14
14
  export declare const NOTICES_FILE_VERSION = 1;
@@ -20,33 +20,9 @@ export declare const HudNoticeSchema: z.ZodObject<{
20
20
  detail: z.ZodOptional<z.ZodString>;
21
21
  cta: z.ZodOptional<z.ZodObject<{
22
22
  label: z.ZodString;
23
- url: z.ZodEffects<z.ZodString, string, string>;
24
- }, "strip", z.ZodTypeAny, {
25
- label: string;
26
- url: string;
27
- }, {
28
- label: string;
29
- url: string;
30
- }>>;
31
- }, "strip", z.ZodTypeAny, {
32
- id: string;
33
- title: string;
34
- detail?: string | undefined;
35
- kicker?: string | undefined;
36
- cta?: {
37
- label: string;
38
- url: string;
39
- } | undefined;
40
- }, {
41
- id: string;
42
- title: string;
43
- detail?: string | undefined;
44
- kicker?: string | undefined;
45
- cta?: {
46
- label: string;
47
- url: string;
48
- } | undefined;
49
- }>;
23
+ url: z.ZodString;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
50
26
  export type HudNotice = z.infer<typeof HudNoticeSchema>;
51
27
  /** One entry in the file: a notice plus who sees it and when. */
52
28
  export declare const HudNoticeEntrySchema: z.ZodObject<{
@@ -56,67 +32,17 @@ export declare const HudNoticeEntrySchema: z.ZodObject<{
56
32
  detail: z.ZodOptional<z.ZodString>;
57
33
  cta: z.ZodOptional<z.ZodObject<{
58
34
  label: z.ZodString;
59
- url: z.ZodEffects<z.ZodString, string, string>;
60
- }, "strip", z.ZodTypeAny, {
61
- label: string;
62
- url: string;
63
- }, {
64
- label: string;
65
- url: string;
66
- }>>;
67
- } & {
35
+ url: z.ZodString;
36
+ }, z.core.$strip>>;
68
37
  audience: z.ZodOptional<z.ZodObject<{
69
38
  signedIn: z.ZodOptional<z.ZodBoolean>;
70
39
  entitled: z.ZodOptional<z.ZodBoolean>;
71
- }, "strip", z.ZodTypeAny, {
72
- signedIn?: boolean | undefined;
73
- entitled?: boolean | undefined;
74
- }, {
75
- signedIn?: boolean | undefined;
76
- entitled?: boolean | undefined;
77
- }>>;
78
- /** ISO dates. Shown from `from` (inclusive) until `until` (exclusive). */
40
+ }, z.core.$strip>>;
79
41
  from: z.ZodOptional<z.ZodString>;
80
42
  until: z.ZodOptional<z.ZodString>;
81
- /** Oldest SDK that can show it, e.g. "x.y.z". */
82
43
  minSdk: z.ZodOptional<z.ZodString>;
83
- /** Higher shows first. */
84
44
  weight: z.ZodOptional<z.ZodNumber>;
85
- }, "strip", z.ZodTypeAny, {
86
- id: string;
87
- title: string;
88
- from?: string | undefined;
89
- detail?: string | undefined;
90
- until?: string | undefined;
91
- kicker?: string | undefined;
92
- cta?: {
93
- label: string;
94
- url: string;
95
- } | undefined;
96
- audience?: {
97
- signedIn?: boolean | undefined;
98
- entitled?: boolean | undefined;
99
- } | undefined;
100
- minSdk?: string | undefined;
101
- weight?: number | undefined;
102
- }, {
103
- id: string;
104
- title: string;
105
- from?: string | undefined;
106
- detail?: string | undefined;
107
- until?: string | undefined;
108
- kicker?: string | undefined;
109
- cta?: {
110
- label: string;
111
- url: string;
112
- } | undefined;
113
- audience?: {
114
- signedIn?: boolean | undefined;
115
- entitled?: boolean | undefined;
116
- } | undefined;
117
- minSdk?: string | undefined;
118
- weight?: number | undefined;
119
- }>;
45
+ }, z.core.$strip>;
120
46
  export type HudNoticeEntry = z.infer<typeof HudNoticeEntrySchema>;
121
47
  /**
122
48
  * The entries in a notices file this SDK understands. An unknown version or shape answers nothing,
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Everything here is pure. Fetching and caching live in the daemon; the clock arrives as an argument.
10
10
  */
11
- import { z } from 'zod';
11
+ import * as z from 'zod';
12
12
  /** Where the daemon reads the notices from. Overridable for self-hosting and tests. */
13
13
  export const HUD_NOTICES_URL = 'https://reticle.sh/hud/notices.v1.json';
14
14
  export const NOTICES_FILE_VERSION = 1;