diffpanel 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,408 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const reviewScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ type: z.ZodLiteral<"worktree">;
5
+ baseRef: z.ZodString;
6
+ baseSha: z.ZodString;
7
+ }, z.core.$strip>, z.ZodObject<{
8
+ type: z.ZodLiteral<"staged">;
9
+ baseRef: z.ZodString;
10
+ baseSha: z.ZodString;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ type: z.ZodLiteral<"range">;
13
+ expression: z.ZodString;
14
+ baseRef: z.ZodString;
15
+ compareRef: z.ZodString;
16
+ baseSha: z.ZodString;
17
+ compareSha: z.ZodString;
18
+ mergeBase: z.ZodBoolean;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ type: z.ZodLiteral<"repository">;
21
+ ref: z.ZodString;
22
+ sha: z.ZodString;
23
+ maxFiles: z.ZodNumber;
24
+ }, z.core.$strip>], "type">;
25
+ declare const fileStatusSchema: z.ZodEnum<{
26
+ unknown: "unknown";
27
+ added: "added";
28
+ modified: "modified";
29
+ deleted: "deleted";
30
+ renamed: "renamed";
31
+ copied: "copied";
32
+ unmerged: "unmerged";
33
+ snapshot: "snapshot";
34
+ }>;
35
+ declare const reviewItemSchema: z.ZodObject<{
36
+ id: z.ZodString;
37
+ kind: z.ZodEnum<{
38
+ file: "file";
39
+ hunk: "hunk";
40
+ }>;
41
+ filePath: z.ZodString;
42
+ oldPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
43
+ status: z.ZodEnum<{
44
+ unknown: "unknown";
45
+ added: "added";
46
+ modified: "modified";
47
+ deleted: "deleted";
48
+ renamed: "renamed";
49
+ copied: "copied";
50
+ unmerged: "unmerged";
51
+ snapshot: "snapshot";
52
+ }>;
53
+ ordinal: z.ZodNumber;
54
+ oldStart: z.ZodNullable<z.ZodNumber>;
55
+ oldLines: z.ZodNullable<z.ZodNumber>;
56
+ newStart: z.ZodNullable<z.ZodNumber>;
57
+ newLines: z.ZodNullable<z.ZodNumber>;
58
+ patch: z.ZodString;
59
+ contentHash: z.ZodString;
60
+ }, z.core.$strip>;
61
+ declare const reviewFileSchema: z.ZodObject<{
62
+ id: z.ZodString;
63
+ filePath: z.ZodString;
64
+ oldPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
65
+ status: z.ZodEnum<{
66
+ unknown: "unknown";
67
+ added: "added";
68
+ modified: "modified";
69
+ deleted: "deleted";
70
+ renamed: "renamed";
71
+ copied: "copied";
72
+ unmerged: "unmerged";
73
+ snapshot: "snapshot";
74
+ }>;
75
+ beforeBlob: z.ZodNullable<z.ZodString>;
76
+ afterBlob: z.ZodNullable<z.ZodString>;
77
+ additions: z.ZodNumber;
78
+ deletions: z.ZodNumber;
79
+ language: z.ZodNullable<z.ZodString>;
80
+ size: z.ZodNumber;
81
+ items: z.ZodArray<z.ZodObject<{
82
+ id: z.ZodString;
83
+ kind: z.ZodEnum<{
84
+ file: "file";
85
+ hunk: "hunk";
86
+ }>;
87
+ filePath: z.ZodString;
88
+ oldPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
89
+ status: z.ZodEnum<{
90
+ unknown: "unknown";
91
+ added: "added";
92
+ modified: "modified";
93
+ deleted: "deleted";
94
+ renamed: "renamed";
95
+ copied: "copied";
96
+ unmerged: "unmerged";
97
+ snapshot: "snapshot";
98
+ }>;
99
+ ordinal: z.ZodNumber;
100
+ oldStart: z.ZodNullable<z.ZodNumber>;
101
+ oldLines: z.ZodNullable<z.ZodNumber>;
102
+ newStart: z.ZodNullable<z.ZodNumber>;
103
+ newLines: z.ZodNullable<z.ZodNumber>;
104
+ patch: z.ZodString;
105
+ contentHash: z.ZodString;
106
+ }, z.core.$strip>>;
107
+ }, z.core.$strip>;
108
+ declare const skippedEntrySchema: z.ZodObject<{
109
+ filePath: z.ZodString;
110
+ reason: z.ZodString;
111
+ }, z.core.$strip>;
112
+ declare const reviewManifestSchema: z.ZodObject<{
113
+ schemaVersion: z.ZodLiteral<1>;
114
+ runId: z.ZodString;
115
+ repositoryId: z.ZodString;
116
+ repositoryRoot: z.ZodString;
117
+ repositoryName: z.ZodString;
118
+ createdAt: z.ZodString;
119
+ snapshotHash: z.ZodString;
120
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
121
+ type: z.ZodLiteral<"worktree">;
122
+ baseRef: z.ZodString;
123
+ baseSha: z.ZodString;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ type: z.ZodLiteral<"staged">;
126
+ baseRef: z.ZodString;
127
+ baseSha: z.ZodString;
128
+ }, z.core.$strip>, z.ZodObject<{
129
+ type: z.ZodLiteral<"range">;
130
+ expression: z.ZodString;
131
+ baseRef: z.ZodString;
132
+ compareRef: z.ZodString;
133
+ baseSha: z.ZodString;
134
+ compareSha: z.ZodString;
135
+ mergeBase: z.ZodBoolean;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ type: z.ZodLiteral<"repository">;
138
+ ref: z.ZodString;
139
+ sha: z.ZodString;
140
+ maxFiles: z.ZodNumber;
141
+ }, z.core.$strip>], "type">;
142
+ files: z.ZodArray<z.ZodObject<{
143
+ id: z.ZodString;
144
+ filePath: z.ZodString;
145
+ oldPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
146
+ status: z.ZodEnum<{
147
+ unknown: "unknown";
148
+ added: "added";
149
+ modified: "modified";
150
+ deleted: "deleted";
151
+ renamed: "renamed";
152
+ copied: "copied";
153
+ unmerged: "unmerged";
154
+ snapshot: "snapshot";
155
+ }>;
156
+ beforeBlob: z.ZodNullable<z.ZodString>;
157
+ afterBlob: z.ZodNullable<z.ZodString>;
158
+ additions: z.ZodNumber;
159
+ deletions: z.ZodNumber;
160
+ language: z.ZodNullable<z.ZodString>;
161
+ size: z.ZodNumber;
162
+ items: z.ZodArray<z.ZodObject<{
163
+ id: z.ZodString;
164
+ kind: z.ZodEnum<{
165
+ file: "file";
166
+ hunk: "hunk";
167
+ }>;
168
+ filePath: z.ZodString;
169
+ oldPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
170
+ status: z.ZodEnum<{
171
+ unknown: "unknown";
172
+ added: "added";
173
+ modified: "modified";
174
+ deleted: "deleted";
175
+ renamed: "renamed";
176
+ copied: "copied";
177
+ unmerged: "unmerged";
178
+ snapshot: "snapshot";
179
+ }>;
180
+ ordinal: z.ZodNumber;
181
+ oldStart: z.ZodNullable<z.ZodNumber>;
182
+ oldLines: z.ZodNullable<z.ZodNumber>;
183
+ newStart: z.ZodNullable<z.ZodNumber>;
184
+ newLines: z.ZodNullable<z.ZodNumber>;
185
+ patch: z.ZodString;
186
+ contentHash: z.ZodString;
187
+ }, z.core.$strip>>;
188
+ }, z.core.$strip>>;
189
+ skipped: z.ZodArray<z.ZodObject<{
190
+ filePath: z.ZodString;
191
+ reason: z.ZodString;
192
+ }, z.core.$strip>>;
193
+ requirements: z.ZodOptional<z.ZodObject<{
194
+ diagramAssessment: z.ZodLiteral<true>;
195
+ }, z.core.$strip>>;
196
+ }, z.core.$strip>;
197
+ declare const lineReferenceSchema: z.ZodObject<{
198
+ filePath: z.ZodString;
199
+ side: z.ZodEnum<{
200
+ before: "before";
201
+ after: "after";
202
+ }>;
203
+ startLine: z.ZodNumber;
204
+ endLine: z.ZodNumber;
205
+ }, z.core.$strip>;
206
+ declare const keyChangeSchema: z.ZodObject<{
207
+ content: z.ZodString;
208
+ lineRefs: z.ZodArray<z.ZodObject<{
209
+ filePath: z.ZodString;
210
+ side: z.ZodEnum<{
211
+ before: "before";
212
+ after: "after";
213
+ }>;
214
+ startLine: z.ZodNumber;
215
+ endLine: z.ZodNumber;
216
+ }, z.core.$strip>>;
217
+ }, z.core.$strip>;
218
+ declare const chapterSchema: z.ZodObject<{
219
+ id: z.ZodString;
220
+ parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
221
+ order: z.ZodNumber;
222
+ title: z.ZodString;
223
+ summary: z.ZodString;
224
+ diagram: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ diagramItemRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
+ itemRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
227
+ keyChanges: z.ZodDefault<z.ZodArray<z.ZodObject<{
228
+ content: z.ZodString;
229
+ lineRefs: z.ZodArray<z.ZodObject<{
230
+ filePath: z.ZodString;
231
+ side: z.ZodEnum<{
232
+ before: "before";
233
+ after: "after";
234
+ }>;
235
+ startLine: z.ZodNumber;
236
+ endLine: z.ZodNumber;
237
+ }, z.core.$strip>>;
238
+ }, z.core.$strip>>>;
239
+ }, z.core.$strip>;
240
+ declare const focusAreaSchema: z.ZodObject<{
241
+ type: z.ZodEnum<{
242
+ security: "security";
243
+ "breaking-change": "breaking-change";
244
+ "high-complexity": "high-complexity";
245
+ "data-integrity": "data-integrity";
246
+ "new-pattern": "new-pattern";
247
+ architecture: "architecture";
248
+ performance: "performance";
249
+ "testing-gap": "testing-gap";
250
+ }>;
251
+ severity: z.ZodEnum<{
252
+ critical: "critical";
253
+ high: "high";
254
+ medium: "medium";
255
+ info: "info";
256
+ }>;
257
+ title: z.ZodString;
258
+ description: z.ZodString;
259
+ locations: z.ZodArray<z.ZodString>;
260
+ }, z.core.$strip>;
261
+ declare const prologueSchema: z.ZodObject<{
262
+ motivation: z.ZodNullable<z.ZodString>;
263
+ outcome: z.ZodNullable<z.ZodString>;
264
+ diagram: z.ZodNullable<z.ZodString>;
265
+ diagramItemRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
266
+ keyChanges: z.ZodArray<z.ZodObject<{
267
+ summary: z.ZodString;
268
+ description: z.ZodString;
269
+ }, z.core.$strip>>;
270
+ focusAreas: z.ZodArray<z.ZodObject<{
271
+ type: z.ZodEnum<{
272
+ security: "security";
273
+ "breaking-change": "breaking-change";
274
+ "high-complexity": "high-complexity";
275
+ "data-integrity": "data-integrity";
276
+ "new-pattern": "new-pattern";
277
+ architecture: "architecture";
278
+ performance: "performance";
279
+ "testing-gap": "testing-gap";
280
+ }>;
281
+ severity: z.ZodEnum<{
282
+ critical: "critical";
283
+ high: "high";
284
+ medium: "medium";
285
+ info: "info";
286
+ }>;
287
+ title: z.ZodString;
288
+ description: z.ZodString;
289
+ locations: z.ZodArray<z.ZodString>;
290
+ }, z.core.$strip>>;
291
+ complexity: z.ZodObject<{
292
+ level: z.ZodEnum<{
293
+ high: "high";
294
+ medium: "medium";
295
+ low: "low";
296
+ "very-high": "very-high";
297
+ }>;
298
+ reasoning: z.ZodString;
299
+ }, z.core.$strip>;
300
+ }, z.core.$strip>;
301
+ declare const REVIEW_TITLE_MAX_LENGTH = 80;
302
+ declare const reviewTitleSchema: z.ZodString;
303
+ declare const generatedReviewSchema: z.ZodObject<{
304
+ schemaVersion: z.ZodLiteral<1>;
305
+ runId: z.ZodString;
306
+ generator: z.ZodOptional<z.ZodString>;
307
+ title: z.ZodOptional<z.ZodString>;
308
+ diagramAssessment: z.ZodOptional<z.ZodObject<{
309
+ kind: z.ZodEnum<{
310
+ architectural: "architectural";
311
+ other: "other";
312
+ }>;
313
+ reasoning: z.ZodString;
314
+ overviewOmissionReason: z.ZodOptional<z.ZodString>;
315
+ chapterDiagramOmissionReason: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>>;
317
+ chapters: z.ZodArray<z.ZodObject<{
318
+ id: z.ZodString;
319
+ parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
320
+ order: z.ZodNumber;
321
+ title: z.ZodString;
322
+ summary: z.ZodString;
323
+ diagram: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
+ diagramItemRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
325
+ itemRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
326
+ keyChanges: z.ZodDefault<z.ZodArray<z.ZodObject<{
327
+ content: z.ZodString;
328
+ lineRefs: z.ZodArray<z.ZodObject<{
329
+ filePath: z.ZodString;
330
+ side: z.ZodEnum<{
331
+ before: "before";
332
+ after: "after";
333
+ }>;
334
+ startLine: z.ZodNumber;
335
+ endLine: z.ZodNumber;
336
+ }, z.core.$strip>>;
337
+ }, z.core.$strip>>>;
338
+ }, z.core.$strip>>;
339
+ prologue: z.ZodObject<{
340
+ motivation: z.ZodNullable<z.ZodString>;
341
+ outcome: z.ZodNullable<z.ZodString>;
342
+ diagram: z.ZodNullable<z.ZodString>;
343
+ diagramItemRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ keyChanges: z.ZodArray<z.ZodObject<{
345
+ summary: z.ZodString;
346
+ description: z.ZodString;
347
+ }, z.core.$strip>>;
348
+ focusAreas: z.ZodArray<z.ZodObject<{
349
+ type: z.ZodEnum<{
350
+ security: "security";
351
+ "breaking-change": "breaking-change";
352
+ "high-complexity": "high-complexity";
353
+ "data-integrity": "data-integrity";
354
+ "new-pattern": "new-pattern";
355
+ architecture: "architecture";
356
+ performance: "performance";
357
+ "testing-gap": "testing-gap";
358
+ }>;
359
+ severity: z.ZodEnum<{
360
+ critical: "critical";
361
+ high: "high";
362
+ medium: "medium";
363
+ info: "info";
364
+ }>;
365
+ title: z.ZodString;
366
+ description: z.ZodString;
367
+ locations: z.ZodArray<z.ZodString>;
368
+ }, z.core.$strip>>;
369
+ complexity: z.ZodObject<{
370
+ level: z.ZodEnum<{
371
+ high: "high";
372
+ medium: "medium";
373
+ low: "low";
374
+ "very-high": "very-high";
375
+ }>;
376
+ reasoning: z.ZodString;
377
+ }, z.core.$strip>;
378
+ }, z.core.$strip>;
379
+ }, z.core.$strip>;
380
+ type ReviewScope = z.infer<typeof reviewScopeSchema>;
381
+ type ReviewItem = z.infer<typeof reviewItemSchema>;
382
+ type ReviewFile = z.infer<typeof reviewFileSchema>;
383
+ type ReviewManifest = z.infer<typeof reviewManifestSchema>;
384
+ type Chapter = z.infer<typeof chapterSchema>;
385
+ type GeneratedReview = z.infer<typeof generatedReviewSchema>;
386
+ type Prologue = z.infer<typeof prologueSchema>;
387
+
388
+ declare function formatGenerationInput(manifest: ReviewManifest): string;
389
+
390
+ declare function sha256(value: string | Buffer): string;
391
+ declare function createRunId(now?: Date): string;
392
+ declare function stableId(prefix: string, ...parts: Array<string | number | null>): string;
393
+
394
+ declare function parseReviewTitle(value: string): string;
395
+ declare function titleForScope(scope: ReviewScope): string;
396
+ declare function displayReviewTitle(title: string | null | undefined, scope: ReviewScope): string;
397
+
398
+ interface ReviewValidationResult {
399
+ valid: boolean;
400
+ errors: string[];
401
+ missingItemRefs: string[];
402
+ duplicateItemRefs: string[];
403
+ extraItemRefs: string[];
404
+ }
405
+ declare function validateGeneratedReview(manifestInput: unknown, reviewInput: unknown): ReviewValidationResult;
406
+ declare function assertGeneratedReview(manifest: ReviewManifest, reviewInput: unknown): GeneratedReview;
407
+
408
+ export { type Chapter, type GeneratedReview, type Prologue, REVIEW_TITLE_MAX_LENGTH, type ReviewFile, type ReviewItem, type ReviewManifest, type ReviewScope, type ReviewValidationResult, assertGeneratedReview, chapterSchema, createRunId, displayReviewTitle, fileStatusSchema, focusAreaSchema, formatGenerationInput, generatedReviewSchema, keyChangeSchema, lineReferenceSchema, parseReviewTitle, prologueSchema, reviewFileSchema, reviewItemSchema, reviewManifestSchema, reviewScopeSchema, reviewTitleSchema, sha256, skippedEntrySchema, stableId, titleForScope, validateGeneratedReview };