@oss-autopilot/core 3.34.0 → 3.36.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 (44) hide show
  1. package/dist/cli-registry.js +24 -1
  2. package/dist/cli.bundle.cjs +136 -125
  3. package/dist/commands/daily.js +5 -2
  4. package/dist/commands/ledger-backfill.js +15 -9
  5. package/dist/commands/repo-cap.d.ts +10 -0
  6. package/dist/commands/repo-cap.js +23 -0
  7. package/dist/commands/scout-bridge.js +8 -2
  8. package/dist/commands/search.js +7 -1
  9. package/dist/commands/setup.js +6 -4
  10. package/dist/commands/vet-list.js +2 -0
  11. package/dist/commands/vet.js +2 -0
  12. package/dist/core/ci-analysis.js +14 -1
  13. package/dist/core/close-reason.d.ts +11 -0
  14. package/dist/core/close-reason.js +29 -1
  15. package/dist/core/comment-utils.d.ts +5 -2
  16. package/dist/core/comment-utils.js +11 -3
  17. package/dist/core/config-registry.js +12 -0
  18. package/dist/core/daily-logic.d.ts +3 -1
  19. package/dist/core/daily-logic.js +11 -3
  20. package/dist/core/eval-report.js +3 -1
  21. package/dist/core/gist-state-store.js +4 -1
  22. package/dist/core/index.d.ts +1 -1
  23. package/dist/core/index.js +1 -1
  24. package/dist/core/pr-assembly.d.ts +11 -1
  25. package/dist/core/pr-assembly.js +21 -4
  26. package/dist/core/pr-attention.d.ts +14 -0
  27. package/dist/core/pr-attention.js +18 -0
  28. package/dist/core/pr-graphql.d.ts +31 -1
  29. package/dist/core/pr-graphql.js +49 -5
  30. package/dist/core/pr-monitor.d.ts +37 -0
  31. package/dist/core/pr-monitor.js +42 -0
  32. package/dist/core/repo-cap.d.ts +46 -0
  33. package/dist/core/repo-cap.js +102 -0
  34. package/dist/core/review-analysis.d.ts +64 -0
  35. package/dist/core/review-analysis.js +92 -1
  36. package/dist/core/state-persistence.js +6 -2
  37. package/dist/core/state-schema.d.ts +285 -87
  38. package/dist/core/state-schema.js +91 -27
  39. package/dist/core/state.js +1 -0
  40. package/dist/core/status-determination.js +11 -11
  41. package/dist/core/types.d.ts +32 -2
  42. package/dist/formatters/json.d.ts +25 -0
  43. package/dist/formatters/json.js +13 -0
  44. package/package.json +1 -1
@@ -6,9 +6,14 @@
6
6
  * re-exported through types.ts.
7
7
  *
8
8
  * Schemas are defined bottom-up (leaf types first, composites last).
