@oss-autopilot/core 1.17.4 → 3.0.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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-registry.js +417 -326
  3. package/dist/cli.bundle.cjs +99 -96
  4. package/dist/commands/daily-render.d.ts +39 -0
  5. package/dist/commands/daily-render.js +189 -0
  6. package/dist/commands/dashboard-data.js +9 -3
  7. package/dist/commands/index.d.ts +4 -8
  8. package/dist/commands/index.js +3 -5
  9. package/dist/commands/list-move-tier.d.ts +46 -0
  10. package/dist/commands/list-move-tier.js +192 -0
  11. package/dist/commands/pr-template.js +2 -1
  12. package/dist/commands/state-cmd.d.ts +10 -1
  13. package/dist/commands/state-cmd.js +22 -3
  14. package/dist/commands/track.d.ts +7 -28
  15. package/dist/commands/track.js +8 -30
  16. package/dist/core/auth.d.ts +50 -0
  17. package/dist/core/auth.js +160 -0
  18. package/dist/core/concurrency.d.ts +7 -0
  19. package/dist/core/concurrency.js +9 -0
  20. package/dist/core/daily-logic.d.ts +10 -42
  21. package/dist/core/daily-logic.js +14 -201
  22. package/dist/core/dates.d.ts +37 -0
  23. package/dist/core/dates.js +60 -0
  24. package/dist/core/errors.d.ts +14 -0
  25. package/dist/core/errors.js +22 -0
  26. package/dist/core/gist-state-store.d.ts +48 -2
  27. package/dist/core/gist-state-store.js +120 -24
  28. package/dist/core/github-stats.js +1 -1
  29. package/dist/core/http-cache.js +1 -1
  30. package/dist/core/index.d.ts +5 -1
  31. package/dist/core/index.js +5 -1
  32. package/dist/core/issue-conversation.js +3 -2
  33. package/dist/core/paths.d.ts +68 -0
  34. package/dist/core/paths.js +106 -0
  35. package/dist/core/pr-monitor.js +3 -1
  36. package/dist/core/repo-score-manager.js +1 -1
  37. package/dist/core/state-persistence.js +1 -1
  38. package/dist/core/state.d.ts +16 -2
  39. package/dist/core/state.js +42 -7
  40. package/dist/core/types.d.ts +57 -0
  41. package/dist/core/urls.d.ts +63 -0
  42. package/dist/core/urls.js +101 -0
  43. package/dist/formatters/json.d.ts +464 -74
  44. package/dist/formatters/json.js +380 -0
  45. package/package.json +3 -3
  46. package/dist/commands/read.d.ts +0 -18
  47. package/dist/commands/read.js +0 -20
  48. package/dist/core/utils.d.ts +0 -303
  49. package/dist/core/utils.js +0 -529
@@ -2,11 +2,13 @@
2
2
  * JSON output formatter for CLI --json mode
3
3
  * Provides structured output that can be consumed by scripts and plugins
4
4
  */
5
+ import { z, type ZodType } from 'zod';
5
6
  import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, ShelvedPRRef } from '../core/types.js';
6
7
  import type { ContributionStats } from '../core/stats.js';
7
8
  import type { PRCheckFailure } from '../core/pr-monitor.js';
8
- import type { SearchPriority } from '../core/types.js';
9
+ import type { SearchPriority, CapacityAssessment, ActionableIssue, ActionableIssueType, CompactActionableIssue, ActionMenuItem, ActionMenu } from '../core/types.js';
9
10
  import type { CIFormatterDiagnosis, FormatterDetectionResult } from '../core/formatter-detection.js';
11
+ export type { CapacityAssessment, ActionableIssue, ActionableIssueType, CompactActionableIssue, ActionMenuItem, ActionMenu, };
10
12
  export type ErrorCode = 'AUTH_REQUIRED' | 'RATE_LIMITED' | 'VALIDATION' | 'CONFIGURATION' | 'NETWORK' | 'NOT_FOUND' | 'STATE_CORRUPTED' | 'CONCURRENCY' | 'UNKNOWN';
