@reticlehq/core 3.8.0 → 3.8.2

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 (97) hide show
  1. package/dist/artifacts/drive-script.d.ts +84 -1217
  2. package/dist/artifacts/drive-script.js +1 -1
  3. package/dist/artifacts/flow-expect-flat.d.ts +8 -192
  4. package/dist/artifacts/flow-expect-flat.js +2 -2
  5. package/dist/artifacts/flow-results.d.ts +15 -0
  6. package/dist/artifacts/flow-types.d.ts +202 -2331
  7. package/dist/artifacts/flow-types.js +2 -2
  8. package/dist/artifacts/harness-map.d.ts +8 -69
  9. package/dist/artifacts/harness-map.js +1 -1
  10. package/dist/artifacts/hud-notices.d.ts +8 -82
  11. package/dist/artifacts/hud-notices.js +1 -1
  12. package/dist/artifacts/impact.d.ts +80 -1638
  13. package/dist/artifacts/impact.js +4 -4
  14. package/dist/artifacts/journal.d.ts +12 -247
  15. package/dist/artifacts/journal.js +2 -2
  16. package/dist/artifacts/prompt-context.d.ts +5 -43
  17. package/dist/artifacts/prompt-context.js +1 -1
  18. package/dist/artifacts/screenshot-upload.d.ts +3 -26
  19. package/dist/artifacts/screenshot-upload.js +1 -1
  20. package/dist/hooks/hook-events.d.ts +15 -171
  21. package/dist/hooks/hook-events.js +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/onboarding.d.ts +8 -58
  25. package/dist/onboarding.js +1 -1
  26. package/dist/registry/daemon-registry.d.ts +2 -14
  27. package/dist/registry/daemon-registry.js +1 -1
  28. package/dist/registry/dev-server-registry.d.ts +2 -31
  29. package/dist/registry/dev-server-registry.js +1 -1
  30. package/dist/registry/project-registry.d.ts +4 -32
  31. package/dist/registry/project-registry.js +1 -1
  32. package/dist/schema/command-message.json +65 -68
  33. package/dist/schema/command-name.json +29 -33
  34. package/dist/schema/command-result.json +25 -30
  35. package/dist/schema/event-message.json +104 -103
  36. package/dist/schema/event-payloads.json +142 -119
  37. package/dist/schema/event-type.json +47 -50
  38. package/dist/schema/hello-message.json +150 -154
  39. package/dist/schema/reticle-event.json +98 -96
  40. package/dist/schema/reticle-message.json +338 -333
  41. package/dist/telemetry-bug.d.ts +4 -75
  42. package/dist/telemetry-bug.js +1 -1
  43. package/dist/telemetry-feedback.d.ts +11 -99
  44. package/dist/telemetry-feedback.js +1 -1
  45. package/dist/telemetry-refusal.d.ts +4 -31
  46. package/dist/telemetry-refusal.js +1 -1
  47. package/dist/telemetry-session.d.ts +39 -633
  48. package/dist/telemetry-session.js +10 -8
  49. package/dist/telemetry-signals.d.ts +58 -151
  50. package/dist/telemetry-signals.js +12 -1
  51. package/dist/telemetry.d.ts +137 -1814
  52. package/dist/telemetry.js +1 -1
  53. package/dist/verdict/compare-source.d.ts +1 -1
  54. package/dist/verdict/compare-source.js +1 -1
  55. package/dist/verdict/disparity.d.ts +8 -56
  56. package/dist/verdict/disparity.js +1 -1
  57. package/dist/verdict/instrumentation-coverage.d.ts +3 -3
  58. package/dist/verdict/instrumentation-coverage.js +1 -1
  59. package/dist/verdict/instrumentation-gap.d.ts +3 -10
  60. package/dist/verdict/instrumentation-gap.js +1 -1
  61. package/dist/verdict/intent.d.ts +25 -224
  62. package/dist/verdict/intent.js +1 -1
  63. package/dist/verdict/predicate.d.ts +1 -1
  64. package/dist/verdict/predicate.js +5 -5
  65. package/dist/verdict/property-assertion.d.ts +23 -101
  66. package/dist/verdict/property-assertion.js +1 -1
  67. package/dist/verdict/run-report.d.ts +13 -108
  68. package/dist/verdict/run-report.js +1 -1
  69. package/dist/verdict/security.d.ts +12 -0
  70. package/dist/verdict/security.js +94 -7
  71. package/dist/verdict/verification-run.d.ts +112 -1668
  72. package/dist/verdict/verification-run.js +4 -4
  73. package/dist/verdict/verify-progress.d.ts +22 -64
  74. package/dist/verdict/verify-progress.js +1 -1
  75. package/dist/wire/click-input.d.ts +15 -0
  76. package/dist/wire/click-input.js +42 -0
  77. package/dist/wire/constants/event-types.d.ts +2 -0
  78. package/dist/wire/constants/event-types.js +2 -0
  79. package/dist/wire/constants/response-body-reason.d.ts +4 -4
  80. package/dist/wire/constants/response-body-reason.js +4 -4
  81. package/dist/wire/constants/reticle-env.d.ts +2 -0
  82. package/dist/wire/constants/reticle-env.js +2 -0
  83. package/dist/wire/event-payloads.d.ts +108 -678
  84. package/dist/wire/event-payloads.js +24 -7
  85. package/dist/wire/event-priority.js +1 -0
  86. package/dist/wire/messages.d.ts +66 -755
  87. package/dist/wire/messages.js +3 -3
  88. package/dist/wire/next-step.d.ts +11 -51
  89. package/dist/wire/next-step.js +1 -1
  90. package/dist/wire/platform-link.js +2 -2
  91. package/dist/wire/production/production-policy.d.ts +37 -83
  92. package/dist/wire/production/production-policy.js +1 -1
  93. package/dist/wire/types.d.ts +75 -698
  94. package/dist/wire/types.js +5 -5
  95. package/dist/words/upgrade.d.ts +3 -13
  96. package/dist/words/upgrade.js +1 -1
  97. package/package.json +4 -5
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * Daemon-side only: the HUD draws a plan from a flat view of it (`PlanView`), never this schema.
16
16
  */