9
- * Unknown keys are stripped by default (Zod 4 behavior).
9
+ * Unknown keys are stripped by default (Zod 4 behavior), EXCEPT on the schemas
10
+ * marked `.passthrough()` (#1831): see the note above AgentStateSchema.
10
11
  */
11
12
  import { z } from 'zod';
13
+ /** Drops the `[k: string]: unknown` index signature `.passthrough()` adds to an inferred type. */
14
+ type KnownKeys<T> = {
15
+ [K in keyof T as string extends K ? never : K]: T[K];
16
+ };
12
17
  import type { FetchedPR } from './types.js';
13
18
  export declare const IssueStatusSchema: z.ZodEnum<{
14
19
  candidate: "candidate";
@@ -59,7 +64,7 @@ export declare const RepoScoreSchema: z.ZodObject<{
59
64
  }, z.core.$strip>;
60
65
  stargazersCount: z.ZodOptional<z.ZodNumber>;
61
66
  language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
- }, z.core.$strip>;
67
+ }, z.core.$loose>;
63
68
  /**
64
69
  * What the tool predicted about an issue when it was vetted (#1824). Recorded
65
70
  * by `vet` / `vet-list` keyed by issue URL, then copied onto the outcome
@@ -71,13 +76,9 @@ export declare const PickSnapshotSchema: z.ZodObject<{
71
76
  grade: z.ZodNumber;
72
77
  recommendation: z.ZodString;
73
78
  stargazersCount: z.ZodOptional<z.ZodNumber>;
74
- source: z.ZodEnum<{
75
- vet: "vet";
76
- "vet-list": "vet-list";
77
- list: "list";
78
- }>;
79
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
79
80
  capturedAt: z.ZodOptional<z.ZodString>;
80
- }, z.core.$strip>;
81
+ }, z.core.$loose>;
81
82
  export declare const StoredMergedPRSchema: z.ZodObject<{
82
83
  issueUrl: z.ZodOptional<z.ZodString>;
83
84
  pick: z.ZodOptional<z.ZodObject<{
@@ -85,13 +86,9 @@ export declare const StoredMergedPRSchema: z.ZodObject<{
85
86
  grade: z.ZodNumber;
86
87
  recommendation: z.ZodString;
87
88
  stargazersCount: z.ZodOptional<z.ZodNumber>;
88
- source: z.ZodEnum<{
89
- vet: "vet";
90
- "vet-list": "vet-list";
91
- list: "list";
92
- }>;
89
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
93
90
  capturedAt: z.ZodOptional<z.ZodString>;
94
- }, z.core.$strip>>;
91
+ }, z.core.$loose>>;
95
92
  lastReviewDecision: z.ZodOptional<z.ZodString>;
96
93
  lastCiStatus: z.ZodOptional<z.ZodString>;
97
94
  backfilledAt: z.ZodOptional<z.ZodString>;
@@ -102,29 +99,19 @@ export declare const StoredMergedPRSchema: z.ZodObject<{
102
99
  firstMaintainerResponseAt: z.ZodOptional<z.ZodString>;
103
100
  commentsFetchedAt: z.ZodOptional<z.ZodString>;
104
101
  learningsExtractedAt: z.ZodOptional<z.ZodString>;
105
- }, z.core.$strip>;
102
+ }, z.core.$loose>;
106
103
  export declare const StoredClosedPRSchema: z.ZodObject<{
107
- closeReason: z.ZodOptional<z.ZodEnum<{
108
- unknown: "unknown";
109
- rejected: "rejected";
110
- "ai-policy": "ai-policy";
111
- superseded: "superseded";
112
- stale: "stale";
113
- "self-closed": "self-closed";
114
- }>>;
104
+ closeReason: z.ZodOptional<z.ZodCustom<"unknown" | "rejected" | (string & {}) | "ai-policy" | "superseded" | "stale" | "self-closed", "unknown" | "rejected" | (string & {}) | "ai-policy" | "superseded" | "stale" | "self-closed">>;
105
+ selfCloseReason: z.ZodOptional<z.ZodCustom<(string & {}) | "superseded" | "no-traction" | "after-feedback" | "no-response", (string & {}) | "superseded" | "no-traction" | "after-feedback" | "no-response">>;
115
106
  issueUrl: z.ZodOptional<z.ZodString>;
116
107
  pick: z.ZodOptional<z.ZodObject<{
117
108
  issueUrl: z.ZodString;
118
109
  grade: z.ZodNumber;
119
110
  recommendation: z.ZodString;
120
111
  stargazersCount: z.ZodOptional<z.ZodNumber>;
121
- source: z.ZodEnum<{
122
- vet: "vet";
123
- "vet-list": "vet-list";
124
- list: "list";
125
- }>;
112
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
126
113
  capturedAt: z.ZodOptional<z.ZodString>;
127
- }, z.core.$strip>>;
114
+ }, z.core.$loose>>;
128
115
  lastReviewDecision: z.ZodOptional<z.ZodString>;
129
116
  lastCiStatus: z.ZodOptional<z.ZodString>;
130
117
  backfilledAt: z.ZodOptional<z.ZodString>;
@@ -135,7 +122,7 @@ export declare const StoredClosedPRSchema: z.ZodObject<{
135
122
  firstMaintainerResponseAt: z.ZodOptional<z.ZodString>;
136
123
  commentsFetchedAt: z.ZodOptional<z.ZodString>;
137
124
  learningsExtractedAt: z.ZodOptional<z.ZodString>;
138
- }, z.core.$strip>;
125
+ }, z.core.$loose>;
139
126
  export declare const AnalyzedIssueConversationSchema: z.ZodObject<{
140
127
  url: z.ZodString;
141
128
  repo: z.ZodString;
@@ -294,7 +281,7 @@ export declare const StatusOverrideSchema: z.ZodObject<{
294
281
  setAt: z.ZodString;
295
282
  lastActivityAt: z.ZodString;
296
283
  }, z.core.$strip>;
297
- export declare const AgentConfigSchema: z.ZodObject<{
284
+ export declare const AgentConfigSchema: z.ZodPipe<z.ZodObject<{
298
285
  setupComplete: z.ZodDefault<z.ZodBoolean>;
299
286
  setupCompletedAt: z.ZodOptional<z.ZodString>;
300
287
  persistence: z.ZodDefault<z.ZodEnum<{
@@ -302,6 +289,8 @@ export declare const AgentConfigSchema: z.ZodObject<{
302
289
  gist: "gist";
303
290
  }>>;
304
291
  maxActivePRs: z.ZodDefault<z.ZodNumber>;
292
+ maxOpenPRsPerRepo: z.ZodDefault<z.ZodNumber>;
293
+ maxOpenPRsColdRepo: z.ZodDefault<z.ZodNumber>;
305
294
  dormantThresholdDays: z.ZodDefault<z.ZodNumber>;
306
295
  approachingDormantDays: z.ZodDefault<z.ZodNumber>;
307
296
  maxIssueAgeDays: z.ZodDefault<z.ZodNumber>;
@@ -363,7 +352,107 @@ export declare const AgentConfigSchema: z.ZodObject<{
363
352
  reviewMaxPasses: z.ZodOptional<z.ZodNumber>;
364
353
  slmTriageModel: z.ZodDefault<z.ZodString>;
365
354
  slmTriageHost: z.ZodDefault<z.ZodString>;
366
- }, z.core.$strip>;
355
+ }, z.core.$loose>, z.ZodTransform<{
356
+ [x: string]: unknown;
357
+ setupComplete: boolean;
358
+ persistence: "local" | "gist";
359
+ maxActivePRs: number;
360
+ maxOpenPRsPerRepo: number;
361
+ maxOpenPRsColdRepo: number;
362
+ dormantThresholdDays: number;
363
+ approachingDormantDays: number;
364
+ maxIssueAgeDays: number;
365
+ skipBroadWhenSufficientResults: number;
366
+ languages: string[];
367
+ labels: string[];
368
+ excludeRepos: string[];
369
+ untrackedOrgs: string[];
370
+ avoidRepos: string[];
371
+ boostIssueTypes: string[];
372
+ trustedProjects: string[];
373
+ githubUsername: string;
374
+ minRepoScoreThreshold: number;
375
+ starredRepos: string[];
376
+ squashByDefault: boolean | "ask";
377
+ minStars: number;
378
+ includeDocIssues: boolean;
379
+ aiPolicyBlocklist: string[];
380
+ shelvedPRUrls: string[];
381
+ dismissedIssues: Record<string, string>;
382
+ projectCategories: ("nonprofit" | "devtools" | "infrastructure" | "web-frameworks" | "data-ml" | "education")[];
383
+ preferredOrgs: string[];
384
+ diffTool: "inline" | "custom" | "sourcetree" | "vscode";
385
+ autoExtractLearnings: boolean;
386
+ autoFormatBeforePush: boolean;
387
+ trustOwnRepoWrites: boolean;
388
+ healthCheckFreshnessMinutes: number;
389
+ slmTriageModel: string;
390
+ slmTriageHost: string;
391
+ setupCompletedAt?: string | undefined;
392
+ scope?: ("advanced" | "beginner" | "intermediate")[] | undefined;
393
+ excludeOrgs?: string[] | undefined;
394
+ starredReposLastFetched?: string | undefined;
395
+ localRepoScanPaths?: string[] | undefined;
396
+ statusOverrides?: Record<string, {
397
+ status: "needs_addressing" | "waiting_on_maintainer";
398
+ setAt: string;
399
+ lastActivityAt: string;
400
+ }> | undefined;
401
+ issueListPath?: string | undefined;
402
+ skippedIssuesPath?: string | undefined;
403
+ diffToolCustomCommand?: string | undefined;
404
+ reviewMaxPasses?: number | undefined;
405
+ }, {
406
+ [x: string]: unknown;
407
+ setupComplete: boolean;
408
+ persistence: "local" | "gist";
409
+ maxActivePRs: number;
410
+ maxOpenPRsPerRepo: number;
411
+ maxOpenPRsColdRepo: number;
412
+ dormantThresholdDays: number;
413
+ approachingDormantDays: number;
414
+ maxIssueAgeDays: number;
415
+ skipBroadWhenSufficientResults: number;
416
+ languages: string[];
417
+ labels: string[];
418
+ excludeRepos: string[];
419
+ untrackedOrgs: string[];
420
+ avoidRepos: string[];
421
+ boostIssueTypes: string[];
422
+ trustedProjects: string[];
423
+ githubUsername: string;
424
+ minRepoScoreThreshold: number;
425
+ starredRepos: string[];
426
+ squashByDefault: boolean | "ask";
427
+ minStars: number;
428
+ includeDocIssues: boolean;
429
+ aiPolicyBlocklist: string[];
430
+ shelvedPRUrls: string[];
431
+ dismissedIssues: Record<string, string>;
432
+ projectCategories: ("nonprofit" | "devtools" | "infrastructure" | "web-frameworks" | "data-ml" | "education")[];
433
+ preferredOrgs: string[];
434
+ diffTool: "inline" | "custom" | "sourcetree" | "vscode";
435
+ autoExtractLearnings: boolean;
436
+ autoFormatBeforePush: boolean;
437
+ trustOwnRepoWrites: boolean;
438
+ healthCheckFreshnessMinutes: number;
439
+ slmTriageModel: string;
440
+ slmTriageHost: string;
441
+ setupCompletedAt?: string | undefined;
442
+ scope?: ("advanced" | "beginner" | "intermediate")[] | undefined;
443
+ excludeOrgs?: string[] | undefined;
444
+ starredReposLastFetched?: string | undefined;
445
+ localRepoScanPaths?: string[] | undefined;
446
+ statusOverrides?: Record<string, {
447
+ status: "needs_addressing" | "waiting_on_maintainer";
448
+ setAt: string;
449
+ lastActivityAt: string;
450
+ }> | undefined;
451
+ issueListPath?: string | undefined;
452
+ skippedIssuesPath?: string | undefined;
453
+ diffToolCustomCommand?: string | undefined;
454
+ reviewMaxPasses?: number | undefined;
455
+ }>>;
367
456
  export declare const LocalRepoCacheSchema: z.ZodObject<{
368
457
  repos: z.ZodRecord<z.ZodString, z.ZodObject<{
369
458
  path: z.ZodString;
@@ -498,7 +587,7 @@ export declare const OvernightPreparedSchema: z.ZodObject<{
498
587
  pushedAt: z.ZodOptional<z.ZodString>;
499
588
  compareUrl: z.ZodOptional<z.ZodString>;
500
589
  pushProblem: z.ZodOptional<z.ZodString>;
501
- }, z.core.$strip>;
590
+ }, z.core.$loose>;
502
591
  /** The latest overnight run (#1574); `startup` surfaces its freshness. */