11
13
  export interface JsonOutput<T = unknown> {
12
14
  success: boolean;
@@ -15,66 +17,6 @@ export interface JsonOutput<T = unknown> {
15
17
  errorCode?: ErrorCode;
16
18
  timestamp: string;
17
19
  }
18
- export interface CapacityAssessment {
19
- hasCapacity: boolean;
20
- activePRCount: number;
21
- maxActivePRs: number;
22
- shelvedPRCount: number;
23
- criticalIssueCount: number;
24
- reason: string;
25
- }
26
- export type ActionableIssueType = 'ci_failing' | 'merge_conflict' | 'needs_response' | 'needs_changes' | 'incomplete_checklist';
27
- export interface ActionableIssue {
28
- type: ActionableIssueType;
29
- pr: FetchedPR;
30
- label: string;
31
- /** True if the PR was created after the last daily digest (first time seen). */
32
- isNewContribution: boolean;
33
- }
34
- /**
35
- * Compact version of ActionableIssue for JSON output.
36
- * References the PR by URL instead of embedding the full object,
37
- * since the full PR is already available in digest.openPRs.
38
- * Uses URL (globally unique) instead of number to avoid cross-repo collisions.
39
- */
40
- export interface CompactActionableIssue {
41
- type: ActionableIssueType;
42
- prUrl: string;
43
- label: string;
44
- /** True if the PR was created after the last daily digest (first time seen). */
45
- isNewContribution: boolean;
46
- }
47
- /**
48
- * A single action menu item pre-computed by the CLI.
49
- * The orchestration layer can use these directly in AskUserQuestion prompts.
50
- */
51
- export interface ActionMenuItem {
52
- /** Stable identifier for routing (e.g., "address_all", "search", "done"). */
53
- key: string;
54
- /** Display text for the option (e.g., "Work through all 3 issues (Recommended)"). */
55
- label: string;
56
- /** Explanation shown below the label. */
57
- description: string;
58
- /** Present when the action would exceed the user's PR capacity limit (#765). */
59
- capacityWarning?: string;
60
- }
61
- /**
62
- * Pre-computed action menu for the orchestration layer.
63
- * Contains the menu items the CLI can determine from PR data and capacity,
64
- * plus context flags so the orchestration can insert issue-list options.
65
- */
66
- export interface ActionMenu {
67
- /** Ordered list of menu items. The orchestration may insert issue-list items after the CLI-generated items (address_all, issue_replies) or at the start when none exist. */
68
- items: ActionMenuItem[];
69
- /** Context flags for the orchestration layer to decide on issue-list options. */
70
- context: {
71
- hasActionableIssues: boolean;
72
- actionableCount: number;
73
- hasCapacity: boolean;
74
- hasIssueResponses: boolean;
75
- issueResponseCount: number;
76
- };
77
- }
78
20
  /**
79
21
  * Deduplicated daily digest for JSON output (#287).
80
22
  *
@@ -185,19 +127,444 @@ export declare function compactActionableIssues(issues: ActionableIssue[]): Comp
185
127
  * Replaces full PR arrays with PR URL arrays.
186
128
  */
187
129
  export declare function compactRepoGroups(groups: RepoGroup[]): CompactRepoGroup[];
188
- export interface StatusOutput {
189
- stats: {
190
- mergedPRs: number;
191
- closedPRs: number;
192
- activeIssues: number;
193
- trustedProjects: number;
194
- mergeRate: string;
195
- needsResponse: number;
196
- };
197
- lastRunAt: string;
198
- offline?: boolean;
199
- lastUpdated?: string;
200
- }
130
+ export declare const StatusOutputSchema: z.ZodObject<{
131
+ stats: z.ZodObject<{
132
+ mergedPRs: z.ZodNumber;
133
+ closedPRs: z.ZodNumber;
134
+ activeIssues: z.ZodNumber;
135
+ trustedProjects: z.ZodNumber;
136
+ mergeRate: z.ZodString;
137
+ needsResponse: z.ZodNumber;
138
+ }, z.core.$strip>;
139
+ lastRunAt: z.ZodString;
140
+ offline: z.ZodOptional<z.ZodBoolean>;
141
+ lastUpdated: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>;
143
+ export type StatusOutput = z.infer<typeof StatusOutputSchema>;
144
+ export declare const DailyOutputSchema: z.ZodObject<{
145
+ digest: z.ZodObject<{
146
+ generatedAt: z.ZodString;
147
+ openPRs: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
148
+ needsAddressingPRs: z.ZodArray<z.ZodString>;
149
+ waitingOnMaintainerPRs: z.ZodArray<z.ZodString>;
150
+ recentlyClosedPRs: z.ZodArray<z.ZodObject<{
151
+ number: z.ZodNumber;
152
+ url: z.ZodString;
153
+ title: z.ZodString;
154
+ closedAt: z.ZodString;
155
+ }, z.core.$strip>>;
156
+ recentlyMergedPRs: z.ZodArray<z.ZodObject<{
157
+ number: z.ZodNumber;
158
+ url: z.ZodString;
159
+ title: z.ZodString;
160
+ mergedAt: z.ZodString;
161
+ }, z.core.$strip>>;
162
+ shelvedPRs: z.ZodArray<z.ZodObject<{
163
+ number: z.ZodNumber;
164
+ url: z.ZodString;
165
+ title: z.ZodString;
166
+ repo: z.ZodString;
167
+ daysSinceActivity: z.ZodNumber;
168
+ status: z.ZodString;
169
+ }, z.core.$strip>>;
170
+ autoUnshelvedPRs: z.ZodArray<z.ZodObject<{
171
+ number: z.ZodNumber;
172
+ url: z.ZodString;
173
+ title: z.ZodString;
174
+ repo: z.ZodString;
175
+ daysSinceActivity: z.ZodNumber;
176
+ status: z.ZodString;
177
+ }, z.core.$strip>>;
178
+ summary: z.ZodObject<{
179
+ totalActivePRs: z.ZodNumber;
180
+ totalNeedingAttention: z.ZodNumber;
181
+ totalMergedAllTime: z.ZodNumber;
182
+ mergeRate: z.ZodNumber;
183
+ }, z.core.$strip>;
184
+ }, z.core.$strip>;
185
+ capacity: z.ZodObject<{
186
+ hasCapacity: z.ZodBoolean;
187
+ activePRCount: z.ZodNumber;
188
+ maxActivePRs: z.ZodNumber;
189
+ shelvedPRCount: z.ZodNumber;
190
+ criticalIssueCount: z.ZodNumber;
191
+ reason: z.ZodString;
192
+ }, z.core.$strip>;
193
+ summary: z.ZodString;
194
+ briefSummary: z.ZodString;
195
+ actionableIssues: z.ZodArray<z.ZodObject<{
196
+ type: z.ZodEnum<{
197
+ needs_response: "needs_response";
198
+ needs_changes: "needs_changes";
199
+ merge_conflict: "merge_conflict";
200
+ incomplete_checklist: "incomplete_checklist";
201
+ ci_failing: "ci_failing";
202
+ }>;
203
+ prUrl: z.ZodString;
204
+ label: z.ZodString;
205
+ isNewContribution: z.ZodBoolean;
206
+ }, z.core.$strip>>;
207
+ actionMenu: z.ZodObject<{
208
+ items: z.ZodArray<z.ZodObject<{
209
+ key: z.ZodString;
210
+ label: z.ZodString;
211
+ description: z.ZodString;
212
+ capacityWarning: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strip>>;
214
+ context: z.ZodObject<{
215
+ hasActionableIssues: z.ZodBoolean;
216
+ actionableCount: z.ZodNumber;
217
+ hasCapacity: z.ZodBoolean;
218
+ hasIssueResponses: z.ZodBoolean;
219
+ issueResponseCount: z.ZodNumber;
220
+ }, z.core.$strip>;
221
+ }, z.core.$strip>;
222
+ commentedIssues: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
223
+ repoGroups: z.ZodArray<z.ZodObject<{
224
+ repo: z.ZodString;
225
+ prUrls: z.ZodArray<z.ZodString>;
226
+ }, z.core.$strip>>;
227
+ failures: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
228
+ warnings: z.ZodArray<z.ZodObject<{
229
+ phase: z.ZodEnum<{
230
+ fetch: "fetch";
231
+ "repo-scores": "repo-scores";
232
+ analytics: "analytics";
233
+ "scout-sync": "scout-sync";
234
+ partition: "partition";
235
+ "dismiss-filter": "dismiss-filter";
236
+ "gist-checkpoint": "gist-checkpoint";
237
+ }>;
238
+ operation: z.ZodString;
239
+ message: z.ZodString;
240
+ }, z.core.$strip>>;
241
+ }, z.core.$strip>;
242
+ export declare const CompactDailyOutputSchema: z.ZodObject<{
243
+ digest: z.ZodObject<{
244
+ generatedAt: z.ZodString;
245
+ openPRs: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ needsAddressingPRs: z.ZodArray<z.ZodString>;
247
+ waitingOnMaintainerPRs: z.ZodArray<z.ZodString>;
248
+ recentlyClosedPRs: z.ZodArray<z.ZodObject<{
249
+ number: z.ZodNumber;
250
+ url: z.ZodString;
251
+ title: z.ZodString;
252
+ closedAt: z.ZodString;
253
+ }, z.core.$strip>>;
254
+ recentlyMergedPRs: z.ZodArray<z.ZodObject<{
255
+ number: z.ZodNumber;
256
+ url: z.ZodString;
257
+ title: z.ZodString;
258
+ mergedAt: z.ZodString;
259
+ }, z.core.$strip>>;
260
+ shelvedPRs: z.ZodArray<z.ZodObject<{
261
+ number: z.ZodNumber;
262
+ url: z.ZodString;
263
+ title: z.ZodString;
264
+ repo: z.ZodString;
265
+ daysSinceActivity: z.ZodNumber;
266
+ status: z.ZodString;
267
+ }, z.core.$strip>>;
268
+ autoUnshelvedPRs: z.ZodArray<z.ZodObject<{
269
+ number: z.ZodNumber;
270
+ url: z.ZodString;
271
+ title: z.ZodString;
272
+ repo: z.ZodString;
273
+ daysSinceActivity: z.ZodNumber;
274
+ status: z.ZodString;
275
+ }, z.core.$strip>>;
276
+ summary: z.ZodObject<{
277
+ totalActivePRs: z.ZodNumber;
278
+ totalNeedingAttention: z.ZodNumber;
279
+ totalMergedAllTime: z.ZodNumber;
280
+ mergeRate: z.ZodNumber;
281
+ }, z.core.$strip>;
282
+ }, z.core.$strip>;
283
+ capacity: z.ZodObject<{
284
+ hasCapacity: z.ZodBoolean;
285
+ activePRCount: z.ZodNumber;
286
+ maxActivePRs: z.ZodNumber;
287
+ shelvedPRCount: z.ZodNumber;
288
+ criticalIssueCount: z.ZodNumber;
289
+ reason: z.ZodString;
290
+ }, z.core.$strip>;
291
+ briefSummary: z.ZodString;
292
+ actionableIssues: z.ZodArray<z.ZodObject<{
293
+ type: z.ZodEnum<{
294
+ needs_response: "needs_response";
295
+ needs_changes: "needs_changes";
296
+ merge_conflict: "merge_conflict";
297
+ incomplete_checklist: "incomplete_checklist";
298
+ ci_failing: "ci_failing";
299
+ }>;
300
+ prUrl: z.ZodString;
301
+ label: z.ZodString;
302
+ isNewContribution: z.ZodBoolean;
303
+ }, z.core.$strip>>;
304
+ actionMenu: z.ZodObject<{
305
+ items: z.ZodArray<z.ZodObject<{
306
+ key: z.ZodString;
307
+ label: z.ZodString;
308
+ description: z.ZodString;
309
+ capacityWarning: z.ZodOptional<z.ZodString>;
310
+ }, z.core.$strip>>;
311
+ context: z.ZodObject<{
312
+ hasActionableIssues: z.ZodBoolean;
313
+ actionableCount: z.ZodNumber;
314
+ hasCapacity: z.ZodBoolean;
315
+ hasIssueResponses: z.ZodBoolean;
316
+ issueResponseCount: z.ZodNumber;
317
+ }, z.core.$strip>;
318
+ }, z.core.$strip>;
319
+ commentedIssues: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
320
+ failureCount: z.ZodNumber;
321
+ warnings: z.ZodArray<z.ZodObject<{
322
+ phase: z.ZodEnum<{
323
+ fetch: "fetch";
324
+ "repo-scores": "repo-scores";
325
+ analytics: "analytics";
326
+ "scout-sync": "scout-sync";
327
+ partition: "partition";
328
+ "dismiss-filter": "dismiss-filter";
329
+ "gist-checkpoint": "gist-checkpoint";
330
+ }>;
331
+ operation: z.ZodString;
332
+ message: z.ZodString;
333
+ }, z.core.$strip>>;
334
+ }, z.core.$strip>;
335
+ export declare const SearchOutputSchema: z.ZodObject<{
336
+ candidates: z.ZodArray<z.ZodObject<{
337
+ issue: z.ZodObject<{
338
+ repo: z.ZodString;
339
+ repoUrl: z.ZodString;
340
+ number: z.ZodNumber;
341
+ title: z.ZodString;
342
+ url: z.ZodString;
343
+ labels: z.ZodArray<z.ZodString>;
344
+ }, z.core.$strip>;
345
+ recommendation: z.ZodEnum<{
346
+ approve: "approve";
347
+ skip: "skip";
348
+ needs_review: "needs_review";
349
+ }>;
350
+ reasonsToApprove: z.ZodArray<z.ZodString>;
351
+ reasonsToSkip: z.ZodArray<z.ZodString>;
352
+ searchPriority: z.ZodEnum<{
353
+ normal: "normal";
354
+ merged_pr: "merged_pr";
355
+ preferred_org: "preferred_org";
356
+ starred: "starred";
357
+ }>;
358
+ viabilityScore: z.ZodNumber;
359
+ grade: z.ZodObject<{
360
+ letter: z.ZodEnum<{
361
+ A: "A";
362
+ B: "B";
363
+ C: "C";
364
+ F: "F";
365
+ }>;
366
+ reason: z.ZodString;
367
+ }, z.core.$strip>;
368
+ repoScore: z.ZodOptional<z.ZodObject<{
369
+ score: z.ZodNumber;
370
+ mergedPRCount: z.ZodNumber;
371
+ closedWithoutMergeCount: z.ZodNumber;
372
+ isResponsive: z.ZodBoolean;
373
+ lastMergedAt: z.ZodOptional<z.ZodString>;
374
+ }, z.core.$strip>>;
375
+ }, z.core.$strip>>;
376
+ excludedRepos: z.ZodArray<z.ZodString>;
377
+ aiPolicyBlocklist: z.ZodArray<z.ZodString>;
378
+ rateLimitWarning: z.ZodOptional<z.ZodString>;
379
+ }, z.core.$strip>;
380
+ export declare const DoctorOutputSchema: z.ZodObject<{
381
+ checks: z.ZodArray<z.ZodObject<{
382
+ name: z.ZodString;
383
+ status: z.ZodEnum<{
384
+ error: "error";
385
+ ok: "ok";
386
+ warning: "warning";
387
+ }>;
388
+ message: z.ZodString;
389
+ remediation: z.ZodOptional<z.ZodString>;
390
+ }, z.core.$strip>>;
391
+ summary: z.ZodObject<{
392
+ ok: z.ZodNumber;
393
+ warnings: z.ZodNumber;
394
+ errors: z.ZodNumber;
395
+ }, z.core.$strip>;
396
+ }, z.core.$strip>;
397
+ export declare const SkipAddOutputSchema: z.ZodObject<{
398
+ added: z.ZodBoolean;
399
+ alreadyPresent: z.ZodBoolean;
400
+ url: z.ZodString;
401
+ path: z.ZodString;
402
+ date: z.ZodOptional<z.ZodString>;
403
+ }, z.core.$strip>;
404
+ export declare const ListMoveTierOutputSchema: z.ZodObject<{
405
+ moved: z.ZodBoolean;
406
+ filePath: z.ZodString;
407
+ url: z.ZodString;
408
+ toTier: z.ZodEnum<{
409
+ maybe: "maybe";
410
+ skip: "skip";
411
+ pursue: "pursue";
412
+ }>;
413
+ fromTier: z.ZodOptional<z.ZodString>;
414
+ count: z.ZodNumber;
415
+ reason: z.ZodOptional<z.ZodString>;
416
+ }, z.core.$strip>;
417
+ export declare const PostOutputSchema: z.ZodObject<{
418
+ commentUrl: z.ZodString;
419
+ url: z.ZodString;
420
+ }, z.core.$strip>;
421
+ export declare const ClaimOutputSchema: z.ZodObject<{
422
+ commentUrl: z.ZodString;
423
+ issueUrl: z.ZodString;
424
+ }, z.core.$strip>;
425
+ export declare const InitOutputSchema: z.ZodObject<{
426
+ username: z.ZodString;
427
+ message: z.ZodString;
428
+ }, z.core.$strip>;
429
+ export declare const CheckSetupOutputSchema: z.ZodObject<{
430
+ setupComplete: z.ZodBoolean;
431
+ username: z.ZodString;
432
+ }, z.core.$strip>;
433
+ export declare const SetupOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
434
+ success: z.ZodLiteral<true>;
435
+ settings: z.ZodRecord<z.ZodString, z.ZodString>;
436
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
437
+ }, z.core.$strip>, z.ZodObject<{
438
+ setupComplete: z.ZodLiteral<true>;
439
+ config: z.ZodObject<{
440
+ githubUsername: z.ZodString;
441
+ maxActivePRs: z.ZodNumber;
442
+ dormantThresholdDays: z.ZodNumber;
443
+ approachingDormantDays: z.ZodNumber;
444
+ languages: z.ZodArray<z.ZodString>;
445
+ labels: z.ZodArray<z.ZodString>;
446
+ projectCategories: z.ZodArray<z.ZodString>;
447
+ preferredOrgs: z.ZodArray<z.ZodString>;
448
+ scope: z.ZodArray<z.ZodString>;
449
+ persistence: z.ZodEnum<{
450
+ local: "local";
451
+ gist: "gist";
452
+ }>;
453
+ }, z.core.$strip>;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ setupRequired: z.ZodLiteral<true>;
456
+ prompts: z.ZodArray<z.ZodObject<{
457
+ setting: z.ZodString;
458
+ prompt: z.ZodString;
459
+ current: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>, z.ZodNull]>;
460
+ required: z.ZodOptional<z.ZodBoolean>;
461
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>>;
462
+ type: z.ZodOptional<z.ZodString>;
463
+ }, z.core.$strip>>;
464
+ }, z.core.$strip>]>;
465
+ export declare const ConfigCommandOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
466
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
467
+ }, z.core.$strip>, z.ZodObject<{
468
+ success: z.ZodLiteral<true>;
469
+ key: z.ZodString;
470
+ value: z.ZodString;
471
+ }, z.core.$strip>, z.ZodObject<{
472
+ keys: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
473
+ }, z.core.$strip>]>;
474
+ export declare const MoveOutputSchema: z.ZodObject<{
475
+ url: z.ZodString;
476
+ target: z.ZodEnum<{
477
+ auto: "auto";
478
+ waiting: "waiting";
479
+ attention: "attention";
480
+ shelved: "shelved";
481
+ }>;
482
+ description: z.ZodString;
483
+ }, z.core.$strip>;
484
+ export declare const PRTemplateOutputSchema: z.ZodObject<{
485
+ template: z.ZodNullable<z.ZodString>;
486
+ source: z.ZodNullable<z.ZodString>;
487
+ error: z.ZodOptional<z.ZodString>;
488
+ }, z.core.$strip>;
489
+ export declare const ParseIssueListOutputSchema: z.ZodObject<{
490
+ available: z.ZodArray<z.ZodObject<{
491
+ repo: z.ZodString;
492
+ number: z.ZodNumber;
493
+ title: z.ZodString;
494
+ tier: z.ZodString;
495
+ url: z.ZodString;
496
+ score: z.ZodOptional<z.ZodNumber>;
497
+ }, z.core.$strip>>;
498
+ completed: z.ZodArray<z.ZodObject<{
499
+ repo: z.ZodString;
500
+ number: z.ZodNumber;
501
+ title: z.ZodString;
502
+ tier: z.ZodString;
503
+ url: z.ZodString;
504
+ score: z.ZodOptional<z.ZodNumber>;
505
+ }, z.core.$strip>>;
506
+ availableCount: z.ZodNumber;
507
+ completedCount: z.ZodNumber;
508
+ }, z.core.$strip>;
509
+ export declare const CheckIntegrationOutputSchema: z.ZodObject<{
510
+ newFiles: z.ZodArray<z.ZodObject<{
511
+ path: z.ZodString;
512
+ referencedBy: z.ZodArray<z.ZodString>;
513
+ isIntegrated: z.ZodBoolean;
514
+ suggestedEntryPoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
515
+ }, z.core.$strip>>;
516
+ unreferencedCount: z.ZodNumber;
517
+ }, z.core.$strip>;
518
+ export declare const DetectFormattersOutputSchema: z.ZodObject<{
519
+ formatters: z.ZodArray<z.ZodObject<{
520
+ name: z.ZodEnum<{
521
+ prettier: "prettier";
522
+ eslint: "eslint";
523
+ biome: "biome";
524
+ black: "black";
525
+ ruff: "ruff";
526
+ rustfmt: "rustfmt";
527
+ gofmt: "gofmt";
528
+ "clang-format": "clang-format";
529
+ rubocop: "rubocop";
530
+ }>;
531
+ configPath: z.ZodString;
532
+ fixCommand: z.ZodString;
533
+ checkCommand: z.ZodString;
534
+ supportsFileArgs: z.ZodBoolean;
535
+ }, z.core.$strip>>;
536
+ packageJsonScripts: z.ZodArray<z.ZodObject<{
537
+ name: z.ZodString;
538
+ command: z.ZodString;
539
+ }, z.core.$strip>>;
540
+ repoPath: z.ZodString;
541
+ ciDiagnosis: z.ZodOptional<z.ZodObject<{
542
+ isFormattingFailure: z.ZodBoolean;
543
+ formatter: z.ZodOptional<z.ZodEnum<{
544
+ prettier: "prettier";
545
+ eslint: "eslint";
546
+ biome: "biome";
547
+ black: "black";
548
+ ruff: "ruff";
549
+ rustfmt: "rustfmt";
550
+ gofmt: "gofmt";
551
+ "clang-format": "clang-format";
552
+ rubocop: "rubocop";
553
+ }>>;
554
+ fixCommand: z.ZodOptional<z.ZodString>;
555
+ evidence: z.ZodArray<z.ZodString>;
556
+ }, z.core.$strip>>;
557
+ }, z.core.$strip>;
558
+ export declare const LocalReposOutputSchema: z.ZodObject<{
559
+ repos: z.ZodRecord<z.ZodString, z.ZodObject<{
560
+ path: z.ZodString;
561
+ exists: z.ZodBoolean;
562
+ currentBranch: z.ZodNullable<z.ZodString>;
563
+ }, z.core.$strip>>;
564
+ scanPaths: z.ZodArray<z.ZodString>;
565
+ cachedAt: z.ZodString;
566
+ fromCache: z.ZodBoolean;
567
+ }, z.core.$strip>;
201
568
  export interface SearchOutput {
202
569
  candidates: Array<{
203
570
  issue: {
@@ -445,3 +812,26 @@ export declare function outputJson<T>(data: T): void;
445
812
  * Output error JSON to stdout (sets success: false)
446
813
  */
447
814
  export declare function outputJsonError(message: string, errorCode?: ErrorCode): void;
815
+ /**
816
+ * Validate `data` against a Zod schema and wrap the result in the standard
817
+ * JSON output envelope (#1105 long-term ask from #965).
818
+ *
819
+ * Throws a contract-drift `Error` if `data` doesn't match the schema. The
820
+ * error's message lists the failing field paths so a developer can find the
821
+ * drift quickly. Use this at the `--json` boundary of every CLI command —
822
+ * whenever the producer adds, renames, or drops a field that doesn't match
823
+ * the schema, the test harness fails immediately rather than silently
824
+ * shipping a contract break to consumers (plugin layer, MCP server,
825
+ * downstream scripts).
826
+ *
827
+ * @example
828
+ * import { formatJson, StatusOutputSchema } from '../formatters/json.js';
829
+ * const envelope = formatJson(StatusOutputSchema, await runStatus());
830
+ * console.log(JSON.stringify(envelope, null, 2));
831
+ */
832
+ export declare function formatJson<T>(schema: ZodType<T>, data: unknown): JsonOutput<T>;
833
+ /**
834
+ * `outputJson(data)` plus Zod validation. Same throwing semantics as
835
+ * {@link formatJson}; the validated envelope is what gets printed.
836
+ */
837
+ export declare function outputJsonValidated<T>(schema: ZodType<T>, data: unknown): void;