17
- import { z } from 'zod';
17
+ import * as z from 'zod';
18
18
  import { PredicateSchema } from '../verdict/predicate.js';
19
19
  export const ScriptStepKind = {
20
20
  REPLAY: 'replay',
@@ -10,7 +10,7 @@
10
10
  * in memory is lifted. That is what makes the migration safe to ship to people whose flows are
11
11
  * committed to a repository they share.
12
12
  */
13
- import { z } from 'zod';
13
+ import * as z from 'zod';
14
14
  import type { Predicate } from '../verdict/predicate.js';
15
15
  /**
16
16
  * A post-condition a step asserts (compiled from a structured annotation; optional).
@@ -22,225 +22,41 @@ import type { Predicate } from '../verdict/predicate.js';
22
22
  * flow then replays green against nothing, having proved no real regression.
23
23
  */
24
24
  export declare const FlowExpectSchema: z.ZodObject<{
25
- /**
26
- * The route the step must have reached — the consequence of a NAVIGATION.
27
- *
28
- * Absent until now, and its absence was not a corner case: navigation is one of the commonest
29
- * journeys there is, and every route-asserted drive saved a flow that could never go red. Found
30
- * by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
31
- * `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
32
- *
33
- * Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
34
- * stays 1 — the same treatment `signalData` and `signalCount` had.
35
- */
36
25
  route: z.ZodOptional<z.ZodObject<{
37
26
  pathname: z.ZodOptional<z.ZodString>;
38
27
  contains: z.ZodOptional<z.ZodString>;
39
- }, "strip", z.ZodTypeAny, {
40
- contains?: string | undefined;
41
- pathname?: string | undefined;
42
- }, {
43
- contains?: string | undefined;
44
- pathname?: string | undefined;
45
- }>>;
28
+ }, z.core.$strip>>;
46
29
  signal: z.ZodOptional<z.ZodString>;
47
- /**
48
- * Optional payload shape an `assert-signal` annotation requires the signal
49
- * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
50
- * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
51
- */
52
30
  signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
- /**
54
- * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
55
- * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
56
- * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
57
- * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
58
- * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
59
- */
60
31
  signalCount: z.ZodOptional<z.ZodNumber>;
61
32
  net: z.ZodOptional<z.ZodObject<{
62
33
  method: z.ZodOptional<z.ZodString>;
63
34
  urlContains: z.ZodOptional<z.ZodString>;
64
35
  status: z.ZodOptional<z.ZodNumber>;
65
- /**
66
- * Exact number of matching requests since the action — turns presence into a cardinality
67
- * assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
68
- * the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
69
- */
70
36
  count: z.ZodOptional<z.ZodNumber>;
71
- }, "strict", z.ZodTypeAny, {
72
- status?: number | undefined;
73
- method?: string | undefined;
74
- urlContains?: string | undefined;
75
- count?: number | undefined;
76
- }, {
77
- status?: number | undefined;
78
- method?: string | undefined;
79
- urlContains?: string | undefined;
80
- count?: number | undefined;
81
- }>>;
82
- /**
83
- * Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
84
- * console message at `level` (default 'error'). `absent:true` is the common case — "the action
85
- * completed with a clean console" — catching the regression where an action throws a caught error
86
- * / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
87
- */
37
+ }, z.core.$strict>>;
88
38
  console: z.ZodOptional<z.ZodObject<{
89
39
  level: z.ZodOptional<z.ZodString>;
90
40
  absent: z.ZodOptional<z.ZodBoolean>;
91
- }, "strict", z.ZodTypeAny, {
92
- level?: string | undefined;
93
- absent?: boolean | undefined;
94
- }, {
95
- level?: string | undefined;
96
- absent?: boolean | undefined;
97
- }>>;
41
+ }, z.core.$strict>>;
98
42
  element: z.ZodOptional<z.ZodObject<{
99
43
  testid: z.ZodOptional<z.ZodString>;
100
44
  role: z.ZodOptional<z.ZodString>;
101
45
  name: z.ZodOptional<z.ZodString>;
102
- }, "strict", z.ZodTypeAny, {
103
- name?: string | undefined;
104
- testid?: string | undefined;
105
- role?: string | undefined;
106
- }, {
107
- name?: string | undefined;
108
- testid?: string | undefined;
109
- role?: string | undefined;
110
- }>>;
111
- /**
112
- * Rendered text as an end-condition, using the shapes the assert surface already accepts.
113
- *
114
- * The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
115
- * network call on the interaction under test -- a discount price computed and rendered, a
116
- * formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
117
- * vocabulary offered needed a channel that app does not have, so the only honest outcome was
118
- * `assertion-free`, which is a permanent green (#811).
119
- *
120
- * Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
121
- * that could not be pinned.
122
- *
123
- * Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
124
- * DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
125
- * which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
126
- */
46
+ }, z.core.$strict>>;
127
47
  text: z.ZodOptional<z.ZodObject<{
128
48
  contains: z.ZodString;
129
- /** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
130
49
  scope: z.ZodOptional<z.ZodString>;
131
- /** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
132
50
  absent: z.ZodOptional<z.ZodBoolean>;
133
- /** Require the match to be visible, not merely present in the DOM. */
134
51
  visible: z.ZodOptional<z.ZodBoolean>;
135
- }, "strict", z.ZodTypeAny, {
136
- contains: string;
137
- scope?: string | undefined;
138
- visible?: boolean | undefined;
139
- absent?: boolean | undefined;
140
- }, {
141
- contains: string;
142
- scope?: string | undefined;
143
- visible?: boolean | undefined;
144
- absent?: boolean | undefined;
145
- }>>;
146
- /**
147
- * Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
148
- * to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
149
- * and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
150
- * or a `{ $gte | $contains | $length }` operator pattern.
151
- */
52
+ }, z.core.$strict>>;
152
53
  state: z.ZodOptional<z.ZodObject<{
153
54
  store: z.ZodOptional<z.ZodString>;
154
55
  path: z.ZodString;
155
56
  equals: z.ZodOptional<z.ZodUnknown>;
156
- /**
157
- * Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
158
- * condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
159
- * moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
160
- */
161
57
  hold: z.ZodOptional<z.ZodBoolean>;
162
- }, "strict", z.ZodTypeAny, {
163
- path: string;
164
- hold?: boolean | undefined;
165
- store?: string | undefined;
166
- equals?: unknown;
167
- }, {
168
- path: string;
169
- hold?: boolean | undefined;
170
- store?: string | undefined;
171
- equals?: unknown;
172
- }>>;
173
- }, "strict", z.ZodTypeAny, {
174
- signal?: string | undefined;
175
- net?: {
176
- status?: number | undefined;
177
- method?: string | undefined;
178
- urlContains?: string | undefined;
179
- count?: number | undefined;
180
- } | undefined;
181
- state?: {
182
- path: string;
183
- hold?: boolean | undefined;
184
- store?: string | undefined;
185
- equals?: unknown;
186
- } | undefined;
187
- element?: {
188
- name?: string | undefined;
189
- testid?: string | undefined;
190
- role?: string | undefined;
191
- } | undefined;
192
- text?: {
193
- contains: string;
194
- scope?: string | undefined;
195
- visible?: boolean | undefined;
196
- absent?: boolean | undefined;
197
- } | undefined;
198
- route?: {
199
- contains?: string | undefined;
200
- pathname?: string | undefined;
201
- } | undefined;
202
- console?: {
203
- level?: string | undefined;
204
- absent?: boolean | undefined;
205
- } | undefined;
206
- signalData?: Record<string, unknown> | undefined;
207
- signalCount?: number | undefined;
208
- }, {
209
- signal?: string | undefined;
210
- net?: {
211
- status?: number | undefined;
212
- method?: string | undefined;
213
- urlContains?: string | undefined;
214
- count?: number | undefined;
215
- } | undefined;
216
- state?: {
217
- path: string;
218
- hold?: boolean | undefined;
219
- store?: string | undefined;
220
- equals?: unknown;
221
- } | undefined;
222
- element?: {
223
- name?: string | undefined;
224
- testid?: string | undefined;
225
- role?: string | undefined;
226
- } | undefined;
227
- text?: {
228
- contains: string;
229
- scope?: string | undefined;
230
- visible?: boolean | undefined;
231
- absent?: boolean | undefined;
232
- } | undefined;
233
- route?: {
234
- contains?: string | undefined;
235
- pathname?: string | undefined;
236
- } | undefined;
237
- console?: {
238
- level?: string | undefined;
239
- absent?: boolean | undefined;
240
- } | undefined;
241
- signalData?: Record<string, unknown> | undefined;
242
- signalCount?: number | undefined;
243
- }>;
58
+ }, z.core.$strict>>;
59
+ }, z.core.$strict>;
244
60
  export type FlowExpect = z.infer<typeof FlowExpectSchema>;