503
592
  /**
504
593
  * One list issue the overnight run tried to implement (#1715). Kept across
@@ -513,7 +602,7 @@ export declare const OvernightImplementAttemptSchema: z.ZodObject<{
513
602
  prepared: "prepared";
514
603
  }>;
515
604
  note: z.ZodOptional<z.ZodString>;
516
- }, z.core.$strip>;
605
+ }, z.core.$loose>;
517
606
  export declare const OvernightRecordSchema: z.ZodObject<{
518
607
  runAt: z.ZodString;
519
608
  reportPath: z.ZodString;
@@ -529,7 +618,7 @@ export declare const OvernightRecordSchema: z.ZodObject<{
529
618
  pushedAt: z.ZodOptional<z.ZodString>;
530
619
  compareUrl: z.ZodOptional<z.ZodString>;
531
620
  pushProblem: z.ZodOptional<z.ZodString>;
532
- }, z.core.$strip>>>;
621
+ }, z.core.$loose>>>;
533
622
  implementUrl: z.ZodOptional<z.ZodString>;
534
623
  implementAttempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
535
624
  url: z.ZodString;
@@ -539,14 +628,14 @@ export declare const OvernightRecordSchema: z.ZodObject<{
539
628
  prepared: "prepared";
540
629
  }>;
541
630
  note: z.ZodOptional<z.ZodString>;
542
- }, z.core.$strip>>>;
543
- }, z.core.$strip>;
631
+ }, z.core.$loose>>>;
632
+ }, z.core.$loose>;
544
633
  /**
545
634
  * Mirrors oss-scout's `searchRotation`: the broad-phase language cursor, the
546
635
  * repo-window cursors of the capped phases, and the round-robin strategy
547
- * cursor (oss-scout 1.7.0). Every field must be listed: z.object strips
548
- * unknown keys, so a cursor missing here would be dropped on every load and
549
- * scout's rotation would restart from 0 each search.
636
+ * cursor (oss-scout 1.7.0). List every cursor so it gets its default;
637
+ * passthrough (#1831) keeps a cursor added by a newer bundled scout instead of
638
+ * resetting it to 0 on this release's next save.
550
639
  */
