@simonren/quorum 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/commands/multi-consult.md +109 -0
  4. package/commands/multi-review.md +139 -0
  5. package/dist/adapters/base.d.ts +120 -0
  6. package/dist/adapters/base.js +98 -0
  7. package/dist/adapters/claude.d.ts +25 -0
  8. package/dist/adapters/claude.js +217 -0
  9. package/dist/adapters/codex.d.ts +20 -0
  10. package/dist/adapters/codex.js +227 -0
  11. package/dist/adapters/gemini.d.ts +20 -0
  12. package/dist/adapters/gemini.js +197 -0
  13. package/dist/adapters/index.d.ts +12 -0
  14. package/dist/adapters/index.js +15 -0
  15. package/dist/cli/check.d.ts +20 -0
  16. package/dist/cli/check.js +78 -0
  17. package/dist/cli/codex.d.ts +11 -0
  18. package/dist/cli/codex.js +255 -0
  19. package/dist/cli/gemini.d.ts +12 -0
  20. package/dist/cli/gemini.js +253 -0
  21. package/dist/commands.d.ts +28 -0
  22. package/dist/commands.js +105 -0
  23. package/dist/config.d.ts +244 -0
  24. package/dist/config.js +179 -0
  25. package/dist/consult-prompt.d.ts +10 -0
  26. package/dist/consult-prompt.js +72 -0
  27. package/dist/context.d.ts +1538 -0
  28. package/dist/context.js +383 -0
  29. package/dist/decoders/claude.d.ts +53 -0
  30. package/dist/decoders/claude.js +106 -0
  31. package/dist/decoders/codex.d.ts +71 -0
  32. package/dist/decoders/codex.js +145 -0
  33. package/dist/decoders/gemini.d.ts +33 -0
  34. package/dist/decoders/gemini.js +58 -0
  35. package/dist/decoders/index.d.ts +6 -0
  36. package/dist/decoders/index.js +3 -0
  37. package/dist/errors.d.ts +46 -0
  38. package/dist/errors.js +192 -0
  39. package/dist/executor.d.ts +103 -0
  40. package/dist/executor.js +244 -0
  41. package/dist/handoff.d.ts +270 -0
  42. package/dist/handoff.js +599 -0
  43. package/dist/index.d.ts +18 -0
  44. package/dist/index.js +134 -0
  45. package/dist/pipeline.d.ts +135 -0
  46. package/dist/pipeline.js +462 -0
  47. package/dist/prompt-v2.d.ts +38 -0
  48. package/dist/prompt-v2.js +391 -0
  49. package/dist/prompt.d.ts +71 -0
  50. package/dist/prompt.js +309 -0
  51. package/dist/schema.d.ts +660 -0
  52. package/dist/schema.js +536 -0
  53. package/dist/tools/consult.d.ts +104 -0
  54. package/dist/tools/consult.js +220 -0
  55. package/dist/tools/feedback.d.ts +91 -0
  56. package/dist/tools/feedback.js +117 -0
  57. package/dist/types.d.ts +105 -0
  58. package/dist/types.js +31 -0
  59. package/package.json +54 -0
