@oss-autopilot/core 3.11.0 → 3.13.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.
- package/dist/cli-registry.js +40 -11
- package/dist/cli.bundle.cjs +144 -91
- package/dist/commands/daily-render.d.ts +2 -1
- package/dist/commands/daily-render.js +8 -2
- package/dist/commands/daily.d.ts +3 -1
- package/dist/commands/daily.js +7 -2
- package/dist/commands/dashboard-data.js +14 -5
- package/dist/commands/dashboard-server.js +7 -2
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/list-mark-done.d.ts +9 -1
- package/dist/commands/list-mark-done.js +14 -1
- package/dist/commands/list-move-tier.d.ts +11 -3
- package/dist/commands/list-move-tier.js +18 -7
- package/dist/commands/search.d.ts +8 -0
- package/dist/commands/search.js +27 -3
- package/dist/commands/verify-issue.d.ts +20 -0
- package/dist/commands/verify-issue.js +32 -0
- package/dist/core/daily-logic.js +65 -52
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/issue-verification.d.ts +91 -0
- package/dist/core/issue-verification.js +270 -0
- package/dist/core/pr-attention.d.ts +52 -0
- package/dist/core/pr-attention.js +76 -0
- package/dist/core/types.d.ts +7 -0
- package/dist/formatters/json.d.ts +84 -2
- package/dist/formatters/json.js +50 -2
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Provides structured output that can be consumed by scripts and plugins
|
|
4
4
|
*/
|
|
5
5
|
import { z, type ZodType } from 'zod';
|
|
6
|
+
import type { AttentionSummary } from '../core/pr-attention.js';
|
|
6
7
|
import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, ShelvedPRRef, SearchPriority, CapacityAssessment, ActionableIssue, ActionableIssueType, CompactActionableIssue, ActionMenuItem, ActionMenu } from '../core/types.js';
|
|
7
8
|
import type { ContributionStats } from '../core/stats.js';
|
|
8
9
|
import type { PRCheckFailure } from '../core/pr-monitor.js';
|
|
@@ -87,6 +88,8 @@ export interface DailyOutput {
|
|
|
87
88
|
summary: string;
|
|
88
89
|
briefSummary: string;
|
|
89
90
|
actionableIssues: CompactActionableIssue[];
|
|
91
|
+
/** Unified attention-bucket counts (#1352) — same classifier the dashboard stamps per-PR. */
|
|
92
|
+
attention: AttentionSummary;
|
|
90
93
|
actionMenu: ActionMenu;
|
|
91
94
|
commentedIssues: CommentedIssue[];
|
|
92
95
|
repoGroups: CompactRepoGroup[];
|
|
@@ -119,6 +122,8 @@ export interface CompactDailyOutput {
|
|
|
119
122
|
capacity: CapacityAssessment;
|
|
120
123
|
briefSummary: string;
|
|
121
124
|
actionableIssues: CompactActionableIssue[];
|
|
125
|
+
/** Unified attention-bucket counts (#1352), retained under --compact. */
|
|
126
|
+
attention: AttentionSummary;
|
|
122
127
|
actionMenu: ActionMenu;
|
|
123
128
|
commentedIssues: CommentedIssue[];
|
|
124
129
|
/** Number of PRs that failed to fetch. Non-zero indicates partial results. */
|
|
@@ -285,6 +290,12 @@ export declare const StrategyOutputSchema: z.ZodObject<{
|
|
|
285
290
|
message: z.ZodOptional<z.ZodString>;
|
|
286
291
|
}, z.core.$strip>;
|
|
287
292
|
export type StrategyCommandOutput = z.infer<typeof StrategyOutputSchema>;
|
|
293
|
+
export declare const AttentionSummarySchema: z.ZodObject<{
|
|
294
|
+
needsAttention: z.ZodNumber;
|
|
295
|
+
stuckCI: z.ZodNumber;
|
|
296
|
+
dormantFollowup: z.ZodNumber;
|
|
297
|
+
waiting: z.ZodNumber;
|
|
298
|
+
}, z.core.$strip>;
|
|
288
299
|
export declare const DailyOutputSchema: z.ZodObject<{
|
|
289
300
|
digest: z.ZodObject<{
|
|
290
301
|
generatedAt: z.ZodString;
|
|
@@ -348,6 +359,12 @@ export declare const DailyOutputSchema: z.ZodObject<{
|
|
|
348
359
|
label: z.ZodString;
|
|
349
360
|
isNewContribution: z.ZodBoolean;
|
|
350
361
|
}, z.core.$strip>>;
|
|
362
|
+
attention: z.ZodObject<{
|
|
363
|
+
needsAttention: z.ZodNumber;
|
|
364
|
+
stuckCI: z.ZodNumber;
|
|
365
|
+
dormantFollowup: z.ZodNumber;
|
|
366
|
+
waiting: z.ZodNumber;
|
|
367
|
+
}, z.core.$strip>;
|
|
351
368
|
actionMenu: z.ZodObject<{
|
|
352
369
|
items: z.ZodArray<z.ZodObject<{
|
|
353
370
|
key: z.ZodString;
|
|
@@ -493,6 +510,12 @@ export declare const CompactDailyOutputSchema: z.ZodObject<{
|
|
|
493
510
|
label: z.ZodString;
|
|
494
511
|
isNewContribution: z.ZodBoolean;
|
|
495
512
|
}, z.core.$strip>>;
|
|
513
|
+
attention: z.ZodObject<{
|
|
514
|
+
needsAttention: z.ZodNumber;
|
|
515
|
+
stuckCI: z.ZodNumber;
|
|
516
|
+
dormantFollowup: z.ZodNumber;
|
|
517
|
+
waiting: z.ZodNumber;
|
|
518
|
+
}, z.core.$strip>;
|
|
496
519
|
actionMenu: z.ZodObject<{
|
|
497
520
|
items: z.ZodArray<z.ZodObject<{
|
|
498
521
|
key: z.ZodString;
|
|
@@ -625,9 +648,11 @@ export declare const SearchOutputSchema: z.ZodObject<{
|
|
|
625
648
|
}, z.core.$strip>>;
|
|
626
649
|
boostScore: z.ZodOptional<z.ZodNumber>;
|
|
627
650
|
boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
651
|
+
diversitySlot: z.ZodOptional<z.ZodBoolean>;
|
|
628
652
|
}, z.core.$strip>>;
|
|
629
653
|
excludedRepos: z.ZodArray<z.ZodString>;
|
|
630
654
|
aiPolicyBlocklist: z.ZodArray<z.ZodString>;
|
|
655
|
+
hiddenOwnPRCount: z.ZodNumber;
|
|
631
656
|
rateLimitWarning: z.ZodOptional<z.ZodString>;
|
|
632
657
|
}, z.core.$strip>;
|
|
633
658
|
export declare const FeaturesOutputSchema: z.ZodObject<{
|
|
@@ -683,6 +708,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
|
|
|
683
708
|
}, z.core.$strip>>;
|
|
684
709
|
boostScore: z.ZodOptional<z.ZodNumber>;
|
|
685
710
|
boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
711
|
+
diversitySlot: z.ZodOptional<z.ZodBoolean>;
|
|
686
712
|
horizon: z.ZodEnum<{
|
|
687
713
|
"quick-win": "quick-win";
|
|
688
714
|
"bigger-bet": "bigger-bet";
|
|
@@ -740,6 +766,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
|
|
|
740
766
|
}, z.core.$strip>>;
|
|
741
767
|
boostScore: z.ZodOptional<z.ZodNumber>;
|
|
742
768
|
boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
769
|
+
diversitySlot: z.ZodOptional<z.ZodBoolean>;
|
|
743
770
|
horizon: z.ZodEnum<{
|
|
744
771
|
"quick-win": "quick-win";
|
|
745
772
|
"bigger-bet": "bigger-bet";
|
|
@@ -784,7 +811,7 @@ export declare const ListMoveTierOutputSchema: z.ZodObject<{
|
|
|
784
811
|
}>;
|
|
785
812
|
fromTier: z.ZodOptional<z.ZodString>;
|
|
786
813
|
count: z.ZodNumber;
|
|
787
|
-
reason: z.ZodOptional<z.
|
|
814
|
+
reason: z.ZodOptional<z.ZodLiteral<"already in target tier">>;
|
|
788
815
|
}, z.core.$strip>;
|
|
789
816
|
export declare const ListMarkDoneOutputSchema: z.ZodObject<{
|
|
790
817
|
marked: z.ZodBoolean;
|
|
@@ -792,7 +819,53 @@ export declare const ListMarkDoneOutputSchema: z.ZodObject<{
|
|
|
792
819
|
url: z.ZodString;
|
|
793
820
|
repoHeadingStruck: z.ZodBoolean;
|
|
794
821
|
remainingUnderRepo: z.ZodNumber;
|
|
795
|
-
reason: z.ZodOptional<z.
|
|
822
|
+
reason: z.ZodOptional<z.ZodLiteral<"already marked done">>;
|
|
823
|
+
}, z.core.$strip>;
|
|
824
|
+
export declare const VerifyIssueOutputSchema: z.ZodObject<{
|
|
825
|
+
url: z.ZodString;
|
|
826
|
+
owner: z.ZodString;
|
|
827
|
+
repo: z.ZodString;
|
|
828
|
+
number: z.ZodNumber;
|
|
829
|
+
title: z.ZodString;
|
|
830
|
+
state: z.ZodEnum<{
|
|
831
|
+
closed: "closed";
|
|
832
|
+
open: "open";
|
|
833
|
+
}>;
|
|
834
|
+
stateReason: z.ZodNullable<z.ZodEnum<{
|
|
835
|
+
completed: "completed";
|
|
836
|
+
reopened: "reopened";
|
|
837
|
+
not_planned: "not_planned";
|
|
838
|
+
duplicate: "duplicate";
|
|
839
|
+
}>>;
|
|
840
|
+
closedAt: z.ZodNullable<z.ZodString>;
|
|
841
|
+
assignees: z.ZodArray<z.ZodString>;
|
|
842
|
+
linkedPRs: z.ZodArray<z.ZodObject<{
|
|
843
|
+
number: z.ZodNumber;
|
|
844
|
+
url: z.ZodString;
|
|
845
|
+
title: z.ZodString;
|
|
846
|
+
state: z.ZodEnum<{
|
|
847
|
+
closed: "closed";
|
|
848
|
+
open: "open";
|
|
849
|
+
merged: "merged";
|
|
850
|
+
}>;
|
|
851
|
+
isDraft: z.ZodBoolean;
|
|
852
|
+
author: z.ZodNullable<z.ZodString>;
|
|
853
|
+
isOwn: z.ZodBoolean;
|
|
854
|
+
linkType: z.ZodEnum<{
|
|
855
|
+
closing: "closing";
|
|
856
|
+
"cross-referenced": "cross-referenced";
|
|
857
|
+
}>;
|
|
858
|
+
updatedAt: z.ZodNullable<z.ZodString>;
|
|
859
|
+
}, z.core.$strip>>;
|
|
860
|
+
verdict: z.ZodEnum<{
|
|
861
|
+
closed: "closed";
|
|
862
|
+
"own-open-pr": "own-open-pr";
|
|
863
|
+
taken: "taken";
|
|
864
|
+
"at-risk": "at-risk";
|
|
865
|
+
available: "available";
|
|
866
|
+
}>;
|
|
867
|
+
verdictReason: z.ZodString;
|
|
868
|
+
userLogin: z.ZodString;
|
|
796
869
|
}, z.core.$strip>;
|
|
797
870
|
export declare const PostOutputSchema: z.ZodObject<{
|
|
798
871
|
commentUrl: z.ZodString;
|
|
@@ -1146,12 +1219,21 @@ export interface SearchCandidate {
|
|
|
1146
1219
|
* opportunities (open PR + no updates for 30+ days, scout 0.9.0 #97).
|
|
1147
1220
|
*/
|
|
1148
1221
|
linkedPR?: CandidateLinkedPR;
|
|
1222
|
+
/** Strategy-bias sort boost from scout (#1244); absent when unboosted. */
|
|
1223
|
+
boostScore?: number;
|
|
1224
|
+
/** Human-readable boost explanations, e.g. "repo affinity: vercel/next.js". */
|
|
1225
|
+
boostReasons?: string[];
|
|
1226
|
+
/** True when this candidate filled a diversity slot (#1244). */
|
|
1227
|
+
diversitySlot?: boolean;
|
|
1149
1228
|
}
|
|
1150
1229
|
export interface SearchOutput {
|
|
1151
1230
|
candidates: SearchCandidate[];
|
|
1152
1231
|
excludedRepos: string[];
|
|
1153
1232
|
/** Repos with known anti-AI contribution policies, filtered from search results (#108). */
|
|
1154
1233
|
aiPolicyBlocklist: string[];
|
|
1234
|
+
/** Candidates dropped because the authenticated user already has an open PR
|
|
1235
|
+
* linked to the issue (#1354). Surfaced as a count so the filter is visible. */
|
|
1236
|
+
hiddenOwnPRCount: number;
|
|
1155
1237
|
/** Present when rate limits affected the search — either low pre-flight quota or mid-search rate limit hits (#100). */
|
|
1156
1238
|
rateLimitWarning?: string;
|
|
1157
1239
|
}
|
package/dist/formatters/json.js
CHANGED
|
@@ -26,6 +26,7 @@ export function toCompactDailyOutput(output) {
|
|
|
26
26
|
capacity: output.capacity,
|
|
27
27
|
briefSummary: output.briefSummary,
|
|
28
28
|
actionableIssues: output.actionableIssues,
|
|
29
|
+
attention: output.attention,
|
|
29
30
|
actionMenu: output.actionMenu,
|
|
30
31
|
commentedIssues: output.commentedIssues,
|
|
31
32
|
failureCount: output.failures.length,
|
|
@@ -271,12 +272,19 @@ export const StrategyOutputSchema = z.object({
|
|
|
271
272
|
strategy: StrategyResultSchema.nullable(),
|
|
272
273
|
message: z.string().optional(),
|
|
273
274
|
});
|
|
275
|
+
export const AttentionSummarySchema = z.object({
|
|
276
|
+
needsAttention: z.number().int().nonnegative(),
|
|
277
|
+
stuckCI: z.number().int().nonnegative(),
|
|
278
|
+
dormantFollowup: z.number().int().nonnegative(),
|
|
279
|
+
waiting: z.number().int().nonnegative(),
|
|
280
|
+
});
|
|
274
281
|
export const DailyOutputSchema = z.object({
|
|
275
282
|
digest: DailyDigestCompactSchema,
|
|
276
283
|
capacity: CapacityAssessmentSchema,
|
|
277
284
|
summary: z.string(),
|
|
278
285
|
briefSummary: z.string(),
|
|
279
286
|
actionableIssues: z.array(CompactActionableIssueSchema),
|
|
287
|
+
attention: AttentionSummarySchema,
|
|
280
288
|
actionMenu: ActionMenuSchema,
|
|
281
289
|
commentedIssues: z.array(CommentedIssuePassthroughSchema),
|
|
282
290
|
repoGroups: z.array(CompactRepoGroupSchema),
|
|
@@ -289,6 +297,7 @@ export const CompactDailyOutputSchema = z.object({
|
|
|
289
297
|
capacity: CapacityAssessmentSchema,
|
|
290
298
|
briefSummary: z.string(),
|
|
291
299
|
actionableIssues: z.array(CompactActionableIssueSchema),
|
|
300
|
+
attention: AttentionSummarySchema,
|
|
292
301
|
actionMenu: ActionMenuSchema,
|
|
293
302
|
commentedIssues: z.array(CommentedIssuePassthroughSchema),
|
|
294
303
|
failureCount: z.number().int().nonnegative(),
|
|
@@ -344,11 +353,15 @@ const SearchCandidateSchema = z.object({
|
|
|
344
353
|
*/
|
|
345
354
|
boostScore: z.number().optional(),
|
|
346
355
|
boostReasons: z.array(z.string()).optional(),
|
|
356
|
+
/** True when this candidate filled a diversity slot (#1244) — surfaced so
|
|
357
|
+
* the user can see the counterweight working, not just its absence. */
|
|
358
|
+
diversitySlot: z.boolean().optional(),
|
|
347
359
|
});
|
|
348
360
|
export const SearchOutputSchema = z.object({
|
|
349
361
|
candidates: z.array(SearchCandidateSchema),
|
|
350
362
|
excludedRepos: z.array(z.string()),
|
|
351
363
|
aiPolicyBlocklist: z.array(z.string()),
|
|
364
|
+
hiddenOwnPRCount: z.number().int().nonnegative(),
|
|
352
365
|
rateLimitWarning: z.string().optional(),
|
|
353
366
|
});
|
|
354
367
|
// ── Features output schema (scout 0.9.0 #97/#98/#99) ─────────────────
|
|
@@ -396,7 +409,10 @@ export const ListMoveTierOutputSchema = z.object({
|
|
|
396
409
|
toTier: z.enum(['pursue', 'maybe', 'skip']),
|
|
397
410
|
fromTier: z.string().optional(),
|
|
398
411
|
count: z.number().int().nonnegative(),
|
|
399
|
-
|
|
412
|
+
// #1355: not-found now throws before reaching the success envelope, so the
|
|
413
|
+
// only reachable no-op reason is the idempotent one. Pinned so a new quiet
|
|
414
|
+
// no-op path trips the #1105 runtime validator instead of shipping silently.
|
|
415
|
+
reason: z.literal('already in target tier').optional(),
|
|
400
416
|
});
|
|
401
417
|
// list-mark-done (#1299): mirrors {@link MarkDoneOutput} from the command
|
|
402
418
|
// module. Strict shape — additional keys must be added here AND in the
|
|
@@ -408,7 +424,39 @@ export const ListMarkDoneOutputSchema = z.object({
|
|
|
408
424
|
url: z.string(),
|
|
409
425
|
repoHeadingStruck: z.boolean(),
|
|
410
426
|
remainingUnderRepo: z.number().int().nonnegative(),
|
|
411
|
-
|
|
427
|
+
// #1406: not-found now throws before the success envelope, so the only
|
|
428
|
+
// reachable no-op reason is the idempotent one. Pinned so a new quiet
|
|
429
|
+
// no-op path trips the #1105 runtime validator instead of shipping silently.
|
|
430
|
+
reason: z.literal('already marked done').optional(),
|
|
431
|
+
});
|
|
432
|
+
// verify-issue (#1353, #1354): mirrors {@link IssueVerification} from
|
|
433
|
+
// core/issue-verification.ts. Strict shape — additional keys must be added
|
|
434
|
+
// here AND in the module output, otherwise the validator rejects the
|
|
435
|
+
// response before it reaches consumers.
|
|
436
|
+
export const VerifyIssueOutputSchema = z.object({
|
|
437
|
+
url: z.string(),
|
|
438
|
+
owner: z.string(),
|
|
439
|
+
repo: z.string(),
|
|
440
|
+
number: z.number().int().positive(),
|
|
441
|
+
title: z.string(),
|
|
442
|
+
state: z.enum(['open', 'closed']),
|
|
443
|
+
stateReason: z.enum(['completed', 'not_planned', 'reopened', 'duplicate']).nullable(),
|
|
444
|
+
closedAt: z.string().nullable(),
|
|
445
|
+
assignees: z.array(z.string()),
|
|
446
|
+
linkedPRs: z.array(z.object({
|
|
447
|
+
number: z.number().int().positive(),
|
|
448
|
+
url: z.string(),
|
|
449
|
+
title: z.string(),
|
|
450
|
+
state: z.enum(['open', 'closed', 'merged']),
|
|
451
|
+
isDraft: z.boolean(),
|
|
452
|
+
author: z.string().nullable(),
|
|
453
|
+
isOwn: z.boolean(),
|
|
454
|
+
linkType: z.enum(['closing', 'cross-referenced']),
|
|
455
|
+
updatedAt: z.string().nullable(),
|
|
456
|
+
})),
|
|
457
|
+
verdict: z.enum(['closed', 'own-open-pr', 'taken', 'at-risk', 'available']),
|
|
458
|
+
verdictReason: z.string(),
|
|
459
|
+
userLogin: z.string(),
|
|
412
460
|
});
|
|
413
461
|
// ── #1155: Zod coverage for remaining CLI commands ───────────────────
|
|
414
462
|
export const PostOutputSchema = z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"zod": "^4.4.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^25.9.
|
|
62
|
+
"@types/node": "^25.9.3",
|
|
63
63
|
"@vitest/coverage-v8": "^4.1.8",
|
|
64
64
|
"esbuild": "^0.28.0",
|
|
65
65
|
"tsx": "^4.22.4",
|