@zigrivers/surface-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2665 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ConfidenceCutoffsSchema: z.ZodObject<{
4
+ assert: z.ZodNumber;
5
+ question: z.ZodNumber;
6
+ }, z.core.$strict>;
7
+ type ConfidenceCutoffs = z.infer<typeof ConfidenceCutoffsSchema>;
8
+ declare const SeverityCutoffsSchema: z.ZodObject<{
9
+ P0: z.ZodNumber;
10
+ P1: z.ZodNumber;
11
+ P2: z.ZodNumber;
12
+ P3: z.ZodNumber;
13
+ }, z.core.$strict>;
14
+ type SeverityCutoffs = z.infer<typeof SeverityCutoffsSchema>;
15
+ declare const FindingsPolicySchema: z.ZodObject<{
16
+ confidenceCutoffs: z.ZodObject<{
17
+ assert: z.ZodNumber;
18
+ question: z.ZodNumber;
19
+ }, z.core.$strict>;
20
+ severityCutoffs: z.ZodObject<{
21
+ P0: z.ZodNumber;
22
+ P1: z.ZodNumber;
23
+ P2: z.ZodNumber;
24
+ P3: z.ZodNumber;
25
+ }, z.core.$strict>;
26
+ }, z.core.$strict>;
27
+ type FindingsPolicy = z.infer<typeof FindingsPolicySchema>;
28
+ declare const DEFAULT_FINDINGS_POLICY: {
29
+ confidenceCutoffs: {
30
+ assert: number;
31
+ question: number;
32
+ };
33
+ severityCutoffs: {
34
+ P0: number;
35
+ P1: number;
36
+ P2: number;
37
+ P3: number;
38
+ };
39
+ };
40
+
41
+ declare const DepthSchema: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
42
+ type Depth = z.infer<typeof DepthSchema>;
43
+ declare const PresetSchema: z.ZodEnum<{
44
+ custom: "custom";
45
+ quick: "quick";
46
+ mvp: "mvp";
47
+ standard: "standard";
48
+ deep: "deep";
49
+ "accessibility-first": "accessibility-first";
50
+ "agent-ready": "agent-ready";
51
+ "conversion-focused": "conversion-focused";
52
+ "design-system-focused": "design-system-focused";
53
+ }>;
54
+ type Preset = z.infer<typeof PresetSchema>;
55
+ declare const AppTypeSchema: z.ZodEnum<{
56
+ generic: "generic";
57
+ "saas-dashboard": "saas-dashboard";
58
+ "e-commerce": "e-commerce";
59
+ marketing: "marketing";
60
+ admin: "admin";
61
+ "content-media": "content-media";
62
+ }>;
63
+ type AppType = z.infer<typeof AppTypeSchema>;
64
+ declare const StackSchema: z.ZodEnum<{
65
+ react: "react";
66
+ next: "next";
67
+ vue: "vue";
68
+ svelte: "svelte";
69
+ agnostic: "agnostic";
70
+ }>;
71
+ type Stack = z.infer<typeof StackSchema>;
72
+ declare const RedactionRuleSchema: z.ZodObject<{
73
+ pattern: z.ZodString;
74
+ appliesTo: z.ZodArray<z.ZodEnum<{
75
+ dom: "dom";
76
+ screenshot: "screenshot";
77
+ export: "export";
78
+ }>>;
79
+ }, z.core.$strict>;
80
+ type RedactionRule = z.infer<typeof RedactionRuleSchema>;
81
+ declare const ViewportSchema: z.ZodObject<{
82
+ width: z.ZodNumber;
83
+ height: z.ZodNumber;
84
+ label: z.ZodEnum<{
85
+ mobile: "mobile";
86
+ tablet: "tablet";
87
+ desktop: "desktop";
88
+ }>;
89
+ }, z.core.$strict>;
90
+ type Viewport$1 = z.infer<typeof ViewportSchema>;
91
+ declare const CaptureConfigSchema: z.ZodObject<{
92
+ redactionRules: z.ZodArray<z.ZodObject<{
93
+ pattern: z.ZodString;
94
+ appliesTo: z.ZodArray<z.ZodEnum<{
95
+ dom: "dom";
96
+ screenshot: "screenshot";
97
+ export: "export";
98
+ }>>;
99
+ }, z.core.$strict>>;
100
+ viewports: z.ZodArray<z.ZodObject<{
101
+ width: z.ZodNumber;
102
+ height: z.ZodNumber;
103
+ label: z.ZodEnum<{
104
+ mobile: "mobile";
105
+ tablet: "tablet";
106
+ desktop: "desktop";
107
+ }>;
108
+ }, z.core.$strict>>;
109
+ allowlist: z.ZodArray<z.ZodString>;
110
+ captureRetention: z.ZodEnum<{
111
+ ephemeral: "ephemeral";
112
+ retain: "retain";
113
+ }>;
114
+ networkInterception: z.ZodBoolean;
115
+ }, z.core.$strict>;
116
+ type CaptureConfig = z.infer<typeof CaptureConfigSchema>;
117
+ declare const EvaluationConfigSchema: z.ZodObject<{
118
+ preset: z.ZodEnum<{
119
+ custom: "custom";
120
+ quick: "quick";
121
+ mvp: "mvp";
122
+ standard: "standard";
123
+ deep: "deep";
124
+ "accessibility-first": "accessibility-first";
125
+ "agent-ready": "agent-ready";
126
+ "conversion-focused": "conversion-focused";
127
+ "design-system-focused": "design-system-focused";
128
+ }>;
129
+ depth: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
130
+ stack: z.ZodArray<z.ZodEnum<{
131
+ react: "react";
132
+ next: "next";
133
+ vue: "vue";
134
+ svelte: "svelte";
135
+ agnostic: "agnostic";
136
+ }>>;
137
+ appType: z.ZodOptional<z.ZodEnum<{
138
+ generic: "generic";
139
+ "saas-dashboard": "saas-dashboard";
140
+ "e-commerce": "e-commerce";
141
+ marketing: "marketing";
142
+ admin: "admin";
143
+ "content-media": "content-media";
144
+ }>>;
145
+ }, z.core.$strict>;
146
+ type EvaluationConfig = z.infer<typeof EvaluationConfigSchema>;
147
+ declare const ConfidenceCutoffsLayerSchema: z.ZodObject<{
148
+ assert: z.ZodOptional<z.ZodNumber>;
149
+ question: z.ZodOptional<z.ZodNumber>;
150
+ }, z.core.$strict>;
151
+ declare const SeverityCutoffsLayerSchema: z.ZodObject<{
152
+ P0: z.ZodOptional<z.ZodNumber>;
153
+ P1: z.ZodOptional<z.ZodNumber>;
154
+ P2: z.ZodOptional<z.ZodNumber>;
155
+ P3: z.ZodOptional<z.ZodNumber>;
156
+ }, z.core.$strict>;
157
+ declare const ExportTargetSchema: z.ZodEnum<{
158
+ github: "github";
159
+ linear: "linear";
160
+ jira: "jira";
161
+ }>;
162
+ type ExportTarget = z.infer<typeof ExportTargetSchema>;
163
+ declare const GatePolicySchema: z.ZodObject<{
164
+ failOnNewMeasuredAtOrAbove: z.ZodEnum<{
165
+ P0: "P0";
166
+ P1: "P1";
167
+ P2: "P2";
168
+ P3: "P3";
169
+ }>;
170
+ thresholds: z.ZodRecord<z.ZodString, z.ZodNumber>;
171
+ neverFailOn: z.ZodArray<z.ZodEnum<{
172
+ judged: "judged";
173
+ gatedForHuman: "gatedForHuman";
174
+ }>>;
175
+ }, z.core.$strict>;
176
+ type GatePolicy$1 = z.infer<typeof GatePolicySchema>;
177
+ declare const ReportingConfigSchema: z.ZodObject<{
178
+ integrations: z.ZodArray<z.ZodEnum<{
179
+ github: "github";
180
+ linear: "linear";
181
+ jira: "jira";
182
+ }>>;
183
+ gatePolicy: z.ZodObject<{
184
+ failOnNewMeasuredAtOrAbove: z.ZodEnum<{
185
+ P0: "P0";
186
+ P1: "P1";
187
+ P2: "P2";
188
+ P3: "P3";
189
+ }>;
190
+ thresholds: z.ZodRecord<z.ZodString, z.ZodNumber>;
191
+ neverFailOn: z.ZodArray<z.ZodEnum<{
192
+ judged: "judged";
193
+ gatedForHuman: "gatedForHuman";
194
+ }>>;
195
+ }, z.core.$strict>;
196
+ }, z.core.$strict>;
197
+ type ReportingConfig = z.infer<typeof ReportingConfigSchema>;
198
+ declare const SurfaceConfigSchema: z.ZodObject<{
199
+ capture: z.ZodObject<{
200
+ redactionRules: z.ZodArray<z.ZodObject<{
201
+ pattern: z.ZodString;
202
+ appliesTo: z.ZodArray<z.ZodEnum<{
203
+ dom: "dom";
204
+ screenshot: "screenshot";
205
+ export: "export";
206
+ }>>;
207
+ }, z.core.$strict>>;
208
+ viewports: z.ZodArray<z.ZodObject<{
209
+ width: z.ZodNumber;
210
+ height: z.ZodNumber;
211
+ label: z.ZodEnum<{
212
+ mobile: "mobile";
213
+ tablet: "tablet";
214
+ desktop: "desktop";
215
+ }>;
216
+ }, z.core.$strict>>;
217
+ allowlist: z.ZodArray<z.ZodString>;
218
+ captureRetention: z.ZodEnum<{
219
+ ephemeral: "ephemeral";
220
+ retain: "retain";
221
+ }>;
222
+ networkInterception: z.ZodBoolean;
223
+ }, z.core.$strict>;
224
+ evaluation: z.ZodObject<{
225
+ preset: z.ZodEnum<{
226
+ custom: "custom";
227
+ quick: "quick";
228
+ mvp: "mvp";
229
+ standard: "standard";
230
+ deep: "deep";
231
+ "accessibility-first": "accessibility-first";
232
+ "agent-ready": "agent-ready";
233
+ "conversion-focused": "conversion-focused";
234
+ "design-system-focused": "design-system-focused";
235
+ }>;
236
+ depth: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
237
+ stack: z.ZodArray<z.ZodEnum<{
238
+ react: "react";
239
+ next: "next";
240
+ vue: "vue";
241
+ svelte: "svelte";
242
+ agnostic: "agnostic";
243
+ }>>;
244
+ appType: z.ZodOptional<z.ZodEnum<{
245
+ generic: "generic";
246
+ "saas-dashboard": "saas-dashboard";
247
+ "e-commerce": "e-commerce";
248
+ marketing: "marketing";
249
+ admin: "admin";
250
+ "content-media": "content-media";
251
+ }>>;
252
+ }, z.core.$strict>;
253
+ findings: z.ZodObject<{
254
+ confidenceCutoffs: z.ZodObject<{
255
+ assert: z.ZodNumber;
256
+ question: z.ZodNumber;
257
+ }, z.core.$strict>;
258
+ severityCutoffs: z.ZodObject<{
259
+ P0: z.ZodNumber;
260
+ P1: z.ZodNumber;
261
+ P2: z.ZodNumber;
262
+ P3: z.ZodNumber;
263
+ }, z.core.$strict>;
264
+ }, z.core.$strict>;
265
+ reporting: z.ZodObject<{
266
+ integrations: z.ZodArray<z.ZodEnum<{
267
+ github: "github";
268
+ linear: "linear";
269
+ jira: "jira";
270
+ }>>;
271
+ gatePolicy: z.ZodObject<{
272
+ failOnNewMeasuredAtOrAbove: z.ZodEnum<{
273
+ P0: "P0";
274
+ P1: "P1";
275
+ P2: "P2";
276
+ P3: "P3";
277
+ }>;
278
+ thresholds: z.ZodRecord<z.ZodString, z.ZodNumber>;
279
+ neverFailOn: z.ZodArray<z.ZodEnum<{
280
+ judged: "judged";
281
+ gatedForHuman: "gatedForHuman";
282
+ }>>;
283
+ }, z.core.$strict>;
284
+ }, z.core.$strict>;
285
+ }, z.core.$strict>;
286
+ type SurfaceConfig = z.infer<typeof SurfaceConfigSchema>;
287
+ declare const CaptureConfigLayerSchema: z.ZodObject<{
288
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
289
+ pattern: z.ZodString;
290
+ appliesTo: z.ZodArray<z.ZodEnum<{
291
+ dom: "dom";
292
+ screenshot: "screenshot";
293
+ export: "export";
294
+ }>>;
295
+ }, z.core.$strict>>>;
296
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
297
+ width: z.ZodNumber;
298
+ height: z.ZodNumber;
299
+ label: z.ZodEnum<{
300
+ mobile: "mobile";
301
+ tablet: "tablet";
302
+ desktop: "desktop";
303
+ }>;
304
+ }, z.core.$strict>>>;
305
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
306
+ captureRetention: z.ZodOptional<z.ZodEnum<{
307
+ ephemeral: "ephemeral";
308
+ retain: "retain";
309
+ }>>;
310
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
311
+ }, z.core.$strict>;
312
+ declare const EvaluationConfigLayerSchema: z.ZodObject<{
313
+ preset: z.ZodOptional<z.ZodEnum<{
314
+ custom: "custom";
315
+ quick: "quick";
316
+ mvp: "mvp";
317
+ standard: "standard";
318
+ deep: "deep";
319
+ "accessibility-first": "accessibility-first";
320
+ "agent-ready": "agent-ready";
321
+ "conversion-focused": "conversion-focused";
322
+ "design-system-focused": "design-system-focused";
323
+ }>>;
324
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
325
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
326
+ react: "react";
327
+ next: "next";
328
+ vue: "vue";
329
+ svelte: "svelte";
330
+ agnostic: "agnostic";
331
+ }>>>;
332
+ appType: z.ZodOptional<z.ZodEnum<{
333
+ generic: "generic";
334
+ "saas-dashboard": "saas-dashboard";
335
+ "e-commerce": "e-commerce";
336
+ marketing: "marketing";
337
+ admin: "admin";
338
+ "content-media": "content-media";
339
+ }>>;
340
+ }, z.core.$strict>;
341
+ declare const FindingsPolicyLayerSchema: z.ZodObject<{
342
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
343
+ assert: z.ZodOptional<z.ZodNumber>;
344
+ question: z.ZodOptional<z.ZodNumber>;
345
+ }, z.core.$strict>>;
346
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
347
+ P0: z.ZodOptional<z.ZodNumber>;
348
+ P1: z.ZodOptional<z.ZodNumber>;
349
+ P2: z.ZodOptional<z.ZodNumber>;
350
+ P3: z.ZodOptional<z.ZodNumber>;
351
+ }, z.core.$strict>>;
352
+ }, z.core.$strict>;
353
+ declare const GatePolicyLayerSchema: z.ZodObject<{
354
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
355
+ P0: "P0";
356
+ P1: "P1";
357
+ P2: "P2";
358
+ P3: "P3";
359
+ }>>;
360
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
361
+ }, z.core.$strict>;
362
+ declare const ReportingConfigLayerSchema: z.ZodObject<{
363
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
364
+ github: "github";
365
+ linear: "linear";
366
+ jira: "jira";
367
+ }>>>;
368
+ gatePolicy: z.ZodOptional<z.ZodObject<{
369
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
370
+ P0: "P0";
371
+ P1: "P1";
372
+ P2: "P2";
373
+ P3: "P3";
374
+ }>>;
375
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
376
+ }, z.core.$strict>>;
377
+ }, z.core.$strict>;
378
+ declare const SurfaceConfigLayerSchema: z.ZodObject<{
379
+ capture: z.ZodOptional<z.ZodObject<{
380
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
381
+ pattern: z.ZodString;
382
+ appliesTo: z.ZodArray<z.ZodEnum<{
383
+ dom: "dom";
384
+ screenshot: "screenshot";
385
+ export: "export";
386
+ }>>;
387
+ }, z.core.$strict>>>;
388
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
389
+ width: z.ZodNumber;
390
+ height: z.ZodNumber;
391
+ label: z.ZodEnum<{
392
+ mobile: "mobile";
393
+ tablet: "tablet";
394
+ desktop: "desktop";
395
+ }>;
396
+ }, z.core.$strict>>>;
397
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
398
+ captureRetention: z.ZodOptional<z.ZodEnum<{
399
+ ephemeral: "ephemeral";
400
+ retain: "retain";
401
+ }>>;
402
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
403
+ }, z.core.$strict>>;
404
+ evaluation: z.ZodOptional<z.ZodObject<{
405
+ preset: z.ZodOptional<z.ZodEnum<{
406
+ custom: "custom";
407
+ quick: "quick";
408
+ mvp: "mvp";
409
+ standard: "standard";
410
+ deep: "deep";
411
+ "accessibility-first": "accessibility-first";
412
+ "agent-ready": "agent-ready";
413
+ "conversion-focused": "conversion-focused";
414
+ "design-system-focused": "design-system-focused";
415
+ }>>;
416
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
417
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
418
+ react: "react";
419
+ next: "next";
420
+ vue: "vue";
421
+ svelte: "svelte";
422
+ agnostic: "agnostic";
423
+ }>>>;
424
+ appType: z.ZodOptional<z.ZodEnum<{
425
+ generic: "generic";
426
+ "saas-dashboard": "saas-dashboard";
427
+ "e-commerce": "e-commerce";
428
+ marketing: "marketing";
429
+ admin: "admin";
430
+ "content-media": "content-media";
431
+ }>>;
432
+ }, z.core.$strict>>;
433
+ findings: z.ZodOptional<z.ZodObject<{
434
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
435
+ assert: z.ZodOptional<z.ZodNumber>;
436
+ question: z.ZodOptional<z.ZodNumber>;
437
+ }, z.core.$strict>>;
438
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
439
+ P0: z.ZodOptional<z.ZodNumber>;
440
+ P1: z.ZodOptional<z.ZodNumber>;
441
+ P2: z.ZodOptional<z.ZodNumber>;
442
+ P3: z.ZodOptional<z.ZodNumber>;
443
+ }, z.core.$strict>>;
444
+ }, z.core.$strict>>;
445
+ reporting: z.ZodOptional<z.ZodObject<{
446
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
447
+ github: "github";
448
+ linear: "linear";
449
+ jira: "jira";
450
+ }>>>;
451
+ gatePolicy: z.ZodOptional<z.ZodObject<{
452
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
453
+ P0: "P0";
454
+ P1: "P1";
455
+ P2: "P2";
456
+ P3: "P3";
457
+ }>>;
458
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
459
+ }, z.core.$strict>>;
460
+ }, z.core.$strict>>;
461
+ }, z.core.$strict>;
462
+ type SurfaceConfigLayer = z.infer<typeof SurfaceConfigLayerSchema>;
463
+ declare const SurfaceConfigLayersSchema: z.ZodObject<{
464
+ defaults: z.ZodOptional<z.ZodObject<{
465
+ capture: z.ZodOptional<z.ZodObject<{
466
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
467
+ pattern: z.ZodString;
468
+ appliesTo: z.ZodArray<z.ZodEnum<{
469
+ dom: "dom";
470
+ screenshot: "screenshot";
471
+ export: "export";
472
+ }>>;
473
+ }, z.core.$strict>>>;
474
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
475
+ width: z.ZodNumber;
476
+ height: z.ZodNumber;
477
+ label: z.ZodEnum<{
478
+ mobile: "mobile";
479
+ tablet: "tablet";
480
+ desktop: "desktop";
481
+ }>;
482
+ }, z.core.$strict>>>;
483
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
484
+ captureRetention: z.ZodOptional<z.ZodEnum<{
485
+ ephemeral: "ephemeral";
486
+ retain: "retain";
487
+ }>>;
488
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
489
+ }, z.core.$strict>>;
490
+ evaluation: z.ZodOptional<z.ZodObject<{
491
+ preset: z.ZodOptional<z.ZodEnum<{
492
+ custom: "custom";
493
+ quick: "quick";
494
+ mvp: "mvp";
495
+ standard: "standard";
496
+ deep: "deep";
497
+ "accessibility-first": "accessibility-first";
498
+ "agent-ready": "agent-ready";
499
+ "conversion-focused": "conversion-focused";
500
+ "design-system-focused": "design-system-focused";
501
+ }>>;
502
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
503
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
504
+ react: "react";
505
+ next: "next";
506
+ vue: "vue";
507
+ svelte: "svelte";
508
+ agnostic: "agnostic";
509
+ }>>>;
510
+ appType: z.ZodOptional<z.ZodEnum<{
511
+ generic: "generic";
512
+ "saas-dashboard": "saas-dashboard";
513
+ "e-commerce": "e-commerce";
514
+ marketing: "marketing";
515
+ admin: "admin";
516
+ "content-media": "content-media";
517
+ }>>;
518
+ }, z.core.$strict>>;
519
+ findings: z.ZodOptional<z.ZodObject<{
520
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
521
+ assert: z.ZodOptional<z.ZodNumber>;
522
+ question: z.ZodOptional<z.ZodNumber>;
523
+ }, z.core.$strict>>;
524
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
525
+ P0: z.ZodOptional<z.ZodNumber>;
526
+ P1: z.ZodOptional<z.ZodNumber>;
527
+ P2: z.ZodOptional<z.ZodNumber>;
528
+ P3: z.ZodOptional<z.ZodNumber>;
529
+ }, z.core.$strict>>;
530
+ }, z.core.$strict>>;
531
+ reporting: z.ZodOptional<z.ZodObject<{
532
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
533
+ github: "github";
534
+ linear: "linear";
535
+ jira: "jira";
536
+ }>>>;
537
+ gatePolicy: z.ZodOptional<z.ZodObject<{
538
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
539
+ P0: "P0";
540
+ P1: "P1";
541
+ P2: "P2";
542
+ P3: "P3";
543
+ }>>;
544
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
545
+ }, z.core.$strict>>;
546
+ }, z.core.$strict>>;
547
+ }, z.core.$strict>>;
548
+ user: z.ZodOptional<z.ZodObject<{
549
+ capture: z.ZodOptional<z.ZodObject<{
550
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
551
+ pattern: z.ZodString;
552
+ appliesTo: z.ZodArray<z.ZodEnum<{
553
+ dom: "dom";
554
+ screenshot: "screenshot";
555
+ export: "export";
556
+ }>>;
557
+ }, z.core.$strict>>>;
558
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
559
+ width: z.ZodNumber;
560
+ height: z.ZodNumber;
561
+ label: z.ZodEnum<{
562
+ mobile: "mobile";
563
+ tablet: "tablet";
564
+ desktop: "desktop";
565
+ }>;
566
+ }, z.core.$strict>>>;
567
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
568
+ captureRetention: z.ZodOptional<z.ZodEnum<{
569
+ ephemeral: "ephemeral";
570
+ retain: "retain";
571
+ }>>;
572
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
573
+ }, z.core.$strict>>;
574
+ evaluation: z.ZodOptional<z.ZodObject<{
575
+ preset: z.ZodOptional<z.ZodEnum<{
576
+ custom: "custom";
577
+ quick: "quick";
578
+ mvp: "mvp";
579
+ standard: "standard";
580
+ deep: "deep";
581
+ "accessibility-first": "accessibility-first";
582
+ "agent-ready": "agent-ready";
583
+ "conversion-focused": "conversion-focused";
584
+ "design-system-focused": "design-system-focused";
585
+ }>>;
586
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
587
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
588
+ react: "react";
589
+ next: "next";
590
+ vue: "vue";
591
+ svelte: "svelte";
592
+ agnostic: "agnostic";
593
+ }>>>;
594
+ appType: z.ZodOptional<z.ZodEnum<{
595
+ generic: "generic";
596
+ "saas-dashboard": "saas-dashboard";
597
+ "e-commerce": "e-commerce";
598
+ marketing: "marketing";
599
+ admin: "admin";
600
+ "content-media": "content-media";
601
+ }>>;
602
+ }, z.core.$strict>>;
603
+ findings: z.ZodOptional<z.ZodObject<{
604
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
605
+ assert: z.ZodOptional<z.ZodNumber>;
606
+ question: z.ZodOptional<z.ZodNumber>;
607
+ }, z.core.$strict>>;
608
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
609
+ P0: z.ZodOptional<z.ZodNumber>;
610
+ P1: z.ZodOptional<z.ZodNumber>;
611
+ P2: z.ZodOptional<z.ZodNumber>;
612
+ P3: z.ZodOptional<z.ZodNumber>;
613
+ }, z.core.$strict>>;
614
+ }, z.core.$strict>>;
615
+ reporting: z.ZodOptional<z.ZodObject<{
616
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
617
+ github: "github";
618
+ linear: "linear";
619
+ jira: "jira";
620
+ }>>>;
621
+ gatePolicy: z.ZodOptional<z.ZodObject<{
622
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
623
+ P0: "P0";
624
+ P1: "P1";
625
+ P2: "P2";
626
+ P3: "P3";
627
+ }>>;
628
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
629
+ }, z.core.$strict>>;
630
+ }, z.core.$strict>>;
631
+ }, z.core.$strict>>;
632
+ project: z.ZodOptional<z.ZodObject<{
633
+ capture: z.ZodOptional<z.ZodObject<{
634
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
635
+ pattern: z.ZodString;
636
+ appliesTo: z.ZodArray<z.ZodEnum<{
637
+ dom: "dom";
638
+ screenshot: "screenshot";
639
+ export: "export";
640
+ }>>;
641
+ }, z.core.$strict>>>;
642
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
643
+ width: z.ZodNumber;
644
+ height: z.ZodNumber;
645
+ label: z.ZodEnum<{
646
+ mobile: "mobile";
647
+ tablet: "tablet";
648
+ desktop: "desktop";
649
+ }>;
650
+ }, z.core.$strict>>>;
651
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
652
+ captureRetention: z.ZodOptional<z.ZodEnum<{
653
+ ephemeral: "ephemeral";
654
+ retain: "retain";
655
+ }>>;
656
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
657
+ }, z.core.$strict>>;
658
+ evaluation: z.ZodOptional<z.ZodObject<{
659
+ preset: z.ZodOptional<z.ZodEnum<{
660
+ custom: "custom";
661
+ quick: "quick";
662
+ mvp: "mvp";
663
+ standard: "standard";
664
+ deep: "deep";
665
+ "accessibility-first": "accessibility-first";
666
+ "agent-ready": "agent-ready";
667
+ "conversion-focused": "conversion-focused";
668
+ "design-system-focused": "design-system-focused";
669
+ }>>;
670
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
671
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
672
+ react: "react";
673
+ next: "next";
674
+ vue: "vue";
675
+ svelte: "svelte";
676
+ agnostic: "agnostic";
677
+ }>>>;
678
+ appType: z.ZodOptional<z.ZodEnum<{
679
+ generic: "generic";
680
+ "saas-dashboard": "saas-dashboard";
681
+ "e-commerce": "e-commerce";
682
+ marketing: "marketing";
683
+ admin: "admin";
684
+ "content-media": "content-media";
685
+ }>>;
686
+ }, z.core.$strict>>;
687
+ findings: z.ZodOptional<z.ZodObject<{
688
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
689
+ assert: z.ZodOptional<z.ZodNumber>;
690
+ question: z.ZodOptional<z.ZodNumber>;
691
+ }, z.core.$strict>>;
692
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
693
+ P0: z.ZodOptional<z.ZodNumber>;
694
+ P1: z.ZodOptional<z.ZodNumber>;
695
+ P2: z.ZodOptional<z.ZodNumber>;
696
+ P3: z.ZodOptional<z.ZodNumber>;
697
+ }, z.core.$strict>>;
698
+ }, z.core.$strict>>;
699
+ reporting: z.ZodOptional<z.ZodObject<{
700
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
701
+ github: "github";
702
+ linear: "linear";
703
+ jira: "jira";
704
+ }>>>;
705
+ gatePolicy: z.ZodOptional<z.ZodObject<{
706
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
707
+ P0: "P0";
708
+ P1: "P1";
709
+ P2: "P2";
710
+ P3: "P3";
711
+ }>>;
712
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
713
+ }, z.core.$strict>>;
714
+ }, z.core.$strict>>;
715
+ }, z.core.$strict>>;
716
+ env: z.ZodOptional<z.ZodObject<{
717
+ capture: z.ZodOptional<z.ZodObject<{
718
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
719
+ pattern: z.ZodString;
720
+ appliesTo: z.ZodArray<z.ZodEnum<{
721
+ dom: "dom";
722
+ screenshot: "screenshot";
723
+ export: "export";
724
+ }>>;
725
+ }, z.core.$strict>>>;
726
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
727
+ width: z.ZodNumber;
728
+ height: z.ZodNumber;
729
+ label: z.ZodEnum<{
730
+ mobile: "mobile";
731
+ tablet: "tablet";
732
+ desktop: "desktop";
733
+ }>;
734
+ }, z.core.$strict>>>;
735
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
736
+ captureRetention: z.ZodOptional<z.ZodEnum<{
737
+ ephemeral: "ephemeral";
738
+ retain: "retain";
739
+ }>>;
740
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
741
+ }, z.core.$strict>>;
742
+ evaluation: z.ZodOptional<z.ZodObject<{
743
+ preset: z.ZodOptional<z.ZodEnum<{
744
+ custom: "custom";
745
+ quick: "quick";
746
+ mvp: "mvp";
747
+ standard: "standard";
748
+ deep: "deep";
749
+ "accessibility-first": "accessibility-first";
750
+ "agent-ready": "agent-ready";
751
+ "conversion-focused": "conversion-focused";
752
+ "design-system-focused": "design-system-focused";
753
+ }>>;
754
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
755
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
756
+ react: "react";
757
+ next: "next";
758
+ vue: "vue";
759
+ svelte: "svelte";
760
+ agnostic: "agnostic";
761
+ }>>>;
762
+ appType: z.ZodOptional<z.ZodEnum<{
763
+ generic: "generic";
764
+ "saas-dashboard": "saas-dashboard";
765
+ "e-commerce": "e-commerce";
766
+ marketing: "marketing";
767
+ admin: "admin";
768
+ "content-media": "content-media";
769
+ }>>;
770
+ }, z.core.$strict>>;
771
+ findings: z.ZodOptional<z.ZodObject<{
772
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
773
+ assert: z.ZodOptional<z.ZodNumber>;
774
+ question: z.ZodOptional<z.ZodNumber>;
775
+ }, z.core.$strict>>;
776
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
777
+ P0: z.ZodOptional<z.ZodNumber>;
778
+ P1: z.ZodOptional<z.ZodNumber>;
779
+ P2: z.ZodOptional<z.ZodNumber>;
780
+ P3: z.ZodOptional<z.ZodNumber>;
781
+ }, z.core.$strict>>;
782
+ }, z.core.$strict>>;
783
+ reporting: z.ZodOptional<z.ZodObject<{
784
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
785
+ github: "github";
786
+ linear: "linear";
787
+ jira: "jira";
788
+ }>>>;
789
+ gatePolicy: z.ZodOptional<z.ZodObject<{
790
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
791
+ P0: "P0";
792
+ P1: "P1";
793
+ P2: "P2";
794
+ P3: "P3";
795
+ }>>;
796
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
797
+ }, z.core.$strict>>;
798
+ }, z.core.$strict>>;
799
+ }, z.core.$strict>>;
800
+ cli: z.ZodOptional<z.ZodObject<{
801
+ capture: z.ZodOptional<z.ZodObject<{
802
+ redactionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
803
+ pattern: z.ZodString;
804
+ appliesTo: z.ZodArray<z.ZodEnum<{
805
+ dom: "dom";
806
+ screenshot: "screenshot";
807
+ export: "export";
808
+ }>>;
809
+ }, z.core.$strict>>>;
810
+ viewports: z.ZodOptional<z.ZodArray<z.ZodObject<{
811
+ width: z.ZodNumber;
812
+ height: z.ZodNumber;
813
+ label: z.ZodEnum<{
814
+ mobile: "mobile";
815
+ tablet: "tablet";
816
+ desktop: "desktop";
817
+ }>;
818
+ }, z.core.$strict>>>;
819
+ allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
820
+ captureRetention: z.ZodOptional<z.ZodEnum<{
821
+ ephemeral: "ephemeral";
822
+ retain: "retain";
823
+ }>>;
824
+ networkInterception: z.ZodOptional<z.ZodBoolean>;
825
+ }, z.core.$strict>>;
826
+ evaluation: z.ZodOptional<z.ZodObject<{
827
+ preset: z.ZodOptional<z.ZodEnum<{
828
+ custom: "custom";
829
+ quick: "quick";
830
+ mvp: "mvp";
831
+ standard: "standard";
832
+ deep: "deep";
833
+ "accessibility-first": "accessibility-first";
834
+ "agent-ready": "agent-ready";
835
+ "conversion-focused": "conversion-focused";
836
+ "design-system-focused": "design-system-focused";
837
+ }>>;
838
+ depth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>>;
839
+ stack: z.ZodOptional<z.ZodArray<z.ZodEnum<{
840
+ react: "react";
841
+ next: "next";
842
+ vue: "vue";
843
+ svelte: "svelte";
844
+ agnostic: "agnostic";
845
+ }>>>;
846
+ appType: z.ZodOptional<z.ZodEnum<{
847
+ generic: "generic";
848
+ "saas-dashboard": "saas-dashboard";
849
+ "e-commerce": "e-commerce";
850
+ marketing: "marketing";
851
+ admin: "admin";
852
+ "content-media": "content-media";
853
+ }>>;
854
+ }, z.core.$strict>>;
855
+ findings: z.ZodOptional<z.ZodObject<{
856
+ confidenceCutoffs: z.ZodOptional<z.ZodObject<{
857
+ assert: z.ZodOptional<z.ZodNumber>;
858
+ question: z.ZodOptional<z.ZodNumber>;
859
+ }, z.core.$strict>>;
860
+ severityCutoffs: z.ZodOptional<z.ZodObject<{
861
+ P0: z.ZodOptional<z.ZodNumber>;
862
+ P1: z.ZodOptional<z.ZodNumber>;
863
+ P2: z.ZodOptional<z.ZodNumber>;
864
+ P3: z.ZodOptional<z.ZodNumber>;
865
+ }, z.core.$strict>>;
866
+ }, z.core.$strict>>;
867
+ reporting: z.ZodOptional<z.ZodObject<{
868
+ integrations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
869
+ github: "github";
870
+ linear: "linear";
871
+ jira: "jira";
872
+ }>>>;
873
+ gatePolicy: z.ZodOptional<z.ZodObject<{
874
+ failOnNewMeasuredAtOrAbove: z.ZodOptional<z.ZodEnum<{
875
+ P0: "P0";
876
+ P1: "P1";
877
+ P2: "P2";
878
+ P3: "P3";
879
+ }>>;
880
+ thresholds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
881
+ }, z.core.$strict>>;
882
+ }, z.core.$strict>>;
883
+ }, z.core.$strict>>;
884
+ }, z.core.$strict>;
885
+ /**
886
+ * Ordered partial config layers. Resolution precedence is:
887
+ * DEFAULT_SURFACE_CONFIG < defaults < user < project < env < cli.
888
+ */
889
+ type SurfaceConfigLayers = z.input<typeof SurfaceConfigLayersSchema>;
890
+ declare const DEFAULT_SURFACE_CONFIG: {
891
+ capture: {
892
+ redactionRules: {
893
+ pattern: string;
894
+ appliesTo: ("dom" | "screenshot" | "export")[];
895
+ }[];
896
+ viewports: {
897
+ width: number;
898
+ height: number;
899
+ label: "mobile" | "tablet" | "desktop";
900
+ }[];
901
+ allowlist: string[];
902
+ captureRetention: "ephemeral" | "retain";
903
+ networkInterception: boolean;
904
+ };
905
+ evaluation: {
906
+ preset: "custom" | "quick" | "mvp" | "standard" | "deep" | "accessibility-first" | "agent-ready" | "conversion-focused" | "design-system-focused";
907
+ depth: 1 | 2 | 4 | 3 | 5;
908
+ stack: ("react" | "next" | "vue" | "svelte" | "agnostic")[];
909
+ appType?: "generic" | "saas-dashboard" | "e-commerce" | "marketing" | "admin" | "content-media" | undefined;
910
+ };
911
+ findings: {
912
+ confidenceCutoffs: {
913
+ assert: number;
914
+ question: number;
915
+ };
916
+ severityCutoffs: {
917
+ P0: number;
918
+ P1: number;
919
+ P2: number;
920
+ P3: number;
921
+ };
922
+ };
923
+ reporting: {
924
+ integrations: ("github" | "linear" | "jira")[];
925
+ gatePolicy: {
926
+ failOnNewMeasuredAtOrAbove: "P0" | "P1" | "P2" | "P3";
927
+ thresholds: Record<string, number>;
928
+ neverFailOn: ("judged" | "gatedForHuman")[];
929
+ };
930
+ };
931
+ };
932
+ /**
933
+ * Resolve SurfaceConfig layers with documented precedence. Higher layers replace arrays and
934
+ * scalars, merge nested objects, and ignore explicit undefined values from optional adapters.
935
+ * Returned configs are owned mutable data; DEFAULT_SURFACE_CONFIG remains deeply frozen.
936
+ */
937
+ declare function resolveSurfaceConfig(layers?: SurfaceConfigLayers): SurfaceConfig;
938
+
939
+ declare const CliExitCodeSchema: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>]>;
940
+ type CliExitCode = z.infer<typeof CliExitCodeSchema>;
941
+ declare const SurfaceErrorKindSchema: z.ZodEnum<{
942
+ UsageError: "UsageError";
943
+ ConfigError: "ConfigError";
944
+ CaptureError: "CaptureError";
945
+ GroundingError: "GroundingError";
946
+ AdapterError: "AdapterError";
947
+ ModelError: "ModelError";
948
+ IntegrationError: "IntegrationError";
949
+ StateError: "StateError";
950
+ RuntimeError: "RuntimeError";
951
+ McpError: "McpError";
952
+ }>;
953
+ type SurfaceErrorKind = z.infer<typeof SurfaceErrorKindSchema>;
954
+ declare const SurfaceErrorCodeSchema: z.ZodEnum<{
955
+ unknown_step: "unknown_step";
956
+ unknown_lens: "unknown_lens";
957
+ unknown_export_target: "unknown_export_target";
958
+ no_target: "no_target";
959
+ no_decision_flag: "no_decision_flag";
960
+ config_invalid: "config_invalid";
961
+ policy_invalid: "policy_invalid";
962
+ capture_unreachable: "capture_unreachable";
963
+ auth_injection_failed: "auth_injection_failed";
964
+ capture_failed: "capture_failed";
965
+ grounding_failed: "grounding_failed";
966
+ adapter_failed: "adapter_failed";
967
+ model_unavailable: "model_unavailable";
968
+ invalid_model_request: "invalid_model_request";
969
+ model_request_failed: "model_request_failed";
970
+ finding_draft_invalid: "finding_draft_invalid";
971
+ finding_score_failed: "finding_score_failed";
972
+ backlog_synthesis_failed: "backlog_synthesis_failed";
973
+ reconciliation_failed: "reconciliation_failed";
974
+ finding_not_found: "finding_not_found";
975
+ evidence_missing: "evidence_missing";
976
+ invalid_verdict_transition: "invalid_verdict_transition";
977
+ run_not_found: "run_not_found";
978
+ runs_incomparable: "runs_incomparable";
979
+ invalid_run_id: "invalid_run_id";
980
+ invalid_resume_stage: "invalid_resume_stage";
981
+ validation_run_failed: "validation_run_failed";
982
+ step_failed: "step_failed";
983
+ pipeline_completion_failed: "pipeline_completion_failed";
984
+ export_partial: "export_partial";
985
+ export_failed: "export_failed";
986
+ state_read_failed: "state_read_failed";
987
+ state_write_failed: "state_write_failed";
988
+ state_corrupt: "state_corrupt";
989
+ baseline_write_failed: "baseline_write_failed";
990
+ no_findings_to_baseline: "no_findings_to_baseline";
991
+ no_pipeline: "no_pipeline";
992
+ mcp_schema_incompatible: "mcp_schema_incompatible";
993
+ }>;
994
+ type SurfaceErrorCode = z.infer<typeof SurfaceErrorCodeSchema>;
995
+ type SurfaceErrorDefinition = {
996
+ readonly kind: SurfaceErrorKind;
997
+ readonly exitCode: CliExitCode;
998
+ };
999
+ declare const SURFACE_ERROR_DEFINITIONS: {
1000
+ readonly unknown_step: {
1001
+ readonly kind: "UsageError";
1002
+ readonly exitCode: 2;
1003
+ };
1004
+ readonly unknown_lens: {
1005
+ readonly kind: "UsageError";
1006
+ readonly exitCode: 2;
1007
+ };
1008
+ readonly unknown_export_target: {
1009
+ readonly kind: "UsageError";
1010
+ readonly exitCode: 2;
1011
+ };
1012
+ readonly no_target: {
1013
+ readonly kind: "UsageError";
1014
+ readonly exitCode: 2;
1015
+ };
1016
+ readonly no_decision_flag: {
1017
+ readonly kind: "UsageError";
1018
+ readonly exitCode: 2;
1019
+ };
1020
+ readonly config_invalid: {
1021
+ readonly kind: "ConfigError";
1022
+ readonly exitCode: 1;
1023
+ };
1024
+ readonly policy_invalid: {
1025
+ readonly kind: "ConfigError";
1026
+ readonly exitCode: 1;
1027
+ };
1028
+ readonly capture_unreachable: {
1029
+ readonly kind: "CaptureError";
1030
+ readonly exitCode: 1;
1031
+ };
1032
+ readonly auth_injection_failed: {
1033
+ readonly kind: "CaptureError";
1034
+ readonly exitCode: 1;
1035
+ };
1036
+ readonly capture_failed: {
1037
+ readonly kind: "CaptureError";
1038
+ readonly exitCode: 1;
1039
+ };
1040
+ readonly grounding_failed: {
1041
+ readonly kind: "GroundingError";
1042
+ readonly exitCode: 1;
1043
+ };
1044
+ readonly adapter_failed: {
1045
+ readonly kind: "AdapterError";
1046
+ readonly exitCode: 1;
1047
+ };
1048
+ readonly model_unavailable: {
1049
+ readonly kind: "ModelError";
1050
+ readonly exitCode: 1;
1051
+ };
1052
+ readonly invalid_model_request: {
1053
+ readonly kind: "ModelError";
1054
+ readonly exitCode: 1;
1055
+ };
1056
+ readonly model_request_failed: {
1057
+ readonly kind: "ModelError";
1058
+ readonly exitCode: 1;
1059
+ };
1060
+ readonly finding_draft_invalid: {
1061
+ readonly kind: "StateError";
1062
+ readonly exitCode: 1;
1063
+ };
1064
+ readonly finding_score_failed: {
1065
+ readonly kind: "StateError";
1066
+ readonly exitCode: 1;
1067
+ };
1068
+ readonly backlog_synthesis_failed: {
1069
+ readonly kind: "StateError";
1070
+ readonly exitCode: 1;
1071
+ };
1072
+ readonly reconciliation_failed: {
1073
+ readonly kind: "StateError";
1074
+ readonly exitCode: 1;
1075
+ };
1076
+ readonly finding_not_found: {
1077
+ readonly kind: "StateError";
1078
+ readonly exitCode: 1;
1079
+ };
1080
+ readonly evidence_missing: {
1081
+ readonly kind: "StateError";
1082
+ readonly exitCode: 1;
1083
+ };
1084
+ readonly invalid_verdict_transition: {
1085
+ readonly kind: "StateError";
1086
+ readonly exitCode: 1;
1087
+ };
1088
+ readonly run_not_found: {
1089
+ readonly kind: "RuntimeError";
1090
+ readonly exitCode: 1;
1091
+ };
1092
+ readonly runs_incomparable: {
1093
+ readonly kind: "RuntimeError";
1094
+ readonly exitCode: 1;
1095
+ };
1096
+ readonly invalid_run_id: {
1097
+ readonly kind: "RuntimeError";
1098
+ readonly exitCode: 1;
1099
+ };
1100
+ readonly invalid_resume_stage: {
1101
+ readonly kind: "RuntimeError";
1102
+ readonly exitCode: 1;
1103
+ };
1104
+ readonly validation_run_failed: {
1105
+ readonly kind: "RuntimeError";
1106
+ readonly exitCode: 1;
1107
+ };
1108
+ readonly step_failed: {
1109
+ readonly kind: "RuntimeError";
1110
+ readonly exitCode: 1;
1111
+ };
1112
+ readonly pipeline_completion_failed: {
1113
+ readonly kind: "RuntimeError";
1114
+ readonly exitCode: 1;
1115
+ };
1116
+ readonly export_partial: {
1117
+ readonly kind: "IntegrationError";
1118
+ readonly exitCode: 1;
1119
+ };
1120
+ readonly export_failed: {
1121
+ readonly kind: "IntegrationError";
1122
+ readonly exitCode: 1;
1123
+ };
1124
+ readonly state_read_failed: {
1125
+ readonly kind: "StateError";
1126
+ readonly exitCode: 1;
1127
+ };
1128
+ readonly state_write_failed: {
1129
+ readonly kind: "StateError";
1130
+ readonly exitCode: 1;
1131
+ };
1132
+ readonly state_corrupt: {
1133
+ readonly kind: "StateError";
1134
+ readonly exitCode: 1;
1135
+ };
1136
+ readonly baseline_write_failed: {
1137
+ readonly kind: "StateError";
1138
+ readonly exitCode: 1;
1139
+ };
1140
+ readonly no_findings_to_baseline: {
1141
+ readonly kind: "StateError";
1142
+ readonly exitCode: 1;
1143
+ };
1144
+ readonly no_pipeline: {
1145
+ readonly kind: "StateError";
1146
+ readonly exitCode: 1;
1147
+ };
1148
+ readonly mcp_schema_incompatible: {
1149
+ readonly kind: "McpError";
1150
+ readonly exitCode: 1;
1151
+ };
1152
+ };
1153
+ declare const SurfaceErrorSchema: z.ZodObject<{
1154
+ kind: z.ZodEnum<{
1155
+ UsageError: "UsageError";
1156
+ ConfigError: "ConfigError";
1157
+ CaptureError: "CaptureError";
1158
+ GroundingError: "GroundingError";
1159
+ AdapterError: "AdapterError";
1160
+ ModelError: "ModelError";
1161
+ IntegrationError: "IntegrationError";
1162
+ StateError: "StateError";
1163
+ RuntimeError: "RuntimeError";
1164
+ McpError: "McpError";
1165
+ }>;
1166
+ code: z.ZodEnum<{
1167
+ unknown_step: "unknown_step";
1168
+ unknown_lens: "unknown_lens";
1169
+ unknown_export_target: "unknown_export_target";
1170
+ no_target: "no_target";
1171
+ no_decision_flag: "no_decision_flag";
1172
+ config_invalid: "config_invalid";
1173
+ policy_invalid: "policy_invalid";
1174
+ capture_unreachable: "capture_unreachable";
1175
+ auth_injection_failed: "auth_injection_failed";
1176
+ capture_failed: "capture_failed";
1177
+ grounding_failed: "grounding_failed";
1178
+ adapter_failed: "adapter_failed";
1179
+ model_unavailable: "model_unavailable";
1180
+ invalid_model_request: "invalid_model_request";
1181
+ model_request_failed: "model_request_failed";
1182
+ finding_draft_invalid: "finding_draft_invalid";
1183
+ finding_score_failed: "finding_score_failed";
1184
+ backlog_synthesis_failed: "backlog_synthesis_failed";
1185
+ reconciliation_failed: "reconciliation_failed";
1186
+ finding_not_found: "finding_not_found";
1187
+ evidence_missing: "evidence_missing";
1188
+ invalid_verdict_transition: "invalid_verdict_transition";
1189
+ run_not_found: "run_not_found";
1190
+ runs_incomparable: "runs_incomparable";
1191
+ invalid_run_id: "invalid_run_id";
1192
+ invalid_resume_stage: "invalid_resume_stage";
1193
+ validation_run_failed: "validation_run_failed";
1194
+ step_failed: "step_failed";
1195
+ pipeline_completion_failed: "pipeline_completion_failed";
1196
+ export_partial: "export_partial";
1197
+ export_failed: "export_failed";
1198
+ state_read_failed: "state_read_failed";
1199
+ state_write_failed: "state_write_failed";
1200
+ state_corrupt: "state_corrupt";
1201
+ baseline_write_failed: "baseline_write_failed";
1202
+ no_findings_to_baseline: "no_findings_to_baseline";
1203
+ no_pipeline: "no_pipeline";
1204
+ mcp_schema_incompatible: "mcp_schema_incompatible";
1205
+ }>;
1206
+ message: z.ZodString;
1207
+ cause: z.ZodOptional<z.ZodUnknown>;
1208
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1209
+ }, z.core.$strict>;
1210
+ type SurfaceError = z.infer<typeof SurfaceErrorSchema>;
1211
+ type Result<T, E = SurfaceError> = {
1212
+ readonly ok: true;
1213
+ readonly value: T;
1214
+ } | {
1215
+ readonly ok: false;
1216
+ readonly error: E;
1217
+ };
1218
+ declare function ok<T>(value: T): Result<T>;
1219
+ declare function err<E extends SurfaceError>(error: E): Result<never, E>;
1220
+ declare function isOk<T, E>(result: Result<T, E>): result is {
1221
+ readonly ok: true;
1222
+ readonly value: T;
1223
+ };
1224
+ declare function isErr<T, E>(result: Result<T, E>): result is {
1225
+ readonly ok: false;
1226
+ readonly error: E;
1227
+ };
1228
+ type CreateSurfaceErrorOptions = {
1229
+ readonly cause?: unknown;
1230
+ readonly details?: Record<string, unknown>;
1231
+ };
1232
+ declare function createSurfaceError(code: SurfaceErrorCode, message: string, options?: CreateSurfaceErrorOptions): SurfaceError;
1233
+ type EdgeErrorContext = {
1234
+ readonly judgedRequired?: boolean;
1235
+ readonly modelUnavailableIsDegradation?: boolean;
1236
+ };
1237
+ declare function exitCodeForSurfaceError(error: SurfaceError, context?: EdgeErrorContext): CliExitCode;
1238
+ type CliErrorEnvelope = {
1239
+ readonly ok: false;
1240
+ readonly command: string;
1241
+ readonly schemaVersion: "1.0";
1242
+ readonly error: {
1243
+ readonly code: SurfaceErrorCode;
1244
+ readonly kind: SurfaceErrorKind;
1245
+ readonly message: string;
1246
+ readonly exitCode: CliExitCode;
1247
+ readonly cause?: unknown;
1248
+ readonly details?: Record<string, unknown>;
1249
+ };
1250
+ };
1251
+ declare function toCliErrorEnvelope(command: string, error: SurfaceError, context?: EdgeErrorContext): CliErrorEnvelope;
1252
+ type McpStructuredError = {
1253
+ readonly code: SurfaceErrorCode;
1254
+ readonly kind: SurfaceErrorKind;
1255
+ readonly message: string;
1256
+ readonly details?: Record<string, unknown>;
1257
+ };
1258
+ declare function toMcpError(error: SurfaceError): McpStructuredError;
1259
+
1260
+ declare const EvaluationMethodSchema: z.ZodEnum<{
1261
+ measured: "measured";
1262
+ judged: "judged";
1263
+ }>;
1264
+ type EvaluationMethod = z.infer<typeof EvaluationMethodSchema>;
1265
+ declare const SeverityBandSchema: z.ZodEnum<{
1266
+ P0: "P0";
1267
+ P1: "P1";
1268
+ P2: "P2";
1269
+ P3: "P3";
1270
+ }>;
1271
+ type SeverityBand = z.infer<typeof SeverityBandSchema>;
1272
+ declare const ConfidenceBandSchema: z.ZodEnum<{
1273
+ assert: "assert";
1274
+ "surface-as-question": "surface-as-question";
1275
+ "suppress-unless-deep": "suppress-unless-deep";
1276
+ }>;
1277
+ type ConfidenceBand = z.infer<typeof ConfidenceBandSchema>;
1278
+ declare const RectSchema: z.ZodObject<{
1279
+ x: z.ZodNumber;
1280
+ y: z.ZodNumber;
1281
+ width: z.ZodNumber;
1282
+ height: z.ZodNumber;
1283
+ }, z.core.$strict>;
1284
+ type Rect = z.infer<typeof RectSchema>;
1285
+ declare const ToolResultEvidenceSchema: z.ZodObject<{
1286
+ kind: z.ZodLiteral<"tool-result">;
1287
+ tool: z.ZodEnum<{
1288
+ axe: "axe";
1289
+ lighthouse: "lighthouse";
1290
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
1291
+ backend: "backend";
1292
+ "context-ingestor": "context-ingestor";
1293
+ }>;
1294
+ rule: z.ZodString;
1295
+ measuredValue: z.ZodString;
1296
+ threshold: z.ZodOptional<z.ZodString>;
1297
+ }, z.core.$strict>;
1298
+ type ToolResultEvidence = z.infer<typeof ToolResultEvidenceSchema>;
1299
+ declare const DomEvidenceSchema: z.ZodObject<{
1300
+ kind: z.ZodLiteral<"dom">;
1301
+ selector: z.ZodString;
1302
+ elementRef: z.ZodOptional<z.ZodString>;
1303
+ }, z.core.$strict>;
1304
+ type DomEvidence = z.infer<typeof DomEvidenceSchema>;
1305
+ declare const ScreenshotRegionEvidenceSchema: z.ZodObject<{
1306
+ kind: z.ZodLiteral<"screenshot-region">;
1307
+ artifactId: z.ZodString;
1308
+ rect: z.ZodObject<{
1309
+ x: z.ZodNumber;
1310
+ y: z.ZodNumber;
1311
+ width: z.ZodNumber;
1312
+ height: z.ZodNumber;
1313
+ }, z.core.$strict>;
1314
+ }, z.core.$strict>;
1315
+ type ScreenshotRegionEvidence = z.infer<typeof ScreenshotRegionEvidenceSchema>;
1316
+ declare const CitedHeuristicEvidenceSchema: z.ZodObject<{
1317
+ kind: z.ZodLiteral<"cited-heuristic">;
1318
+ knowledgeEntryId: z.ZodString;
1319
+ }, z.core.$strict>;
1320
+ type CitedHeuristicEvidence = z.infer<typeof CitedHeuristicEvidenceSchema>;
1321
+ declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1322
+ kind: z.ZodLiteral<"tool-result">;
1323
+ tool: z.ZodEnum<{
1324
+ axe: "axe";
1325
+ lighthouse: "lighthouse";
1326
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
1327
+ backend: "backend";
1328
+ "context-ingestor": "context-ingestor";
1329
+ }>;
1330
+ rule: z.ZodString;
1331
+ measuredValue: z.ZodString;
1332
+ threshold: z.ZodOptional<z.ZodString>;
1333
+ }, z.core.$strict>, z.ZodObject<{
1334
+ kind: z.ZodLiteral<"dom">;
1335
+ selector: z.ZodString;
1336
+ elementRef: z.ZodOptional<z.ZodString>;
1337
+ }, z.core.$strict>, z.ZodObject<{
1338
+ kind: z.ZodLiteral<"screenshot-region">;
1339
+ artifactId: z.ZodString;
1340
+ rect: z.ZodObject<{
1341
+ x: z.ZodNumber;
1342
+ y: z.ZodNumber;
1343
+ width: z.ZodNumber;
1344
+ height: z.ZodNumber;
1345
+ }, z.core.$strict>;
1346
+ }, z.core.$strict>, z.ZodObject<{
1347
+ kind: z.ZodLiteral<"cited-heuristic">;
1348
+ knowledgeEntryId: z.ZodString;
1349
+ }, z.core.$strict>], "kind">;
1350
+ type Evidence = z.infer<typeof EvidenceSchema>;
1351
+ declare const DimensionsSchema: z.ZodObject<{
1352
+ severity: z.ZodNumber;
1353
+ confidence: z.ZodNumber;
1354
+ effort: z.ZodNumber;
1355
+ userImpact: z.ZodNumber;
1356
+ businessImpact: z.ZodNumber;
1357
+ a11yLegalRisk: z.ZodNumber;
1358
+ evidenceQuality: z.ZodNumber;
1359
+ agentImplementability: z.ZodNumber;
1360
+ }, z.core.$strict>;
1361
+ type Dimensions = z.infer<typeof DimensionsSchema>;
1362
+ declare const LocationSchema: z.ZodObject<{
1363
+ file: z.ZodOptional<z.ZodString>;
1364
+ component: z.ZodOptional<z.ZodString>;
1365
+ selector: z.ZodOptional<z.ZodString>;
1366
+ elementRef: z.ZodOptional<z.ZodString>;
1367
+ }, z.core.$strict>;
1368
+ type Location = z.infer<typeof LocationSchema>;
1369
+ declare const ContrastHexSuggestedPatchSchema: z.ZodObject<{
1370
+ kind: z.ZodLiteral<"contrast-hex">;
1371
+ change: z.ZodString;
1372
+ }, z.core.$strict>;
1373
+ declare const AriaAttributeSuggestedPatchSchema: z.ZodObject<{
1374
+ kind: z.ZodLiteral<"aria-attribute">;
1375
+ change: z.ZodString;
1376
+ }, z.core.$strict>;
1377
+ declare const TargetSizeSuggestedPatchSchema: z.ZodObject<{
1378
+ kind: z.ZodLiteral<"target-size">;
1379
+ change: z.ZodString;
1380
+ }, z.core.$strict>;
1381
+ declare const SuggestedPatchSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1382
+ kind: z.ZodLiteral<"contrast-hex">;
1383
+ change: z.ZodString;
1384
+ }, z.core.$strict>, z.ZodObject<{
1385
+ kind: z.ZodLiteral<"aria-attribute">;
1386
+ change: z.ZodString;
1387
+ }, z.core.$strict>, z.ZodObject<{
1388
+ kind: z.ZodLiteral<"target-size">;
1389
+ change: z.ZodString;
1390
+ }, z.core.$strict>], "kind">;
1391
+ type SuggestedPatch = z.infer<typeof SuggestedPatchSchema>;
1392
+ declare const FindingDraftSchema: z.ZodObject<{
1393
+ draftId: z.ZodString;
1394
+ lens: z.ZodString;
1395
+ issueType: z.ZodString;
1396
+ method: z.ZodEnum<{
1397
+ measured: "measured";
1398
+ judged: "judged";
1399
+ }>;
1400
+ title: z.ZodString;
1401
+ rationale: z.ZodString;
1402
+ citedHeuristics: z.ZodArray<z.ZodString>;
1403
+ evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1404
+ kind: z.ZodLiteral<"tool-result">;
1405
+ tool: z.ZodEnum<{
1406
+ axe: "axe";
1407
+ lighthouse: "lighthouse";
1408
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
1409
+ backend: "backend";
1410
+ "context-ingestor": "context-ingestor";
1411
+ }>;
1412
+ rule: z.ZodString;
1413
+ measuredValue: z.ZodString;
1414
+ threshold: z.ZodOptional<z.ZodString>;
1415
+ }, z.core.$strict>, z.ZodObject<{
1416
+ kind: z.ZodLiteral<"dom">;
1417
+ selector: z.ZodString;
1418
+ elementRef: z.ZodOptional<z.ZodString>;
1419
+ }, z.core.$strict>, z.ZodObject<{
1420
+ kind: z.ZodLiteral<"screenshot-region">;
1421
+ artifactId: z.ZodString;
1422
+ rect: z.ZodObject<{
1423
+ x: z.ZodNumber;
1424
+ y: z.ZodNumber;
1425
+ width: z.ZodNumber;
1426
+ height: z.ZodNumber;
1427
+ }, z.core.$strict>;
1428
+ }, z.core.$strict>, z.ZodObject<{
1429
+ kind: z.ZodLiteral<"cited-heuristic">;
1430
+ knowledgeEntryId: z.ZodString;
1431
+ }, z.core.$strict>], "kind">>;
1432
+ rawDimensions: z.ZodObject<{
1433
+ severity: z.ZodOptional<z.ZodNumber>;
1434
+ confidence: z.ZodOptional<z.ZodNumber>;
1435
+ effort: z.ZodOptional<z.ZodNumber>;
1436
+ userImpact: z.ZodOptional<z.ZodNumber>;
1437
+ businessImpact: z.ZodOptional<z.ZodNumber>;
1438
+ a11yLegalRisk: z.ZodOptional<z.ZodNumber>;
1439
+ evidenceQuality: z.ZodOptional<z.ZodNumber>;
1440
+ agentImplementability: z.ZodOptional<z.ZodNumber>;
1441
+ }, z.core.$strict>;
1442
+ location: z.ZodObject<{
1443
+ file: z.ZodOptional<z.ZodString>;
1444
+ component: z.ZodOptional<z.ZodString>;
1445
+ selector: z.ZodOptional<z.ZodString>;
1446
+ elementRef: z.ZodOptional<z.ZodString>;
1447
+ }, z.core.$strict>;
1448
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1449
+ kind: z.ZodLiteral<"contrast-hex">;
1450
+ change: z.ZodString;
1451
+ }, z.core.$strict>, z.ZodObject<{
1452
+ kind: z.ZodLiteral<"aria-attribute">;
1453
+ change: z.ZodString;
1454
+ }, z.core.$strict>, z.ZodObject<{
1455
+ kind: z.ZodLiteral<"target-size">;
1456
+ change: z.ZodString;
1457
+ }, z.core.$strict>], "kind">>;
1458
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1459
+ }, z.core.$strict>;
1460
+ type FindingDraft = z.infer<typeof FindingDraftSchema>;
1461
+ declare const FindingSchema: z.ZodObject<{
1462
+ id: z.ZodString;
1463
+ lens: z.ZodString;
1464
+ issueType: z.ZodString;
1465
+ method: z.ZodEnum<{
1466
+ measured: "measured";
1467
+ judged: "judged";
1468
+ }>;
1469
+ title: z.ZodString;
1470
+ rationale: z.ZodString;
1471
+ citedHeuristics: z.ZodArray<z.ZodString>;
1472
+ evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1473
+ kind: z.ZodLiteral<"tool-result">;
1474
+ tool: z.ZodEnum<{
1475
+ axe: "axe";
1476
+ lighthouse: "lighthouse";
1477
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
1478
+ backend: "backend";
1479
+ "context-ingestor": "context-ingestor";
1480
+ }>;
1481
+ rule: z.ZodString;
1482
+ measuredValue: z.ZodString;
1483
+ threshold: z.ZodOptional<z.ZodString>;
1484
+ }, z.core.$strict>, z.ZodObject<{
1485
+ kind: z.ZodLiteral<"dom">;
1486
+ selector: z.ZodString;
1487
+ elementRef: z.ZodOptional<z.ZodString>;
1488
+ }, z.core.$strict>, z.ZodObject<{
1489
+ kind: z.ZodLiteral<"screenshot-region">;
1490
+ artifactId: z.ZodString;
1491
+ rect: z.ZodObject<{
1492
+ x: z.ZodNumber;
1493
+ y: z.ZodNumber;
1494
+ width: z.ZodNumber;
1495
+ height: z.ZodNumber;
1496
+ }, z.core.$strict>;
1497
+ }, z.core.$strict>, z.ZodObject<{
1498
+ kind: z.ZodLiteral<"cited-heuristic">;
1499
+ knowledgeEntryId: z.ZodString;
1500
+ }, z.core.$strict>], "kind">>;
1501
+ dimensions: z.ZodObject<{
1502
+ severity: z.ZodNumber;
1503
+ confidence: z.ZodNumber;
1504
+ effort: z.ZodNumber;
1505
+ userImpact: z.ZodNumber;
1506
+ businessImpact: z.ZodNumber;
1507
+ a11yLegalRisk: z.ZodNumber;
1508
+ evidenceQuality: z.ZodNumber;
1509
+ agentImplementability: z.ZodNumber;
1510
+ }, z.core.$strict>;
1511
+ severityBand: z.ZodEnum<{
1512
+ P0: "P0";
1513
+ P1: "P1";
1514
+ P2: "P2";
1515
+ P3: "P3";
1516
+ }>;
1517
+ location: z.ZodObject<{
1518
+ file: z.ZodOptional<z.ZodString>;
1519
+ component: z.ZodOptional<z.ZodString>;
1520
+ selector: z.ZodOptional<z.ZodString>;
1521
+ elementRef: z.ZodOptional<z.ZodString>;
1522
+ }, z.core.$strict>;
1523
+ confidenceBand: z.ZodEnum<{
1524
+ assert: "assert";
1525
+ "surface-as-question": "surface-as-question";
1526
+ "suppress-unless-deep": "suppress-unless-deep";
1527
+ }>;
1528
+ gatedForHuman: z.ZodBoolean;
1529
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1530
+ kind: z.ZodLiteral<"contrast-hex">;
1531
+ change: z.ZodString;
1532
+ }, z.core.$strict>, z.ZodObject<{
1533
+ kind: z.ZodLiteral<"aria-attribute">;
1534
+ change: z.ZodString;
1535
+ }, z.core.$strict>, z.ZodObject<{
1536
+ kind: z.ZodLiteral<"target-size">;
1537
+ change: z.ZodString;
1538
+ }, z.core.$strict>], "kind">>;
1539
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1540
+ }, z.core.$strict>;
1541
+ type Finding = z.infer<typeof FindingSchema>;
1542
+ /**
1543
+ * A single backlog row produced from a scored finding.
1544
+ *
1545
+ * Priority is an internal ordering value, not a headline product score. Duplicate
1546
+ * findings remain visible, but rows that match a prior finding by issue type and
1547
+ * precise anchor, or by issue type plus high title-token similarity on precise
1548
+ * anchors, are demoted and point at the highest-priority canonical finding.
1549
+ */
1550
+ declare const BacklogEntrySchema: z.ZodObject<{
1551
+ findingId: z.ZodString;
1552
+ title: z.ZodOptional<z.ZodString>;
1553
+ rationale: z.ZodOptional<z.ZodString>;
1554
+ severityBand: z.ZodOptional<z.ZodEnum<{
1555
+ P0: "P0";
1556
+ P1: "P1";
1557
+ P2: "P2";
1558
+ P3: "P3";
1559
+ }>>;
1560
+ location: z.ZodOptional<z.ZodObject<{
1561
+ file: z.ZodOptional<z.ZodString>;
1562
+ component: z.ZodOptional<z.ZodString>;
1563
+ selector: z.ZodOptional<z.ZodString>;
1564
+ elementRef: z.ZodOptional<z.ZodString>;
1565
+ }, z.core.$strict>>;
1566
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1567
+ kind: z.ZodLiteral<"contrast-hex">;
1568
+ change: z.ZodString;
1569
+ }, z.core.$strict>, z.ZodObject<{
1570
+ kind: z.ZodLiteral<"aria-attribute">;
1571
+ change: z.ZodString;
1572
+ }, z.core.$strict>, z.ZodObject<{
1573
+ kind: z.ZodLiteral<"target-size">;
1574
+ change: z.ZodString;
1575
+ }, z.core.$strict>], "kind">>;
1576
+ priority: z.ZodNumber;
1577
+ rank: z.ZodNumber;
1578
+ demotedAsDuplicateOf: z.ZodOptional<z.ZodString>;
1579
+ }, z.core.$strict>;
1580
+ type BacklogEntry = z.infer<typeof BacklogEntrySchema>;
1581
+ /**
1582
+ * Ordered implementation backlog for a run.
1583
+ *
1584
+ * Entries are ranked in list order by descending priority. The schema rejects
1585
+ * duplicate finding IDs and any extra scalar summary fields such as
1586
+ * `score`/`overallScore`.
1587
+ */
1588
+ declare const BacklogSchema: z.ZodObject<{
1589
+ id: z.ZodString;
1590
+ runId: z.ZodString;
1591
+ entries: z.ZodArray<z.ZodObject<{
1592
+ findingId: z.ZodString;
1593
+ title: z.ZodOptional<z.ZodString>;
1594
+ rationale: z.ZodOptional<z.ZodString>;
1595
+ severityBand: z.ZodOptional<z.ZodEnum<{
1596
+ P0: "P0";
1597
+ P1: "P1";
1598
+ P2: "P2";
1599
+ P3: "P3";
1600
+ }>>;
1601
+ location: z.ZodOptional<z.ZodObject<{
1602
+ file: z.ZodOptional<z.ZodString>;
1603
+ component: z.ZodOptional<z.ZodString>;
1604
+ selector: z.ZodOptional<z.ZodString>;
1605
+ elementRef: z.ZodOptional<z.ZodString>;
1606
+ }, z.core.$strict>>;
1607
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1608
+ kind: z.ZodLiteral<"contrast-hex">;
1609
+ change: z.ZodString;
1610
+ }, z.core.$strict>, z.ZodObject<{
1611
+ kind: z.ZodLiteral<"aria-attribute">;
1612
+ change: z.ZodString;
1613
+ }, z.core.$strict>, z.ZodObject<{
1614
+ kind: z.ZodLiteral<"target-size">;
1615
+ change: z.ZodString;
1616
+ }, z.core.$strict>], "kind">>;
1617
+ priority: z.ZodNumber;
1618
+ rank: z.ZodNumber;
1619
+ demotedAsDuplicateOf: z.ZodOptional<z.ZodString>;
1620
+ }, z.core.$strict>>;
1621
+ }, z.core.$strict>;
1622
+ type Backlog = z.infer<typeof BacklogSchema>;
1623
+ /**
1624
+ * Builds the implementation backlog for a run.
1625
+ *
1626
+ * Findings are ranked by severity, user impact, business impact, confidence,
1627
+ * effort, and accessibility/legal risk. Near duplicates are detected within the
1628
+ * same issue type by matching precise anchors or, when both findings have
1629
+ * precise anchors, title-token similarity of at least 0.7. Duplicate chains point
1630
+ * to the highest-priority canonical finding. The returned backlog intentionally
1631
+ * has no scalar `score` or `overallScore` field.
1632
+ */
1633
+ declare function synthesizeBacklog(runId: string, findings: readonly Finding[]): Result<Backlog>;
1634
+ /**
1635
+ * Converts a validated draft occurrence into the immutable Finding shape used by reports/backlogs.
1636
+ */
1637
+ declare function scoreFinding(draft: FindingDraft, policy?: FindingsPolicy): Result<Finding>;
1638
+ declare const FindingsEnvelopeSchema: z.ZodObject<{
1639
+ schemaVersion: z.ZodLiteral<"1.0">;
1640
+ runId: z.ZodString;
1641
+ generatedAt: z.ZodString;
1642
+ findings: z.ZodArray<z.ZodObject<{
1643
+ id: z.ZodString;
1644
+ lens: z.ZodString;
1645
+ issueType: z.ZodString;
1646
+ method: z.ZodEnum<{
1647
+ measured: "measured";
1648
+ judged: "judged";
1649
+ }>;
1650
+ title: z.ZodString;
1651
+ rationale: z.ZodString;
1652
+ citedHeuristics: z.ZodArray<z.ZodString>;
1653
+ evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1654
+ kind: z.ZodLiteral<"tool-result">;
1655
+ tool: z.ZodEnum<{
1656
+ axe: "axe";
1657
+ lighthouse: "lighthouse";
1658
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
1659
+ backend: "backend";
1660
+ "context-ingestor": "context-ingestor";
1661
+ }>;
1662
+ rule: z.ZodString;
1663
+ measuredValue: z.ZodString;
1664
+ threshold: z.ZodOptional<z.ZodString>;
1665
+ }, z.core.$strict>, z.ZodObject<{
1666
+ kind: z.ZodLiteral<"dom">;
1667
+ selector: z.ZodString;
1668
+ elementRef: z.ZodOptional<z.ZodString>;
1669
+ }, z.core.$strict>, z.ZodObject<{
1670
+ kind: z.ZodLiteral<"screenshot-region">;
1671
+ artifactId: z.ZodString;
1672
+ rect: z.ZodObject<{
1673
+ x: z.ZodNumber;
1674
+ y: z.ZodNumber;
1675
+ width: z.ZodNumber;
1676
+ height: z.ZodNumber;
1677
+ }, z.core.$strict>;
1678
+ }, z.core.$strict>, z.ZodObject<{
1679
+ kind: z.ZodLiteral<"cited-heuristic">;
1680
+ knowledgeEntryId: z.ZodString;
1681
+ }, z.core.$strict>], "kind">>;
1682
+ dimensions: z.ZodObject<{
1683
+ severity: z.ZodNumber;
1684
+ confidence: z.ZodNumber;
1685
+ effort: z.ZodNumber;
1686
+ userImpact: z.ZodNumber;
1687
+ businessImpact: z.ZodNumber;
1688
+ a11yLegalRisk: z.ZodNumber;
1689
+ evidenceQuality: z.ZodNumber;
1690
+ agentImplementability: z.ZodNumber;
1691
+ }, z.core.$strict>;
1692
+ severityBand: z.ZodEnum<{
1693
+ P0: "P0";
1694
+ P1: "P1";
1695
+ P2: "P2";
1696
+ P3: "P3";
1697
+ }>;
1698
+ location: z.ZodObject<{
1699
+ file: z.ZodOptional<z.ZodString>;
1700
+ component: z.ZodOptional<z.ZodString>;
1701
+ selector: z.ZodOptional<z.ZodString>;
1702
+ elementRef: z.ZodOptional<z.ZodString>;
1703
+ }, z.core.$strict>;
1704
+ confidenceBand: z.ZodEnum<{
1705
+ assert: "assert";
1706
+ "surface-as-question": "surface-as-question";
1707
+ "suppress-unless-deep": "suppress-unless-deep";
1708
+ }>;
1709
+ gatedForHuman: z.ZodBoolean;
1710
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1711
+ kind: z.ZodLiteral<"contrast-hex">;
1712
+ change: z.ZodString;
1713
+ }, z.core.$strict>, z.ZodObject<{
1714
+ kind: z.ZodLiteral<"aria-attribute">;
1715
+ change: z.ZodString;
1716
+ }, z.core.$strict>, z.ZodObject<{
1717
+ kind: z.ZodLiteral<"target-size">;
1718
+ change: z.ZodString;
1719
+ }, z.core.$strict>], "kind">>;
1720
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1721
+ }, z.core.$strict>>;
1722
+ degradation: z.ZodObject<{
1723
+ skippedLenses: z.ZodArray<z.ZodString>;
1724
+ reason: z.ZodNullable<z.ZodString>;
1725
+ }, z.core.$strict>;
1726
+ }, z.core.$strict>;
1727
+ type FindingsEnvelope = z.infer<typeof FindingsEnvelopeSchema>;
1728
+
1729
+ /** Built-in provider ids that core can resolve from environment configuration. */
1730
+ declare const ModelProviderIdSchema: z.ZodEnum<{
1731
+ local: "local";
1732
+ anthropic: "anthropic";
1733
+ openai: "openai";
1734
+ }>;
1735
+ type ModelProviderId = z.infer<typeof ModelProviderIdSchema>;
1736
+ /** Runtime-safe provider configuration; credentialRef names an env var and never stores secrets. */
1737
+ declare const ModelProviderConfigSchema: z.ZodObject<{
1738
+ provider: z.ZodEnum<{
1739
+ local: "local";
1740
+ anthropic: "anthropic";
1741
+ openai: "openai";
1742
+ }>;
1743
+ model: z.ZodString;
1744
+ credentialRef: z.ZodOptional<z.ZodString>;
1745
+ baseUrl: z.ZodOptional<z.ZodString>;
1746
+ }, z.core.$strict>;
1747
+ type ModelProviderConfig = z.infer<typeof ModelProviderConfigSchema>;
1748
+ /** Prompt/input boundary that judged lenses send to a model adapter. */
1749
+ declare const ModelPromptSchema: z.ZodObject<{
1750
+ instructions: z.ZodString;
1751
+ input: z.ZodUnknown;
1752
+ system: z.ZodOptional<z.ZodString>;
1753
+ }, z.core.$strict>;
1754
+ type ModelPrompt = z.infer<typeof ModelPromptSchema>;
1755
+ /** Model completion request with bounded generation controls. */
1756
+ declare const ModelRequestSchema: z.ZodObject<{
1757
+ prompt: z.ZodObject<{
1758
+ instructions: z.ZodString;
1759
+ input: z.ZodUnknown;
1760
+ system: z.ZodOptional<z.ZodString>;
1761
+ }, z.core.$strict>;
1762
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1763
+ temperature: z.ZodOptional<z.ZodNumber>;
1764
+ }, z.core.$strict>;
1765
+ type ModelRequest = z.infer<typeof ModelRequestSchema>;
1766
+ /** Normalized text response returned by a provider adapter. */
1767
+ declare const ModelResponseSchema: z.ZodObject<{
1768
+ provider: z.ZodEnum<{
1769
+ local: "local";
1770
+ anthropic: "anthropic";
1771
+ openai: "openai";
1772
+ }>;
1773
+ model: z.ZodString;
1774
+ text: z.ZodString;
1775
+ }, z.core.$loose>;
1776
+ type ModelResponse = z.infer<typeof ModelResponseSchema>;
1777
+ /** Availability result used to skip judged lenses without failing measured coverage. */
1778
+ declare const ModelAvailabilitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1779
+ available: z.ZodLiteral<true>;
1780
+ provider: z.ZodEnum<{
1781
+ local: "local";
1782
+ anthropic: "anthropic";
1783
+ openai: "openai";
1784
+ }>;
1785
+ model: z.ZodString;
1786
+ }, z.core.$strict>, z.ZodObject<{
1787
+ available: z.ZodLiteral<false>;
1788
+ reason: z.ZodEnum<{
1789
+ "no-model-configured": "no-model-configured";
1790
+ "missing-credential": "missing-credential";
1791
+ "missing-base-url": "missing-base-url";
1792
+ "invalid-provider": "invalid-provider";
1793
+ "invalid-config": "invalid-config";
1794
+ }>;
1795
+ message: z.ZodString;
1796
+ }, z.core.$strict>], "available">;
1797
+ type ModelAvailability = z.infer<typeof ModelAvailabilitySchema>;
1798
+ /** Per-lens skip metadata reported when judged coverage is unavailable. */
1799
+ declare const ModelLensSkipSchema: z.ZodObject<{
1800
+ lensId: z.ZodString;
1801
+ reason: z.ZodLiteral<"model_unavailable">;
1802
+ message: z.ZodString;
1803
+ }, z.core.$strict>;
1804
+ type ModelLensSkip = z.infer<typeof ModelLensSkipSchema>;
1805
+ type MaybePromise$1<T> = T | Promise<T>;
1806
+ /** Interface judged lenses call; implementations must return Result values instead of throwing. */
1807
+ interface ModelProvider {
1808
+ readonly id?: ModelProviderId;
1809
+ availability(): MaybePromise$1<Result<ModelAvailability, SurfaceError>>;
1810
+ complete(request: ModelRequest): MaybePromise$1<Result<ModelResponse, SurfaceError>>;
1811
+ }
1812
+ /** Inputs accepted by the resolver; env defaults to process.env when available. */
1813
+ type ModelProviderConfigInput = {
1814
+ readonly env?: Readonly<Record<string, string | undefined>>;
1815
+ readonly provider?: string;
1816
+ readonly model?: string;
1817
+ readonly baseUrl?: string;
1818
+ };
1819
+ /** Result of resolving BYO model configuration from explicit inputs and environment. */
1820
+ type ModelProviderResolution = {
1821
+ readonly configured: true;
1822
+ readonly config: ModelProviderConfig;
1823
+ } | {
1824
+ readonly configured: false;
1825
+ readonly availability: ModelAvailability;
1826
+ };
1827
+ /** Adapter implemented by SDK/CLI integrations behind the core provider boundary. */
1828
+ type ModelCompletionAdapter = (request: ModelRequest, config: ModelProviderConfig) => MaybePromise$1<Result<ModelResponse, SurfaceError>>;
1829
+ /** Canonical no-model degradation message for US-012 reporting. */
1830
+ declare const JUDGED_COVERAGE_UNAVAILABLE_MESSAGE = "judged coverage unavailable - no model configured";
1831
+ /**
1832
+ * Resolve provider configuration from explicit input and env.
1833
+ *
1834
+ * Explicit provider wins; otherwise autodetection prefers Anthropic, then OpenAI, then local
1835
+ * endpoints. Invalid or incomplete runtime input returns configured:false instead of throwing.
1836
+ */
1837
+ declare function resolveModelProviderConfig(input?: ModelProviderConfigInput): ModelProviderResolution;
1838
+ /**
1839
+ * Create a configured provider from validated config and an injected adapter.
1840
+ *
1841
+ * Invalid requests and invalid success responses from adapters are mapped to ModelError Results;
1842
+ * adapter-provided errors are returned as-is.
1843
+ */
1844
+ declare function createConfiguredModelProvider(config: ModelProviderConfig, complete: ModelCompletionAdapter): ModelProvider;
1845
+ /**
1846
+ * Create a provider that reports unavailable and returns model_unavailable for completion calls.
1847
+ */
1848
+ declare function createUnavailableModelProvider(availability?: ModelAvailability): ModelProvider;
1849
+ /** Return skip metadata for model-required lenses when availability is false. */
1850
+ declare function modelSkipForLens(lens: {
1851
+ readonly id: string;
1852
+ readonly requiresModel: boolean;
1853
+ }, availability: ModelAvailability): ModelLensSkip | undefined;
1854
+
1855
+ declare const IdentityAnchorKindSchema: z.ZodEnum<{
1856
+ file: "file";
1857
+ selector: "selector";
1858
+ component: "component";
1859
+ "element-ref": "element-ref";
1860
+ }>;
1861
+ type IdentityAnchorKind = z.infer<typeof IdentityAnchorKindSchema>;
1862
+ declare const FindingIdentityCandidateSchema: z.ZodObject<{
1863
+ lens: z.ZodString;
1864
+ issueType: z.ZodString;
1865
+ locationAnchor: z.ZodString;
1866
+ anchorKind: z.ZodEnum<{
1867
+ file: "file";
1868
+ selector: "selector";
1869
+ component: "component";
1870
+ "element-ref": "element-ref";
1871
+ }>;
1872
+ }, z.core.$strict>;
1873
+ type FindingIdentityCandidate = z.infer<typeof FindingIdentityCandidateSchema>;
1874
+ declare const FindingIdentitySchema: z.ZodObject<{
1875
+ lens: z.ZodString;
1876
+ issueType: z.ZodString;
1877
+ locationAnchor: z.ZodString;
1878
+ anchorKind: z.ZodEnum<{
1879
+ file: "file";
1880
+ selector: "selector";
1881
+ component: "component";
1882
+ "element-ref": "element-ref";
1883
+ }>;
1884
+ discriminator: z.ZodOptional<z.ZodString>;
1885
+ identityKey: z.ZodString;
1886
+ }, z.core.$strict>;
1887
+ type FindingIdentity = z.infer<typeof FindingIdentitySchema>;
1888
+ declare const StableFindingIdentityAssignmentSchema: z.ZodObject<{
1889
+ findingId: z.ZodString;
1890
+ status: z.ZodLiteral<"stable">;
1891
+ identity: z.ZodObject<{
1892
+ lens: z.ZodString;
1893
+ issueType: z.ZodString;
1894
+ locationAnchor: z.ZodString;
1895
+ anchorKind: z.ZodEnum<{
1896
+ file: "file";
1897
+ selector: "selector";
1898
+ component: "component";
1899
+ "element-ref": "element-ref";
1900
+ }>;
1901
+ discriminator: z.ZodOptional<z.ZodString>;
1902
+ identityKey: z.ZodString;
1903
+ }, z.core.$strict>;
1904
+ reason: z.ZodEnum<{
1905
+ "stable-anchor": "stable-anchor";
1906
+ "disambiguated-collision": "disambiguated-collision";
1907
+ }>;
1908
+ }, z.core.$strict>;
1909
+ type StableFindingIdentityAssignment = z.infer<typeof StableFindingIdentityAssignmentSchema>;
1910
+ declare const BrokenFindingIdentityAssignmentSchema: z.ZodObject<{
1911
+ findingId: z.ZodString;
1912
+ status: z.ZodLiteral<"identity-broken">;
1913
+ candidate: z.ZodObject<{
1914
+ lens: z.ZodString;
1915
+ issueType: z.ZodString;
1916
+ locationAnchor: z.ZodString;
1917
+ anchorKind: z.ZodEnum<{
1918
+ file: "file";
1919
+ selector: "selector";
1920
+ component: "component";
1921
+ "element-ref": "element-ref";
1922
+ }>;
1923
+ }, z.core.$strict>;
1924
+ reason: z.ZodLiteral<"ambiguous-collision">;
1925
+ }, z.core.$strict>;
1926
+ type BrokenFindingIdentityAssignment = z.infer<typeof BrokenFindingIdentityAssignmentSchema>;
1927
+ declare const FindingIdentityAssignmentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1928
+ findingId: z.ZodString;
1929
+ status: z.ZodLiteral<"stable">;
1930
+ identity: z.ZodObject<{
1931
+ lens: z.ZodString;
1932
+ issueType: z.ZodString;
1933
+ locationAnchor: z.ZodString;
1934
+ anchorKind: z.ZodEnum<{
1935
+ file: "file";
1936
+ selector: "selector";
1937
+ component: "component";
1938
+ "element-ref": "element-ref";
1939
+ }>;
1940
+ discriminator: z.ZodOptional<z.ZodString>;
1941
+ identityKey: z.ZodString;
1942
+ }, z.core.$strict>;
1943
+ reason: z.ZodEnum<{
1944
+ "stable-anchor": "stable-anchor";
1945
+ "disambiguated-collision": "disambiguated-collision";
1946
+ }>;
1947
+ }, z.core.$strict>, z.ZodObject<{
1948
+ findingId: z.ZodString;
1949
+ status: z.ZodLiteral<"identity-broken">;
1950
+ candidate: z.ZodObject<{
1951
+ lens: z.ZodString;
1952
+ issueType: z.ZodString;
1953
+ locationAnchor: z.ZodString;
1954
+ anchorKind: z.ZodEnum<{
1955
+ file: "file";
1956
+ selector: "selector";
1957
+ component: "component";
1958
+ "element-ref": "element-ref";
1959
+ }>;
1960
+ }, z.core.$strict>;
1961
+ reason: z.ZodLiteral<"ambiguous-collision">;
1962
+ }, z.core.$strict>], "status">;
1963
+ type FindingIdentityAssignment = z.infer<typeof FindingIdentityAssignmentSchema>;
1964
+ declare const StableIdentityDriftResultSchema: z.ZodObject<{
1965
+ currentFindingId: z.ZodString;
1966
+ status: z.ZodLiteral<"stable">;
1967
+ identity: z.ZodObject<{
1968
+ lens: z.ZodString;
1969
+ issueType: z.ZodString;
1970
+ locationAnchor: z.ZodString;
1971
+ anchorKind: z.ZodEnum<{
1972
+ file: "file";
1973
+ selector: "selector";
1974
+ component: "component";
1975
+ "element-ref": "element-ref";
1976
+ }>;
1977
+ discriminator: z.ZodOptional<z.ZodString>;
1978
+ identityKey: z.ZodString;
1979
+ }, z.core.$strict>;
1980
+ reason: z.ZodLiteral<"stable-anchor">;
1981
+ }, z.core.$strict>;
1982
+ declare const BrokenIdentityDriftResultSchema: z.ZodObject<{
1983
+ currentFindingId: z.ZodString;
1984
+ status: z.ZodLiteral<"identity-broken">;
1985
+ previousIdentity: z.ZodObject<{
1986
+ lens: z.ZodString;
1987
+ issueType: z.ZodString;
1988
+ locationAnchor: z.ZodString;
1989
+ anchorKind: z.ZodEnum<{
1990
+ file: "file";
1991
+ selector: "selector";
1992
+ component: "component";
1993
+ "element-ref": "element-ref";
1994
+ }>;
1995
+ discriminator: z.ZodOptional<z.ZodString>;
1996
+ identityKey: z.ZodString;
1997
+ }, z.core.$strict>;
1998
+ candidate: z.ZodObject<{
1999
+ lens: z.ZodString;
2000
+ issueType: z.ZodString;
2001
+ locationAnchor: z.ZodString;
2002
+ anchorKind: z.ZodEnum<{
2003
+ file: "file";
2004
+ selector: "selector";
2005
+ component: "component";
2006
+ "element-ref": "element-ref";
2007
+ }>;
2008
+ }, z.core.$strict>;
2009
+ reason: z.ZodLiteral<"anchor-drift">;
2010
+ }, z.core.$strict>;
2011
+ declare const IdentityDriftResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2012
+ currentFindingId: z.ZodString;
2013
+ status: z.ZodLiteral<"stable">;
2014
+ identity: z.ZodObject<{
2015
+ lens: z.ZodString;
2016
+ issueType: z.ZodString;
2017
+ locationAnchor: z.ZodString;
2018
+ anchorKind: z.ZodEnum<{
2019
+ file: "file";
2020
+ selector: "selector";
2021
+ component: "component";
2022
+ "element-ref": "element-ref";
2023
+ }>;
2024
+ discriminator: z.ZodOptional<z.ZodString>;
2025
+ identityKey: z.ZodString;
2026
+ }, z.core.$strict>;
2027
+ reason: z.ZodLiteral<"stable-anchor">;
2028
+ }, z.core.$strict>, z.ZodObject<{
2029
+ currentFindingId: z.ZodString;
2030
+ status: z.ZodLiteral<"identity-broken">;
2031
+ previousIdentity: z.ZodObject<{
2032
+ lens: z.ZodString;
2033
+ issueType: z.ZodString;
2034
+ locationAnchor: z.ZodString;
2035
+ anchorKind: z.ZodEnum<{
2036
+ file: "file";
2037
+ selector: "selector";
2038
+ component: "component";
2039
+ "element-ref": "element-ref";
2040
+ }>;
2041
+ discriminator: z.ZodOptional<z.ZodString>;
2042
+ identityKey: z.ZodString;
2043
+ }, z.core.$strict>;
2044
+ candidate: z.ZodObject<{
2045
+ lens: z.ZodString;
2046
+ issueType: z.ZodString;
2047
+ locationAnchor: z.ZodString;
2048
+ anchorKind: z.ZodEnum<{
2049
+ file: "file";
2050
+ selector: "selector";
2051
+ component: "component";
2052
+ "element-ref": "element-ref";
2053
+ }>;
2054
+ }, z.core.$strict>;
2055
+ reason: z.ZodLiteral<"anchor-drift">;
2056
+ }, z.core.$strict>], "status">;
2057
+ type IdentityDriftResult = z.infer<typeof IdentityDriftResultSchema>;
2058
+ declare function canonicalJson(value: unknown, seen?: WeakSet<object>): string;
2059
+ declare function normalizeAnchorForKind(kind: IdentityAnchorKind, value: string): string;
2060
+ declare function stableEvidenceAnchor(evidence: Evidence): Record<string, unknown> | undefined;
2061
+ /**
2062
+ * Derives the ADR-010 identity candidate from lens, issue type, and the most stable location
2063
+ * anchor. Element refs win over selectors, selectors win over components, and components win
2064
+ * over file-only anchors. Invalid findings raise ZodError from FindingSchema. The stored lens,
2065
+ * issue type, and anchor values are normalized so display casing/path casing does not change keys.
2066
+ */
2067
+ declare function deriveFindingIdentityCandidate(finding: Finding): FindingIdentityCandidate;
2068
+ /**
2069
+ * Derives a stable key for a single finding. Use assignFindingIdentities for a full run so
2070
+ * same-anchor collisions can be marked identity-broken. The key is based only on lens, issue
2071
+ * type, and location anchor so wording, evidence, and other mutable details do not churn identity.
2072
+ */
2073
+ declare function deriveFindingIdentity(finding: Finding): FindingIdentity;
2074
+ /**
2075
+ * Assigns stable identities for a run.
2076
+ *
2077
+ * Findings with unique anchors get stable hashes. Coarse component/file anchors include stable
2078
+ * secondary anchors when location-like evidence is available, so identity does not depend on
2079
+ * whether another same-anchor finding exists in the current run. Same precise-anchor collisions
2080
+ * are marked identity-broken. Same coarse-anchor collisions are disambiguated only when secondary
2081
+ * anchors differ; duplicate secondary anchors are identity-broken because assigning ordinals would
2082
+ * make closed-loop state shift when another indistinguishable finding appears or disappears.
2083
+ *
2084
+ * Example:
2085
+ * assignFindingIdentities(findings).filter((entry) => entry.status === "stable")
2086
+ * returns entries whose identityKey can be used by the closed-loop state machine.
2087
+ */
2088
+ declare function assignFindingIdentities(findings: readonly Finding[]): FindingIdentityAssignment[];
2089
+ /**
2090
+ * Compares a previous identity with a current finding occurrence.
2091
+ *
2092
+ * Matching anchors are stable. Any changed anchor is identity-broken, and callers must not infer
2093
+ * resolved/regressed from it.
2094
+ */
2095
+ declare function matchFindingIdentity(previousIdentity: FindingIdentity, currentFinding: Finding): IdentityDriftResult;
2096
+ declare const identityInternalsForTesting: Readonly<{
2097
+ canonicalJson: typeof canonicalJson;
2098
+ normalizeAnchorForKind: typeof normalizeAnchorForKind;
2099
+ stableEvidenceAnchor: typeof stableEvidenceAnchor;
2100
+ }>;
2101
+
2102
+ declare const FindingStatusSchema: z.ZodEnum<{
2103
+ "identity-broken": "identity-broken";
2104
+ new: "new";
2105
+ "still-failing": "still-failing";
2106
+ resolved: "resolved";
2107
+ regressed: "regressed";
2108
+ }>;
2109
+ type FindingStatus = z.infer<typeof FindingStatusSchema>;
2110
+ declare const GateDispositionSchema: z.ZodEnum<{
2111
+ active: "active";
2112
+ "ignored-by-waiver": "ignored-by-waiver";
2113
+ }>;
2114
+ type GateDisposition = z.infer<typeof GateDispositionSchema>;
2115
+ declare const WaiverSchema: z.ZodObject<{
2116
+ findingIdentityKey: z.ZodString;
2117
+ reason: z.ZodString;
2118
+ owner: z.ZodString;
2119
+ expiry: z.ZodOptional<z.ZodString>;
2120
+ }, z.core.$strict>;
2121
+ type Waiver = Readonly<z.infer<typeof WaiverSchema>>;
2122
+ declare const BaselineSchema: z.ZodObject<{
2123
+ baselineId: z.ZodString;
2124
+ identityKeys: z.ZodArray<z.ZodString>;
2125
+ reason: z.ZodOptional<z.ZodString>;
2126
+ waivers: z.ZodDefault<z.ZodArray<z.ZodObject<{
2127
+ findingIdentityKey: z.ZodString;
2128
+ reason: z.ZodString;
2129
+ owner: z.ZodString;
2130
+ expiry: z.ZodOptional<z.ZodString>;
2131
+ }, z.core.$strict>>>;
2132
+ }, z.core.$strict>;
2133
+ type ParsedBaseline = z.infer<typeof BaselineSchema>;
2134
+ type Baseline = Omit<Readonly<ParsedBaseline>, "identityKeys" | "waivers"> & {
2135
+ readonly identityKeys: readonly string[];
2136
+ readonly waivers: readonly Waiver[];
2137
+ };
2138
+ declare const ValidationCheckSchema: z.ZodObject<{
2139
+ kind: z.ZodEnum<{
2140
+ "measured-rule": "measured-rule";
2141
+ "re-evaluate-lens": "re-evaluate-lens";
2142
+ }>;
2143
+ expectation: z.ZodString;
2144
+ }, z.core.$strict>;
2145
+ type ValidationCheck = z.infer<typeof ValidationCheckSchema>;
2146
+ declare const TrackedFindingHistoryEntrySchema: z.ZodObject<{
2147
+ runId: z.ZodString;
2148
+ status: z.ZodEnum<{
2149
+ "identity-broken": "identity-broken";
2150
+ new: "new";
2151
+ "still-failing": "still-failing";
2152
+ resolved: "resolved";
2153
+ regressed: "regressed";
2154
+ }>;
2155
+ }, z.core.$loose>;
2156
+ type TrackedFindingHistoryEntry = z.infer<typeof TrackedFindingHistoryEntrySchema>;
2157
+ declare const TrackedFindingSchema: z.ZodObject<{
2158
+ identityKey: z.ZodString;
2159
+ identity: z.ZodObject<{
2160
+ lens: z.ZodString;
2161
+ issueType: z.ZodString;
2162
+ locationAnchor: z.ZodString;
2163
+ anchorKind: z.ZodEnum<{
2164
+ file: "file";
2165
+ selector: "selector";
2166
+ component: "component";
2167
+ "element-ref": "element-ref";
2168
+ }>;
2169
+ discriminator: z.ZodOptional<z.ZodString>;
2170
+ identityKey: z.ZodString;
2171
+ }, z.core.$strict>;
2172
+ currentFindingId: z.ZodOptional<z.ZodString>;
2173
+ status: z.ZodEnum<{
2174
+ "identity-broken": "identity-broken";
2175
+ new: "new";
2176
+ "still-failing": "still-failing";
2177
+ resolved: "resolved";
2178
+ regressed: "regressed";
2179
+ }>;
2180
+ gateDisposition: z.ZodEnum<{
2181
+ active: "active";
2182
+ "ignored-by-waiver": "ignored-by-waiver";
2183
+ }>;
2184
+ validation: z.ZodObject<{
2185
+ kind: z.ZodEnum<{
2186
+ "measured-rule": "measured-rule";
2187
+ "re-evaluate-lens": "re-evaluate-lens";
2188
+ }>;
2189
+ expectation: z.ZodString;
2190
+ }, z.core.$strict>;
2191
+ firstSeenRunId: z.ZodString;
2192
+ lastSeenRunId: z.ZodString;
2193
+ history: z.ZodArray<z.ZodObject<{
2194
+ runId: z.ZodString;
2195
+ status: z.ZodEnum<{
2196
+ "identity-broken": "identity-broken";
2197
+ new: "new";
2198
+ "still-failing": "still-failing";
2199
+ resolved: "resolved";
2200
+ regressed: "regressed";
2201
+ }>;
2202
+ }, z.core.$loose>>;
2203
+ }, z.core.$loose>;
2204
+ type TrackedFinding = z.infer<typeof TrackedFindingSchema>;
2205
+ declare const TrackedFindingTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2206
+ runId: z.ZodString;
2207
+ kind: z.ZodLiteral<"detected">;
2208
+ finding: z.ZodObject<{
2209
+ id: z.ZodString;
2210
+ lens: z.ZodString;
2211
+ issueType: z.ZodString;
2212
+ method: z.ZodEnum<{
2213
+ measured: "measured";
2214
+ judged: "judged";
2215
+ }>;
2216
+ title: z.ZodString;
2217
+ rationale: z.ZodString;
2218
+ citedHeuristics: z.ZodArray<z.ZodString>;
2219
+ evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2220
+ kind: z.ZodLiteral<"tool-result">;
2221
+ tool: z.ZodEnum<{
2222
+ axe: "axe";
2223
+ lighthouse: "lighthouse";
2224
+ "eslint-jsx-a11y": "eslint-jsx-a11y";
2225
+ backend: "backend";
2226
+ "context-ingestor": "context-ingestor";
2227
+ }>;
2228
+ rule: z.ZodString;
2229
+ measuredValue: z.ZodString;
2230
+ threshold: z.ZodOptional<z.ZodString>;
2231
+ }, z.core.$strict>, z.ZodObject<{
2232
+ kind: z.ZodLiteral<"dom">;
2233
+ selector: z.ZodString;
2234
+ elementRef: z.ZodOptional<z.ZodString>;
2235
+ }, z.core.$strict>, z.ZodObject<{
2236
+ kind: z.ZodLiteral<"screenshot-region">;
2237
+ artifactId: z.ZodString;
2238
+ rect: z.ZodObject<{
2239
+ x: z.ZodNumber;
2240
+ y: z.ZodNumber;
2241
+ width: z.ZodNumber;
2242
+ height: z.ZodNumber;
2243
+ }, z.core.$strict>;
2244
+ }, z.core.$strict>, z.ZodObject<{
2245
+ kind: z.ZodLiteral<"cited-heuristic">;
2246
+ knowledgeEntryId: z.ZodString;
2247
+ }, z.core.$strict>], "kind">>;
2248
+ dimensions: z.ZodObject<{
2249
+ severity: z.ZodNumber;
2250
+ confidence: z.ZodNumber;
2251
+ effort: z.ZodNumber;
2252
+ userImpact: z.ZodNumber;
2253
+ businessImpact: z.ZodNumber;
2254
+ a11yLegalRisk: z.ZodNumber;
2255
+ evidenceQuality: z.ZodNumber;
2256
+ agentImplementability: z.ZodNumber;
2257
+ }, z.core.$strict>;
2258
+ severityBand: z.ZodEnum<{
2259
+ P0: "P0";
2260
+ P1: "P1";
2261
+ P2: "P2";
2262
+ P3: "P3";
2263
+ }>;
2264
+ location: z.ZodObject<{
2265
+ file: z.ZodOptional<z.ZodString>;
2266
+ component: z.ZodOptional<z.ZodString>;
2267
+ selector: z.ZodOptional<z.ZodString>;
2268
+ elementRef: z.ZodOptional<z.ZodString>;
2269
+ }, z.core.$strict>;
2270
+ confidenceBand: z.ZodEnum<{
2271
+ assert: "assert";
2272
+ "surface-as-question": "surface-as-question";
2273
+ "suppress-unless-deep": "suppress-unless-deep";
2274
+ }>;
2275
+ gatedForHuman: z.ZodBoolean;
2276
+ suggestedPatch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2277
+ kind: z.ZodLiteral<"contrast-hex">;
2278
+ change: z.ZodString;
2279
+ }, z.core.$strict>, z.ZodObject<{
2280
+ kind: z.ZodLiteral<"aria-attribute">;
2281
+ change: z.ZodString;
2282
+ }, z.core.$strict>, z.ZodObject<{
2283
+ kind: z.ZodLiteral<"target-size">;
2284
+ change: z.ZodString;
2285
+ }, z.core.$strict>], "kind">>;
2286
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
2287
+ }, z.core.$strict>;
2288
+ identity: z.ZodOptional<z.ZodObject<{
2289
+ lens: z.ZodString;
2290
+ issueType: z.ZodString;
2291
+ locationAnchor: z.ZodString;
2292
+ anchorKind: z.ZodEnum<{
2293
+ file: "file";
2294
+ selector: "selector";
2295
+ component: "component";
2296
+ "element-ref": "element-ref";
2297
+ }>;
2298
+ discriminator: z.ZodOptional<z.ZodString>;
2299
+ identityKey: z.ZodString;
2300
+ }, z.core.$strict>>;
2301
+ }, z.core.$strict>, z.ZodObject<{
2302
+ runId: z.ZodString;
2303
+ kind: z.ZodLiteral<"missing">;
2304
+ validationPassed: z.ZodBoolean;
2305
+ }, z.core.$strict>, z.ZodObject<{
2306
+ runId: z.ZodString;
2307
+ kind: z.ZodLiteral<"identity-broken">;
2308
+ currentFindingId: z.ZodOptional<z.ZodString>;
2309
+ }, z.core.$strict>], "kind">;
2310
+ type TrackedFindingTransition = z.infer<typeof TrackedFindingTransitionSchema>;
2311
+ type CreateTrackedFindingInput = {
2312
+ readonly runId: string;
2313
+ readonly finding: Finding;
2314
+ readonly identity?: FindingIdentity;
2315
+ readonly validation: ValidationCheck;
2316
+ readonly gateDisposition?: GateDisposition;
2317
+ };
2318
+ type CreateBaselineInput = {
2319
+ readonly baselineId: string;
2320
+ readonly identityKeys: readonly string[];
2321
+ readonly reason?: string;
2322
+ readonly waivers?: readonly Waiver[];
2323
+ };
2324
+ type ApplyWaiversInput = {
2325
+ readonly trackedFindings: readonly TrackedFinding[];
2326
+ readonly waivers: readonly Waiver[];
2327
+ readonly now: Date | string;
2328
+ };
2329
+ type DiffableTrackedFinding = {
2330
+ readonly currentFindingId?: string | undefined;
2331
+ readonly identityKey: string;
2332
+ readonly status: FindingStatus;
2333
+ };
2334
+ type TrackedFindingsDiffEntry = {
2335
+ readonly findingId?: string;
2336
+ readonly identityKey: string;
2337
+ readonly status: FindingStatus;
2338
+ };
2339
+ type TrackedFindingsDiff = {
2340
+ readonly identityBroken: readonly TrackedFindingsDiffEntry[];
2341
+ readonly introduced: readonly TrackedFindingsDiffEntry[];
2342
+ readonly regressed: readonly TrackedFindingsDiffEntry[];
2343
+ readonly resolved: readonly TrackedFindingsDiffEntry[];
2344
+ readonly stillFailing: readonly TrackedFindingsDiffEntry[];
2345
+ };
2346
+ /**
2347
+ * Create the first tracked lifecycle record for a finding identity.
2348
+ *
2349
+ * @param input - Finding, run id, validation check, and optional precomputed identity.
2350
+ * @returns A tracked finding with `new` status and one history entry.
2351
+ * @throws If the finding, validation check, or explicit identity is invalid, or if the explicit
2352
+ * identity does not match the supplied finding.
2353
+ */
2354
+ declare function createTrackedFinding(input: CreateTrackedFindingInput): TrackedFinding;
2355
+ /**
2356
+ * Apply one lifecycle observation to a tracked finding.
2357
+ *
2358
+ * @param trackedFinding - Existing tracked finding state.
2359
+ * @param transition - Detected, missing, or identity-broken observation for a later run.
2360
+ * @returns Updated tracked finding state with appended history.
2361
+ * @throws If the transition is invalid, reuses a run id, or a detected finding resolves to a
2362
+ * different identityKey than the tracked finding.
2363
+ */
2364
+ declare function transitionTrackedFinding(trackedFinding: TrackedFinding, transition: TrackedFindingTransition): TrackedFinding;
2365
+ declare function createBaseline(input: CreateBaselineInput): Baseline;
2366
+ declare function applyWaiversToTrackedFindings(input: ApplyWaiversInput): readonly TrackedFinding[];
2367
+ declare function isWaiverActive(waiver: Waiver, now: Date | string): boolean;
2368
+ declare function diffTrackedFindings(before: readonly DiffableTrackedFinding[], after: readonly DiffableTrackedFinding[]): TrackedFindingsDiff;
2369
+
2370
+ type MaybePromise<T> = T | Promise<T>;
2371
+ type ViewportLabel = "mobile" | "tablet" | "desktop";
2372
+ type Theme = "light" | "dark";
2373
+ interface Viewport {
2374
+ readonly width: number;
2375
+ readonly height: number;
2376
+ readonly label: ViewportLabel;
2377
+ }
2378
+ type TargetKind = "url" | "localhost" | "route" | "screenshot" | "component" | "dom";
2379
+ interface Target {
2380
+ readonly kind: TargetKind;
2381
+ readonly ref: string;
2382
+ readonly viewport?: Viewport;
2383
+ readonly theme?: Theme;
2384
+ }
2385
+ type BuiltInCaptureBackendId = "playwright" | "agent-browser" | "static";
2386
+ type CaptureArtifactType = "screenshot" | "dom-snapshot" | "accessibility-tree" | "computed-styles";
2387
+ interface CaptureArtifact {
2388
+ readonly id: string;
2389
+ readonly type: CaptureArtifactType;
2390
+ readonly path: string;
2391
+ readonly redacted: boolean;
2392
+ }
2393
+ interface DegradationReport {
2394
+ readonly skippedArtifacts: CaptureArtifactType[];
2395
+ readonly skippedReason: string;
2396
+ }
2397
+ interface TargetVerification {
2398
+ readonly authInjectedBeforeNavigation: boolean;
2399
+ readonly isRequestedTarget: boolean;
2400
+ readonly landedUrl: string;
2401
+ readonly requestedUrl: string;
2402
+ }
2403
+ type CaptureStatus = "requested" | "completed" | "degraded" | "auth-failed" | "unreachable";
2404
+ interface Capture {
2405
+ readonly id: string;
2406
+ readonly target: Target;
2407
+ readonly backend: string;
2408
+ readonly authUsed?: boolean;
2409
+ readonly artifacts: CaptureArtifact[];
2410
+ readonly degradation?: DegradationReport;
2411
+ readonly verification?: TargetVerification;
2412
+ readonly capturedAt: string;
2413
+ readonly status: CaptureStatus;
2414
+ }
2415
+ interface CaptureNetworkPolicy {
2416
+ readonly allowlist: readonly string[];
2417
+ readonly targetHost: string;
2418
+ readonly targetOrigin: string;
2419
+ readonly resolvedAddresses: readonly string[];
2420
+ readonly blockPrivateNetwork: boolean;
2421
+ readonly enforceOnNavigation: true;
2422
+ readonly enforceOnRedirects: true;
2423
+ readonly enforceOnSubresources: true;
2424
+ }
2425
+ interface CaptureOptions {
2426
+ readonly config: SurfaceConfig["capture"];
2427
+ readonly artifactRoot?: string;
2428
+ readonly artifactWriter?: ArtifactWriter;
2429
+ readonly authStateRef?: string;
2430
+ readonly computedStyleLimit?: number;
2431
+ readonly navigationTimeoutMs?: number;
2432
+ readonly navigationWaitUntil?: "domcontentloaded" | "load";
2433
+ readonly networkPolicy?: CaptureNetworkPolicy;
2434
+ }
2435
+ interface CaptureBackend {
2436
+ readonly id: string;
2437
+ detect(): boolean;
2438
+ observe(target: Target, options: CaptureOptions): MaybePromise<Result<Capture, SurfaceError>>;
2439
+ }
2440
+ interface SourceFileRef {
2441
+ readonly path: string;
2442
+ readonly contents: string;
2443
+ }
2444
+ interface ComponentMapEntry {
2445
+ readonly component: string;
2446
+ readonly file: string;
2447
+ readonly selectors: string[];
2448
+ }
2449
+ interface ComponentMap {
2450
+ readonly entries: ComponentMapEntry[];
2451
+ }
2452
+ interface FrameworkAdapter {
2453
+ readonly id: string;
2454
+ supports(file: string): boolean;
2455
+ introspect(source: SourceFileRef): MaybePromise<Result<ComponentMap, SurfaceError>>;
2456
+ }
2457
+ interface ToolResult {
2458
+ readonly tool: string;
2459
+ readonly evidence: ToolResultEvidence[];
2460
+ }
2461
+ interface GroundingTool {
2462
+ readonly id: string;
2463
+ run(capture: Capture): MaybePromise<Result<ToolResult[], SurfaceError>>;
2464
+ }
2465
+ interface LensContext {
2466
+ readonly capture: Capture;
2467
+ readonly config: SurfaceConfig;
2468
+ readonly evidence: Evidence[];
2469
+ readonly knowledge: KnowledgeSource;
2470
+ readonly model?: ModelProvider;
2471
+ }
2472
+ interface Lens {
2473
+ readonly id: string;
2474
+ readonly method: EvaluationMethod;
2475
+ readonly requiresModel: boolean;
2476
+ readonly requiresLiveDom: boolean;
2477
+ evaluate(context: LensContext): MaybePromise<Result<FindingDraft[], SurfaceError>>;
2478
+ }
2479
+ type BuiltInReportFormat = "findings-md" | "findings-json" | "backlog" | "agent-plan" | "validation-report" | "explain-md" | "explain-json" | "sarif" | "alternatives" | "diff";
2480
+ type ReportFormat = string;
2481
+ interface Report {
2482
+ readonly format: ReportFormat;
2483
+ readonly bytes: Uint8Array;
2484
+ readonly byteStable: boolean;
2485
+ }
2486
+ interface ReportRenderer {
2487
+ readonly format: ReportFormat;
2488
+ render(findings: readonly Finding[], backlog: Backlog): MaybePromise<Result<Report, SurfaceError>>;
2489
+ }
2490
+ type GatePolicy = SurfaceConfig["reporting"]["gatePolicy"];
2491
+ interface GateResult {
2492
+ readonly passed: boolean;
2493
+ readonly failingFindingIds: string[];
2494
+ readonly exitCode: 0 | 1 | 2;
2495
+ readonly baselineId?: string;
2496
+ }
2497
+ type GateEvaluationContext = {
2498
+ readonly baseline?: Baseline;
2499
+ readonly trackedFindings?: readonly TrackedFinding[];
2500
+ readonly now?: Date | string;
2501
+ };
2502
+ interface GateEvaluator {
2503
+ evaluate(findings: readonly Finding[], policy: GatePolicy, context?: GateEvaluationContext): MaybePromise<Result<GateResult, SurfaceError>>;
2504
+ }
2505
+ interface LocalBacklogRef {
2506
+ readonly path: string;
2507
+ readonly backlogId: string;
2508
+ }
2509
+ type BuiltInIssueExportTarget = "github" | "linear" | "jira";
2510
+ type IssueExportTarget = string;
2511
+ interface IssueExport {
2512
+ readonly id: string;
2513
+ readonly target: IssueExportTarget;
2514
+ readonly synced: string[];
2515
+ readonly unsynced: string[];
2516
+ readonly status: "complete" | "partial" | "failed";
2517
+ }
2518
+ interface IssueExporter {
2519
+ readonly target: IssueExportTarget;
2520
+ export(backlog: LocalBacklogRef): MaybePromise<Result<IssueExport, SurfaceError>>;
2521
+ }
2522
+ declare const KNOWLEDGE_CATEGORIES: readonly ["core-heuristics", "accessibility", "forms", "navigation", "states", "visual-content", "design-systems", "conversion", "platform-web", "agent-implementation", "dashboards", "data-viz", "e-commerce", "saas-onboarding", "admin", "search-discovery", "trust-safety", "i18n"];
2523
+ type KnowledgeCategory = (typeof KNOWLEDGE_CATEGORIES)[number];
2524
+ declare const FRESHNESS_VOLATILITIES: readonly ["stable", "evolving", "volatile"];
2525
+ type FreshnessVolatility = (typeof FRESHNESS_VOLATILITIES)[number];
2526
+ interface Citation {
2527
+ readonly source: string;
2528
+ readonly url?: string;
2529
+ readonly retrievedAt: string;
2530
+ }
2531
+ interface Freshness {
2532
+ readonly volatility: FreshnessVolatility;
2533
+ readonly lastReviewed: string;
2534
+ }
2535
+ interface KnowledgeEntry {
2536
+ readonly id: string;
2537
+ readonly title: string;
2538
+ readonly summary: string;
2539
+ readonly category?: KnowledgeCategory;
2540
+ readonly deepGuidance?: string;
2541
+ readonly citation?: Citation;
2542
+ readonly freshness?: Freshness;
2543
+ readonly appliesToAppTypes?: readonly AppType[];
2544
+ readonly appliesToLenses?: readonly string[];
2545
+ readonly steps?: readonly string[];
2546
+ readonly tags?: readonly string[];
2547
+ readonly draft?: boolean;
2548
+ readonly sourcePath?: string;
2549
+ }
2550
+ interface RelevanceQuery {
2551
+ readonly lensId: string;
2552
+ readonly appType: string;
2553
+ readonly step: string;
2554
+ }
2555
+ interface KnowledgeSource {
2556
+ query(relevanceQuery: RelevanceQuery): MaybePromise<Result<KnowledgeEntry[], SurfaceError>>;
2557
+ resolve(id: string): MaybePromise<Result<KnowledgeEntry, SurfaceError>>;
2558
+ }
2559
+ interface PersistArtifactIntent {
2560
+ readonly kind: "capture" | "report" | "generated";
2561
+ readonly relativePath: string;
2562
+ readonly bytes: Uint8Array;
2563
+ }
2564
+ interface PersistedArtifactRef {
2565
+ readonly path: string;
2566
+ readonly sha256: string;
2567
+ }
2568
+ interface ArtifactWriter {
2569
+ writeArtifact(intent: PersistArtifactIntent): MaybePromise<Result<PersistedArtifactRef, SurfaceError>>;
2570
+ }
2571
+ interface ProjectStateSnapshot {
2572
+ readonly version: string;
2573
+ readonly baselines?: readonly Baseline[];
2574
+ readonly backlog?: ProjectBacklogSnapshot;
2575
+ readonly currentStage?: string;
2576
+ readonly findings?: readonly ProjectFindingSnapshot[];
2577
+ readonly runRecords?: readonly ProjectRunRecord[];
2578
+ readonly discovery?: {
2579
+ readonly [key: string]: unknown;
2580
+ readonly appType?: AppType;
2581
+ readonly classification?: {
2582
+ readonly [key: string]: unknown;
2583
+ readonly appType: AppType;
2584
+ readonly matchedSignals: readonly string[];
2585
+ readonly source: "config" | "route-inventory" | "target-ref" | "generic-fallback";
2586
+ };
2587
+ readonly events?: readonly {
2588
+ readonly [key: string]: unknown;
2589
+ readonly type: string;
2590
+ }[];
2591
+ readonly overlayId?: AppType;
2592
+ readonly personaTask?: {
2593
+ readonly [key: string]: unknown;
2594
+ readonly persona: string;
2595
+ readonly task: string;
2596
+ };
2597
+ readonly routeInventory?: {
2598
+ readonly [key: string]: unknown;
2599
+ readonly cap: number;
2600
+ readonly routes: readonly {
2601
+ readonly [key: string]: unknown;
2602
+ readonly path: string;
2603
+ readonly source: "target" | "candidate";
2604
+ }[];
2605
+ readonly skipped: readonly {
2606
+ readonly [key: string]: unknown;
2607
+ readonly path: string;
2608
+ readonly reason: "route_cap_exceeded";
2609
+ readonly source: "target" | "candidate";
2610
+ }[];
2611
+ };
2612
+ readonly runId?: string;
2613
+ };
2614
+ readonly pipeline?: {
2615
+ readonly [key: string]: unknown;
2616
+ readonly activeConfig?: SurfaceConfig;
2617
+ readonly lastCompletedStage?: string | undefined;
2618
+ readonly nextEventSequence?: number | undefined;
2619
+ readonly runId: string;
2620
+ readonly stageIds: readonly string[];
2621
+ };
2622
+ readonly trackedFindings?: readonly TrackedFinding[];
2623
+ readonly verdicts?: readonly ProjectVerdictSnapshot[];
2624
+ }
2625
+ interface ProjectBacklogSnapshot {
2626
+ readonly id: string;
2627
+ readonly runId: string;
2628
+ readonly entries: readonly unknown[];
2629
+ }
2630
+ interface ProjectFindingSnapshot {
2631
+ readonly id: string;
2632
+ }
2633
+ interface ProjectRunRecord {
2634
+ readonly runId: string;
2635
+ readonly status?: "completed" | "failed";
2636
+ readonly backlog?: Backlog;
2637
+ readonly capture?: Capture;
2638
+ readonly findings?: readonly Finding[];
2639
+ readonly skippedLenses?: readonly {
2640
+ readonly lensId: string;
2641
+ readonly message: string;
2642
+ readonly reason: string;
2643
+ }[];
2644
+ readonly trackedFindings: readonly TrackedFinding[];
2645
+ }
2646
+ interface ProjectVerdictSnapshot {
2647
+ readonly decision: string;
2648
+ readonly findingId: string;
2649
+ readonly rationale: string;
2650
+ }
2651
+ interface StateStore {
2652
+ readState(): MaybePromise<Result<ProjectStateSnapshot, SurfaceError>>;
2653
+ writeState(state: ProjectStateSnapshot): MaybePromise<Result<ProjectStateSnapshot, SurfaceError>>;
2654
+ /**
2655
+ * Apply a read-modify-write update under the store's native atomicity
2656
+ * boundary. File-backed stores should hold a file lock; transactional stores
2657
+ * should run the updater inside a transaction. Production stores should
2658
+ * implement this method when callers need race-free state updates; callers may
2659
+ * keep readState/writeState fallback paths only for backward compatibility.
2660
+ */
2661
+ updateState?(updater: (state: ProjectStateSnapshot) => ProjectStateSnapshot): MaybePromise<Result<ProjectStateSnapshot, SurfaceError>>;
2662
+ writeArtifact(intent: PersistArtifactIntent): MaybePromise<Result<PersistedArtifactRef, SurfaceError>>;
2663
+ }
2664
+
2665
+ export { type EdgeErrorContext as $, type AppType as A, type Backlog as B, type Capture as C, type CliErrorEnvelope as D, type CliExitCode as E, CliExitCodeSchema as F, type ComponentMap as G, type ComponentMapEntry as H, type ConfidenceBand as I, ConfidenceBandSchema as J, type ConfidenceCutoffs as K, ConfidenceCutoffsLayerSchema as L, ConfidenceCutoffsSchema as M, ContrastHexSuggestedPatchSchema as N, type CreateBaselineInput as O, type CreateSurfaceErrorOptions as P, type CreateTrackedFindingInput as Q, DEFAULT_FINDINGS_POLICY as R, DEFAULT_SURFACE_CONFIG as S, type DegradationReport as T, type Depth as U, DepthSchema as V, type DiffableTrackedFinding as W, type Dimensions as X, DimensionsSchema as Y, type DomEvidence as Z, DomEvidenceSchema as _, AppTypeSchema as a, type ModelProvider as a$, type EvaluationConfig as a0, EvaluationConfigLayerSchema as a1, EvaluationConfigSchema as a2, type EvaluationMethod as a3, EvaluationMethodSchema as a4, type Evidence as a5, EvidenceSchema as a6, type ExportTarget as a7, ExportTargetSchema as a8, FRESHNESS_VOLATILITIES as a9, type GateResult as aA, type GroundingTool as aB, type IdentityAnchorKind as aC, IdentityAnchorKindSchema as aD, type IdentityDriftResult as aE, IdentityDriftResultSchema as aF, type IssueExport as aG, type IssueExportTarget as aH, type IssueExporter as aI, JUDGED_COVERAGE_UNAVAILABLE_MESSAGE as aJ, KNOWLEDGE_CATEGORIES as aK, type KnowledgeCategory as aL, type KnowledgeEntry as aM, type KnowledgeSource as aN, type Lens as aO, type LensContext as aP, type LocalBacklogRef as aQ, type Location as aR, LocationSchema as aS, type McpStructuredError as aT, type ModelAvailability as aU, ModelAvailabilitySchema as aV, type ModelCompletionAdapter as aW, type ModelLensSkip as aX, ModelLensSkipSchema as aY, type ModelPrompt as aZ, ModelPromptSchema as a_, type Finding as aa, type FindingDraft as ab, FindingDraftSchema as ac, type FindingIdentity as ad, type FindingIdentityAssignment as ae, FindingIdentityAssignmentSchema as af, type FindingIdentityCandidate as ag, FindingIdentityCandidateSchema as ah, FindingIdentitySchema as ai, FindingSchema as aj, type FindingStatus as ak, type FindingsEnvelope as al, FindingsEnvelopeSchema as am, type FindingsPolicy as an, FindingsPolicyLayerSchema as ao, FindingsPolicySchema as ap, type FrameworkAdapter as aq, type Freshness as ar, type FreshnessVolatility as as, type GateDisposition as at, type GateEvaluationContext as au, type GateEvaluator as av, type GatePolicy$1 as aw, type GatePolicy as ax, GatePolicyLayerSchema as ay, GatePolicySchema as az, type ApplyWaiversInput as b, type TargetVerification as b$, type ModelProviderConfig as b0, type ModelProviderConfigInput as b1, ModelProviderConfigSchema as b2, type ModelProviderId as b3, type ModelProviderResolution as b4, type ModelRequest as b5, ModelRequestSchema as b6, type ModelResponse as b7, ModelResponseSchema as b8, type PersistArtifactIntent as b9, SeverityCutoffsLayerSchema as bA, SeverityCutoffsSchema as bB, type SourceFileRef as bC, type StableFindingIdentityAssignment as bD, StableFindingIdentityAssignmentSchema as bE, StableIdentityDriftResultSchema as bF, type Stack as bG, StackSchema as bH, type StateStore as bI, type SuggestedPatch as bJ, SuggestedPatchSchema as bK, type SurfaceConfig as bL, type SurfaceConfigLayer as bM, SurfaceConfigLayerSchema as bN, type SurfaceConfigLayers as bO, SurfaceConfigLayersSchema as bP, SurfaceConfigSchema as bQ, type SurfaceError as bR, type SurfaceErrorCode as bS, SurfaceErrorCodeSchema as bT, type SurfaceErrorDefinition as bU, type SurfaceErrorKind as bV, SurfaceErrorKindSchema as bW, SurfaceErrorSchema as bX, type Target as bY, type TargetKind as bZ, TargetSizeSuggestedPatchSchema as b_, type PersistedArtifactRef as ba, type Preset as bb, PresetSchema as bc, type ProjectBacklogSnapshot as bd, type ProjectFindingSnapshot as be, type ProjectRunRecord as bf, type ProjectStateSnapshot as bg, type ProjectVerdictSnapshot as bh, type Rect as bi, RectSchema as bj, type RedactionRule as bk, RedactionRuleSchema as bl, type RelevanceQuery as bm, type Report as bn, type ReportFormat as bo, type ReportRenderer as bp, type ReportingConfig as bq, ReportingConfigLayerSchema as br, ReportingConfigSchema as bs, type Result as bt, SURFACE_ERROR_DEFINITIONS as bu, type ScreenshotRegionEvidence as bv, ScreenshotRegionEvidenceSchema as bw, type SeverityBand as bx, SeverityBandSchema as by, type SeverityCutoffs as bz, AriaAttributeSuggestedPatchSchema as c, type Theme as c0, type ToolResult as c1, type ToolResultEvidence as c2, ToolResultEvidenceSchema as c3, type TrackedFinding as c4, type TrackedFindingHistoryEntry as c5, type TrackedFindingTransition as c6, type TrackedFindingsDiff as c7, type TrackedFindingsDiffEntry as c8, type ValidationCheck as c9, scoreFinding as cA, synthesizeBacklog as cB, toCliErrorEnvelope as cC, toMcpError as cD, transitionTrackedFinding as cE, type Viewport$1 as ca, type Viewport as cb, type ViewportLabel as cc, ViewportSchema as cd, type Waiver as ce, applyWaiversToTrackedFindings as cf, assignFindingIdentities as cg, createBaseline as ch, createConfiguredModelProvider as ci, createSurfaceError as cj, createTrackedFinding as ck, createUnavailableModelProvider as cl, deriveFindingIdentity as cm, deriveFindingIdentityCandidate as cn, diffTrackedFindings as co, err as cp, exitCodeForSurfaceError as cq, identityInternalsForTesting as cr, isErr as cs, isOk as ct, isWaiverActive as cu, matchFindingIdentity as cv, modelSkipForLens as cw, ok as cx, resolveModelProviderConfig as cy, resolveSurfaceConfig as cz, type ArtifactWriter as d, type BacklogEntry as e, BacklogEntrySchema as f, BacklogSchema as g, type Baseline as h, type BrokenFindingIdentityAssignment as i, BrokenFindingIdentityAssignmentSchema as j, BrokenIdentityDriftResultSchema as k, type BuiltInCaptureBackendId as l, type BuiltInIssueExportTarget as m, type BuiltInReportFormat as n, type CaptureArtifact as o, type CaptureArtifactType as p, type CaptureBackend as q, type CaptureConfig as r, CaptureConfigLayerSchema as s, CaptureConfigSchema as t, type CaptureNetworkPolicy as u, type CaptureOptions as v, type CaptureStatus as w, type Citation as x, type CitedHeuristicEvidence as y, CitedHeuristicEvidenceSchema as z };