@tellagen/mcp-server 0.1.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +208 -12
  2. package/SKILL.md +376 -15
  3. package/contracts/runbooks/manifest.json +47 -0
  4. package/contracts/runbooks/v1/fixtures/global-runbook.json +7 -0
  5. package/contracts/runbooks/v1/runbook-definition.schema.json +25 -0
  6. package/contracts/runbooks/v2/compiled-plan.schema.json +40 -0
  7. package/contracts/runbooks/v2/fixtures/filesystem-pressure.json +181 -0
  8. package/contracts/runbooks/v2/fixtures/grafana-error-rate-plan.json +50 -0
  9. package/contracts/runbooks/v2/fixtures/grafana-error-rate.json +58 -0
  10. package/contracts/runbooks/v2/fixtures/timeline-event-blocks-rejected.json +90 -0
  11. package/contracts/runbooks/v2/fixtures/timeline-event-with-blocks.json +61 -0
  12. package/contracts/runbooks/v2/runbook-definition.schema.json +377 -0
  13. package/contracts/runbooks/v2/timeline-event-blocks.schema.json +480 -0
  14. package/contracts/tellagen-runbook-contracts.json +8 -0
  15. package/dist/auth.d.ts +2 -1
  16. package/dist/auth.js +2 -1
  17. package/dist/auth.js.map +1 -1
  18. package/dist/client.d.ts +20 -0
  19. package/dist/client.js +81 -12
  20. package/dist/client.js.map +1 -1
  21. package/dist/diagnosis-structure.d.ts +1416 -0
  22. package/dist/diagnosis-structure.js +656 -0
  23. package/dist/diagnosis-structure.js.map +1 -0
  24. package/dist/errors.d.ts +2 -1
  25. package/dist/errors.js +4 -1
  26. package/dist/errors.js.map +1 -1
  27. package/dist/figures.d.ts +2336 -0
  28. package/dist/figures.js +1288 -0
  29. package/dist/figures.js.map +1 -0
  30. package/dist/image-info.d.ts +14 -0
  31. package/dist/image-info.js +65 -0
  32. package/dist/image-info.js.map +1 -0
  33. package/dist/index.js +2 -6
  34. package/dist/index.js.map +1 -1
  35. package/dist/server.js +63 -6
  36. package/dist/server.js.map +1 -1
  37. package/dist/source-links.d.ts +101 -0
  38. package/dist/source-links.js +374 -0
  39. package/dist/source-links.js.map +1 -0
  40. package/dist/start.d.ts +11 -0
  41. package/dist/start.js +14 -0
  42. package/dist/start.js.map +1 -0
  43. package/dist/tools/attachments.d.ts +19 -0
  44. package/dist/tools/attachments.js +177 -0
  45. package/dist/tools/attachments.js.map +1 -0
  46. package/dist/tools/causes.d.ts +50 -0
  47. package/dist/tools/causes.js +97 -0
  48. package/dist/tools/causes.js.map +1 -0
  49. package/dist/tools/datasources.d.ts +3 -0
  50. package/dist/tools/datasources.js +325 -0
  51. package/dist/tools/datasources.js.map +1 -0
  52. package/dist/tools/diagnostics.d.ts +3 -0
  53. package/dist/tools/diagnostics.js +113 -0
  54. package/dist/tools/diagnostics.js.map +1 -0
  55. package/dist/tools/figures.d.ts +8 -0
  56. package/dist/tools/figures.js +209 -0
  57. package/dist/tools/figures.js.map +1 -0
  58. package/dist/tools/findings.js +84 -6
  59. package/dist/tools/findings.js.map +1 -1
  60. package/dist/tools/incidents.js +44 -4
  61. package/dist/tools/incidents.js.map +1 -1
  62. package/dist/tools/index.js +14 -0
  63. package/dist/tools/index.js.map +1 -1
  64. package/dist/tools/investigations.js +523 -21
  65. package/dist/tools/investigations.js.map +1 -1
  66. package/dist/tools/postmortem-runbooks.d.ts +786 -0
  67. package/dist/tools/postmortem-runbooks.js +330 -0
  68. package/dist/tools/postmortem-runbooks.js.map +1 -0
  69. package/dist/tools/source-links.d.ts +47 -0
  70. package/dist/tools/source-links.js +302 -0
  71. package/dist/tools/source-links.js.map +1 -0
  72. package/dist/tools/timeline.js +173 -0
  73. package/dist/tools/timeline.js.map +1 -1
  74. package/dist/version.d.ts +2 -0
  75. package/dist/version.js +12 -0
  76. package/dist/version.js.map +1 -0
  77. package/package.json +3 -2
  78. package/server.json +15 -1