551
640
  export declare const SearchRotationSchema: z.ZodObject<{
552
641
  languageOffset: z.ZodDefault<z.ZodNumber>;
@@ -555,7 +644,18 @@ export declare const SearchRotationSchema: z.ZodObject<{
555
644
  maintainedOffset: z.ZodDefault<z.ZodNumber>;
556
645
  strategyOffset: z.ZodDefault<z.ZodNumber>;
557
646
  lastRotatedAt: z.ZodOptional<z.ZodString>;
558
- }, z.core.$strip>;
647
+ }, z.core.$loose>;
648
+ /**
649
+ * Forward compatibility (#1831). The state Gist is shared by clients on
650
+ * different releases, and a strict parse let an older client drop a newer
651
+ * release's fields on its next save. Schemas for data that is written once and
652
+ * kept (root, config, repoScores, the outcome ledger and pick snapshots,
653
+ * lastOvernight, searchRotation) are `.passthrough()`; schemas regenerated on
654
+ * every run (lastDigest) or rarely extended still strip. Persisted enums that
655
+ * grow (closeReason, pick source) accept unknown strings via {@link openEnum}.
656
+ * Inferred types drop the passthrough index signature ({@link KnownKeys}) so a
657
+ * misspelled key still fails to compile.
658
+ */
559
659
  export declare const AgentStateSchema: z.ZodObject<{
560
660
  version: z.ZodLiteral<4>;
561
661
  gistId: z.ZodOptional<z.ZodString>;
@@ -574,8 +674,8 @@ export declare const AgentStateSchema: z.ZodObject<{
574
674
  }, z.core.$strip>;
575
675
  stargazersCount: z.ZodOptional<z.ZodNumber>;
576
676
  language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
577
- }, z.core.$strip>>>;
578
- config: z.ZodDefault<z.ZodObject<{
677
+ }, z.core.$loose>>>;
678
+ config: z.ZodDefault<z.ZodPipe<z.ZodObject<{
579
679
  setupComplete: z.ZodDefault<z.ZodBoolean>;
580
680
  setupCompletedAt: z.ZodOptional<z.ZodString>;
581
681
  persistence: z.ZodDefault<z.ZodEnum<{
@@ -583,6 +683,8 @@ export declare const AgentStateSchema: z.ZodObject<{
583
683
  gist: "gist";
584
684
  }>>;
585
685
  maxActivePRs: z.ZodDefault<z.ZodNumber>;
686
+ maxOpenPRsPerRepo: z.ZodDefault<z.ZodNumber>;
687
+ maxOpenPRsColdRepo: z.ZodDefault<z.ZodNumber>;
586
688
  dormantThresholdDays: z.ZodDefault<z.ZodNumber>;
587
689
  approachingDormantDays: z.ZodDefault<z.ZodNumber>;
588
690
  maxIssueAgeDays: z.ZodDefault<z.ZodNumber>;
@@ -644,7 +746,107 @@ export declare const AgentStateSchema: z.ZodObject<{
644
746
  reviewMaxPasses: z.ZodOptional<z.ZodNumber>;
645
747
  slmTriageModel: z.ZodDefault<z.ZodString>;
646
748
  slmTriageHost: z.ZodDefault<z.ZodString>;
647
- }, z.core.$strip>>;
749
+ }, z.core.$loose>, z.ZodTransform<{
750
+ [x: string]: unknown;
751
+ setupComplete: boolean;
752
+ persistence: "local" | "gist";
753
+ maxActivePRs: number;
754
+ maxOpenPRsPerRepo: number;
755
+ maxOpenPRsColdRepo: number;
756
+ dormantThresholdDays: number;
757
+ approachingDormantDays: number;
758
+ maxIssueAgeDays: number;
759
+ skipBroadWhenSufficientResults: number;
760
+ languages: string[];
761
+ labels: string[];
762
+ excludeRepos: string[];
763
+ untrackedOrgs: string[];
764
+ avoidRepos: string[];
765
+ boostIssueTypes: string[];
766
+ trustedProjects: string[];
767
+ githubUsername: string;
768
+ minRepoScoreThreshold: number;
769
+ starredRepos: string[];
770
+ squashByDefault: boolean | "ask";
771
+ minStars: number;
772
+ includeDocIssues: boolean;
773
+ aiPolicyBlocklist: string[];
774
+ shelvedPRUrls: string[];
775
+ dismissedIssues: Record<string, string>;
776
+ projectCategories: ("nonprofit" | "devtools" | "infrastructure" | "web-frameworks" | "data-ml" | "education")[];
777
+ preferredOrgs: string[];
778
+ diffTool: "inline" | "custom" | "sourcetree" | "vscode";
779
+ autoExtractLearnings: boolean;
780
+ autoFormatBeforePush: boolean;
781
+ trustOwnRepoWrites: boolean;
782
+ healthCheckFreshnessMinutes: number;
783
+ slmTriageModel: string;
784
+ slmTriageHost: string;
785
+ setupCompletedAt?: string | undefined;
786
+ scope?: ("advanced" | "beginner" | "intermediate")[] | undefined;
787
+ excludeOrgs?: string[] | undefined;
788
+ starredReposLastFetched?: string | undefined;
789
+ localRepoScanPaths?: string[] | undefined;
790
+ statusOverrides?: Record<string, {
791
+ status: "needs_addressing" | "waiting_on_maintainer";
792
+ setAt: string;
793
+ lastActivityAt: string;
794
+ }> | undefined;
795
+ issueListPath?: string | undefined;
796
+ skippedIssuesPath?: string | undefined;
797
+ diffToolCustomCommand?: string | undefined;
798
+ reviewMaxPasses?: number | undefined;
799
+ }, {
800
+ [x: string]: unknown;
801
+ setupComplete: boolean;
802
+ persistence: "local" | "gist";
803
+ maxActivePRs: number;
804
+ maxOpenPRsPerRepo: number;
805
+ maxOpenPRsColdRepo: number;
806
+ dormantThresholdDays: number;
807
+ approachingDormantDays: number;
808
+ maxIssueAgeDays: number;
809
+ skipBroadWhenSufficientResults: number;
810
+ languages: string[];
811
+ labels: string[];
812
+ excludeRepos: string[];
813
+ untrackedOrgs: string[];
814
+ avoidRepos: string[];
815
+ boostIssueTypes: string[];
816
+ trustedProjects: string[];
817
+ githubUsername: string;
818
+ minRepoScoreThreshold: number;
819
+ starredRepos: string[];
820
+ squashByDefault: boolean | "ask";
821
+ minStars: number;
822
+ includeDocIssues: boolean;
823
+ aiPolicyBlocklist: string[];
824
+ shelvedPRUrls: string[];
825
+ dismissedIssues: Record<string, string>;
826
+ projectCategories: ("nonprofit" | "devtools" | "infrastructure" | "web-frameworks" | "data-ml" | "education")[];
827
+ preferredOrgs: string[];
828
+ diffTool: "inline" | "custom" | "sourcetree" | "vscode";
829
+ autoExtractLearnings: boolean;
830
+ autoFormatBeforePush: boolean;
831
+ trustOwnRepoWrites: boolean;
832
+ healthCheckFreshnessMinutes: number;
833
+ slmTriageModel: string;
834
+ slmTriageHost: string;
835
+ setupCompletedAt?: string | undefined;
836
+ scope?: ("advanced" | "beginner" | "intermediate")[] | undefined;
837
+ excludeOrgs?: string[] | undefined;
838
+ starredReposLastFetched?: string | undefined;
839
+ localRepoScanPaths?: string[] | undefined;
840
+ statusOverrides?: Record<string, {
841
+ status: "needs_addressing" | "waiting_on_maintainer";
842
+ setAt: string;
843
+ lastActivityAt: string;
844
+ }> | undefined;
845
+ issueListPath?: string | undefined;
846
+ skippedIssuesPath?: string | undefined;
847
+ diffToolCustomCommand?: string | undefined;
848
+ reviewMaxPasses?: number | undefined;
849
+ }>>>;
648
850
  lastRunAt: z.ZodDefault<z.ZodString>;
649
851
  lastDigestAt: z.ZodOptional<z.ZodString>;
650
852
  lastStrategyAt: z.ZodOptional<z.ZodString>;
@@ -720,13 +922,9 @@ export declare const AgentStateSchema: z.ZodObject<{
720
922
  grade: z.ZodNumber;
721
923
  recommendation: z.ZodString;
722
924
  stargazersCount: z.ZodOptional<z.ZodNumber>;
723
- source: z.ZodEnum<{
724
- vet: "vet";
725
- "vet-list": "vet-list";
726
- list: "list";
727
- }>;
925
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
728
926
  capturedAt: z.ZodOptional<z.ZodString>;
729
- }, z.core.$strip>>;
927
+ }, z.core.$loose>>;
730
928
  lastReviewDecision: z.ZodOptional<z.ZodString>;