@@ -0,0 +1,1538 @@
1
+ /**
2
+ * Rich Context Protocol for Review Handoff
3
+ *
4
+ * Defines the structured information that should flow from CC to reviewers.
5
+ * This replaces the simple "ccOutput: string" with a rich, queryable context.
6
+ */
7
+ import { z } from 'zod';
8
+ /**
9
+ * Represents a change to a single file with semantic understanding
10
+ */
11
+ export declare const FileChangeSchema: z.ZodObject<{
12
+ path: z.ZodString;
13
+ language: z.ZodOptional<z.ZodString>;
14
+ changeType: z.ZodEnum<["created", "modified", "deleted", "renamed"]>;
15
+ diff: z.ZodOptional<z.ZodString>;
16
+ linesAdded: z.ZodOptional<z.ZodNumber>;
17
+ linesRemoved: z.ZodOptional<z.ZodNumber>;
18
+ content: z.ZodOptional<z.ZodString>;
19
+ changedSymbols: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
+ name: z.ZodString;
21
+ type: z.ZodEnum<["function", "class", "variable", "type", "import", "export", "other"]>;
22
+ lineStart: z.ZodOptional<z.ZodNumber>;
23
+ lineEnd: z.ZodOptional<z.ZodNumber>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
26
+ name: string;
27
+ lineStart?: number | undefined;
28
+ lineEnd?: number | undefined;
29
+ }, {
30
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
31
+ name: string;
32
+ lineStart?: number | undefined;
33
+ lineEnd?: number | undefined;
34
+ }>, "many">>;
35
+ imports: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ importedBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
37
+ testFile: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ path: string;
40
+ changeType: "created" | "modified" | "deleted" | "renamed";
41
+ language?: string | undefined;
42
+ diff?: string | undefined;
43
+ linesAdded?: number | undefined;
44
+ linesRemoved?: number | undefined;
45
+ content?: string | undefined;
46
+ changedSymbols?: {
47
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
48
+ name: string;
49
+ lineStart?: number | undefined;
50
+ lineEnd?: number | undefined;
51
+ }[] | undefined;
52
+ imports?: string[] | undefined;
53
+ importedBy?: string[] | undefined;
54
+ testFile?: string | undefined;
55
+ }, {
56
+ path: string;
57
+ changeType: "created" | "modified" | "deleted" | "renamed";
58
+ language?: string | undefined;
59
+ diff?: string | undefined;
60
+ linesAdded?: number | undefined;
61
+ linesRemoved?: number | undefined;
62
+ content?: string | undefined;
63
+ changedSymbols?: {
64
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
65
+ name: string;
66
+ lineStart?: number | undefined;
67
+ lineEnd?: number | undefined;
68
+ }[] | undefined;
69
+ imports?: string[] | undefined;
70
+ importedBy?: string[] | undefined;
71
+ testFile?: string | undefined;
72
+ }>;
73
+ export type FileChange = z.infer<typeof FileChangeSchema>;
74
+ /**
75
+ * Results from running tests, build, lint, etc.
76
+ */
77
+ export declare const ExecutionContextSchema: z.ZodObject<{
78
+ tests: z.ZodOptional<z.ZodObject<{
79
+ ran: z.ZodBoolean;
80
+ passed: z.ZodOptional<z.ZodNumber>;
81
+ failed: z.ZodOptional<z.ZodNumber>;
82
+ skipped: z.ZodOptional<z.ZodNumber>;
83
+ failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ testName: z.ZodString;
85
+ file: z.ZodOptional<z.ZodString>;
86
+ error: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ testName: string;
89
+ error: string;
90
+ file?: string | undefined;
91
+ }, {
92
+ testName: string;
93
+ error: string;
94
+ file?: string | undefined;
95
+ }>, "many">>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ ran: boolean;
98
+ passed?: number | undefined;
99
+ failed?: number | undefined;
100
+ skipped?: number | undefined;
101
+ failures?: {
102
+ testName: string;
103
+ error: string;
104
+ file?: string | undefined;
105
+ }[] | undefined;
106
+ }, {
107
+ ran: boolean;
108
+ passed?: number | undefined;
109
+ failed?: number | undefined;
110
+ skipped?: number | undefined;
111
+ failures?: {
112
+ testName: string;
113
+ error: string;
114
+ file?: string | undefined;
115
+ }[] | undefined;
116
+ }>>;
117
+ build: z.ZodOptional<z.ZodObject<{
118
+ ran: z.ZodBoolean;
119
+ success: z.ZodOptional<z.ZodBoolean>;
120
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
+ file: z.ZodString;
122
+ line: z.ZodOptional<z.ZodNumber>;
123
+ message: z.ZodString;
124
+ }, "strip", z.ZodTypeAny, {
125
+ message: string;
126
+ file: string;
127
+ line?: number | undefined;
128
+ }, {
129
+ message: string;
130
+ file: string;
131
+ line?: number | undefined;
132
+ }>, "many">>;
133
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
134
+ file: z.ZodString;
135
+ line: z.ZodOptional<z.ZodNumber>;
136
+ message: z.ZodString;
137
+ }, "strip", z.ZodTypeAny, {
138
+ message: string;
139
+ file: string;
140
+ line?: number | undefined;
141
+ }, {
142
+ message: string;
143
+ file: string;
144
+ line?: number | undefined;
145
+ }>, "many">>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ ran: boolean;
148
+ success?: boolean | undefined;
149
+ errors?: {
150
+ message: string;
151
+ file: string;
152
+ line?: number | undefined;
153
+ }[] | undefined;
154
+ warnings?: {
155
+ message: string;
156
+ file: string;
157
+ line?: number | undefined;
158
+ }[] | undefined;
159
+ }, {
160
+ ran: boolean;
161
+ success?: boolean | undefined;
162
+ errors?: {
163
+ message: string;
164
+ file: string;
165
+ line?: number | undefined;
166
+ }[] | undefined;
167
+ warnings?: {
168
+ message: string;
169
+ file: string;
170
+ line?: number | undefined;
171
+ }[] | undefined;
172
+ }>>;
173
+ typeCheck: z.ZodOptional<z.ZodObject<{
174
+ ran: z.ZodBoolean;
175
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
176
+ file: z.ZodString;
177
+ line: z.ZodOptional<z.ZodNumber>;
178
+ message: z.ZodString;
179
+ code: z.ZodOptional<z.ZodString>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ message: string;
182
+ file: string;
183
+ code?: string | undefined;
184
+ line?: number | undefined;
185
+ }, {
186
+ message: string;
187
+ file: string;
188
+ code?: string | undefined;
189
+ line?: number | undefined;
190
+ }>, "many">>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ ran: boolean;
193
+ errors?: {
194
+ message: string;
195
+ file: string;
196
+ code?: string | undefined;
197
+ line?: number | undefined;
198
+ }[] | undefined;
199
+ }, {
200
+ ran: boolean;
201
+ errors?: {
202
+ message: string;
203
+ file: string;
204
+ code?: string | undefined;
205
+ line?: number | undefined;
206
+ }[] | undefined;
207
+ }>>;
208
+ lint: z.ZodOptional<z.ZodObject<{
209
+ ran: z.ZodBoolean;
210
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ file: z.ZodString;
212
+ line: z.ZodOptional<z.ZodNumber>;
213
+ rule: z.ZodOptional<z.ZodString>;
214
+ severity: z.ZodEnum<["error", "warning", "info"]>;
215
+ message: z.ZodString;
216
+ }, "strip", z.ZodTypeAny, {
217
+ message: string;
218
+ file: string;
219
+ severity: "error" | "warning" | "info";
220
+ line?: number | undefined;
221
+ rule?: string | undefined;
222
+ }, {
223
+ message: string;
224
+ file: string;
225
+ severity: "error" | "warning" | "info";
226
+ line?: number | undefined;
227
+ rule?: string | undefined;
228
+ }>, "many">>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ ran: boolean;
231
+ issues?: {
232
+ message: string;
233
+ file: string;
234
+ severity: "error" | "warning" | "info";
235
+ line?: number | undefined;
236
+ rule?: string | undefined;
237
+ }[] | undefined;
238
+ }, {
239
+ ran: boolean;
240
+ issues?: {
241
+ message: string;
242
+ file: string;
243
+ severity: "error" | "warning" | "info";
244
+ line?: number | undefined;
245
+ rule?: string | undefined;
246
+ }[] | undefined;
247
+ }>>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ tests?: {
250
+ ran: boolean;
251
+ passed?: number | undefined;
252
+ failed?: number | undefined;
253
+ skipped?: number | undefined;
254
+ failures?: {
255
+ testName: string;
256
+ error: string;
257
+ file?: string | undefined;
258
+ }[] | undefined;
259
+ } | undefined;
260
+ build?: {
261
+ ran: boolean;
262
+ success?: boolean | undefined;
263
+ errors?: {
264
+ message: string;
265
+ file: string;
266
+ line?: number | undefined;
267
+ }[] | undefined;
268
+ warnings?: {
269
+ message: string;
270
+ file: string;
271
+ line?: number | undefined;
272
+ }[] | undefined;
273
+ } | undefined;
274
+ typeCheck?: {
275
+ ran: boolean;
276
+ errors?: {
277
+ message: string;
278
+ file: string;
279
+ code?: string | undefined;
280
+ line?: number | undefined;
281
+ }[] | undefined;
282
+ } | undefined;
283
+ lint?: {
284
+ ran: boolean;
285
+ issues?: {
286
+ message: string;
287
+ file: string;
288
+ severity: "error" | "warning" | "info";
289
+ line?: number | undefined;
290
+ rule?: string | undefined;
291
+ }[] | undefined;
292
+ } | undefined;
293
+ }, {
294
+ tests?: {
295
+ ran: boolean;
296
+ passed?: number | undefined;
297
+ failed?: number | undefined;
298
+ skipped?: number | undefined;
299
+ failures?: {
300
+ testName: string;
301
+ error: string;
302
+ file?: string | undefined;
303
+ }[] | undefined;
304
+ } | undefined;
305
+ build?: {
306
+ ran: boolean;
307
+ success?: boolean | undefined;
308
+ errors?: {
309
+ message: string;
310
+ file: string;
311
+ line?: number | undefined;
312
+ }[] | undefined;
313
+ warnings?: {
314
+ message: string;
315
+ file: string;
316
+ line?: number | undefined;
317
+ }[] | undefined;
318
+ } | undefined;
319
+ typeCheck?: {
320
+ ran: boolean;
321
+ errors?: {
322
+ message: string;
323
+ file: string;
324
+ code?: string | undefined;
325
+ line?: number | undefined;
326
+ }[] | undefined;
327
+ } | undefined;
328
+ lint?: {
329
+ ran: boolean;
330
+ issues?: {
331
+ message: string;
332
+ file: string;
333
+ severity: "error" | "warning" | "info";
334
+ line?: number | undefined;
335
+ rule?: string | undefined;
336
+ }[] | undefined;
337
+ } | undefined;
338
+ }>;
339
+ export type ExecutionContext = z.infer<typeof ExecutionContextSchema>;
340
+ export declare const GitContextSchema: z.ZodObject<{
341
+ branch: z.ZodOptional<z.ZodString>;
342
+ baseBranch: z.ZodOptional<z.ZodString>;
343
+ commits: z.ZodOptional<z.ZodArray<z.ZodObject<{
344
+ hash: z.ZodString;
345
+ message: z.ZodString;
346
+ filesChanged: z.ZodArray<z.ZodString, "many">;
347
+ }, "strip", z.ZodTypeAny, {
348
+ message: string;
349
+ hash: string;
350
+ filesChanged: string[];
351
+ }, {
352
+ message: string;
353
+ hash: string;
354
+ filesChanged: string[];
355
+ }>, "many">>;
356
+ pullRequest: z.ZodOptional<z.ZodObject<{
357
+ title: z.ZodOptional<z.ZodString>;
358
+ description: z.ZodOptional<z.ZodString>;
359
+ targetBranch: z.ZodOptional<z.ZodString>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ title?: string | undefined;
362
+ description?: string | undefined;
363
+ targetBranch?: string | undefined;
364
+ }, {
365
+ title?: string | undefined;
366
+ description?: string | undefined;
367
+ targetBranch?: string | undefined;
368
+ }>>;
369
+ uncommittedChanges: z.ZodOptional<z.ZodBoolean>;
370
+ }, "strip", z.ZodTypeAny, {
371
+ branch?: string | undefined;
372
+ baseBranch?: string | undefined;
373
+ commits?: {
374
+ message: string;
375
+ hash: string;
376
+ filesChanged: string[];
377
+ }[] | undefined;
378
+ pullRequest?: {
379
+ title?: string | undefined;
380
+ description?: string | undefined;
381
+ targetBranch?: string | undefined;
382
+ } | undefined;
383
+ uncommittedChanges?: boolean | undefined;
384
+ }, {
385
+ branch?: string | undefined;
386
+ baseBranch?: string | undefined;
387
+ commits?: {
388
+ message: string;
389
+ hash: string;
390
+ filesChanged: string[];
391
+ }[] | undefined;
392
+ pullRequest?: {
393
+ title?: string | undefined;
394
+ description?: string | undefined;
395
+ targetBranch?: string | undefined;
396
+ } | undefined;
397
+ uncommittedChanges?: boolean | undefined;
398
+ }>;
399
+ export type GitContext = z.infer<typeof GitContextSchema>;
400
+ export declare const CCAnalysisSchema: z.ZodObject<{
401
+ originalRequest: z.ZodString;
402
+ taskType: z.ZodOptional<z.ZodEnum<["feature", "bugfix", "refactor", "security-fix", "performance", "review", "other"]>>;
403
+ summary: z.ZodString;
404
+ findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
405
+ category: z.ZodString;
406
+ description: z.ZodString;
407
+ location: z.ZodOptional<z.ZodString>;
408
+ confidence: z.ZodOptional<z.ZodNumber>;
409
+ addressed: z.ZodOptional<z.ZodBoolean>;
410
+ }, "strip", z.ZodTypeAny, {
411
+ description: string;
412
+ category: string;
413
+ location?: string | undefined;
414
+ confidence?: number | undefined;
415
+ addressed?: boolean | undefined;
416
+ }, {
417
+ description: string;
418
+ category: string;
419
+ location?: string | undefined;
420
+ confidence?: number | undefined;
421
+ addressed?: boolean | undefined;
422
+ }>, "many">>;
423
+ uncertainties: z.ZodOptional<z.ZodArray<z.ZodObject<{
424
+ topic: z.ZodString;
425
+ question: z.ZodString;
426
+ ccBestGuess: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ question: string;
429
+ topic: string;
430
+ ccBestGuess?: string | undefined;
431
+ }, {
432
+ question: string;
433
+ topic: string;
434
+ ccBestGuess?: string | undefined;
435
+ }>, "many">>;
436
+ assumptions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
437
+ decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
438
+ decision: z.ZodString;
439
+ rationale: z.ZodString;
440
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
441
+ }, "strip", z.ZodTypeAny, {
442
+ decision: string;
443
+ rationale: string;
444
+ alternatives?: string[] | undefined;
445
+ }, {
446
+ decision: string;
447
+ rationale: string;
448
+ alternatives?: string[] | undefined;
449
+ }>, "many">>;
450
+ confidence: z.ZodOptional<z.ZodNumber>;
451
+ }, "strip", z.ZodTypeAny, {
452
+ originalRequest: string;
453
+ summary: string;
454
+ findings?: {
455
+ description: string;
456
+ category: string;
457
+ location?: string | undefined;
458
+ confidence?: number | undefined;
459
+ addressed?: boolean | undefined;
460
+ }[] | undefined;
461
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
462
+ confidence?: number | undefined;
463
+ uncertainties?: {
464
+ question: string;
465
+ topic: string;
466
+ ccBestGuess?: string | undefined;
467
+ }[] | undefined;
468
+ assumptions?: string[] | undefined;
469
+ decisions?: {
470
+ decision: string;
471
+ rationale: string;
472
+ alternatives?: string[] | undefined;
473
+ }[] | undefined;
474
+ }, {
475
+ originalRequest: string;
476
+ summary: string;
477
+ findings?: {
478
+ description: string;
479
+ category: string;
480
+ location?: string | undefined;
481
+ confidence?: number | undefined;
482
+ addressed?: boolean | undefined;
483
+ }[] | undefined;
484
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
485
+ confidence?: number | undefined;
486
+ uncertainties?: {
487
+ question: string;
488
+ topic: string;
489
+ ccBestGuess?: string | undefined;
490
+ }[] | undefined;
491
+ assumptions?: string[] | undefined;
492
+ decisions?: {
493
+ decision: string;
494
+ rationale: string;
495
+ alternatives?: string[] | undefined;
496
+ }[] | undefined;
497
+ }>;
498
+ export type CCAnalysis = z.infer<typeof CCAnalysisSchema>;
499
+ export declare const ReviewScopeSchema: z.ZodObject<{
500
+ mustReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
501
+ path: z.ZodString;
502
+ reason: z.ZodString;
503
+ specificConcerns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ path: string;
506
+ reason: string;
507
+ specificConcerns?: string[] | undefined;
508
+ }, {
509
+ path: string;
510
+ reason: string;
511
+ specificConcerns?: string[] | undefined;
512
+ }>, "many">>;
513
+ shouldReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
514
+ path: z.ZodString;
515
+ reason: z.ZodString;
516
+ }, "strip", z.ZodTypeAny, {
517
+ path: string;
518
+ reason: string;
519
+ }, {
520
+ path: string;
521
+ reason: string;
522
+ }>, "many">>;
523
+ mayReview: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
524
+ skipReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
525
+ path: z.ZodString;
526
+ reason: z.ZodString;
527
+ }, "strip", z.ZodTypeAny, {
528
+ path: string;
529
+ reason: string;
530
+ }, {
531
+ path: string;
532
+ reason: string;
533
+ }>, "many">>;
534
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
535
+ question: z.ZodString;
536
+ context: z.ZodOptional<z.ZodString>;
537
+ relevantFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
538
+ ccAnswer: z.ZodOptional<z.ZodString>;
539
+ }, "strip", z.ZodTypeAny, {
540
+ question: string;
541
+ relevantFiles?: string[] | undefined;
542
+ context?: string | undefined;
543
+ ccAnswer?: string | undefined;
544
+ }, {
545
+ question: string;
546
+ relevantFiles?: string[] | undefined;
547
+ context?: string | undefined;
548
+ ccAnswer?: string | undefined;
549
+ }>, "many">>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ mustReview?: {
552
+ path: string;
553
+ reason: string;
554
+ specificConcerns?: string[] | undefined;
555
+ }[] | undefined;
556
+ shouldReview?: {
557
+ path: string;
558
+ reason: string;
559
+ }[] | undefined;
560
+ mayReview?: string[] | undefined;
561
+ skipReview?: {
562
+ path: string;
563
+ reason: string;
564
+ }[] | undefined;
565
+ questions?: {
566
+ question: string;
567
+ relevantFiles?: string[] | undefined;
568
+ context?: string | undefined;
569
+ ccAnswer?: string | undefined;
570
+ }[] | undefined;
571
+ }, {
572
+ mustReview?: {
573
+ path: string;
574
+ reason: string;
575
+ specificConcerns?: string[] | undefined;
576
+ }[] | undefined;
577
+ shouldReview?: {
578
+ path: string;
579
+ reason: string;
580
+ }[] | undefined;
581
+ mayReview?: string[] | undefined;
582
+ skipReview?: {
583
+ path: string;
584
+ reason: string;
585
+ }[] | undefined;
586
+ questions?: {
587
+ question: string;
588
+ relevantFiles?: string[] | undefined;
589
+ context?: string | undefined;
590
+ ccAnswer?: string | undefined;
591
+ }[] | undefined;
592
+ }>;
593
+ export type ReviewScope = z.infer<typeof ReviewScopeSchema>;
594
+ /**
595
+ * Complete context for a review request.
596
+ * This is what should be passed from CC to reviewers.
597
+ */
598
+ export declare const ReviewContextSchema: z.ZodObject<{
599
+ timestamp: z.ZodOptional<z.ZodString>;
600
+ workingDir: z.ZodString;
601
+ changes: z.ZodObject<{
602
+ files: z.ZodArray<z.ZodObject<{
603
+ path: z.ZodString;
604
+ language: z.ZodOptional<z.ZodString>;
605
+ changeType: z.ZodEnum<["created", "modified", "deleted", "renamed"]>;
606
+ diff: z.ZodOptional<z.ZodString>;
607
+ linesAdded: z.ZodOptional<z.ZodNumber>;
608
+ linesRemoved: z.ZodOptional<z.ZodNumber>;
609
+ content: z.ZodOptional<z.ZodString>;
610
+ changedSymbols: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ name: z.ZodString;
612
+ type: z.ZodEnum<["function", "class", "variable", "type", "import", "export", "other"]>;
613
+ lineStart: z.ZodOptional<z.ZodNumber>;
614
+ lineEnd: z.ZodOptional<z.ZodNumber>;
615
+ }, "strip", z.ZodTypeAny, {
616
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
617
+ name: string;
618
+ lineStart?: number | undefined;
619
+ lineEnd?: number | undefined;
620
+ }, {
621
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
622
+ name: string;
623
+ lineStart?: number | undefined;
624
+ lineEnd?: number | undefined;
625
+ }>, "many">>;
626
+ imports: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
627
+ importedBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
628
+ testFile: z.ZodOptional<z.ZodString>;
629
+ }, "strip", z.ZodTypeAny, {
630
+ path: string;
631
+ changeType: "created" | "modified" | "deleted" | "renamed";
632
+ language?: string | undefined;
633
+ diff?: string | undefined;
634
+ linesAdded?: number | undefined;
635
+ linesRemoved?: number | undefined;
636
+ content?: string | undefined;
637
+ changedSymbols?: {
638
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
639
+ name: string;
640
+ lineStart?: number | undefined;
641
+ lineEnd?: number | undefined;
642
+ }[] | undefined;
643
+ imports?: string[] | undefined;
644
+ importedBy?: string[] | undefined;
645
+ testFile?: string | undefined;
646
+ }, {
647
+ path: string;
648
+ changeType: "created" | "modified" | "deleted" | "renamed";
649
+ language?: string | undefined;
650
+ diff?: string | undefined;
651
+ linesAdded?: number | undefined;
652
+ linesRemoved?: number | undefined;
653
+ content?: string | undefined;
654
+ changedSymbols?: {
655
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
656
+ name: string;
657
+ lineStart?: number | undefined;
658
+ lineEnd?: number | undefined;
659
+ }[] | undefined;
660
+ imports?: string[] | undefined;
661
+ importedBy?: string[] | undefined;
662
+ testFile?: string | undefined;
663
+ }>, "many">;
664
+ totalLinesAdded: z.ZodOptional<z.ZodNumber>;
665
+ totalLinesRemoved: z.ZodOptional<z.ZodNumber>;
666
+ impactedModules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ files: {
669
+ path: string;
670
+ changeType: "created" | "modified" | "deleted" | "renamed";
671
+ language?: string | undefined;
672
+ diff?: string | undefined;
673
+ linesAdded?: number | undefined;
674
+ linesRemoved?: number | undefined;
675
+ content?: string | undefined;
676
+ changedSymbols?: {
677
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
678
+ name: string;
679
+ lineStart?: number | undefined;
680
+ lineEnd?: number | undefined;
681
+ }[] | undefined;
682
+ imports?: string[] | undefined;
683
+ importedBy?: string[] | undefined;
684
+ testFile?: string | undefined;
685
+ }[];
686
+ totalLinesAdded?: number | undefined;
687
+ totalLinesRemoved?: number | undefined;
688
+ impactedModules?: string[] | undefined;
689
+ }, {
690
+ files: {
691
+ path: string;
692
+ changeType: "created" | "modified" | "deleted" | "renamed";
693
+ language?: string | undefined;
694
+ diff?: string | undefined;
695
+ linesAdded?: number | undefined;
696
+ linesRemoved?: number | undefined;
697
+ content?: string | undefined;
698
+ changedSymbols?: {
699
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
700
+ name: string;
701
+ lineStart?: number | undefined;
702
+ lineEnd?: number | undefined;
703
+ }[] | undefined;
704
+ imports?: string[] | undefined;
705
+ importedBy?: string[] | undefined;
706
+ testFile?: string | undefined;
707
+ }[];
708
+ totalLinesAdded?: number | undefined;
709
+ totalLinesRemoved?: number | undefined;
710
+ impactedModules?: string[] | undefined;
711
+ }>;
712
+ analysis: z.ZodObject<{
713
+ originalRequest: z.ZodString;
714
+ taskType: z.ZodOptional<z.ZodEnum<["feature", "bugfix", "refactor", "security-fix", "performance", "review", "other"]>>;
715
+ summary: z.ZodString;
716
+ findings: z.ZodOptional<z.ZodArray<z.ZodObject<{
717
+ category: z.ZodString;
718
+ description: z.ZodString;
719
+ location: z.ZodOptional<z.ZodString>;
720
+ confidence: z.ZodOptional<z.ZodNumber>;
721
+ addressed: z.ZodOptional<z.ZodBoolean>;
722
+ }, "strip", z.ZodTypeAny, {
723
+ description: string;
724
+ category: string;
725
+ location?: string | undefined;
726
+ confidence?: number | undefined;
727
+ addressed?: boolean | undefined;
728
+ }, {
729
+ description: string;
730
+ category: string;
731
+ location?: string | undefined;
732
+ confidence?: number | undefined;
733
+ addressed?: boolean | undefined;
734
+ }>, "many">>;
735
+ uncertainties: z.ZodOptional<z.ZodArray<z.ZodObject<{
736
+ topic: z.ZodString;
737
+ question: z.ZodString;
738
+ ccBestGuess: z.ZodOptional<z.ZodString>;
739
+ }, "strip", z.ZodTypeAny, {
740
+ question: string;
741
+ topic: string;
742
+ ccBestGuess?: string | undefined;
743
+ }, {
744
+ question: string;
745
+ topic: string;
746
+ ccBestGuess?: string | undefined;
747
+ }>, "many">>;
748
+ assumptions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
749
+ decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
750
+ decision: z.ZodString;
751
+ rationale: z.ZodString;
752
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ decision: string;
755
+ rationale: string;
756
+ alternatives?: string[] | undefined;
757
+ }, {
758
+ decision: string;
759
+ rationale: string;
760
+ alternatives?: string[] | undefined;
761
+ }>, "many">>;
762
+ confidence: z.ZodOptional<z.ZodNumber>;
763
+ }, "strip", z.ZodTypeAny, {
764
+ originalRequest: string;
765
+ summary: string;
766
+ findings?: {
767
+ description: string;
768
+ category: string;
769
+ location?: string | undefined;
770
+ confidence?: number | undefined;
771
+ addressed?: boolean | undefined;
772
+ }[] | undefined;
773
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
774
+ confidence?: number | undefined;
775
+ uncertainties?: {
776
+ question: string;
777
+ topic: string;
778
+ ccBestGuess?: string | undefined;
779
+ }[] | undefined;
780
+ assumptions?: string[] | undefined;
781
+ decisions?: {
782
+ decision: string;
783
+ rationale: string;
784
+ alternatives?: string[] | undefined;
785
+ }[] | undefined;
786
+ }, {
787
+ originalRequest: string;
788
+ summary: string;
789
+ findings?: {
790
+ description: string;
791
+ category: string;
792
+ location?: string | undefined;
793
+ confidence?: number | undefined;
794
+ addressed?: boolean | undefined;
795
+ }[] | undefined;
796
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
797
+ confidence?: number | undefined;
798
+ uncertainties?: {
799
+ question: string;
800
+ topic: string;
801
+ ccBestGuess?: string | undefined;
802
+ }[] | undefined;
803
+ assumptions?: string[] | undefined;
804
+ decisions?: {
805
+ decision: string;
806
+ rationale: string;
807
+ alternatives?: string[] | undefined;
808
+ }[] | undefined;
809
+ }>;
810
+ execution: z.ZodOptional<z.ZodObject<{
811
+ tests: z.ZodOptional<z.ZodObject<{
812
+ ran: z.ZodBoolean;
813
+ passed: z.ZodOptional<z.ZodNumber>;
814
+ failed: z.ZodOptional<z.ZodNumber>;
815
+ skipped: z.ZodOptional<z.ZodNumber>;
816
+ failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
817
+ testName: z.ZodString;
818
+ file: z.ZodOptional<z.ZodString>;
819
+ error: z.ZodString;
820
+ }, "strip", z.ZodTypeAny, {
821
+ testName: string;
822
+ error: string;
823
+ file?: string | undefined;
824
+ }, {
825
+ testName: string;
826
+ error: string;
827
+ file?: string | undefined;
828
+ }>, "many">>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ ran: boolean;
831
+ passed?: number | undefined;
832
+ failed?: number | undefined;
833
+ skipped?: number | undefined;
834
+ failures?: {
835
+ testName: string;
836
+ error: string;
837
+ file?: string | undefined;
838
+ }[] | undefined;
839
+ }, {
840
+ ran: boolean;
841
+ passed?: number | undefined;
842
+ failed?: number | undefined;
843
+ skipped?: number | undefined;
844
+ failures?: {
845
+ testName: string;
846
+ error: string;
847
+ file?: string | undefined;
848
+ }[] | undefined;
849
+ }>>;
850
+ build: z.ZodOptional<z.ZodObject<{
851
+ ran: z.ZodBoolean;
852
+ success: z.ZodOptional<z.ZodBoolean>;
853
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
854
+ file: z.ZodString;
855
+ line: z.ZodOptional<z.ZodNumber>;
856
+ message: z.ZodString;
857
+ }, "strip", z.ZodTypeAny, {
858
+ message: string;
859
+ file: string;
860
+ line?: number | undefined;
861
+ }, {
862
+ message: string;
863
+ file: string;
864
+ line?: number | undefined;
865
+ }>, "many">>;
866
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
867
+ file: z.ZodString;
868
+ line: z.ZodOptional<z.ZodNumber>;
869
+ message: z.ZodString;
870
+ }, "strip", z.ZodTypeAny, {
871
+ message: string;
872
+ file: string;
873
+ line?: number | undefined;
874
+ }, {
875
+ message: string;
876
+ file: string;
877
+ line?: number | undefined;
878
+ }>, "many">>;
879
+ }, "strip", z.ZodTypeAny, {
880
+ ran: boolean;
881
+ success?: boolean | undefined;
882
+ errors?: {
883
+ message: string;
884
+ file: string;
885
+ line?: number | undefined;
886
+ }[] | undefined;
887
+ warnings?: {
888
+ message: string;
889
+ file: string;
890
+ line?: number | undefined;
891
+ }[] | undefined;
892
+ }, {
893
+ ran: boolean;
894
+ success?: boolean | undefined;
895
+ errors?: {
896
+ message: string;
897
+ file: string;
898
+ line?: number | undefined;
899
+ }[] | undefined;
900
+ warnings?: {
901
+ message: string;
902
+ file: string;
903
+ line?: number | undefined;
904
+ }[] | undefined;
905
+ }>>;
906
+ typeCheck: z.ZodOptional<z.ZodObject<{
907
+ ran: z.ZodBoolean;
908
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
909
+ file: z.ZodString;
910
+ line: z.ZodOptional<z.ZodNumber>;
911
+ message: z.ZodString;
912
+ code: z.ZodOptional<z.ZodString>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ message: string;
915
+ file: string;
916
+ code?: string | undefined;
917
+ line?: number | undefined;
918
+ }, {
919
+ message: string;
920
+ file: string;
921
+ code?: string | undefined;
922
+ line?: number | undefined;
923
+ }>, "many">>;
924
+ }, "strip", z.ZodTypeAny, {
925
+ ran: boolean;
926
+ errors?: {
927
+ message: string;
928
+ file: string;
929
+ code?: string | undefined;
930
+ line?: number | undefined;
931
+ }[] | undefined;
932
+ }, {
933
+ ran: boolean;
934
+ errors?: {
935
+ message: string;
936
+ file: string;
937
+ code?: string | undefined;
938
+ line?: number | undefined;
939
+ }[] | undefined;
940
+ }>>;
941
+ lint: z.ZodOptional<z.ZodObject<{
942
+ ran: z.ZodBoolean;
943
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
944
+ file: z.ZodString;
945
+ line: z.ZodOptional<z.ZodNumber>;
946
+ rule: z.ZodOptional<z.ZodString>;
947
+ severity: z.ZodEnum<["error", "warning", "info"]>;
948
+ message: z.ZodString;
949
+ }, "strip", z.ZodTypeAny, {
950
+ message: string;
951
+ file: string;
952
+ severity: "error" | "warning" | "info";
953
+ line?: number | undefined;
954
+ rule?: string | undefined;
955
+ }, {
956
+ message: string;
957
+ file: string;
958
+ severity: "error" | "warning" | "info";
959
+ line?: number | undefined;
960
+ rule?: string | undefined;
961
+ }>, "many">>;
962
+ }, "strip", z.ZodTypeAny, {
963
+ ran: boolean;
964
+ issues?: {
965
+ message: string;
966
+ file: string;
967
+ severity: "error" | "warning" | "info";
968
+ line?: number | undefined;
969
+ rule?: string | undefined;
970
+ }[] | undefined;
971
+ }, {
972
+ ran: boolean;
973
+ issues?: {
974
+ message: string;
975
+ file: string;
976
+ severity: "error" | "warning" | "info";
977
+ line?: number | undefined;
978
+ rule?: string | undefined;
979
+ }[] | undefined;
980
+ }>>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ tests?: {
983
+ ran: boolean;
984
+ passed?: number | undefined;
985
+ failed?: number | undefined;
986
+ skipped?: number | undefined;
987
+ failures?: {
988
+ testName: string;
989
+ error: string;
990
+ file?: string | undefined;
991
+ }[] | undefined;
992
+ } | undefined;
993
+ build?: {
994
+ ran: boolean;
995
+ success?: boolean | undefined;
996
+ errors?: {
997
+ message: string;
998
+ file: string;
999
+ line?: number | undefined;
1000
+ }[] | undefined;
1001
+ warnings?: {
1002
+ message: string;
1003
+ file: string;
1004
+ line?: number | undefined;
1005
+ }[] | undefined;
1006
+ } | undefined;
1007
+ typeCheck?: {
1008
+ ran: boolean;
1009
+ errors?: {
1010
+ message: string;
1011
+ file: string;
1012
+ code?: string | undefined;
1013
+ line?: number | undefined;
1014
+ }[] | undefined;
1015
+ } | undefined;
1016
+ lint?: {
1017
+ ran: boolean;
1018
+ issues?: {
1019
+ message: string;
1020
+ file: string;
1021
+ severity: "error" | "warning" | "info";
1022
+ line?: number | undefined;
1023
+ rule?: string | undefined;
1024
+ }[] | undefined;
1025
+ } | undefined;
1026
+ }, {
1027
+ tests?: {
1028
+ ran: boolean;
1029
+ passed?: number | undefined;
1030
+ failed?: number | undefined;
1031
+ skipped?: number | undefined;
1032
+ failures?: {
1033
+ testName: string;
1034
+ error: string;
1035
+ file?: string | undefined;
1036
+ }[] | undefined;
1037
+ } | undefined;
1038
+ build?: {
1039
+ ran: boolean;
1040
+ success?: boolean | undefined;
1041
+ errors?: {
1042
+ message: string;
1043
+ file: string;
1044
+ line?: number | undefined;
1045
+ }[] | undefined;
1046
+ warnings?: {
1047
+ message: string;
1048
+ file: string;
1049
+ line?: number | undefined;
1050
+ }[] | undefined;
1051
+ } | undefined;
1052
+ typeCheck?: {
1053
+ ran: boolean;
1054
+ errors?: {
1055
+ message: string;
1056
+ file: string;
1057
+ code?: string | undefined;
1058
+ line?: number | undefined;
1059
+ }[] | undefined;
1060
+ } | undefined;
1061
+ lint?: {
1062
+ ran: boolean;
1063
+ issues?: {
1064
+ message: string;
1065
+ file: string;
1066
+ severity: "error" | "warning" | "info";
1067
+ line?: number | undefined;
1068
+ rule?: string | undefined;
1069
+ }[] | undefined;
1070
+ } | undefined;
1071
+ }>>;
1072
+ git: z.ZodOptional<z.ZodObject<{
1073
+ branch: z.ZodOptional<z.ZodString>;
1074
+ baseBranch: z.ZodOptional<z.ZodString>;
1075
+ commits: z.ZodOptional<z.ZodArray<z.ZodObject<{
1076
+ hash: z.ZodString;
1077
+ message: z.ZodString;
1078
+ filesChanged: z.ZodArray<z.ZodString, "many">;
1079
+ }, "strip", z.ZodTypeAny, {
1080
+ message: string;
1081
+ hash: string;
1082
+ filesChanged: string[];
1083
+ }, {
1084
+ message: string;
1085
+ hash: string;
1086
+ filesChanged: string[];
1087
+ }>, "many">>;
1088
+ pullRequest: z.ZodOptional<z.ZodObject<{
1089
+ title: z.ZodOptional<z.ZodString>;
1090
+ description: z.ZodOptional<z.ZodString>;
1091
+ targetBranch: z.ZodOptional<z.ZodString>;
1092
+ }, "strip", z.ZodTypeAny, {
1093
+ title?: string | undefined;
1094
+ description?: string | undefined;
1095
+ targetBranch?: string | undefined;
1096
+ }, {
1097
+ title?: string | undefined;
1098
+ description?: string | undefined;
1099
+ targetBranch?: string | undefined;
1100
+ }>>;
1101
+ uncommittedChanges: z.ZodOptional<z.ZodBoolean>;
1102
+ }, "strip", z.ZodTypeAny, {
1103
+ branch?: string | undefined;
1104
+ baseBranch?: string | undefined;
1105
+ commits?: {
1106
+ message: string;
1107
+ hash: string;
1108
+ filesChanged: string[];
1109
+ }[] | undefined;
1110
+ pullRequest?: {
1111
+ title?: string | undefined;
1112
+ description?: string | undefined;
1113
+ targetBranch?: string | undefined;
1114
+ } | undefined;
1115
+ uncommittedChanges?: boolean | undefined;
1116
+ }, {
1117
+ branch?: string | undefined;
1118
+ baseBranch?: string | undefined;
1119
+ commits?: {
1120
+ message: string;
1121
+ hash: string;
1122
+ filesChanged: string[];
1123
+ }[] | undefined;
1124
+ pullRequest?: {
1125
+ title?: string | undefined;
1126
+ description?: string | undefined;
1127
+ targetBranch?: string | undefined;
1128
+ } | undefined;
1129
+ uncommittedChanges?: boolean | undefined;
1130
+ }>>;
1131
+ scope: z.ZodOptional<z.ZodObject<{
1132
+ mustReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
1133
+ path: z.ZodString;
1134
+ reason: z.ZodString;
1135
+ specificConcerns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1136
+ }, "strip", z.ZodTypeAny, {
1137
+ path: string;
1138
+ reason: string;
1139
+ specificConcerns?: string[] | undefined;
1140
+ }, {
1141
+ path: string;
1142
+ reason: string;
1143
+ specificConcerns?: string[] | undefined;
1144
+ }>, "many">>;
1145
+ shouldReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
1146
+ path: z.ZodString;
1147
+ reason: z.ZodString;
1148
+ }, "strip", z.ZodTypeAny, {
1149
+ path: string;
1150
+ reason: string;
1151
+ }, {
1152
+ path: string;
1153
+ reason: string;
1154
+ }>, "many">>;
1155
+ mayReview: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1156
+ skipReview: z.ZodOptional<z.ZodArray<z.ZodObject<{
1157
+ path: z.ZodString;
1158
+ reason: z.ZodString;
1159
+ }, "strip", z.ZodTypeAny, {
1160
+ path: string;
1161
+ reason: string;
1162
+ }, {
1163
+ path: string;
1164
+ reason: string;
1165
+ }>, "many">>;
1166
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1167
+ question: z.ZodString;
1168
+ context: z.ZodOptional<z.ZodString>;
1169
+ relevantFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1170
+ ccAnswer: z.ZodOptional<z.ZodString>;
1171
+ }, "strip", z.ZodTypeAny, {
1172
+ question: string;
1173
+ relevantFiles?: string[] | undefined;
1174
+ context?: string | undefined;
1175
+ ccAnswer?: string | undefined;
1176
+ }, {
1177
+ question: string;
1178
+ relevantFiles?: string[] | undefined;
1179
+ context?: string | undefined;
1180
+ ccAnswer?: string | undefined;
1181
+ }>, "many">>;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ mustReview?: {
1184
+ path: string;
1185
+ reason: string;
1186
+ specificConcerns?: string[] | undefined;
1187
+ }[] | undefined;
1188
+ shouldReview?: {
1189
+ path: string;
1190
+ reason: string;
1191
+ }[] | undefined;
1192
+ mayReview?: string[] | undefined;
1193
+ skipReview?: {
1194
+ path: string;
1195
+ reason: string;
1196
+ }[] | undefined;
1197
+ questions?: {
1198
+ question: string;
1199
+ relevantFiles?: string[] | undefined;
1200
+ context?: string | undefined;
1201
+ ccAnswer?: string | undefined;
1202
+ }[] | undefined;
1203
+ }, {
1204
+ mustReview?: {
1205
+ path: string;
1206
+ reason: string;
1207
+ specificConcerns?: string[] | undefined;
1208
+ }[] | undefined;
1209
+ shouldReview?: {
1210
+ path: string;
1211
+ reason: string;
1212
+ }[] | undefined;
1213
+ mayReview?: string[] | undefined;
1214
+ skipReview?: {
1215
+ path: string;
1216
+ reason: string;
1217
+ }[] | undefined;
1218
+ questions?: {
1219
+ question: string;
1220
+ relevantFiles?: string[] | undefined;
1221
+ context?: string | undefined;
1222
+ ccAnswer?: string | undefined;
1223
+ }[] | undefined;
1224
+ }>>;
1225
+ focusAreas: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1226
+ customInstructions: z.ZodOptional<z.ZodString>;
1227
+ }, "strip", z.ZodTypeAny, {
1228
+ analysis: {
1229
+ originalRequest: string;
1230
+ summary: string;
1231
+ findings?: {
1232
+ description: string;
1233
+ category: string;
1234
+ location?: string | undefined;
1235
+ confidence?: number | undefined;
1236
+ addressed?: boolean | undefined;
1237
+ }[] | undefined;
1238
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
1239
+ confidence?: number | undefined;
1240
+ uncertainties?: {
1241
+ question: string;
1242
+ topic: string;
1243
+ ccBestGuess?: string | undefined;
1244
+ }[] | undefined;
1245
+ assumptions?: string[] | undefined;
1246
+ decisions?: {
1247
+ decision: string;
1248
+ rationale: string;
1249
+ alternatives?: string[] | undefined;
1250
+ }[] | undefined;
1251
+ };
1252
+ workingDir: string;
1253
+ changes: {
1254
+ files: {
1255
+ path: string;
1256
+ changeType: "created" | "modified" | "deleted" | "renamed";
1257
+ language?: string | undefined;
1258
+ diff?: string | undefined;
1259
+ linesAdded?: number | undefined;
1260
+ linesRemoved?: number | undefined;
1261
+ content?: string | undefined;
1262
+ changedSymbols?: {
1263
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
1264
+ name: string;
1265
+ lineStart?: number | undefined;
1266
+ lineEnd?: number | undefined;
1267
+ }[] | undefined;
1268
+ imports?: string[] | undefined;
1269
+ importedBy?: string[] | undefined;
1270
+ testFile?: string | undefined;
1271
+ }[];
1272
+ totalLinesAdded?: number | undefined;
1273
+ totalLinesRemoved?: number | undefined;
1274
+ impactedModules?: string[] | undefined;
1275
+ };
1276
+ timestamp?: string | undefined;
1277
+ execution?: {
1278
+ tests?: {
1279
+ ran: boolean;
1280
+ passed?: number | undefined;
1281
+ failed?: number | undefined;
1282
+ skipped?: number | undefined;
1283
+ failures?: {
1284
+ testName: string;
1285
+ error: string;
1286
+ file?: string | undefined;
1287
+ }[] | undefined;
1288
+ } | undefined;
1289
+ build?: {
1290
+ ran: boolean;
1291
+ success?: boolean | undefined;
1292
+ errors?: {
1293
+ message: string;
1294
+ file: string;
1295
+ line?: number | undefined;
1296
+ }[] | undefined;
1297
+ warnings?: {
1298
+ message: string;
1299
+ file: string;
1300
+ line?: number | undefined;
1301
+ }[] | undefined;
1302
+ } | undefined;
1303
+ typeCheck?: {
1304
+ ran: boolean;
1305
+ errors?: {
1306
+ message: string;
1307
+ file: string;
1308
+ code?: string | undefined;
1309
+ line?: number | undefined;
1310
+ }[] | undefined;
1311
+ } | undefined;
1312
+ lint?: {
1313
+ ran: boolean;
1314
+ issues?: {
1315
+ message: string;
1316
+ file: string;
1317
+ severity: "error" | "warning" | "info";
1318
+ line?: number | undefined;
1319
+ rule?: string | undefined;
1320
+ }[] | undefined;
1321
+ } | undefined;
1322
+ } | undefined;
1323
+ git?: {
1324
+ branch?: string | undefined;
1325
+ baseBranch?: string | undefined;
1326
+ commits?: {
1327
+ message: string;
1328
+ hash: string;
1329
+ filesChanged: string[];
1330
+ }[] | undefined;
1331
+ pullRequest?: {
1332
+ title?: string | undefined;
1333
+ description?: string | undefined;
1334
+ targetBranch?: string | undefined;
1335
+ } | undefined;
1336
+ uncommittedChanges?: boolean | undefined;
1337
+ } | undefined;
1338
+ scope?: {
1339
+ mustReview?: {
1340
+ path: string;
1341
+ reason: string;
1342
+ specificConcerns?: string[] | undefined;
1343
+ }[] | undefined;
1344
+ shouldReview?: {
1345
+ path: string;
1346
+ reason: string;
1347
+ }[] | undefined;
1348
+ mayReview?: string[] | undefined;
1349
+ skipReview?: {
1350
+ path: string;
1351
+ reason: string;
1352
+ }[] | undefined;
1353
+ questions?: {
1354
+ question: string;
1355
+ relevantFiles?: string[] | undefined;
1356
+ context?: string | undefined;
1357
+ ccAnswer?: string | undefined;
1358
+ }[] | undefined;
1359
+ } | undefined;
1360
+ focusAreas?: string[] | undefined;
1361
+ customInstructions?: string | undefined;
1362
+ }, {
1363
+ analysis: {
1364
+ originalRequest: string;
1365
+ summary: string;
1366
+ findings?: {
1367
+ description: string;
1368
+ category: string;
1369
+ location?: string | undefined;
1370
+ confidence?: number | undefined;
1371
+ addressed?: boolean | undefined;
1372
+ }[] | undefined;
1373
+ taskType?: "performance" | "other" | "feature" | "bugfix" | "refactor" | "security-fix" | "review" | undefined;
1374
+ confidence?: number | undefined;
1375
+ uncertainties?: {
1376
+ question: string;
1377
+ topic: string;
1378
+ ccBestGuess?: string | undefined;
1379
+ }[] | undefined;
1380
+ assumptions?: string[] | undefined;
1381
+ decisions?: {
1382
+ decision: string;
1383
+ rationale: string;
1384
+ alternatives?: string[] | undefined;
1385
+ }[] | undefined;
1386
+ };
1387
+ workingDir: string;
1388
+ changes: {
1389
+ files: {
1390
+ path: string;
1391
+ changeType: "created" | "modified" | "deleted" | "renamed";
1392
+ language?: string | undefined;
1393
+ diff?: string | undefined;
1394
+ linesAdded?: number | undefined;
1395
+ linesRemoved?: number | undefined;
1396
+ content?: string | undefined;
1397
+ changedSymbols?: {
1398
+ type: "function" | "type" | "class" | "variable" | "import" | "export" | "other";
1399
+ name: string;
1400
+ lineStart?: number | undefined;
1401
+ lineEnd?: number | undefined;
1402
+ }[] | undefined;
1403
+ imports?: string[] | undefined;
1404
+ importedBy?: string[] | undefined;
1405
+ testFile?: string | undefined;
1406
+ }[];
1407
+ totalLinesAdded?: number | undefined;
1408
+ totalLinesRemoved?: number | undefined;
1409
+ impactedModules?: string[] | undefined;
1410
+ };
1411
+ timestamp?: string | undefined;
1412
+ execution?: {
1413
+ tests?: {
1414
+ ran: boolean;
1415
+ passed?: number | undefined;
1416
+ failed?: number | undefined;
1417
+ skipped?: number | undefined;
1418
+ failures?: {
1419
+ testName: string;
1420
+ error: string;
1421
+ file?: string | undefined;
1422
+ }[] | undefined;
1423
+ } | undefined;
1424
+ build?: {
1425
+ ran: boolean;
1426
+ success?: boolean | undefined;
1427
+ errors?: {
1428
+ message: string;
1429
+ file: string;
1430
+ line?: number | undefined;
1431
+ }[] | undefined;
1432
+ warnings?: {
1433
+ message: string;
1434
+ file: string;
1435
+ line?: number | undefined;
1436
+ }[] | undefined;
1437
+ } | undefined;
1438
+ typeCheck?: {
1439
+ ran: boolean;
1440
+ errors?: {
1441
+ message: string;
1442
+ file: string;
1443
+ code?: string | undefined;
1444
+ line?: number | undefined;
1445
+ }[] | undefined;
1446
+ } | undefined;
1447
+ lint?: {
1448
+ ran: boolean;
1449
+ issues?: {
1450
+ message: string;
1451
+ file: string;
1452
+ severity: "error" | "warning" | "info";
1453
+ line?: number | undefined;
1454
+ rule?: string | undefined;
1455
+ }[] | undefined;
1456
+ } | undefined;
1457
+ } | undefined;
1458
+ git?: {
1459
+ branch?: string | undefined;
1460
+ baseBranch?: string | undefined;
1461
+ commits?: {
1462
+ message: string;
1463
+ hash: string;
1464
+ filesChanged: string[];
1465
+ }[] | undefined;
1466
+ pullRequest?: {
1467
+ title?: string | undefined;
1468
+ description?: string | undefined;
1469
+ targetBranch?: string | undefined;
1470
+ } | undefined;
1471
+ uncommittedChanges?: boolean | undefined;
1472
+ } | undefined;
1473
+ scope?: {
1474
+ mustReview?: {
1475
+ path: string;
1476
+ reason: string;
1477
+ specificConcerns?: string[] | undefined;
1478
+ }[] | undefined;
1479
+ shouldReview?: {
1480
+ path: string;
1481
+ reason: string;
1482
+ }[] | undefined;
1483
+ mayReview?: string[] | undefined;
1484
+ skipReview?: {
1485
+ path: string;
1486
+ reason: string;
1487
+ }[] | undefined;
1488
+ questions?: {
1489
+ question: string;
1490
+ relevantFiles?: string[] | undefined;
1491
+ context?: string | undefined;
1492
+ ccAnswer?: string | undefined;
1493
+ }[] | undefined;
1494
+ } | undefined;
1495
+ focusAreas?: string[] | undefined;
1496
+ customInstructions?: string | undefined;
1497
+ }>;
1498
+ export type ReviewContext = z.infer<typeof ReviewContextSchema>;
1499
+ /**
1500
+ * Build a minimal context from legacy inputs
1501
+ */
1502
+ export declare function buildMinimalContext(workingDir: string, ccOutput: string, analyzedFiles?: string[], focusAreas?: string[], customPrompt?: string): ReviewContext;
1503
+ /**
1504
+ * Build context from git diff
1505
+ */
1506
+ export declare function buildContextFromGitDiff(workingDir: string, baseBranch?: string): Promise<Partial<ReviewContext>>;
1507
+ export interface OptimizationOptions {
1508
+ maxTokens: number;
1509
+ focusAreas?: string[];
1510
+ includeFullContent: boolean;
1511
+ includeDiffs: boolean;
1512
+ }
1513
+ /**
1514
+ * Optimize context to fit within token limits while preserving important info
1515
+ */
1516
+ export declare function optimizeContext(context: ReviewContext, options: OptimizationOptions): ReviewContext;
1517
+ /**
1518
+ * Convert context to a string suitable for inclusion in prompts
1519
+ */
1520
+ export declare function contextToPromptString(context: ReviewContext): string;
1521
+ /**
1522
+ * Data needed to verify reviewer claims
1523
+ */
1524
+ export interface VerificationData {
1525
+ existingFiles: Set<string>;
1526
+ fileContents: Map<string, string>;
1527
+ fileLineCounts: Map<string, number>;
1528
+ }
1529
+ /**
1530
+ * Check if a file:line reference is valid
1531
+ */
1532
+ export declare function verifyFileLineReference(reference: {
1533
+ file: string;
1534
+ line?: number;
1535
+ }, verification: VerificationData): {
1536
+ valid: boolean;
1537
+ reason?: string;
1538
+ };