@reticlehq/core 3.5.0 → 3.7.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 (113) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +4 -0
  2. package/dist/artifacts/artifacts-entry.js +4 -0
  3. package/dist/artifacts/drive-script.d.ts +1404 -0
  4. package/dist/artifacts/drive-script.js +220 -0
  5. package/dist/artifacts/flow-constants.d.ts +19 -0
  6. package/dist/artifacts/flow-constants.js +21 -0
  7. package/dist/artifacts/flow-results.d.ts +450 -0
  8. package/dist/artifacts/flow-results.js +1 -0
  9. package/dist/artifacts/flow-types.d.ts +75 -427
  10. package/dist/artifacts/flow-types.js +15 -2
  11. package/dist/artifacts/harness-credits.d.ts +39 -0
  12. package/dist/artifacts/harness-credits.js +69 -0
  13. package/dist/artifacts/harness-map.d.ts +98 -0
  14. package/dist/artifacts/harness-map.js +36 -0
  15. package/dist/artifacts/hud-notices.d.ts +134 -0
  16. package/dist/artifacts/hud-notices.js +124 -0
  17. package/dist/artifacts/impact.d.ts +489 -189
  18. package/dist/artifacts/impact.js +90 -47
  19. package/dist/artifacts/journal.d.ts +105 -5
  20. package/dist/artifacts/journal.js +41 -0
  21. package/dist/artifacts/prompt-context.d.ts +105 -0
  22. package/dist/artifacts/prompt-context.js +108 -0
  23. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  24. package/dist/artifacts/screenshot-upload.js +26 -0
  25. package/dist/desktop-contract.cjs +1 -0
  26. package/dist/desktop-contract.d.cts +1 -0
  27. package/dist/hooks/hook-events.d.ts +4 -4
  28. package/dist/hud-entry.d.ts +2 -0
  29. package/dist/hud-entry.js +4 -0
  30. package/dist/identity/contract-fingerprint.d.ts +9 -0
  31. package/dist/identity/contract-fingerprint.js +12 -0
  32. package/dist/identity/testid-attribute.d.ts +18 -0
  33. package/dist/identity/testid-attribute.js +24 -0
  34. package/dist/index.d.ts +9 -1
  35. package/dist/index.js +9 -1
  36. package/dist/onboarding.d.ts +10 -2
  37. package/dist/onboarding.js +6 -0
  38. package/dist/realm/registry.js +19 -1
  39. package/dist/schema/command-message.json +36 -0
  40. package/dist/schema/command-name.json +5 -1
  41. package/dist/schema/event-payloads.json +56 -2
  42. package/dist/schema/reticle-message.json +36 -0
  43. package/dist/telemetry-bug.d.ts +169 -0
  44. package/dist/telemetry-bug.js +123 -0
  45. package/dist/telemetry-entry.d.ts +1 -0
  46. package/dist/telemetry-entry.js +1 -0
  47. package/dist/telemetry-feedback.d.ts +2 -2
  48. package/dist/telemetry-refusal.d.ts +5 -4
  49. package/dist/telemetry-session.d.ts +79 -1
  50. package/dist/telemetry-session.js +57 -1
  51. package/dist/telemetry-signals.d.ts +339 -0
  52. package/dist/telemetry-signals.js +138 -0
  53. package/dist/telemetry.d.ts +330 -276
  54. package/dist/telemetry.js +40 -115
  55. package/dist/tour.d.ts +1 -0
  56. package/dist/tour.js +13 -5
  57. package/dist/verdict/consequence.d.ts +3 -0
  58. package/dist/verdict/disparity.d.ts +105 -0
  59. package/dist/verdict/disparity.js +40 -0
  60. package/dist/verdict/findings.d.ts +11 -0
  61. package/dist/verdict/findings.js +16 -0
  62. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  63. package/dist/verdict/instrumentation-coverage.js +226 -0
  64. package/dist/verdict/instrumentation-gap.js +1 -1
  65. package/dist/verdict/intent.d.ts +19 -5
  66. package/dist/verdict/intent.js +13 -1
  67. package/dist/verdict/predicate-tree.d.ts +15 -0
  68. package/dist/verdict/predicate-tree.js +21 -0
  69. package/dist/verdict/predicate.d.ts +28 -0
  70. package/dist/verdict/predicate.js +94 -15
  71. package/dist/verdict/security.d.ts +25 -0
  72. package/dist/verdict/security.js +82 -0
  73. package/dist/verdict/verdict-attribution.js +1 -0
  74. package/dist/verdict/verification-run.d.ts +638 -32
  75. package/dist/verdict/verification-run.js +90 -0
  76. package/dist/verdict/verified-constants.d.ts +19 -0
  77. package/dist/verdict/verified-constants.js +22 -0
  78. package/dist/wire/constants/constants.d.ts +60 -32
  79. package/dist/wire/constants/constants.js +61 -33
  80. package/dist/wire/constants/hud-controls.d.ts +1 -1
  81. package/dist/wire/constants/hud-controls.js +34 -1
  82. package/dist/wire/constants/hud-use.d.ts +89 -1
  83. package/dist/wire/constants/hud-use.js +62 -1
  84. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  85. package/dist/wire/constants/mcp-wire.js +10 -0
  86. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  87. package/dist/wire/constants/reticle-chrome.js +19 -0
  88. package/dist/wire/constants/session-constants.d.ts +21 -0
  89. package/dist/wire/constants/session-constants.js +21 -0
  90. package/dist/wire/desktop-contract.d.ts +11 -0
  91. package/dist/wire/desktop-contract.js +14 -0
  92. package/dist/wire/event-payloads.d.ts +77 -4
  93. package/dist/wire/event-payloads.js +27 -0
  94. package/dist/wire/global-press.d.ts +34 -3
  95. package/dist/wire/global-press.js +91 -3
  96. package/dist/wire/hold.d.ts +14 -0
  97. package/dist/wire/hold.js +18 -0
  98. package/dist/wire/messages.d.ts +129 -32
  99. package/dist/wire/messages.js +17 -1
  100. package/dist/wire/platform-link.d.ts +238 -0
  101. package/dist/wire/platform-link.js +234 -0
  102. package/dist/wire/tool-names.d.ts +2 -0
  103. package/dist/wire/tool-names.js +2 -0
  104. package/dist/wire/types.d.ts +26 -6
  105. package/dist/wire/types.js +5 -0
  106. package/dist/words/no-session-reason.d.ts +7 -0
  107. package/dist/words/no-session-reason.js +7 -0
  108. package/dist/words/notices.d.ts +1 -1
  109. package/dist/words/notices.js +5 -3
  110. package/dist/words/upgrade.js +1 -1
  111. package/dist/words/writing-rule.d.ts +14 -0
  112. package/dist/words/writing-rule.js +17 -0
  113. package/package.json +1 -1