731
929
  lastCiStatus: z.ZodOptional<z.ZodString>;
732
930
  backfilledAt: z.ZodOptional<z.ZodString>;
@@ -737,29 +935,19 @@ export declare const AgentStateSchema: z.ZodObject<{
737
935
  firstMaintainerResponseAt: z.ZodOptional<z.ZodString>;
738
936
  commentsFetchedAt: z.ZodOptional<z.ZodString>;
739
937
  learningsExtractedAt: z.ZodOptional<z.ZodString>;
740
- }, z.core.$strip>>>;
938
+ }, z.core.$loose>>>;
741
939
  closedPRs: z.ZodOptional<z.ZodArray<z.ZodObject<{
742
- closeReason: z.ZodOptional<z.ZodEnum<{
743
- unknown: "unknown";
744
- rejected: "rejected";
745
- "ai-policy": "ai-policy";
746
- superseded: "superseded";
747
- stale: "stale";
748
- "self-closed": "self-closed";
749
- }>>;
940
+ closeReason: z.ZodOptional<z.ZodCustom<"unknown" | "rejected" | (string & {}) | "ai-policy" | "superseded" | "stale" | "self-closed", "unknown" | "rejected" | (string & {}) | "ai-policy" | "superseded" | "stale" | "self-closed">>;
941
+ selfCloseReason: z.ZodOptional<z.ZodCustom<(string & {}) | "superseded" | "no-traction" | "after-feedback" | "no-response", (string & {}) | "superseded" | "no-traction" | "after-feedback" | "no-response">>;
750
942
  issueUrl: z.ZodOptional<z.ZodString>;
751
943
  pick: z.ZodOptional<z.ZodObject<{
752
944
  issueUrl: z.ZodString;
753
945
  grade: z.ZodNumber;
754
946
  recommendation: z.ZodString;
755
947
  stargazersCount: z.ZodOptional<z.ZodNumber>;
756
- source: z.ZodEnum<{
757
- vet: "vet";
758
- "vet-list": "vet-list";
759
- list: "list";
760
- }>;
948
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
761
949
  capturedAt: z.ZodOptional<z.ZodString>;
762
- }, z.core.$strip>>;
950
+ }, z.core.$loose>>;
763
951
  lastReviewDecision: z.ZodOptional<z.ZodString>;