245
61
  /**
246
62
  * Lift a flat `FlowExpect` into the predicate a current file stores directly.
@@ -10,7 +10,7 @@
10
10
  * in memory is lifted. That is what makes the migration safe to ship to people whose flows are
11
11
  * committed to a repository they share.
12
12
  */
13
- import { z } from 'zod';
13
+ import * as z from 'zod';
14
14
  import { PredicateKind } from '../verdict/consequence.js';
15
15
  /**
16
16
  * A post-condition a step asserts (compiled from a structured annotation; optional).
@@ -43,7 +43,7 @@ export const FlowExpectSchema = z
43
43
  * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
44
44
  * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
45
45
  */
46
- signalData: z.record(z.unknown()).optional(),
46
+ signalData: z.record(z.string(), z.unknown()).optional(),
47
47
  /**
48
48
  * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
49
49
  * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
@@ -388,6 +388,12 @@ export interface FlowReplayResult {
388
388
  atStep: number;
389
389
  notAttempted: number;
390
390
  };
391
+ /**
392
+ * Set when replay waited for the start page longer than the step budget, because the leased tab
393
+ * said the page was still loading (a cold dev server compiling the route). Absent means the wait
394
+ * stayed inside the budget.
395
+ */
396
+ startPageWait?: StartPageWait;
391
397
  /**
392
398
  * Set on an `ok` replay whose flow cannot fail: it asserts no observable consequence, or has no
393
399
  * steps at all. The replay genuinely completed, so the status stays `ok` — but a bare `ok` read
@@ -425,6 +431,15 @@ export interface FlowReplayResult {
425
431
  status: string;
426
432
  }[];
427
433
  }
434
+ /** How long replay waited for a start page that was still loading. */
435
+ export interface StartPageWait {
436
+ /** From the navigation to the page connecting, or to replay giving up. */
437
+ waitedMs: number;
438
+ /** The step budget the wait went past. */
439
+ budgetMs: number;
440
+ /** What the tab said the last time replay asked. True when replay gave up means it gave up at the cap. */
441
+ stillLoading: boolean;
442
+ }
428
443
  /** A concrete, confidence-scored rebind proposed for one drifted step. */
429
444
  export interface HealProposal {
430
445
  /** 0-based step index in the flow. */