@@ -0,0 +1,1404 @@
1
+ /**
2
+ * A drive script: the Harness's plan, written down before it drives, in a language small enough to
3
+ * check.
4
+ *
5
+ * Journeys say WHAT to drive: replay a saved flow (deterministic, no model), act and wait on one
6
+ * exact control, hand an open goal to the model, assert a consequence. Lanes say HOW: each lane is
7
+ * one browser context driven in order, and lanes run side by side. A journey that needs another one
8
+ * either follows it in the same lane (and inherits its page) or waits on it from a later lane (a
9
+ * barrier: it starts once that journey passed, and is blocked if it failed).
10
+ *
11
+ * A checkpoint names a point a journey can come back to, and how: replay a flow up to a step. A
12
+ * branch drives several cases from that point; every case after the first re-enters it first, so
13
+ * each case starts from the same page and not from wherever the previous case left it.
14
+ *
15
+ * Daemon-side only: the HUD draws a plan from a flat view of it (`PlanView`), never this schema.
16
+ */
17
+ import { z } from 'zod';
18
+ export declare const ScriptStepKind: {
19
+ readonly REPLAY: "replay";
20
+ readonly ACT: "act";
21
+ readonly ASSERT: "assert";
22
+ readonly CHECKPOINT: "checkpoint";
23
+ readonly BRANCH: "branch";
24
+ };
25
+ /** How a journey of a plan was answered: its saved flows replayed (no model), or the model drove it. */
26
+ export declare const JourneyBy: {
27
+ readonly REPLAY: "replay";
28
+ readonly MODEL: "model";
29
+ };
30
+ export type JourneyBy = (typeof JourneyBy)[keyof typeof JourneyBy];
31
+ export declare const ScriptSource: {
32
+ readonly LOCAL: "local";
33
+ readonly PLATFORM: "platform";
34
+ };
35
+ /** How the journey a condition names must have ended for the conditional one to run. */
36
+ export declare const JourneyOutcome: {
37
+ readonly PASSED: "passed";
38
+ readonly FAILED: "failed";
39
+ };
40
+ export type JourneyOutcome = (typeof JourneyOutcome)[keyof typeof JourneyOutcome];
41
+ declare const LeafStep: z.ZodUnion<[z.ZodObject<{
42
+ kind: z.ZodLiteral<"replay">;
43
+ flow: z.ZodString;
44
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
45
+ at: z.ZodOptional<z.ZodNumber>;
46
+ /** Stop before this step. Absent: the whole flow. */
47
+ to: z.ZodOptional<z.ZodNumber>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ kind: "replay";
50
+ flow: string;
51
+ at?: number | undefined;
52
+ to?: number | undefined;
53
+ }, {
54
+ kind: "replay";
55
+ flow: string;
56
+ at?: number | undefined;
57
+ to?: number | undefined;
58
+ }>, z.ZodEffects<z.ZodObject<{
59
+ kind: z.ZodLiteral<"act">;
60
+ /** Exact: a target, an action and the consequence that must follow. */
61
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
+ action: z.ZodOptional<z.ZodString>;
63
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
64
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
65
+ /** Open: what the model should accomplish, in plain words. */
66
+ goal: z.ZodOptional<z.ZodString>;
67
+ maxSteps: z.ZodOptional<z.ZodNumber>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ kind: "act";
70
+ goal?: string | undefined;
71
+ target?: Record<string, unknown> | undefined;
72
+ action?: string | undefined;
73
+ args?: Record<string, unknown> | undefined;
74
+ until?: import("../index.js").Predicate | undefined;
75
+ maxSteps?: number | undefined;
76
+ }, {
77
+ kind: "act";
78
+ goal?: string | undefined;
79
+ target?: Record<string, unknown> | undefined;
80
+ action?: string | undefined;
81
+ args?: Record<string, unknown> | undefined;
82
+ until?: import("../index.js").Predicate | undefined;
83
+ maxSteps?: number | undefined;
84
+ }>, {
85
+ kind: "act";
86
+ goal?: string | undefined;
87
+ target?: Record<string, unknown> | undefined;
88
+ action?: string | undefined;
89
+ args?: Record<string, unknown> | undefined;
90
+ until?: import("../index.js").Predicate | undefined;
91
+ maxSteps?: number | undefined;
92
+ }, {
93
+ kind: "act";
94
+ goal?: string | undefined;
95
+ target?: Record<string, unknown> | undefined;
96
+ action?: string | undefined;
97
+ args?: Record<string, unknown> | undefined;
98
+ until?: import("../index.js").Predicate | undefined;
99
+ maxSteps?: number | undefined;
100
+ }>, z.ZodObject<{
101
+ kind: z.ZodLiteral<"assert">;
102
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ kind: "assert";
105
+ predicate: import("../index.js").Predicate;
106
+ }, {
107
+ kind: "assert";
108
+ predicate: import("../index.js").Predicate;
109
+ }>]>;
110
+ export declare const ScriptStepSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
111
+ kind: z.ZodLiteral<"replay">;
112
+ flow: z.ZodString;
113
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
114
+ at: z.ZodOptional<z.ZodNumber>;
115
+ /** Stop before this step. Absent: the whole flow. */
116
+ to: z.ZodOptional<z.ZodNumber>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ kind: "replay";
119
+ flow: string;
120
+ at?: number | undefined;
121
+ to?: number | undefined;
122
+ }, {
123
+ kind: "replay";
124
+ flow: string;
125
+ at?: number | undefined;
126
+ to?: number | undefined;
127
+ }>, z.ZodEffects<z.ZodObject<{
128
+ kind: z.ZodLiteral<"act">;
129
+ /** Exact: a target, an action and the consequence that must follow. */
130
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
+ action: z.ZodOptional<z.ZodString>;
132
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
133
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
134
+ /** Open: what the model should accomplish, in plain words. */
135
+ goal: z.ZodOptional<z.ZodString>;
136
+ maxSteps: z.ZodOptional<z.ZodNumber>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ kind: "act";
139
+ goal?: string | undefined;
140
+ target?: Record<string, unknown> | undefined;
141
+ action?: string | undefined;
142
+ args?: Record<string, unknown> | undefined;
143
+ until?: import("../index.js").Predicate | undefined;
144
+ maxSteps?: number | undefined;
145
+ }, {
146
+ kind: "act";
147
+ goal?: string | undefined;
148
+ target?: Record<string, unknown> | undefined;
149
+ action?: string | undefined;
150
+ args?: Record<string, unknown> | undefined;
151
+ until?: import("../index.js").Predicate | undefined;
152
+ maxSteps?: number | undefined;
153
+ }>, {
154
+ kind: "act";
155
+ goal?: string | undefined;
156
+ target?: Record<string, unknown> | undefined;
157
+ action?: string | undefined;
158
+ args?: Record<string, unknown> | undefined;
159
+ until?: import("../index.js").Predicate | undefined;
160
+ maxSteps?: number | undefined;
161
+ }, {
162
+ kind: "act";
163
+ goal?: string | undefined;
164
+ target?: Record<string, unknown> | undefined;
165
+ action?: string | undefined;
166
+ args?: Record<string, unknown> | undefined;
167
+ until?: import("../index.js").Predicate | undefined;
168
+ maxSteps?: number | undefined;
169
+ }>, z.ZodObject<{
170
+ kind: z.ZodLiteral<"assert">;
171
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ kind: "assert";
174
+ predicate: import("../index.js").Predicate;
175
+ }, {
176
+ kind: "assert";
177
+ predicate: import("../index.js").Predicate;
178
+ }>]>, z.ZodObject<{
179
+ kind: z.ZodLiteral<"checkpoint">;
180
+ id: z.ZodString;
181
+ /** How to get back here: replay this flow up to (not including) step `to`. */
182
+ reenter: z.ZodObject<{
183
+ flow: z.ZodString;
184
+ to: z.ZodNumber;
185
+ }, "strip", z.ZodTypeAny, {
186
+ flow: string;
187
+ to: number;
188
+ }, {
189
+ flow: string;
190
+ to: number;
191
+ }>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ kind: "checkpoint";
194
+ id: string;
195
+ reenter: {
196
+ flow: string;
197
+ to: number;
198
+ };
199
+ }, {
200
+ kind: "checkpoint";
201
+ id: string;
202
+ reenter: {
203
+ flow: string;
204
+ to: number;
205
+ };
206
+ }>, z.ZodObject<{
207
+ kind: z.ZodLiteral<"branch">;
208
+ /** The checkpoint every case starts from. */
209
+ at: z.ZodString;
210
+ cases: z.ZodArray<z.ZodObject<{
211
+ label: z.ZodString;
212
+ /** Taken only when this holds once the checkpoint is re-entered. Absent: always taken. */
213
+ when: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
214
+ steps: z.ZodArray<z.ZodUnion<[z.ZodObject<{
215
+ kind: z.ZodLiteral<"replay">;
216
+ flow: z.ZodString;
217
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
218
+ at: z.ZodOptional<z.ZodNumber>;
219
+ /** Stop before this step. Absent: the whole flow. */
220
+ to: z.ZodOptional<z.ZodNumber>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ kind: "replay";
223
+ flow: string;
224
+ at?: number | undefined;
225
+ to?: number | undefined;
226
+ }, {
227
+ kind: "replay";
228
+ flow: string;
229
+ at?: number | undefined;
230
+ to?: number | undefined;
231
+ }>, z.ZodEffects<z.ZodObject<{
232
+ kind: z.ZodLiteral<"act">;
233
+ /** Exact: a target, an action and the consequence that must follow. */
234
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
235
+ action: z.ZodOptional<z.ZodString>;
236
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
237
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
238
+ /** Open: what the model should accomplish, in plain words. */
239
+ goal: z.ZodOptional<z.ZodString>;
240
+ maxSteps: z.ZodOptional<z.ZodNumber>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ kind: "act";
243
+ goal?: string | undefined;
244
+ target?: Record<string, unknown> | undefined;
245
+ action?: string | undefined;
246
+ args?: Record<string, unknown> | undefined;
247
+ until?: import("../index.js").Predicate | undefined;
248
+ maxSteps?: number | undefined;
249
+ }, {
250
+ kind: "act";
251
+ goal?: string | undefined;
252
+ target?: Record<string, unknown> | undefined;
253
+ action?: string | undefined;
254
+ args?: Record<string, unknown> | undefined;
255
+ until?: import("../index.js").Predicate | undefined;
256
+ maxSteps?: number | undefined;
257
+ }>, {
258
+ kind: "act";
259
+ goal?: string | undefined;
260
+ target?: Record<string, unknown> | undefined;
261
+ action?: string | undefined;
262
+ args?: Record<string, unknown> | undefined;
263
+ until?: import("../index.js").Predicate | undefined;
264
+ maxSteps?: number | undefined;
265
+ }, {
266
+ kind: "act";
267
+ goal?: string | undefined;
268
+ target?: Record<string, unknown> | undefined;
269
+ action?: string | undefined;
270
+ args?: Record<string, unknown> | undefined;
271
+ until?: import("../index.js").Predicate | undefined;
272
+ maxSteps?: number | undefined;
273
+ }>, z.ZodObject<{
274
+ kind: z.ZodLiteral<"assert">;
275
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ kind: "assert";
278
+ predicate: import("../index.js").Predicate;
279
+ }, {
280
+ kind: "assert";
281
+ predicate: import("../index.js").Predicate;
282
+ }>]>, "many">;
283
+ }, "strip", z.ZodTypeAny, {
284
+ label: string;
285
+ steps: ({
286
+ kind: "replay";
287
+ flow: string;
288
+ at?: number | undefined;
289
+ to?: number | undefined;
290
+ } | {
291
+ kind: "act";
292
+ goal?: string | undefined;
293
+ target?: Record<string, unknown> | undefined;
294
+ action?: string | undefined;
295
+ args?: Record<string, unknown> | undefined;
296
+ until?: import("../index.js").Predicate | undefined;
297
+ maxSteps?: number | undefined;
298
+ } | {
299
+ kind: "assert";
300
+ predicate: import("../index.js").Predicate;
301
+ })[];
302
+ when?: import("../index.js").Predicate | undefined;
303
+ }, {
304
+ label: string;
305
+ steps: ({
306
+ kind: "replay";
307
+ flow: string;
308
+ at?: number | undefined;
309
+ to?: number | undefined;
310
+ } | {
311
+ kind: "act";
312
+ goal?: string | undefined;
313
+ target?: Record<string, unknown> | undefined;
314
+ action?: string | undefined;
315
+ args?: Record<string, unknown> | undefined;
316
+ until?: import("../index.js").Predicate | undefined;
317
+ maxSteps?: number | undefined;
318
+ } | {
319
+ kind: "assert";
320
+ predicate: import("../index.js").Predicate;
321
+ })[];
322
+ when?: import("../index.js").Predicate | undefined;
323
+ }>, "many">;
324
+ }, "strip", z.ZodTypeAny, {
325
+ kind: "branch";
326
+ at: string;
327
+ cases: {
328
+ label: string;
329
+ steps: ({
330
+ kind: "replay";
331
+ flow: string;
332
+ at?: number | undefined;
333
+ to?: number | undefined;
334
+ } | {
335
+ kind: "act";
336
+ goal?: string | undefined;
337
+ target?: Record<string, unknown> | undefined;
338
+ action?: string | undefined;
339
+ args?: Record<string, unknown> | undefined;
340
+ until?: import("../index.js").Predicate | undefined;
341
+ maxSteps?: number | undefined;
342
+ } | {
343
+ kind: "assert";
344
+ predicate: import("../index.js").Predicate;
345
+ })[];
346
+ when?: import("../index.js").Predicate | undefined;
347
+ }[];
348
+ }, {
349
+ kind: "branch";
350
+ at: string;
351
+ cases: {
352
+ label: string;
353
+ steps: ({
354
+ kind: "replay";
355
+ flow: string;
356
+ at?: number | undefined;
357
+ to?: number | undefined;
358
+ } | {
359
+ kind: "act";
360
+ goal?: string | undefined;
361
+ target?: Record<string, unknown> | undefined;
362
+ action?: string | undefined;
363
+ args?: Record<string, unknown> | undefined;
364
+ until?: import("../index.js").Predicate | undefined;
365
+ maxSteps?: number | undefined;
366
+ } | {
367
+ kind: "assert";
368
+ predicate: import("../index.js").Predicate;
369
+ })[];
370
+ when?: import("../index.js").Predicate | undefined;
371
+ }[];
372
+ }>]>;
373
+ export declare const JourneySchema: z.ZodObject<{
374
+ id: z.ZodString;
375
+ title: z.ZodString;
376
+ persona: z.ZodOptional<z.ZodString>;
377
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
378
+ /**
379
+ * Run only when an earlier journey ended this way, else it is not taken: "if sign-in failed, the
380
+ * error says why". Unlike `dependsOn` it is not blocked by a failure; a failure can be the point.
381
+ */
382
+ when: z.ZodOptional<z.ZodObject<{
383
+ journey: z.ZodString;
384
+ is: z.ZodEnum<["passed", "failed"]>;
385
+ }, "strip", z.ZodTypeAny, {
386
+ is: "passed" | "failed";
387
+ journey: string;
388
+ }, {
389
+ is: "passed" | "failed";
390
+ journey: string;
391
+ }>>;
392
+ steps: z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
393
+ kind: z.ZodLiteral<"replay">;
394
+ flow: z.ZodString;
395
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
396
+ at: z.ZodOptional<z.ZodNumber>;
397
+ /** Stop before this step. Absent: the whole flow. */
398
+ to: z.ZodOptional<z.ZodNumber>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ kind: "replay";
401
+ flow: string;
402
+ at?: number | undefined;
403
+ to?: number | undefined;
404
+ }, {
405
+ kind: "replay";
406
+ flow: string;
407
+ at?: number | undefined;
408
+ to?: number | undefined;
409
+ }>, z.ZodEffects<z.ZodObject<{
410
+ kind: z.ZodLiteral<"act">;
411
+ /** Exact: a target, an action and the consequence that must follow. */
412
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
413
+ action: z.ZodOptional<z.ZodString>;
414
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
415
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
416
+ /** Open: what the model should accomplish, in plain words. */
417
+ goal: z.ZodOptional<z.ZodString>;
418
+ maxSteps: z.ZodOptional<z.ZodNumber>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ kind: "act";
421
+ goal?: string | undefined;
422
+ target?: Record<string, unknown> | undefined;
423
+ action?: string | undefined;
424
+ args?: Record<string, unknown> | undefined;
425
+ until?: import("../index.js").Predicate | undefined;
426
+ maxSteps?: number | undefined;
427
+ }, {
428
+ kind: "act";
429
+ goal?: string | undefined;
430
+ target?: Record<string, unknown> | undefined;
431
+ action?: string | undefined;
432
+ args?: Record<string, unknown> | undefined;
433
+ until?: import("../index.js").Predicate | undefined;
434
+ maxSteps?: number | undefined;
435
+ }>, {
436
+ kind: "act";
437
+ goal?: string | undefined;
438
+ target?: Record<string, unknown> | undefined;
439
+ action?: string | undefined;
440
+ args?: Record<string, unknown> | undefined;
441
+ until?: import("../index.js").Predicate | undefined;
442
+ maxSteps?: number | undefined;
443
+ }, {
444
+ kind: "act";
445
+ goal?: string | undefined;
446
+ target?: Record<string, unknown> | undefined;
447
+ action?: string | undefined;
448
+ args?: Record<string, unknown> | undefined;
449
+ until?: import("../index.js").Predicate | undefined;
450
+ maxSteps?: number | undefined;
451
+ }>, z.ZodObject<{
452
+ kind: z.ZodLiteral<"assert">;
453
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
454
+ }, "strip", z.ZodTypeAny, {
455
+ kind: "assert";
456
+ predicate: import("../index.js").Predicate;
457
+ }, {
458
+ kind: "assert";
459
+ predicate: import("../index.js").Predicate;
460
+ }>]>, z.ZodObject<{
461
+ kind: z.ZodLiteral<"checkpoint">;
462
+ id: z.ZodString;
463
+ /** How to get back here: replay this flow up to (not including) step `to`. */
464
+ reenter: z.ZodObject<{
465
+ flow: z.ZodString;
466
+ to: z.ZodNumber;
467
+ }, "strip", z.ZodTypeAny, {
468
+ flow: string;
469
+ to: number;
470
+ }, {
471
+ flow: string;
472
+ to: number;
473
+ }>;
474
+ }, "strip", z.ZodTypeAny, {
475
+ kind: "checkpoint";
476
+ id: string;
477
+ reenter: {
478
+ flow: string;
479
+ to: number;
480
+ };
481
+ }, {
482
+ kind: "checkpoint";
483
+ id: string;
484
+ reenter: {
485
+ flow: string;
486
+ to: number;
487
+ };
488
+ }>, z.ZodObject<{
489
+ kind: z.ZodLiteral<"branch">;
490
+ /** The checkpoint every case starts from. */
491
+ at: z.ZodString;
492
+ cases: z.ZodArray<z.ZodObject<{
493
+ label: z.ZodString;
494
+ /** Taken only when this holds once the checkpoint is re-entered. Absent: always taken. */
495
+ when: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
496
+ steps: z.ZodArray<z.ZodUnion<[z.ZodObject<{
497
+ kind: z.ZodLiteral<"replay">;
498
+ flow: z.ZodString;
499
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
500
+ at: z.ZodOptional<z.ZodNumber>;
501
+ /** Stop before this step. Absent: the whole flow. */
502
+ to: z.ZodOptional<z.ZodNumber>;
503
+ }, "strip", z.ZodTypeAny, {
504
+ kind: "replay";
505
+ flow: string;
506
+ at?: number | undefined;
507
+ to?: number | undefined;
508
+ }, {
509
+ kind: "replay";
510
+ flow: string;
511
+ at?: number | undefined;
512
+ to?: number | undefined;
513
+ }>, z.ZodEffects<z.ZodObject<{
514
+ kind: z.ZodLiteral<"act">;
515
+ /** Exact: a target, an action and the consequence that must follow. */
516
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
517
+ action: z.ZodOptional<z.ZodString>;
518
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
519
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
520
+ /** Open: what the model should accomplish, in plain words. */
521
+ goal: z.ZodOptional<z.ZodString>;
522
+ maxSteps: z.ZodOptional<z.ZodNumber>;
523
+ }, "strip", z.ZodTypeAny, {
524
+ kind: "act";
525
+ goal?: string | undefined;
526
+ target?: Record<string, unknown> | undefined;
527
+ action?: string | undefined;
528
+ args?: Record<string, unknown> | undefined;
529
+ until?: import("../index.js").Predicate | undefined;
530
+ maxSteps?: number | undefined;
531
+ }, {
532
+ kind: "act";
533
+ goal?: string | undefined;
534
+ target?: Record<string, unknown> | undefined;
535
+ action?: string | undefined;
536
+ args?: Record<string, unknown> | undefined;
537
+ until?: import("../index.js").Predicate | undefined;
538
+ maxSteps?: number | undefined;
539
+ }>, {
540
+ kind: "act";
541
+ goal?: string | undefined;
542
+ target?: Record<string, unknown> | undefined;
543
+ action?: string | undefined;
544
+ args?: Record<string, unknown> | undefined;
545
+ until?: import("../index.js").Predicate | undefined;
546
+ maxSteps?: number | undefined;
547
+ }, {
548
+ kind: "act";
549
+ goal?: string | undefined;
550
+ target?: Record<string, unknown> | undefined;
551
+ action?: string | undefined;
552
+ args?: Record<string, unknown> | undefined;
553
+ until?: import("../index.js").Predicate | undefined;
554
+ maxSteps?: number | undefined;
555
+ }>, z.ZodObject<{
556
+ kind: z.ZodLiteral<"assert">;
557
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
558
+ }, "strip", z.ZodTypeAny, {
559
+ kind: "assert";
560
+ predicate: import("../index.js").Predicate;
561
+ }, {
562
+ kind: "assert";
563
+ predicate: import("../index.js").Predicate;
564
+ }>]>, "many">;
565
+ }, "strip", z.ZodTypeAny, {
566
+ label: string;
567
+ steps: ({
568
+ kind: "replay";
569
+ flow: string;
570
+ at?: number | undefined;
571
+ to?: number | undefined;
572
+ } | {
573
+ kind: "act";
574
+ goal?: string | undefined;
575
+ target?: Record<string, unknown> | undefined;
576
+ action?: string | undefined;
577
+ args?: Record<string, unknown> | undefined;
578
+ until?: import("../index.js").Predicate | undefined;
579
+ maxSteps?: number | undefined;
580
+ } | {
581
+ kind: "assert";
582
+ predicate: import("../index.js").Predicate;
583
+ })[];
584
+ when?: import("../index.js").Predicate | undefined;
585
+ }, {
586
+ label: string;
587
+ steps: ({
588
+ kind: "replay";
589
+ flow: string;
590
+ at?: number | undefined;
591
+ to?: number | undefined;
592
+ } | {
593
+ kind: "act";
594
+ goal?: string | undefined;
595
+ target?: Record<string, unknown> | undefined;
596
+ action?: string | undefined;
597
+ args?: Record<string, unknown> | undefined;
598
+ until?: import("../index.js").Predicate | undefined;
599
+ maxSteps?: number | undefined;
600
+ } | {
601
+ kind: "assert";
602
+ predicate: import("../index.js").Predicate;
603
+ })[];
604
+ when?: import("../index.js").Predicate | undefined;
605
+ }>, "many">;
606
+ }, "strip", z.ZodTypeAny, {
607
+ kind: "branch";
608
+ at: string;
609
+ cases: {
610
+ label: string;
611
+ steps: ({
612
+ kind: "replay";
613
+ flow: string;
614
+ at?: number | undefined;
615
+ to?: number | undefined;
616
+ } | {
617
+ kind: "act";
618
+ goal?: string | undefined;
619
+ target?: Record<string, unknown> | undefined;
620
+ action?: string | undefined;
621
+ args?: Record<string, unknown> | undefined;
622
+ until?: import("../index.js").Predicate | undefined;
623
+ maxSteps?: number | undefined;
624
+ } | {
625
+ kind: "assert";
626
+ predicate: import("../index.js").Predicate;
627
+ })[];
628
+ when?: import("../index.js").Predicate | undefined;
629
+ }[];
630
+ }, {
631
+ kind: "branch";
632
+ at: string;
633
+ cases: {
634
+ label: string;
635
+ steps: ({
636
+ kind: "replay";
637
+ flow: string;
638
+ at?: number | undefined;
639
+ to?: number | undefined;
640
+ } | {
641
+ kind: "act";
642
+ goal?: string | undefined;
643
+ target?: Record<string, unknown> | undefined;
644
+ action?: string | undefined;
645
+ args?: Record<string, unknown> | undefined;
646
+ until?: import("../index.js").Predicate | undefined;
647
+ maxSteps?: number | undefined;
648
+ } | {
649
+ kind: "assert";
650
+ predicate: import("../index.js").Predicate;
651
+ })[];
652
+ when?: import("../index.js").Predicate | undefined;
653
+ }[];
654
+ }>]>, "many">;
655
+ /**
656
+ * Replay first: when every replay in `steps` decides nothing (neither held nor failed), the model
657
+ * drives this goal instead. A replay that failed is a regression and is never re-driven. An older
658
+ * platform omits it.
659
+ */
660
+ fallback: z.ZodOptional<z.ZodObject<{
661
+ goal: z.ZodString;
662
+ }, "strip", z.ZodTypeAny, {
663
+ goal: string;
664
+ }, {
665
+ goal: string;
666
+ }>>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ steps: ({
669
+ kind: "replay";
670
+ flow: string;
671
+ at?: number | undefined;
672
+ to?: number | undefined;
673
+ } | {
674
+ kind: "act";
675
+ goal?: string | undefined;
676
+ target?: Record<string, unknown> | undefined;
677
+ action?: string | undefined;
678
+ args?: Record<string, unknown> | undefined;
679
+ until?: import("../index.js").Predicate | undefined;
680
+ maxSteps?: number | undefined;
681
+ } | {
682
+ kind: "assert";
683
+ predicate: import("../index.js").Predicate;
684
+ } | {
685
+ kind: "checkpoint";
686
+ id: string;
687
+ reenter: {
688
+ flow: string;
689
+ to: number;
690
+ };
691
+ } | {
692
+ kind: "branch";
693
+ at: string;
694
+ cases: {
695
+ label: string;
696
+ steps: ({
697
+ kind: "replay";
698
+ flow: string;
699
+ at?: number | undefined;
700
+ to?: number | undefined;
701
+ } | {
702
+ kind: "act";
703
+ goal?: string | undefined;
704
+ target?: Record<string, unknown> | undefined;
705
+ action?: string | undefined;
706
+ args?: Record<string, unknown> | undefined;
707
+ until?: import("../index.js").Predicate | undefined;
708
+ maxSteps?: number | undefined;
709
+ } | {
710
+ kind: "assert";
711
+ predicate: import("../index.js").Predicate;
712
+ })[];
713
+ when?: import("../index.js").Predicate | undefined;
714
+ }[];
715
+ })[];
716
+ id: string;
717
+ title: string;
718
+ dependsOn: string[];
719
+ persona?: string | undefined;
720
+ when?: {
721
+ is: "passed" | "failed";
722
+ journey: string;
723
+ } | undefined;
724
+ fallback?: {
725
+ goal: string;
726
+ } | undefined;
727
+ }, {
728
+ steps: ({
729
+ kind: "replay";
730
+ flow: string;
731
+ at?: number | undefined;
732
+ to?: number | undefined;
733
+ } | {
734
+ kind: "act";
735
+ goal?: string | undefined;
736
+ target?: Record<string, unknown> | undefined;
737
+ action?: string | undefined;
738
+ args?: Record<string, unknown> | undefined;
739
+ until?: import("../index.js").Predicate | undefined;
740
+ maxSteps?: number | undefined;
741
+ } | {
742
+ kind: "assert";
743
+ predicate: import("../index.js").Predicate;
744
+ } | {
745
+ kind: "checkpoint";
746
+ id: string;
747
+ reenter: {
748
+ flow: string;
749
+ to: number;
750
+ };
751
+ } | {
752
+ kind: "branch";
753
+ at: string;
754
+ cases: {
755
+ label: string;
756
+ steps: ({
757
+ kind: "replay";
758
+ flow: string;
759
+ at?: number | undefined;
760
+ to?: number | undefined;
761
+ } | {
762
+ kind: "act";
763
+ goal?: string | undefined;
764
+ target?: Record<string, unknown> | undefined;
765
+ action?: string | undefined;
766
+ args?: Record<string, unknown> | undefined;
767
+ until?: import("../index.js").Predicate | undefined;
768
+ maxSteps?: number | undefined;
769
+ } | {
770
+ kind: "assert";
771
+ predicate: import("../index.js").Predicate;
772
+ })[];
773
+ when?: import("../index.js").Predicate | undefined;
774
+ }[];
775
+ })[];
776
+ id: string;
777
+ title: string;
778
+ persona?: string | undefined;
779
+ when?: {
780
+ is: "passed" | "failed";
781
+ journey: string;
782
+ } | undefined;
783
+ dependsOn?: string[] | undefined;
784
+ fallback?: {
785
+ goal: string;
786
+ } | undefined;
787
+ }>;
788
+ export declare const LaneSchema: z.ZodObject<{
789
+ id: z.ZodString;
790
+ /** Driven in this order, in one browser context. */
791
+ journeys: z.ZodArray<z.ZodString, "many">;
792
+ }, "strip", z.ZodTypeAny, {
793
+ id: string;
794
+ journeys: string[];
795
+ }, {
796
+ id: string;
797
+ journeys: string[];
798
+ }>;
799
+ export declare const DriveScriptSchema: z.ZodObject<{
800
+ version: z.ZodLiteral<1>;
801
+ source: z.ZodEnum<["local", "platform"]>;
802
+ personas: z.ZodDefault<z.ZodArray<z.ZodObject<{
803
+ name: z.ZodString;
804
+ journey: z.ZodString;
805
+ }, "strip", z.ZodTypeAny, {
806
+ name: string;
807
+ journey: string;
808
+ }, {
809
+ name: string;
810
+ journey: string;
811
+ }>, "many">>;
812
+ journeys: z.ZodArray<z.ZodObject<{
813
+ id: z.ZodString;
814
+ title: z.ZodString;
815
+ persona: z.ZodOptional<z.ZodString>;
816
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
817
+ /**
818
+ * Run only when an earlier journey ended this way, else it is not taken: "if sign-in failed, the
819
+ * error says why". Unlike `dependsOn` it is not blocked by a failure; a failure can be the point.
820
+ */
821
+ when: z.ZodOptional<z.ZodObject<{
822
+ journey: z.ZodString;
823
+ is: z.ZodEnum<["passed", "failed"]>;
824
+ }, "strip", z.ZodTypeAny, {
825
+ is: "passed" | "failed";
826
+ journey: string;
827
+ }, {
828
+ is: "passed" | "failed";
829
+ journey: string;
830
+ }>>;
831
+ steps: z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
832
+ kind: z.ZodLiteral<"replay">;
833
+ flow: z.ZodString;
834
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
835
+ at: z.ZodOptional<z.ZodNumber>;
836
+ /** Stop before this step. Absent: the whole flow. */
837
+ to: z.ZodOptional<z.ZodNumber>;
838
+ }, "strip", z.ZodTypeAny, {
839
+ kind: "replay";
840
+ flow: string;
841
+ at?: number | undefined;
842
+ to?: number | undefined;
843
+ }, {
844
+ kind: "replay";
845
+ flow: string;
846
+ at?: number | undefined;
847
+ to?: number | undefined;
848
+ }>, z.ZodEffects<z.ZodObject<{
849
+ kind: z.ZodLiteral<"act">;
850
+ /** Exact: a target, an action and the consequence that must follow. */
851
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
852
+ action: z.ZodOptional<z.ZodString>;
853
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
854
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
855
+ /** Open: what the model should accomplish, in plain words. */
856
+ goal: z.ZodOptional<z.ZodString>;
857
+ maxSteps: z.ZodOptional<z.ZodNumber>;
858
+ }, "strip", z.ZodTypeAny, {
859
+ kind: "act";
860
+ goal?: string | undefined;
861
+ target?: Record<string, unknown> | undefined;
862
+ action?: string | undefined;
863
+ args?: Record<string, unknown> | undefined;
864
+ until?: import("../index.js").Predicate | undefined;
865
+ maxSteps?: number | undefined;
866
+ }, {
867
+ kind: "act";
868
+ goal?: string | undefined;
869
+ target?: Record<string, unknown> | undefined;
870
+ action?: string | undefined;
871
+ args?: Record<string, unknown> | undefined;
872
+ until?: import("../index.js").Predicate | undefined;
873
+ maxSteps?: number | undefined;
874
+ }>, {
875
+ kind: "act";
876
+ goal?: string | undefined;
877
+ target?: Record<string, unknown> | undefined;
878
+ action?: string | undefined;
879
+ args?: Record<string, unknown> | undefined;
880
+ until?: import("../index.js").Predicate | undefined;
881
+ maxSteps?: number | undefined;
882
+ }, {
883
+ kind: "act";
884
+ goal?: string | undefined;
885
+ target?: Record<string, unknown> | undefined;
886
+ action?: string | undefined;
887
+ args?: Record<string, unknown> | undefined;
888
+ until?: import("../index.js").Predicate | undefined;
889
+ maxSteps?: number | undefined;
890
+ }>, z.ZodObject<{
891
+ kind: z.ZodLiteral<"assert">;
892
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
893
+ }, "strip", z.ZodTypeAny, {
894
+ kind: "assert";
895
+ predicate: import("../index.js").Predicate;
896
+ }, {
897
+ kind: "assert";
898
+ predicate: import("../index.js").Predicate;
899
+ }>]>, z.ZodObject<{
900
+ kind: z.ZodLiteral<"checkpoint">;
901
+ id: z.ZodString;
902
+ /** How to get back here: replay this flow up to (not including) step `to`. */
903
+ reenter: z.ZodObject<{
904
+ flow: z.ZodString;
905
+ to: z.ZodNumber;
906
+ }, "strip", z.ZodTypeAny, {
907
+ flow: string;
908
+ to: number;
909
+ }, {
910
+ flow: string;
911
+ to: number;
912
+ }>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ kind: "checkpoint";
915
+ id: string;
916
+ reenter: {
917
+ flow: string;
918
+ to: number;
919
+ };
920
+ }, {
921
+ kind: "checkpoint";
922
+ id: string;
923
+ reenter: {
924
+ flow: string;
925
+ to: number;
926
+ };
927
+ }>, z.ZodObject<{
928
+ kind: z.ZodLiteral<"branch">;
929
+ /** The checkpoint every case starts from. */
930
+ at: z.ZodString;
931
+ cases: z.ZodArray<z.ZodObject<{
932
+ label: z.ZodString;
933
+ /** Taken only when this holds once the checkpoint is re-entered. Absent: always taken. */
934
+ when: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
935
+ steps: z.ZodArray<z.ZodUnion<[z.ZodObject<{
936
+ kind: z.ZodLiteral<"replay">;
937
+ flow: z.ZodString;
938
+ /** Continue at this step on the page as it is: a branch case picking up at its checkpoint. */
939
+ at: z.ZodOptional<z.ZodNumber>;
940
+ /** Stop before this step. Absent: the whole flow. */
941
+ to: z.ZodOptional<z.ZodNumber>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ kind: "replay";
944
+ flow: string;
945
+ at?: number | undefined;
946
+ to?: number | undefined;
947
+ }, {
948
+ kind: "replay";
949
+ flow: string;
950
+ at?: number | undefined;
951
+ to?: number | undefined;
952
+ }>, z.ZodEffects<z.ZodObject<{
953
+ kind: z.ZodLiteral<"act">;
954
+ /** Exact: a target, an action and the consequence that must follow. */
955
+ target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
956
+ action: z.ZodOptional<z.ZodString>;
957
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
958
+ until: z.ZodOptional<z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>>;
959
+ /** Open: what the model should accomplish, in plain words. */
960
+ goal: z.ZodOptional<z.ZodString>;
961
+ maxSteps: z.ZodOptional<z.ZodNumber>;
962
+ }, "strip", z.ZodTypeAny, {
963
+ kind: "act";
964
+ goal?: string | undefined;
965
+ target?: Record<string, unknown> | undefined;
966
+ action?: string | undefined;
967
+ args?: Record<string, unknown> | undefined;
968
+ until?: import("../index.js").Predicate | undefined;
969
+ maxSteps?: number | undefined;
970
+ }, {
971
+ kind: "act";
972
+ goal?: string | undefined;
973
+ target?: Record<string, unknown> | undefined;
974
+ action?: string | undefined;
975
+ args?: Record<string, unknown> | undefined;
976
+ until?: import("../index.js").Predicate | undefined;
977
+ maxSteps?: number | undefined;
978
+ }>, {
979
+ kind: "act";
980
+ goal?: string | undefined;
981
+ target?: Record<string, unknown> | undefined;
982
+ action?: string | undefined;
983
+ args?: Record<string, unknown> | undefined;
984
+ until?: import("../index.js").Predicate | undefined;
985
+ maxSteps?: number | undefined;
986
+ }, {
987
+ kind: "act";
988
+ goal?: string | undefined;
989
+ target?: Record<string, unknown> | undefined;
990
+ action?: string | undefined;
991
+ args?: Record<string, unknown> | undefined;
992
+ until?: import("../index.js").Predicate | undefined;
993
+ maxSteps?: number | undefined;
994
+ }>, z.ZodObject<{
995
+ kind: z.ZodLiteral<"assert">;
996
+ predicate: z.ZodType<import("../index.js").Predicate, z.ZodTypeDef, import("../index.js").Predicate>;
997
+ }, "strip", z.ZodTypeAny, {
998
+ kind: "assert";
999
+ predicate: import("../index.js").Predicate;
1000
+ }, {
1001
+ kind: "assert";
1002
+ predicate: import("../index.js").Predicate;
1003
+ }>]>, "many">;
1004
+ }, "strip", z.ZodTypeAny, {
1005
+ label: string;
1006
+ steps: ({
1007
+ kind: "replay";
1008
+ flow: string;
1009
+ at?: number | undefined;
1010
+ to?: number | undefined;
1011
+ } | {
1012
+ kind: "act";
1013
+ goal?: string | undefined;
1014
+ target?: Record<string, unknown> | undefined;
1015
+ action?: string | undefined;
1016
+ args?: Record<string, unknown> | undefined;
1017
+ until?: import("../index.js").Predicate | undefined;
1018
+ maxSteps?: number | undefined;
1019
+ } | {
1020
+ kind: "assert";
1021
+ predicate: import("../index.js").Predicate;
1022
+ })[];
1023
+ when?: import("../index.js").Predicate | undefined;
1024
+ }, {
1025
+ label: string;
1026
+ steps: ({
1027
+ kind: "replay";
1028
+ flow: string;
1029
+ at?: number | undefined;
1030
+ to?: number | undefined;
1031
+ } | {
1032
+ kind: "act";
1033
+ goal?: string | undefined;
1034
+ target?: Record<string, unknown> | undefined;
1035
+ action?: string | undefined;
1036
+ args?: Record<string, unknown> | undefined;
1037
+ until?: import("../index.js").Predicate | undefined;
1038
+ maxSteps?: number | undefined;
1039
+ } | {
1040
+ kind: "assert";
1041
+ predicate: import("../index.js").Predicate;
1042
+ })[];
1043
+ when?: import("../index.js").Predicate | undefined;
1044
+ }>, "many">;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ kind: "branch";
1047
+ at: string;
1048
+ cases: {
1049
+ label: string;
1050
+ steps: ({
1051
+ kind: "replay";
1052
+ flow: string;
1053
+ at?: number | undefined;
1054
+ to?: number | undefined;
1055
+ } | {
1056
+ kind: "act";
1057
+ goal?: string | undefined;
1058
+ target?: Record<string, unknown> | undefined;
1059
+ action?: string | undefined;
1060
+ args?: Record<string, unknown> | undefined;
1061
+ until?: import("../index.js").Predicate | undefined;
1062
+ maxSteps?: number | undefined;
1063
+ } | {
1064
+ kind: "assert";
1065
+ predicate: import("../index.js").Predicate;
1066
+ })[];
1067
+ when?: import("../index.js").Predicate | undefined;
1068
+ }[];
1069
+ }, {
1070
+ kind: "branch";
1071
+ at: string;
1072
+ cases: {
1073
+ label: string;
1074
+ steps: ({
1075
+ kind: "replay";
1076
+ flow: string;
1077
+ at?: number | undefined;
1078
+ to?: number | undefined;
1079
+ } | {
1080
+ kind: "act";
1081
+ goal?: string | undefined;
1082
+ target?: Record<string, unknown> | undefined;
1083
+ action?: string | undefined;
1084
+ args?: Record<string, unknown> | undefined;
1085
+ until?: import("../index.js").Predicate | undefined;
1086
+ maxSteps?: number | undefined;
1087
+ } | {
1088
+ kind: "assert";
1089
+ predicate: import("../index.js").Predicate;
1090
+ })[];
1091
+ when?: import("../index.js").Predicate | undefined;
1092
+ }[];
1093
+ }>]>, "many">;
1094
+ /**
1095
+ * Replay first: when every replay in `steps` decides nothing (neither held nor failed), the model
1096
+ * drives this goal instead. A replay that failed is a regression and is never re-driven. An older
1097
+ * platform omits it.
1098
+ */
1099
+ fallback: z.ZodOptional<z.ZodObject<{
1100
+ goal: z.ZodString;
1101
+ }, "strip", z.ZodTypeAny, {
1102
+ goal: string;
1103
+ }, {
1104
+ goal: string;
1105
+ }>>;
1106
+ }, "strip", z.ZodTypeAny, {
1107
+ steps: ({
1108
+ kind: "replay";
1109
+ flow: string;
1110
+ at?: number | undefined;
1111
+ to?: number | undefined;
1112
+ } | {
1113
+ kind: "act";
1114
+ goal?: string | undefined;
1115
+ target?: Record<string, unknown> | undefined;
1116
+ action?: string | undefined;
1117
+ args?: Record<string, unknown> | undefined;
1118
+ until?: import("../index.js").Predicate | undefined;
1119
+ maxSteps?: number | undefined;
1120
+ } | {
1121
+ kind: "assert";
1122
+ predicate: import("../index.js").Predicate;
1123
+ } | {
1124
+ kind: "checkpoint";
1125
+ id: string;
1126
+ reenter: {
1127
+ flow: string;
1128
+ to: number;
1129
+ };
1130
+ } | {
1131
+ kind: "branch";
1132
+ at: string;
1133
+ cases: {
1134
+ label: string;
1135
+ steps: ({
1136
+ kind: "replay";
1137
+ flow: string;
1138
+ at?: number | undefined;
1139
+ to?: number | undefined;
1140
+ } | {
1141
+ kind: "act";
1142
+ goal?: string | undefined;
1143
+ target?: Record<string, unknown> | undefined;
1144
+ action?: string | undefined;
1145
+ args?: Record<string, unknown> | undefined;
1146
+ until?: import("../index.js").Predicate | undefined;
1147
+ maxSteps?: number | undefined;
1148
+ } | {
1149
+ kind: "assert";
1150
+ predicate: import("../index.js").Predicate;
1151
+ })[];
1152
+ when?: import("../index.js").Predicate | undefined;
1153
+ }[];
1154
+ })[];
1155
+ id: string;
1156
+ title: string;
1157
+ dependsOn: string[];
1158
+ persona?: string | undefined;
1159
+ when?: {
1160
+ is: "passed" | "failed";
1161
+ journey: string;
1162
+ } | undefined;
1163
+ fallback?: {
1164
+ goal: string;
1165
+ } | undefined;
1166
+ }, {
1167
+ steps: ({
1168
+ kind: "replay";
1169
+ flow: string;
1170
+ at?: number | undefined;
1171
+ to?: number | undefined;
1172
+ } | {
1173
+ kind: "act";
1174
+ goal?: string | undefined;
1175
+ target?: Record<string, unknown> | undefined;
1176
+ action?: string | undefined;
1177
+ args?: Record<string, unknown> | undefined;
1178
+ until?: import("../index.js").Predicate | undefined;
1179
+ maxSteps?: number | undefined;
1180
+ } | {
1181
+ kind: "assert";
1182
+ predicate: import("../index.js").Predicate;
1183
+ } | {
1184
+ kind: "checkpoint";
1185
+ id: string;
1186
+ reenter: {
1187
+ flow: string;
1188
+ to: number;
1189
+ };
1190
+ } | {
1191
+ kind: "branch";
1192
+ at: string;
1193
+ cases: {
1194
+ label: string;
1195
+ steps: ({
1196
+ kind: "replay";
1197
+ flow: string;
1198
+ at?: number | undefined;
1199
+ to?: number | undefined;
1200
+ } | {
1201
+ kind: "act";
1202
+ goal?: string | undefined;
1203
+ target?: Record<string, unknown> | undefined;
1204
+ action?: string | undefined;
1205
+ args?: Record<string, unknown> | undefined;
1206
+ until?: import("../index.js").Predicate | undefined;
1207
+ maxSteps?: number | undefined;
1208
+ } | {
1209
+ kind: "assert";
1210
+ predicate: import("../index.js").Predicate;
1211
+ })[];
1212
+ when?: import("../index.js").Predicate | undefined;
1213
+ }[];
1214
+ })[];
1215
+ id: string;
1216
+ title: string;
1217
+ persona?: string | undefined;
1218
+ when?: {
1219
+ is: "passed" | "failed";
1220
+ journey: string;
1221
+ } | undefined;
1222
+ dependsOn?: string[] | undefined;
1223
+ fallback?: {
1224
+ goal: string;
1225
+ } | undefined;
1226
+ }>, "many">;
1227
+ lanes: z.ZodArray<z.ZodObject<{
1228
+ id: z.ZodString;
1229
+ /** Driven in this order, in one browser context. */
1230
+ journeys: z.ZodArray<z.ZodString, "many">;
1231
+ }, "strip", z.ZodTypeAny, {
1232
+ id: string;
1233
+ journeys: string[];
1234
+ }, {
1235
+ id: string;
1236
+ journeys: string[];
1237
+ }>, "many">;
1238
+ /** At most this many lanes at once. Absent: as many as the browser pool can lease. */
1239
+ maxParallel: z.ZodOptional<z.ZodNumber>;
1240
+ }, "strip", z.ZodTypeAny, {
1241
+ source: "local" | "platform";
1242
+ version: 1;
1243
+ journeys: {
1244
+ steps: ({
1245
+ kind: "replay";
1246
+ flow: string;
1247
+ at?: number | undefined;
1248
+ to?: number | undefined;
1249
+ } | {
1250
+ kind: "act";
1251
+ goal?: string | undefined;
1252
+ target?: Record<string, unknown> | undefined;
1253
+ action?: string | undefined;
1254
+ args?: Record<string, unknown> | undefined;
1255
+ until?: import("../index.js").Predicate | undefined;
1256
+ maxSteps?: number | undefined;
1257
+ } | {
1258
+ kind: "assert";
1259
+ predicate: import("../index.js").Predicate;
1260
+ } | {
1261
+ kind: "checkpoint";
1262
+ id: string;
1263
+ reenter: {
1264
+ flow: string;
1265
+ to: number;
1266
+ };
1267
+ } | {
1268
+ kind: "branch";
1269
+ at: string;
1270
+ cases: {
1271
+ label: string;
1272
+ steps: ({
1273
+ kind: "replay";
1274
+ flow: string;
1275
+ at?: number | undefined;
1276
+ to?: number | undefined;
1277
+ } | {
1278
+ kind: "act";
1279
+ goal?: string | undefined;
1280
+ target?: Record<string, unknown> | undefined;
1281
+ action?: string | undefined;
1282
+ args?: Record<string, unknown> | undefined;
1283
+ until?: import("../index.js").Predicate | undefined;
1284
+ maxSteps?: number | undefined;
1285
+ } | {
1286
+ kind: "assert";
1287
+ predicate: import("../index.js").Predicate;
1288
+ })[];
1289
+ when?: import("../index.js").Predicate | undefined;
1290
+ }[];
1291
+ })[];
1292
+ id: string;
1293
+ title: string;
1294
+ dependsOn: string[];
1295
+ persona?: string | undefined;
1296
+ when?: {
1297
+ is: "passed" | "failed";
1298
+ journey: string;
1299
+ } | undefined;
1300
+ fallback?: {
1301
+ goal: string;
1302
+ } | undefined;
1303
+ }[];
1304
+ personas: {
1305
+ name: string;
1306
+ journey: string;
1307
+ }[];
1308
+ lanes: {
1309
+ id: string;
1310
+ journeys: string[];
1311
+ }[];
1312
+ maxParallel?: number | undefined;
1313
+ }, {
1314
+ source: "local" | "platform";
1315
+ version: 1;
1316
+ journeys: {
1317
+ steps: ({
1318
+ kind: "replay";
1319
+ flow: string;
1320
+ at?: number | undefined;
1321
+ to?: number | undefined;
1322
+ } | {
1323
+ kind: "act";
1324
+ goal?: string | undefined;
1325
+ target?: Record<string, unknown> | undefined;
1326
+ action?: string | undefined;
1327
+ args?: Record<string, unknown> | undefined;
1328
+ until?: import("../index.js").Predicate | undefined;
1329
+ maxSteps?: number | undefined;
1330
+ } | {
1331
+ kind: "assert";
1332
+ predicate: import("../index.js").Predicate;
1333
+ } | {
1334
+ kind: "checkpoint";
1335
+ id: string;
1336
+ reenter: {
1337
+ flow: string;
1338
+ to: number;
1339
+ };
1340
+ } | {
1341
+ kind: "branch";
1342
+ at: string;
1343
+ cases: {
1344
+ label: string;
1345
+ steps: ({
1346
+ kind: "replay";
1347
+ flow: string;
1348
+ at?: number | undefined;
1349
+ to?: number | undefined;
1350
+ } | {
1351
+ kind: "act";
1352
+ goal?: string | undefined;
1353
+ target?: Record<string, unknown> | undefined;
1354
+ action?: string | undefined;
1355
+ args?: Record<string, unknown> | undefined;
1356
+ until?: import("../index.js").Predicate | undefined;
1357
+ maxSteps?: number | undefined;
1358
+ } | {
1359
+ kind: "assert";
1360
+ predicate: import("../index.js").Predicate;
1361
+ })[];
1362
+ when?: import("../index.js").Predicate | undefined;
1363
+ }[];
1364
+ })[];
1365
+ id: string;
1366
+ title: string;
1367
+ persona?: string | undefined;
1368
+ when?: {
1369
+ is: "passed" | "failed";
1370
+ journey: string;
1371
+ } | undefined;
1372
+ dependsOn?: string[] | undefined;
1373
+ fallback?: {
1374
+ goal: string;
1375
+ } | undefined;
1376
+ }[];
1377
+ lanes: {
1378
+ id: string;
1379
+ journeys: string[];
1380
+ }[];
1381
+ personas?: {
1382
+ name: string;
1383
+ journey: string;
1384
+ }[] | undefined;
1385
+ maxParallel?: number | undefined;
1386
+ }>;
1387
+ export type ScriptStep = z.infer<typeof ScriptStepSchema>;
1388
+ export type ScriptLeafStep = z.infer<typeof LeafStep>;
1389
+ export type Journey = z.infer<typeof JourneySchema>;
1390
+ export type Lane = z.infer<typeof LaneSchema>;
1391
+ export type DriveScript = z.infer<typeof DriveScriptSchema>;
1392
+ /**
1393
+ * Every reason this script cannot run as written, or none.
1394
+ *
1395
+ * A dependency is honoured one of two ways: earlier in the same lane, or in an EARLIER lane (a
1396
+ * barrier). Pointing only backwards is what makes a script acyclic and a barrier unable to wait on
1397
+ * a lane that has not started, so no separate cycle check is needed.
1398
+ */
1399
+ export declare function checkScript(script: DriveScript): string[];
1400
+ /** The lane barrier a journey waits on: its dependencies that are not earlier in its own lane. */
1401
+ export declare function barriersOf(script: DriveScript, laneId: string, journeyId: string): string[];
1402
+ /** One line a person reads for a step: what it drives, in the plan's own words. */
1403
+ export declare function stepLabel(step: ScriptStep): string;
1404
+ export {};