764
952
  lastCiStatus: z.ZodOptional<z.ZodString>;
765
953
  backfilledAt: z.ZodOptional<z.ZodString>;
@@ -770,7 +958,7 @@ export declare const AgentStateSchema: z.ZodObject<{
770
958
  firstMaintainerResponseAt: z.ZodOptional<z.ZodString>;
771
959
  commentsFetchedAt: z.ZodOptional<z.ZodString>;
772
960
  learningsExtractedAt: z.ZodOptional<z.ZodString>;
773
- }, z.core.$strip>>>;
961
+ }, z.core.$loose>>>;
774
962
  analyzedIssueConversations: z.ZodOptional<z.ZodArray<z.ZodObject<{
775
963
  url: z.ZodString;
776
964
  repo: z.ZodString;
@@ -854,13 +1042,9 @@ export declare const AgentStateSchema: z.ZodObject<{
854
1042
  grade: z.ZodNumber;
855
1043
  recommendation: z.ZodString;
856
1044
  stargazersCount: z.ZodOptional<z.ZodNumber>;
857
- source: z.ZodEnum<{
858
- vet: "vet";
859
- "vet-list": "vet-list";
860
- list: "list";
861
- }>;
1045
+ source: z.ZodCustom<(string & {}) | "vet" | "vet-list" | "list", (string & {}) | "vet" | "vet-list" | "list">;
862
1046
  capturedAt: z.ZodOptional<z.ZodString>;
863
- }, z.core.$strip>>>;
1047
+ }, z.core.$loose>>>;
864
1048
  lastOvernight: z.ZodOptional<z.ZodObject<{
865
1049
  runAt: z.ZodString;
866
1050
  reportPath: z.ZodString;
@@ -876,7 +1060,7 @@ export declare const AgentStateSchema: z.ZodObject<{
876
1060
  pushedAt: z.ZodOptional<z.ZodString>;
877
1061
  compareUrl: z.ZodOptional<z.ZodString>;
878
1062
  pushProblem: z.ZodOptional<z.ZodString>;
879
- }, z.core.$strip>>>;
1063
+ }, z.core.$loose>>>;
880
1064
  implementUrl: z.ZodOptional<z.ZodString>;