@@ -0,0 +1,1416 @@
1
+ /**
2
+ * Diagnosis structure (diagnosis_structure_v1).
3
+ *
4
+ * A newer Tellagen backend accepts richer evidence refs (links, command,
5
+ * datasource), a causal chain with finding ids and a figure per step, ruled
6
+ * out / coverage / unknowns, and a trace step outcome. An older backend
7
+ * decodes request bodies leniently and silently drops fields it does not know,
8
+ * so the agent could not tell. The rule is therefore:
9
+ *
10
+ * - the MCP always advertises the capability in `protocol_capabilities`
11
+ * (src/version.ts), and
12
+ * - it sends the new fields only for a run whose pickup / context response
13
+ * lists the capability in the top-level `server_capabilities`.
14
+ *
15
+ * Zod objects below are not strict, so every new field needs an explicit
16
+ * entry or it is stripped before the request leaves.
17
+ */
18
+ import { z } from "zod";
19
+ import type { TellagenClient } from "./client.js";
20
+ export declare const DIAGNOSIS_STRUCTURE_CAPABILITY = "diagnosis_structure_v1";
21
+ /** change_refs on the result and the ci_run, deployment and release link kinds. */
22
+ export declare const DIAGNOSIS_CHANGES_CAPABILITY = "diagnosis_changes_v1";
23
+ /** The client reads a run's screenshots with tellagen_get_context_attachment. */
24
+ export declare const RUN_IMAGES_CAPABILITY = "run_images_v1";
25
+ /**
26
+ * Remembers the capabilities the backend that answered a pickup or context
27
+ * call for `runId` advertises. A missing `server_capabilities` is a definite
28
+ * "none": the backend predates the field.
29
+ */
30
+ export declare function rememberServerCapabilities(client: TellagenClient, runId: string, response: unknown): void;
31
+ /**
32
+ * Whether the backend accepts a capability for this run. Uses what pickup or
33
+ * context told us in this process; otherwise reads the run context once (a
34
+ * resumed run picked up by another process). A failed lookup counts as "not
35
+ * supported" for this call and is retried on the next one.
36
+ */
37
+ export declare function supportsCapability(client: TellagenClient, runId: string, capability: string): Promise<boolean>;
38
+ /** Whether the backend accepts the diagnosis structure for this run. */
39
+ export declare function supportsDiagnosisStructure(client: TellagenClient, runId: string): Promise<boolean>;
40
+ /** Whether the backend accepts change_refs and the change link kinds for this run. */
41
+ export declare function supportsDiagnosisChanges(client: TellagenClient, runId: string): Promise<boolean>;
42
+ /** Link kinds a backend without diagnosis_changes_v1 does not know. */
43
+ export declare const CHANGE_LINK_KINDS: readonly ["ci_run", "deployment", "release"];
44
+ export declare const EVIDENCE_LINK_KINDS: readonly ["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"];
45
+ export declare const evidenceLinkSchema: z.ZodObject<{
46
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
47
+ label: z.ZodString;
48
+ url: z.ZodEffects<z.ZodString, string, string>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ label: string;
51
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
52
+ url: string;
53
+ }, {
54
+ label: string;
55
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
56
+ url: string;
57
+ }>;
58
+ export declare const evidenceLinksSchema: z.ZodArray<z.ZodObject<{
59
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
60
+ label: z.ZodString;
61
+ url: z.ZodEffects<z.ZodString, string, string>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ label: string;
64
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
65
+ url: string;
66
+ }, {
67
+ label: string;
68
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
69
+ url: string;
70
+ }>, "many">;
71
+ /** Fields added to every evidence ref by diagnosis_structure_v1. */
72
+ export declare const evidenceRefStructureShape: {
73
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
75
+ label: z.ZodString;
76
+ url: z.ZodEffects<z.ZodString, string, string>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ label: string;
79
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
80
+ url: string;
81
+ }, {
82
+ label: string;
83
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
84
+ url: string;
85
+ }>, "many">>;
86
+ command: z.ZodOptional<z.ZodString>;
87
+ datasource: z.ZodOptional<z.ZodString>;
88
+ };
89
+ /** Same size cap as the backend: canonical block JSON, 16 KB. */
90
+ export declare const MAX_FIGURE_BYTES: number;
91
+ export declare const stepFigureSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
92
+ items: z.ZodArray<z.ZodObject<{
93
+ label: z.ZodEffects<z.ZodString, string, string>;
94
+ value: z.ZodEffects<z.ZodString, string, string>;
95
+ caption: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
96
+ tone: z.ZodOptional<z.ZodEnum<["good", "warn", "bad", "neutral"]>>;
97
+ }, "strict", z.ZodTypeAny, {
98
+ value: string;
99
+ label: string;
100
+ caption?: string | undefined;
101
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
102
+ }, {
103
+ value: string;
104
+ label: string;
105
+ caption?: string | undefined;
106
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
107
+ }>, "many">;
108
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
109
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
110
+ postmortem: z.ZodOptional<z.ZodBoolean>;
111
+ type: z.ZodLiteral<"stats">;
112
+ }, "strict", z.ZodTypeAny, {
113
+ type: "stats";
114
+ items: {
115
+ value: string;
116
+ label: string;
117
+ caption?: string | undefined;
118
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
119
+ }[];
120
+ slot?: "summary" | undefined;
121
+ anchor?: string | undefined;
122
+ postmortem?: boolean | undefined;
123
+ }, {
124
+ type: "stats";
125
+ items: {
126
+ value: string;
127
+ label: string;
128
+ caption?: string | undefined;
129
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
130
+ }[];
131
+ slot?: "summary" | undefined;
132
+ anchor?: string | undefined;
133
+ postmortem?: boolean | undefined;
134
+ }>, z.ZodObject<{
135
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
136
+ metric: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
137
+ unit: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
138
+ better: z.ZodOptional<z.ZodEnum<["lower", "higher"]>>;
139
+ delta: z.ZodOptional<z.ZodEnum<["rel", "abs"]>>;
140
+ max: z.ZodOptional<z.ZodNumber>;
141
+ threshold: z.ZodOptional<z.ZodObject<{
142
+ value: z.ZodNumber;
143
+ label: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
144
+ }, "strict", z.ZodTypeAny, {
145
+ value: number;
146
+ label?: string | undefined;
147
+ }, {
148
+ value: number;
149
+ label?: string | undefined;
150
+ }>>;
151
+ rows: z.ZodArray<z.ZodObject<{
152
+ label: z.ZodEffects<z.ZodString, string, string>;
153
+ mono: z.ZodOptional<z.ZodBoolean>;
154
+ before: z.ZodNumber;
155
+ after: z.ZodNumber;
156
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
157
+ label: z.ZodEffects<z.ZodString, string, string>;
158
+ before: z.ZodEffects<z.ZodString, string, string>;
159
+ after: z.ZodEffects<z.ZodString, string, string>;
160
+ }, "strict", z.ZodTypeAny, {
161
+ label: string;
162
+ before: string;
163
+ after: string;
164
+ }, {
165
+ label: string;
166
+ before: string;
167
+ after: string;
168
+ }>, "many">>;
169
+ }, "strict", z.ZodTypeAny, {
170
+ label: string;
171
+ before: number;
172
+ after: number;
173
+ mono?: boolean | undefined;
174
+ details?: {
175
+ label: string;
176
+ before: string;
177
+ after: string;
178
+ }[] | undefined;
179
+ }, {
180
+ label: string;
181
+ before: number;
182
+ after: number;
183
+ mono?: boolean | undefined;
184
+ details?: {
185
+ label: string;
186
+ before: string;
187
+ after: string;
188
+ }[] | undefined;
189
+ }>, "many">;
190
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
191
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
192
+ postmortem: z.ZodOptional<z.ZodBoolean>;
193
+ type: z.ZodLiteral<"compare">;
194
+ }, "strict", z.ZodTypeAny, {
195
+ type: "compare";
196
+ rows: {
197
+ label: string;
198
+ before: number;
199
+ after: number;
200
+ mono?: boolean | undefined;
201
+ details?: {
202
+ label: string;
203
+ before: string;
204
+ after: string;
205
+ }[] | undefined;
206
+ }[];
207
+ title?: string | undefined;
208
+ metric?: string | undefined;
209
+ unit?: string | undefined;
210
+ better?: "lower" | "higher" | undefined;
211
+ delta?: "rel" | "abs" | undefined;
212
+ max?: number | undefined;
213
+ threshold?: {
214
+ value: number;
215
+ label?: string | undefined;
216
+ } | undefined;
217
+ slot?: "summary" | undefined;
218
+ anchor?: string | undefined;
219
+ postmortem?: boolean | undefined;
220
+ }, {
221
+ type: "compare";
222
+ rows: {
223
+ label: string;
224
+ before: number;
225
+ after: number;
226
+ mono?: boolean | undefined;
227
+ details?: {
228
+ label: string;
229
+ before: string;
230
+ after: string;
231
+ }[] | undefined;
232
+ }[];
233
+ title?: string | undefined;
234
+ metric?: string | undefined;
235
+ unit?: string | undefined;
236
+ better?: "lower" | "higher" | undefined;
237
+ delta?: "rel" | "abs" | undefined;
238
+ max?: number | undefined;
239
+ threshold?: {
240
+ value: number;
241
+ label?: string | undefined;
242
+ } | undefined;
243
+ slot?: "summary" | undefined;
244
+ anchor?: string | undefined;
245
+ postmortem?: boolean | undefined;
246
+ }>, z.ZodObject<{
247
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
248
+ unit: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
249
+ series: z.ZodArray<z.ZodNumber, "many">;
250
+ start: z.ZodOptional<z.ZodString>;
251
+ step_seconds: z.ZodOptional<z.ZodNumber>;
252
+ max: z.ZodOptional<z.ZodNumber>;
253
+ threshold: z.ZodOptional<z.ZodObject<{
254
+ value: z.ZodNumber;
255
+ label: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
256
+ }, "strict", z.ZodTypeAny, {
257
+ value: number;
258
+ label?: string | undefined;
259
+ }, {
260
+ value: number;
261
+ label?: string | undefined;
262
+ }>>;
263
+ marks: z.ZodOptional<z.ZodArray<z.ZodObject<{
264
+ i: z.ZodNumber;
265
+ label: z.ZodEffects<z.ZodString, string, string>;
266
+ }, "strict", z.ZodTypeAny, {
267
+ label: string;
268
+ i: number;
269
+ }, {
270
+ label: string;
271
+ i: number;
272
+ }>, "many">>;
273
+ source: z.ZodOptional<z.ZodObject<{
274
+ kind: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
275
+ datasource: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
276
+ query: z.ZodOptional<z.ZodString>;
277
+ from: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
278
+ to: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
279
+ step: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
280
+ artifact_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
281
+ }, "strict", z.ZodTypeAny, {
282
+ kind?: string | undefined;
283
+ datasource?: string | undefined;
284
+ query?: string | undefined;
285
+ from?: string | undefined;
286
+ to?: string | undefined;
287
+ step?: string | undefined;
288
+ artifact_id?: string | undefined;
289
+ }, {
290
+ kind?: string | undefined;
291
+ datasource?: string | undefined;
292
+ query?: string | undefined;
293
+ from?: string | undefined;
294
+ to?: string | undefined;
295
+ step?: string | undefined;
296
+ artifact_id?: string | undefined;
297
+ }>>;
298
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
299
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
300
+ postmortem: z.ZodOptional<z.ZodBoolean>;
301
+ type: z.ZodLiteral<"trend">;
302
+ }, "strict", z.ZodTypeAny, {
303
+ type: "trend";
304
+ series: number[];
305
+ title?: string | undefined;
306
+ unit?: string | undefined;
307
+ max?: number | undefined;
308
+ threshold?: {
309
+ value: number;
310
+ label?: string | undefined;
311
+ } | undefined;
312
+ start?: string | undefined;
313
+ step_seconds?: number | undefined;
314
+ marks?: {
315
+ label: string;
316
+ i: number;
317
+ }[] | undefined;
318
+ source?: {
319
+ kind?: string | undefined;
320
+ datasource?: string | undefined;
321
+ query?: string | undefined;
322
+ from?: string | undefined;
323
+ to?: string | undefined;
324
+ step?: string | undefined;
325
+ artifact_id?: string | undefined;
326
+ } | undefined;
327
+ slot?: "summary" | undefined;
328
+ anchor?: string | undefined;
329
+ postmortem?: boolean | undefined;
330
+ }, {
331
+ type: "trend";
332
+ series: number[];
333
+ title?: string | undefined;
334
+ unit?: string | undefined;
335
+ max?: number | undefined;
336
+ threshold?: {
337
+ value: number;
338
+ label?: string | undefined;
339
+ } | undefined;
340
+ start?: string | undefined;
341
+ step_seconds?: number | undefined;
342
+ marks?: {
343
+ label: string;
344
+ i: number;
345
+ }[] | undefined;
346
+ source?: {
347
+ kind?: string | undefined;
348
+ datasource?: string | undefined;
349
+ query?: string | undefined;
350
+ from?: string | undefined;
351
+ to?: string | undefined;
352
+ step?: string | undefined;
353
+ artifact_id?: string | undefined;
354
+ } | undefined;
355
+ slot?: "summary" | undefined;
356
+ anchor?: string | undefined;
357
+ postmortem?: boolean | undefined;
358
+ }>, z.ZodObject<{
359
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
360
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
361
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
362
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
363
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
364
+ }, z.ZodTypeAny, "passthrough">>]>, {
365
+ type: "stats";
366
+ items: {
367
+ value: string;
368
+ label: string;
369
+ caption?: string | undefined;
370
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
371
+ }[];
372
+ slot?: "summary" | undefined;
373
+ anchor?: string | undefined;
374
+ postmortem?: boolean | undefined;
375
+ } | {
376
+ type: "compare";
377
+ rows: {
378
+ label: string;
379
+ before: number;
380
+ after: number;
381
+ mono?: boolean | undefined;
382
+ details?: {
383
+ label: string;
384
+ before: string;
385
+ after: string;
386
+ }[] | undefined;
387
+ }[];
388
+ title?: string | undefined;
389
+ metric?: string | undefined;
390
+ unit?: string | undefined;
391
+ better?: "lower" | "higher" | undefined;
392
+ delta?: "rel" | "abs" | undefined;
393
+ max?: number | undefined;
394
+ threshold?: {
395
+ value: number;
396
+ label?: string | undefined;
397
+ } | undefined;
398
+ slot?: "summary" | undefined;
399
+ anchor?: string | undefined;
400
+ postmortem?: boolean | undefined;
401
+ } | {
402
+ type: "trend";
403
+ series: number[];
404
+ title?: string | undefined;
405
+ unit?: string | undefined;
406
+ max?: number | undefined;
407
+ threshold?: {
408
+ value: number;
409
+ label?: string | undefined;
410
+ } | undefined;
411
+ start?: string | undefined;
412
+ step_seconds?: number | undefined;
413
+ marks?: {
414
+ label: string;
415
+ i: number;
416
+ }[] | undefined;
417
+ source?: {
418
+ kind?: string | undefined;
419
+ datasource?: string | undefined;
420
+ query?: string | undefined;
421
+ from?: string | undefined;
422
+ to?: string | undefined;
423
+ step?: string | undefined;
424
+ artifact_id?: string | undefined;
425
+ } | undefined;
426
+ slot?: "summary" | undefined;
427
+ anchor?: string | undefined;
428
+ postmortem?: boolean | undefined;
429
+ } | z.objectOutputType<{
430
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
431
+ }, z.ZodTypeAny, "passthrough">, {
432
+ type: "stats";
433
+ items: {
434
+ value: string;
435
+ label: string;
436
+ caption?: string | undefined;
437
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
438
+ }[];
439
+ slot?: "summary" | undefined;
440
+ anchor?: string | undefined;
441
+ postmortem?: boolean | undefined;
442
+ } | {
443
+ type: "compare";
444
+ rows: {
445
+ label: string;
446
+ before: number;
447
+ after: number;
448
+ mono?: boolean | undefined;
449
+ details?: {
450
+ label: string;
451
+ before: string;
452
+ after: string;
453
+ }[] | undefined;
454
+ }[];
455
+ title?: string | undefined;
456
+ metric?: string | undefined;
457
+ unit?: string | undefined;
458
+ better?: "lower" | "higher" | undefined;
459
+ delta?: "rel" | "abs" | undefined;
460
+ max?: number | undefined;
461
+ threshold?: {
462
+ value: number;
463
+ label?: string | undefined;
464
+ } | undefined;
465
+ slot?: "summary" | undefined;
466
+ anchor?: string | undefined;
467
+ postmortem?: boolean | undefined;
468
+ } | {
469
+ type: "trend";
470
+ series: number[];
471
+ title?: string | undefined;
472
+ unit?: string | undefined;
473
+ max?: number | undefined;
474
+ threshold?: {
475
+ value: number;
476
+ label?: string | undefined;
477
+ } | undefined;
478
+ start?: string | undefined;
479
+ step_seconds?: number | undefined;
480
+ marks?: {
481
+ label: string;
482
+ i: number;
483
+ }[] | undefined;
484
+ source?: {
485
+ kind?: string | undefined;
486
+ datasource?: string | undefined;
487
+ query?: string | undefined;
488
+ from?: string | undefined;
489
+ to?: string | undefined;
490
+ step?: string | undefined;
491
+ artifact_id?: string | undefined;
492
+ } | undefined;
493
+ slot?: "summary" | undefined;
494
+ anchor?: string | undefined;
495
+ postmortem?: boolean | undefined;
496
+ } | z.objectInputType<{
497
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
498
+ }, z.ZodTypeAny, "passthrough">>;
499
+ export declare const stepStructureShape: {
500
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
501
+ figure: z.ZodOptional<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
502
+ items: z.ZodArray<z.ZodObject<{
503
+ label: z.ZodEffects<z.ZodString, string, string>;
504
+ value: z.ZodEffects<z.ZodString, string, string>;
505
+ caption: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
506
+ tone: z.ZodOptional<z.ZodEnum<["good", "warn", "bad", "neutral"]>>;
507
+ }, "strict", z.ZodTypeAny, {
508
+ value: string;
509
+ label: string;
510
+ caption?: string | undefined;
511
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
512
+ }, {
513
+ value: string;
514
+ label: string;
515
+ caption?: string | undefined;
516
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
517
+ }>, "many">;
518
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
519
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
520
+ postmortem: z.ZodOptional<z.ZodBoolean>;
521
+ type: z.ZodLiteral<"stats">;
522
+ }, "strict", z.ZodTypeAny, {
523
+ type: "stats";
524
+ items: {
525
+ value: string;
526
+ label: string;
527
+ caption?: string | undefined;
528
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
529
+ }[];
530
+ slot?: "summary" | undefined;
531
+ anchor?: string | undefined;
532
+ postmortem?: boolean | undefined;
533
+ }, {
534
+ type: "stats";
535
+ items: {
536
+ value: string;
537
+ label: string;
538
+ caption?: string | undefined;
539
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
540
+ }[];
541
+ slot?: "summary" | undefined;
542
+ anchor?: string | undefined;
543
+ postmortem?: boolean | undefined;
544
+ }>, z.ZodObject<{
545
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
546
+ metric: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
547
+ unit: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
548
+ better: z.ZodOptional<z.ZodEnum<["lower", "higher"]>>;
549
+ delta: z.ZodOptional<z.ZodEnum<["rel", "abs"]>>;
550
+ max: z.ZodOptional<z.ZodNumber>;
551
+ threshold: z.ZodOptional<z.ZodObject<{
552
+ value: z.ZodNumber;
553
+ label: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
554
+ }, "strict", z.ZodTypeAny, {
555
+ value: number;
556
+ label?: string | undefined;
557
+ }, {
558
+ value: number;
559
+ label?: string | undefined;
560
+ }>>;
561
+ rows: z.ZodArray<z.ZodObject<{
562
+ label: z.ZodEffects<z.ZodString, string, string>;
563
+ mono: z.ZodOptional<z.ZodBoolean>;
564
+ before: z.ZodNumber;
565
+ after: z.ZodNumber;
566
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
567
+ label: z.ZodEffects<z.ZodString, string, string>;
568
+ before: z.ZodEffects<z.ZodString, string, string>;
569
+ after: z.ZodEffects<z.ZodString, string, string>;
570
+ }, "strict", z.ZodTypeAny, {
571
+ label: string;
572
+ before: string;
573
+ after: string;
574
+ }, {
575
+ label: string;
576
+ before: string;
577
+ after: string;
578
+ }>, "many">>;
579
+ }, "strict", z.ZodTypeAny, {
580
+ label: string;
581
+ before: number;
582
+ after: number;
583
+ mono?: boolean | undefined;
584
+ details?: {
585
+ label: string;
586
+ before: string;
587
+ after: string;
588
+ }[] | undefined;
589
+ }, {
590
+ label: string;
591
+ before: number;
592
+ after: number;
593
+ mono?: boolean | undefined;
594
+ details?: {
595
+ label: string;
596
+ before: string;
597
+ after: string;
598
+ }[] | undefined;
599
+ }>, "many">;
600
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
601
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
602
+ postmortem: z.ZodOptional<z.ZodBoolean>;
603
+ type: z.ZodLiteral<"compare">;
604
+ }, "strict", z.ZodTypeAny, {
605
+ type: "compare";
606
+ rows: {
607
+ label: string;
608
+ before: number;
609
+ after: number;
610
+ mono?: boolean | undefined;
611
+ details?: {
612
+ label: string;
613
+ before: string;
614
+ after: string;
615
+ }[] | undefined;
616
+ }[];
617
+ title?: string | undefined;
618
+ metric?: string | undefined;
619
+ unit?: string | undefined;
620
+ better?: "lower" | "higher" | undefined;
621
+ delta?: "rel" | "abs" | undefined;
622
+ max?: number | undefined;
623
+ threshold?: {
624
+ value: number;
625
+ label?: string | undefined;
626
+ } | undefined;
627
+ slot?: "summary" | undefined;
628
+ anchor?: string | undefined;
629
+ postmortem?: boolean | undefined;
630
+ }, {
631
+ type: "compare";
632
+ rows: {
633
+ label: string;
634
+ before: number;
635
+ after: number;
636
+ mono?: boolean | undefined;
637
+ details?: {
638
+ label: string;
639
+ before: string;
640
+ after: string;
641
+ }[] | undefined;
642
+ }[];
643
+ title?: string | undefined;
644
+ metric?: string | undefined;
645
+ unit?: string | undefined;
646
+ better?: "lower" | "higher" | undefined;
647
+ delta?: "rel" | "abs" | undefined;
648
+ max?: number | undefined;
649
+ threshold?: {
650
+ value: number;
651
+ label?: string | undefined;
652
+ } | undefined;
653
+ slot?: "summary" | undefined;
654
+ anchor?: string | undefined;
655
+ postmortem?: boolean | undefined;
656
+ }>, z.ZodObject<{
657
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
658
+ unit: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
659
+ series: z.ZodArray<z.ZodNumber, "many">;
660
+ start: z.ZodOptional<z.ZodString>;
661
+ step_seconds: z.ZodOptional<z.ZodNumber>;
662
+ max: z.ZodOptional<z.ZodNumber>;
663
+ threshold: z.ZodOptional<z.ZodObject<{
664
+ value: z.ZodNumber;
665
+ label: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
666
+ }, "strict", z.ZodTypeAny, {
667
+ value: number;
668
+ label?: string | undefined;
669
+ }, {
670
+ value: number;
671
+ label?: string | undefined;
672
+ }>>;
673
+ marks: z.ZodOptional<z.ZodArray<z.ZodObject<{
674
+ i: z.ZodNumber;
675
+ label: z.ZodEffects<z.ZodString, string, string>;
676
+ }, "strict", z.ZodTypeAny, {
677
+ label: string;
678
+ i: number;
679
+ }, {
680
+ label: string;
681
+ i: number;
682
+ }>, "many">>;
683
+ source: z.ZodOptional<z.ZodObject<{
684
+ kind: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
685
+ datasource: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
686
+ query: z.ZodOptional<z.ZodString>;
687
+ from: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
688
+ to: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
689
+ step: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
690
+ artifact_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
691
+ }, "strict", z.ZodTypeAny, {
692
+ kind?: string | undefined;
693
+ datasource?: string | undefined;
694
+ query?: string | undefined;
695
+ from?: string | undefined;
696
+ to?: string | undefined;
697
+ step?: string | undefined;
698
+ artifact_id?: string | undefined;
699
+ }, {
700
+ kind?: string | undefined;
701
+ datasource?: string | undefined;
702
+ query?: string | undefined;
703
+ from?: string | undefined;
704
+ to?: string | undefined;
705
+ step?: string | undefined;
706
+ artifact_id?: string | undefined;
707
+ }>>;
708
+ slot: z.ZodOptional<z.ZodLiteral<"summary">>;
709
+ anchor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
710
+ postmortem: z.ZodOptional<z.ZodBoolean>;
711
+ type: z.ZodLiteral<"trend">;
712
+ }, "strict", z.ZodTypeAny, {
713
+ type: "trend";
714
+ series: number[];
715
+ title?: string | undefined;
716
+ unit?: string | undefined;
717
+ max?: number | undefined;
718
+ threshold?: {
719
+ value: number;
720
+ label?: string | undefined;
721
+ } | undefined;
722
+ start?: string | undefined;
723
+ step_seconds?: number | undefined;
724
+ marks?: {
725
+ label: string;
726
+ i: number;
727
+ }[] | undefined;
728
+ source?: {
729
+ kind?: string | undefined;
730
+ datasource?: string | undefined;
731
+ query?: string | undefined;
732
+ from?: string | undefined;
733
+ to?: string | undefined;
734
+ step?: string | undefined;
735
+ artifact_id?: string | undefined;
736
+ } | undefined;
737
+ slot?: "summary" | undefined;
738
+ anchor?: string | undefined;
739
+ postmortem?: boolean | undefined;
740
+ }, {
741
+ type: "trend";
742
+ series: number[];
743
+ title?: string | undefined;
744
+ unit?: string | undefined;
745
+ max?: number | undefined;
746
+ threshold?: {
747
+ value: number;
748
+ label?: string | undefined;
749
+ } | undefined;
750
+ start?: string | undefined;
751
+ step_seconds?: number | undefined;
752
+ marks?: {
753
+ label: string;
754
+ i: number;
755
+ }[] | undefined;
756
+ source?: {
757
+ kind?: string | undefined;
758
+ datasource?: string | undefined;
759
+ query?: string | undefined;
760
+ from?: string | undefined;
761
+ to?: string | undefined;
762
+ step?: string | undefined;
763
+ artifact_id?: string | undefined;
764
+ } | undefined;
765
+ slot?: "summary" | undefined;
766
+ anchor?: string | undefined;
767
+ postmortem?: boolean | undefined;
768
+ }>, z.ZodObject<{
769
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
770
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
771
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
772
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
773
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
774
+ }, z.ZodTypeAny, "passthrough">>]>, {
775
+ type: "stats";
776
+ items: {
777
+ value: string;
778
+ label: string;
779
+ caption?: string | undefined;
780
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
781
+ }[];
782
+ slot?: "summary" | undefined;
783
+ anchor?: string | undefined;
784
+ postmortem?: boolean | undefined;
785
+ } | {
786
+ type: "compare";
787
+ rows: {
788
+ label: string;
789
+ before: number;
790
+ after: number;
791
+ mono?: boolean | undefined;
792
+ details?: {
793
+ label: string;
794
+ before: string;
795
+ after: string;
796
+ }[] | undefined;
797
+ }[];
798
+ title?: string | undefined;
799
+ metric?: string | undefined;
800
+ unit?: string | undefined;
801
+ better?: "lower" | "higher" | undefined;
802
+ delta?: "rel" | "abs" | undefined;
803
+ max?: number | undefined;
804
+ threshold?: {
805
+ value: number;
806
+ label?: string | undefined;
807
+ } | undefined;
808
+ slot?: "summary" | undefined;
809
+ anchor?: string | undefined;
810
+ postmortem?: boolean | undefined;
811
+ } | {
812
+ type: "trend";
813
+ series: number[];
814
+ title?: string | undefined;
815
+ unit?: string | undefined;
816
+ max?: number | undefined;
817
+ threshold?: {
818
+ value: number;
819
+ label?: string | undefined;
820
+ } | undefined;
821
+ start?: string | undefined;
822
+ step_seconds?: number | undefined;
823
+ marks?: {
824
+ label: string;
825
+ i: number;
826
+ }[] | undefined;
827
+ source?: {
828
+ kind?: string | undefined;
829
+ datasource?: string | undefined;
830
+ query?: string | undefined;
831
+ from?: string | undefined;
832
+ to?: string | undefined;
833
+ step?: string | undefined;
834
+ artifact_id?: string | undefined;
835
+ } | undefined;
836
+ slot?: "summary" | undefined;
837
+ anchor?: string | undefined;
838
+ postmortem?: boolean | undefined;
839
+ } | z.objectOutputType<{
840
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
841
+ }, z.ZodTypeAny, "passthrough">, {
842
+ type: "stats";
843
+ items: {
844
+ value: string;
845
+ label: string;
846
+ caption?: string | undefined;
847
+ tone?: "good" | "warn" | "bad" | "neutral" | undefined;
848
+ }[];
849
+ slot?: "summary" | undefined;
850
+ anchor?: string | undefined;
851
+ postmortem?: boolean | undefined;
852
+ } | {
853
+ type: "compare";
854
+ rows: {
855
+ label: string;
856
+ before: number;
857
+ after: number;
858
+ mono?: boolean | undefined;
859
+ details?: {
860
+ label: string;
861
+ before: string;
862
+ after: string;
863
+ }[] | undefined;
864
+ }[];
865
+ title?: string | undefined;
866
+ metric?: string | undefined;
867
+ unit?: string | undefined;
868
+ better?: "lower" | "higher" | undefined;
869
+ delta?: "rel" | "abs" | undefined;
870
+ max?: number | undefined;
871
+ threshold?: {
872
+ value: number;
873
+ label?: string | undefined;
874
+ } | undefined;
875
+ slot?: "summary" | undefined;
876
+ anchor?: string | undefined;
877
+ postmortem?: boolean | undefined;
878
+ } | {
879
+ type: "trend";
880
+ series: number[];
881
+ title?: string | undefined;
882
+ unit?: string | undefined;
883
+ max?: number | undefined;
884
+ threshold?: {
885
+ value: number;
886
+ label?: string | undefined;
887
+ } | undefined;
888
+ start?: string | undefined;
889
+ step_seconds?: number | undefined;
890
+ marks?: {
891
+ label: string;
892
+ i: number;
893
+ }[] | undefined;
894
+ source?: {
895
+ kind?: string | undefined;
896
+ datasource?: string | undefined;
897
+ query?: string | undefined;
898
+ from?: string | undefined;
899
+ to?: string | undefined;
900
+ step?: string | undefined;
901
+ artifact_id?: string | undefined;
902
+ } | undefined;
903
+ slot?: "summary" | undefined;
904
+ anchor?: string | undefined;
905
+ postmortem?: boolean | undefined;
906
+ } | z.objectInputType<{
907
+ type: z.ZodEnum<["checks", "range_overlap", "histogram", "run_history", "diff"]>;
908
+ }, z.ZodTypeAny, "passthrough">>>;
909
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
910
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
911
+ label: z.ZodString;
912
+ url: z.ZodEffects<z.ZodString, string, string>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ label: string;
915
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
916
+ url: string;
917
+ }, {
918
+ label: string;
919
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
920
+ url: string;
921
+ }>, "many">>;
922
+ };
923
+ export declare const ruledOutSchema: z.ZodObject<{
924
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
925
+ label: z.ZodEffects<z.ZodString, string, string>;
926
+ explanation: z.ZodOptional<z.ZodString>;
927
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
928
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
929
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
930
+ label: z.ZodString;
931
+ url: z.ZodEffects<z.ZodString, string, string>;
932
+ }, "strip", z.ZodTypeAny, {
933
+ label: string;
934
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
935
+ url: string;
936
+ }, {
937
+ label: string;
938
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
939
+ url: string;
940
+ }>, "many">>;
941
+ confidence_percent: z.ZodOptional<z.ZodNumber>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ label: string;
944
+ id?: string | undefined;
945
+ links?: {
946
+ label: string;
947
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
948
+ url: string;
949
+ }[] | undefined;
950
+ explanation?: string | undefined;
951
+ finding_ids?: number[] | undefined;
952
+ confidence_percent?: number | undefined;
953
+ }, {
954
+ label: string;
955
+ id?: string | undefined;
956
+ links?: {
957
+ label: string;
958
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
959
+ url: string;
960
+ }[] | undefined;
961
+ explanation?: string | undefined;
962
+ finding_ids?: number[] | undefined;
963
+ confidence_percent?: number | undefined;
964
+ }>;
965
+ export declare const coverageEntrySchema: z.ZodObject<{
966
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
967
+ source: z.ZodEffects<z.ZodString, string, string>;
968
+ state: z.ZodEnum<["checked", "gap", "not_configured"]>;
969
+ summary: z.ZodOptional<z.ZodString>;
970
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
971
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
972
+ label: z.ZodString;
973
+ url: z.ZodEffects<z.ZodString, string, string>;
974
+ }, "strip", z.ZodTypeAny, {
975
+ label: string;
976
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
977
+ url: string;
978
+ }, {
979
+ label: string;
980
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
981
+ url: string;
982
+ }>, "many">>;
983
+ step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
984
+ integration_id: z.ZodOptional<z.ZodString>;
985
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ source: string;
988
+ state: "checked" | "gap" | "not_configured";
989
+ summary?: string | undefined;
990
+ id?: string | undefined;
991
+ links?: {
992
+ label: string;
993
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
994
+ url: string;
995
+ }[] | undefined;
996
+ finding_ids?: number[] | undefined;
997
+ step_ids?: string[] | undefined;
998
+ integration_id?: string | undefined;
999
+ }, {
1000
+ source: string;
1001
+ state: "checked" | "gap" | "not_configured";
1002
+ summary?: string | undefined;
1003
+ id?: string | undefined;
1004
+ links?: {
1005
+ label: string;
1006
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1007
+ url: string;
1008
+ }[] | undefined;
1009
+ finding_ids?: number[] | undefined;
1010
+ step_ids?: string[] | undefined;
1011
+ integration_id?: string | undefined;
1012
+ }>;
1013
+ export declare const unknownSchema: z.ZodObject<{
1014
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1015
+ label: z.ZodEffects<z.ZodString, string, string>;
1016
+ why: z.ZodOptional<z.ZodString>;
1017
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ label: string;
1020
+ id?: string | undefined;
1021
+ finding_ids?: number[] | undefined;
1022
+ why?: string | undefined;
1023
+ }, {
1024
+ label: string;
1025
+ id?: string | undefined;
1026
+ finding_ids?: number[] | undefined;
1027
+ why?: string | undefined;
1028
+ }>;
1029
+ export declare const CHANGE_ROLES: readonly ["regression_source", "fix", "rollback", "last_good", "first_bad", "verified_by", "context"];
1030
+ export declare const CHANGE_KINDS: readonly ["commit", "pull_request", "deployment", "release", "ci_run", "config_change"];
1031
+ export declare const CHANGE_RESULTS: readonly ["success", "failure", "cancelled", "skipped", "pending", "unknown"];
1032
+ export declare const CHANGE_STATES: readonly ["open", "merged", "closed", "reverted", "deployed", "rolled_back"];
1033
+ /** The backend keeps at most this many change refs. */
1034
+ export declare const MAX_CHANGE_REFS = 6;
1035
+ export declare const changeRefSchema: z.ZodEffects<z.ZodObject<{
1036
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1037
+ role: z.ZodEnum<["regression_source", "fix", "rollback", "last_good", "first_bad", "verified_by", "context"]>;
1038
+ kind: z.ZodEnum<["commit", "pull_request", "deployment", "release", "ci_run", "config_change"]>;
1039
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1040
+ repo: z.ZodOptional<z.ZodString>;
1041
+ ref: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1042
+ sha: z.ZodOptional<z.ZodString>;
1043
+ occurred_at: z.ZodOptional<z.ZodString>;
1044
+ author: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1045
+ result: z.ZodOptional<z.ZodEnum<["success", "failure", "cancelled", "skipped", "pending", "unknown"]>>;
1046
+ state: z.ZodOptional<z.ZodEnum<["open", "merged", "closed", "reverted", "deployed", "rolled_back"]>>;
1047
+ verification: z.ZodOptional<z.ZodEnum<["confirmed", "likely", "unknown"]>>;
1048
+ confidence_percent: z.ZodOptional<z.ZodNumber>;
1049
+ step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1050
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1051
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1052
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
1053
+ label: z.ZodString;
1054
+ url: z.ZodEffects<z.ZodString, string, string>;
1055
+ }, "strip", z.ZodTypeAny, {
1056
+ label: string;
1057
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1058
+ url: string;
1059
+ }, {
1060
+ label: string;
1061
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1062
+ url: string;
1063
+ }>, "many">>;
1064
+ }, "strip", z.ZodTypeAny, {
1065
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1066
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1067
+ title?: string | undefined;
1068
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1069
+ ref?: string | undefined;
1070
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1071
+ sha?: string | undefined;
1072
+ repo?: string | undefined;
1073
+ id?: string | undefined;
1074
+ links?: {
1075
+ label: string;
1076
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1077
+ url: string;
1078
+ }[] | undefined;
1079
+ finding_ids?: number[] | undefined;
1080
+ confidence_percent?: number | undefined;
1081
+ step_ids?: string[] | undefined;
1082
+ occurred_at?: string | undefined;
1083
+ author?: string | undefined;
1084
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1085
+ }, {
1086
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1087
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1088
+ title?: string | undefined;
1089
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1090
+ ref?: string | undefined;
1091
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1092
+ sha?: string | undefined;
1093
+ repo?: string | undefined;
1094
+ id?: string | undefined;
1095
+ links?: {
1096
+ label: string;
1097
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1098
+ url: string;
1099
+ }[] | undefined;
1100
+ finding_ids?: number[] | undefined;
1101
+ confidence_percent?: number | undefined;
1102
+ step_ids?: string[] | undefined;
1103
+ occurred_at?: string | undefined;
1104
+ author?: string | undefined;
1105
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1106
+ }>, {
1107
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1108
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1109
+ title?: string | undefined;
1110
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1111
+ ref?: string | undefined;
1112
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1113
+ sha?: string | undefined;
1114
+ repo?: string | undefined;
1115
+ id?: string | undefined;
1116
+ links?: {
1117
+ label: string;
1118
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1119
+ url: string;
1120
+ }[] | undefined;
1121
+ finding_ids?: number[] | undefined;
1122
+ confidence_percent?: number | undefined;
1123
+ step_ids?: string[] | undefined;
1124
+ occurred_at?: string | undefined;
1125
+ author?: string | undefined;
1126
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1127
+ }, {
1128
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1129
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1130
+ title?: string | undefined;
1131
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1132
+ ref?: string | undefined;
1133
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1134
+ sha?: string | undefined;
1135
+ repo?: string | undefined;
1136
+ id?: string | undefined;
1137
+ links?: {
1138
+ label: string;
1139
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1140
+ url: string;
1141
+ }[] | undefined;
1142
+ finding_ids?: number[] | undefined;
1143
+ confidence_percent?: number | undefined;
1144
+ step_ids?: string[] | undefined;
1145
+ occurred_at?: string | undefined;
1146
+ author?: string | undefined;
1147
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1148
+ }>;
1149
+ export declare const resultChangeShape: {
1150
+ change_refs: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
1151
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1152
+ role: z.ZodEnum<["regression_source", "fix", "rollback", "last_good", "first_bad", "verified_by", "context"]>;
1153
+ kind: z.ZodEnum<["commit", "pull_request", "deployment", "release", "ci_run", "config_change"]>;
1154
+ title: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1155
+ repo: z.ZodOptional<z.ZodString>;
1156
+ ref: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1157
+ sha: z.ZodOptional<z.ZodString>;
1158
+ occurred_at: z.ZodOptional<z.ZodString>;
1159
+ author: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1160
+ result: z.ZodOptional<z.ZodEnum<["success", "failure", "cancelled", "skipped", "pending", "unknown"]>>;
1161
+ state: z.ZodOptional<z.ZodEnum<["open", "merged", "closed", "reverted", "deployed", "rolled_back"]>>;
1162
+ verification: z.ZodOptional<z.ZodEnum<["confirmed", "likely", "unknown"]>>;
1163
+ confidence_percent: z.ZodOptional<z.ZodNumber>;
1164
+ step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1165
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1166
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1167
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
1168
+ label: z.ZodString;
1169
+ url: z.ZodEffects<z.ZodString, string, string>;
1170
+ }, "strip", z.ZodTypeAny, {
1171
+ label: string;
1172
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1173
+ url: string;
1174
+ }, {
1175
+ label: string;
1176
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1177
+ url: string;
1178
+ }>, "many">>;
1179
+ }, "strip", z.ZodTypeAny, {
1180
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1181
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1182
+ title?: string | undefined;
1183
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1184
+ ref?: string | undefined;
1185
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1186
+ sha?: string | undefined;
1187
+ repo?: string | undefined;
1188
+ id?: string | undefined;
1189
+ links?: {
1190
+ label: string;
1191
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1192
+ url: string;
1193
+ }[] | undefined;
1194
+ finding_ids?: number[] | undefined;
1195
+ confidence_percent?: number | undefined;
1196
+ step_ids?: string[] | undefined;
1197
+ occurred_at?: string | undefined;
1198
+ author?: string | undefined;
1199
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1200
+ }, {
1201
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1202
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1203
+ title?: string | undefined;
1204
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1205
+ ref?: string | undefined;
1206
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1207
+ sha?: string | undefined;
1208
+ repo?: string | undefined;
1209
+ id?: string | undefined;
1210
+ links?: {
1211
+ label: string;
1212
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1213
+ url: string;
1214
+ }[] | undefined;
1215
+ finding_ids?: number[] | undefined;
1216
+ confidence_percent?: number | undefined;
1217
+ step_ids?: string[] | undefined;
1218
+ occurred_at?: string | undefined;
1219
+ author?: string | undefined;
1220
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1221
+ }>, {
1222
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1223
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1224
+ title?: string | undefined;
1225
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1226
+ ref?: string | undefined;
1227
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1228
+ sha?: string | undefined;
1229
+ repo?: string | undefined;
1230
+ id?: string | undefined;
1231
+ links?: {
1232
+ label: string;
1233
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1234
+ url: string;
1235
+ }[] | undefined;
1236
+ finding_ids?: number[] | undefined;
1237
+ confidence_percent?: number | undefined;
1238
+ step_ids?: string[] | undefined;
1239
+ occurred_at?: string | undefined;
1240
+ author?: string | undefined;
1241
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1242
+ }, {
1243
+ kind: "ci_run" | "deployment" | "release" | "commit" | "pull_request" | "config_change";
1244
+ role: "fix" | "regression_source" | "first_bad" | "rollback" | "last_good" | "verified_by" | "context";
1245
+ title?: string | undefined;
1246
+ state?: "open" | "merged" | "closed" | "reverted" | "deployed" | "rolled_back" | undefined;
1247
+ ref?: string | undefined;
1248
+ result?: "unknown" | "pending" | "skipped" | "success" | "failure" | "cancelled" | undefined;
1249
+ sha?: string | undefined;
1250
+ repo?: string | undefined;
1251
+ id?: string | undefined;
1252
+ links?: {
1253
+ label: string;
1254
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1255
+ url: string;
1256
+ }[] | undefined;
1257
+ finding_ids?: number[] | undefined;
1258
+ confidence_percent?: number | undefined;
1259
+ step_ids?: string[] | undefined;
1260
+ occurred_at?: string | undefined;
1261
+ author?: string | undefined;
1262
+ verification?: "unknown" | "confirmed" | "likely" | undefined;
1263
+ }>, "many">>;
1264
+ };
1265
+ export declare const resultStructureShape: {
1266
+ ruled_out: z.ZodOptional<z.ZodArray<z.ZodObject<{
1267
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1268
+ label: z.ZodEffects<z.ZodString, string, string>;
1269
+ explanation: z.ZodOptional<z.ZodString>;
1270
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1271
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1272
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
1273
+ label: z.ZodString;
1274
+ url: z.ZodEffects<z.ZodString, string, string>;
1275
+ }, "strip", z.ZodTypeAny, {
1276
+ label: string;
1277
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1278
+ url: string;
1279
+ }, {
1280
+ label: string;
1281
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1282
+ url: string;
1283
+ }>, "many">>;
1284
+ confidence_percent: z.ZodOptional<z.ZodNumber>;
1285
+ }, "strip", z.ZodTypeAny, {
1286
+ label: string;
1287
+ id?: string | undefined;
1288
+ links?: {
1289
+ label: string;
1290
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1291
+ url: string;
1292
+ }[] | undefined;
1293
+ explanation?: string | undefined;
1294
+ finding_ids?: number[] | undefined;
1295
+ confidence_percent?: number | undefined;
1296
+ }, {
1297
+ label: string;
1298
+ id?: string | undefined;
1299
+ links?: {
1300
+ label: string;
1301
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1302
+ url: string;
1303
+ }[] | undefined;
1304
+ explanation?: string | undefined;
1305
+ finding_ids?: number[] | undefined;
1306
+ confidence_percent?: number | undefined;
1307
+ }>, "many">>;
1308
+ coverage: z.ZodOptional<z.ZodArray<z.ZodObject<{
1309
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1310
+ source: z.ZodEffects<z.ZodString, string, string>;
1311
+ state: z.ZodEnum<["checked", "gap", "not_configured"]>;
1312
+ summary: z.ZodOptional<z.ZodString>;
1313
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1314
+ kind: z.ZodEnum<["explore", "panel", "diff", "commit", "pr", "logs", "trace", "ci_run", "deployment", "release"]>;
1315
+ label: z.ZodString;
1316
+ url: z.ZodEffects<z.ZodString, string, string>;
1317
+ }, "strip", z.ZodTypeAny, {
1318
+ label: string;
1319
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1320
+ url: string;
1321
+ }, {
1322
+ label: string;
1323
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1324
+ url: string;
1325
+ }>, "many">>;
1326
+ step_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1327
+ integration_id: z.ZodOptional<z.ZodString>;
1328
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1329
+ }, "strip", z.ZodTypeAny, {
1330
+ source: string;
1331
+ state: "checked" | "gap" | "not_configured";
1332
+ summary?: string | undefined;
1333
+ id?: string | undefined;
1334
+ links?: {
1335
+ label: string;
1336
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1337
+ url: string;
1338
+ }[] | undefined;
1339
+ finding_ids?: number[] | undefined;
1340
+ step_ids?: string[] | undefined;
1341
+ integration_id?: string | undefined;
1342
+ }, {
1343
+ source: string;
1344
+ state: "checked" | "gap" | "not_configured";
1345
+ summary?: string | undefined;
1346
+ id?: string | undefined;
1347
+ links?: {
1348
+ label: string;
1349
+ kind: "diff" | "ci_run" | "deployment" | "release" | "explore" | "panel" | "commit" | "pr" | "logs" | "trace";
1350
+ url: string;
1351
+ }[] | undefined;
1352
+ finding_ids?: number[] | undefined;
1353
+ step_ids?: string[] | undefined;
1354
+ integration_id?: string | undefined;
1355
+ }>, "many">>;
1356
+ unknowns: z.ZodOptional<z.ZodArray<z.ZodObject<{
1357
+ id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1358
+ label: z.ZodEffects<z.ZodString, string, string>;
1359
+ why: z.ZodOptional<z.ZodString>;
1360
+ finding_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1361
+ }, "strip", z.ZodTypeAny, {
1362
+ label: string;
1363
+ id?: string | undefined;
1364
+ finding_ids?: number[] | undefined;
1365
+ why?: string | undefined;
1366
+ }, {
1367
+ label: string;
1368
+ id?: string | undefined;
1369
+ finding_ids?: number[] | undefined;
1370
+ why?: string | undefined;
1371
+ }>, "many">>;
1372
+ };
1373
+ export declare const TRACE_OUTCOMES: readonly ["supports", "rules_out", "nothing_notable", "inconclusive", "unavailable"];
1374
+ export declare const traceStructureShape: {
1375
+ outcome: z.ZodOptional<z.ZodEnum<["supports", "rules_out", "nothing_notable", "inconclusive", "unavailable"]>>;
1376
+ cause_key: z.ZodOptional<z.ZodString>;
1377
+ };
1378
+ type Json = Record<string, unknown>;
1379
+ /** An evidence ref list without links, command and datasource. */
1380
+ export declare function stripFindingEvidenceStructure(refs: unknown): {
1381
+ refs: unknown;
1382
+ removed: string[];
1383
+ };
1384
+ /** A result summary without any diagnosis_structure_v1 field. */
1385
+ export declare function stripResultStructure(summary: unknown): {
1386
+ summary: unknown;
1387
+ removed: string[];
1388
+ };
1389
+ /** The trace body without outcome and cause_key. */
1390
+ export declare function stripTraceStructure(body: Json): {
1391
+ body: Json;
1392
+ removed: string[];
1393
+ };
1394
+ /** A result summary without change_refs and without ci_run, deployment and release links. */
1395
+ export declare function stripResultChanges(summary: unknown): {
1396
+ summary: unknown;
1397
+ removed: string[];
1398
+ };
1399
+ /** Evidence refs without ci_run, deployment and release links. */
1400
+ export declare function stripFindingChangeLinks(refs: unknown): {
1401
+ refs: unknown;
1402
+ removed: string[];
1403
+ };
1404
+ /** The sentence the tool adds when it dropped fields for an older backend. */
1405
+ export declare function unsupportedNotice(removed: string[], capability?: string): string;
1406
+ export type QualityWarning = {
1407
+ code?: string;
1408
+ message?: string;
1409
+ path?: string;
1410
+ };
1411
+ /**
1412
+ * One line the agent can act on, from the backend's warnings. The warnings
1413
+ * themselves stay verbatim in the response; this only groups them by code.
1414
+ */
1415
+ export declare function summarizeWarnings(warnings: unknown): string | undefined;
1416
+ export {};