881
1065
  implementAttempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
882
1066
  url: z.ZodString;
@@ -886,8 +1070,8 @@ export declare const AgentStateSchema: z.ZodObject<{
886
1070
  prepared: "prepared";
887
1071
  }>;
888
1072
  note: z.ZodOptional<z.ZodString>;
889
- }, z.core.$strip>>>;
890
- }, z.core.$strip>>;
1073
+ }, z.core.$loose>>>;
1074
+ }, z.core.$loose>>;
891
1075
  searchRotation: z.ZodOptional<z.ZodObject<{
892
1076
  languageOffset: z.ZodDefault<z.ZodNumber>;
893
1077
  phase0Offset: z.ZodDefault<z.ZodNumber>;
@@ -895,33 +1079,47 @@ export declare const AgentStateSchema: z.ZodObject<{
895
1079
  maintainedOffset: z.ZodDefault<z.ZodNumber>;
896
1080
  strategyOffset: z.ZodDefault<z.ZodNumber>;
897
1081
  lastRotatedAt: z.ZodOptional<z.ZodString>;
898
- }, z.core.$strip>>;
899
- }, z.core.$strip>;
1082
+ }, z.core.$loose>>;
1083
+ }, z.core.$loose>;
900
1084
  export type IssueStatus = z.infer<typeof IssueStatusSchema>;
901
1085
  export type FetchedPRStatus = z.infer<typeof FetchedPRStatusSchema>;
902
1086
  export type ProjectCategory = z.infer<typeof ProjectCategorySchema>;
903
1087
  export type IssueScope = z.infer<typeof IssueScopeSchema>;
904
1088
  export type DiffTool = z.infer<typeof DiffToolSchema>;
905
1089
  export type SearchSeenEntry = z.infer<typeof SearchSeenEntrySchema>;
906
- export type PickSnapshot = z.infer<typeof PickSnapshotSchema>;
907
- export type OvernightPrepared = z.infer<typeof OvernightPreparedSchema>;
908
- export type OvernightRecord = z.infer<typeof OvernightRecordSchema>;
909
- export type OvernightImplementAttempt = z.infer<typeof OvernightImplementAttemptSchema>;
910
- export type SearchRotation = z.infer<typeof SearchRotationSchema>;
1090
+ export type PickSnapshot = KnownKeys<z.infer<typeof PickSnapshotSchema>>;
1091
+ export type OvernightPrepared = KnownKeys<z.infer<typeof OvernightPreparedSchema>>;
1092
+ export type OvernightRecord = KnownKeys<z.infer<typeof OvernightRecordSchema>>;
1093
+ export type OvernightImplementAttempt = KnownKeys<z.infer<typeof OvernightImplementAttemptSchema>>;
1094
+ export type SearchRotation = KnownKeys<z.infer<typeof SearchRotationSchema>>;
911
1095
  export type RepoSignals = z.infer<typeof RepoSignalsSchema>;
912
- export type RepoScore = z.infer<typeof RepoScoreSchema>;
913
- export type StoredMergedPR = z.infer<typeof StoredMergedPRSchema>;
914
- export type StoredClosedPR = z.infer<typeof StoredClosedPRSchema>;
1096
+ export type RepoScore = KnownKeys<z.infer<typeof RepoScoreSchema>>;
1097
+ export type StoredMergedPR = KnownKeys<z.infer<typeof StoredMergedPRSchema>>;
1098
+ export type StoredClosedPR = KnownKeys<z.infer<typeof StoredClosedPRSchema>>;
915
1099
  export type AnalyzedIssueConversation = z.infer<typeof AnalyzedIssueConversationSchema>;
916
1100
  export type ContributionGuidelines = z.infer<typeof ContributionGuidelinesSchema>;
917
1101
  export type IssueVettingResult = z.infer<typeof IssueVettingResultSchema>;
918
1102
  export type TrackedIssue = z.infer<typeof TrackedIssueSchema>;
919
1103
  export type ShelvedPRRef = z.infer<typeof ShelvedPRRefSchema>;
920
1104
  export type StatusOverride = z.infer<typeof StatusOverrideSchema>;
921
- export type AgentConfig = z.infer<typeof AgentConfigSchema>;
1105
+ export type AgentConfig = KnownKeys<z.infer<typeof AgentConfigSchema>>;
922
1106
  export type LocalRepoCache = z.infer<typeof LocalRepoCacheSchema>;
923
1107
  export type ClosedPR = z.infer<typeof ClosedPRSchema>;
924
1108
  export type MergedPR = z.infer<typeof MergedPRSchema>;
925
1109
  export type DailyDigestSummary = z.infer<typeof DailyDigestSummarySchema>;
926
1110
  export type DailyDigest = z.infer<typeof DailyDigestSchema>;
927
- export type AgentState = z.infer<typeof AgentStateSchema>;
1111
+ type RawAgentState = z.infer<typeof AgentStateSchema>;
1112
+ export type AgentState = Omit<KnownKeys<RawAgentState>, 'config' | 'repoScores' | 'mergedPRs' | 'closedPRs' | 'pickSnapshots' | 'lastOvernight' | 'searchRotation'> & {
1113
+ config: AgentConfig;
1114
+ repoScores: Record<string, RepoScore>;
1115
+ mergedPRs?: StoredMergedPR[];
1116
+ closedPRs?: StoredClosedPR[];
1117
+ pickSnapshots: PickSnapshot[];
1118
+ lastOvernight?: OvernightRecord;
1119
+ searchRotation?: SearchRotation;
1120
+ };
1121
+ /** Top-level state keys this release does not know, i.e. written by another (usually newer) release (#1831). */
1122
+ export declare function unknownStateKeys(raw: unknown): string[];
1123
+ /** Warning tail for state written by a newer release (#1831), shared by the Gist and local loaders. */
1124
+ export declare const NEWER_WRITER_HINT: string;
1125
+ export {};