@oss-autopilot/core 0.58.0 → 0.60.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 +54 -0
- package/dist/cli.bundle.cjs +151 -108
- package/dist/commands/comments.d.ts +28 -0
- package/dist/commands/comments.js +28 -0
- package/dist/commands/config.d.ts +11 -0
- package/dist/commands/config.js +11 -0
- package/dist/commands/daily.d.ts +26 -2
- package/dist/commands/daily.js +26 -2
- package/dist/commands/detect-formatters.d.ts +11 -0
- package/dist/commands/detect-formatters.js +24 -0
- package/dist/commands/dismiss.d.ts +17 -0
- package/dist/commands/dismiss.js +17 -0
- package/dist/commands/index.d.ts +3 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.js +8 -0
- package/dist/commands/move.d.ts +10 -0
- package/dist/commands/move.js +10 -0
- package/dist/commands/search.d.ts +18 -0
- package/dist/commands/search.js +18 -0
- package/dist/commands/setup.d.ts +17 -0
- package/dist/commands/setup.js +17 -0
- package/dist/commands/shelve.d.ts +16 -0
- package/dist/commands/shelve.js +16 -0
- package/dist/commands/startup.d.ts +16 -7
- package/dist/commands/startup.js +16 -7
- package/dist/commands/status.d.ts +8 -0
- package/dist/commands/status.js +8 -0
- package/dist/commands/track.d.ts +16 -0
- package/dist/commands/track.js +16 -0
- package/dist/commands/vet.d.ts +8 -0
- package/dist/commands/vet.js +8 -0
- package/dist/core/daily-logic.d.ts +60 -7
- package/dist/core/daily-logic.js +52 -7
- package/dist/core/formatter-detection.d.ts +61 -0
- package/dist/core/formatter-detection.js +360 -0
- package/dist/core/github.d.ts +25 -2
- package/dist/core/github.js +25 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/issue-discovery.d.ts +46 -6
- package/dist/core/issue-discovery.js +46 -6
- package/dist/core/logger.d.ts +13 -0
- package/dist/core/logger.js +13 -0
- package/dist/core/pr-monitor.d.ts +43 -8
- package/dist/core/pr-monitor.js +43 -8
- package/dist/core/state-persistence.d.ts +1 -0
- package/dist/core/state-persistence.js +46 -84
- package/dist/core/state-schema.d.ts +539 -0
- package/dist/core/state-schema.js +214 -0
- package/dist/core/state.d.ts +167 -0
- package/dist/core/state.js +167 -0
- package/dist/core/types.d.ts +4 -318
- package/dist/core/types.js +7 -41
- package/dist/formatters/json.d.ts +5 -0
- package/package.json +8 -4
package/dist/core/types.d.ts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for the Open Source Contribution Agent
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* - `candidate` — Discovered but not yet claimed
|
|
7
|
-
* - `claimed` — Contributor has claimed the issue (e.g., commented "I'll work on this")
|
|
8
|
-
* - `in_progress` — Work is underway locally
|
|
9
|
-
* - `pr_submitted` — A PR has been opened for this issue
|
|
10
|
-
*/
|
|
11
|
-
export type IssueStatus = 'candidate' | 'claimed' | 'in_progress' | 'pr_submitted';
|
|
4
|
+
import type { FetchedPRStatus, RepoSignals, TrackedIssue, IssueVettingResult, IssueScope, AgentConfig, AgentState } from './state-schema.js';
|
|
5
|
+
export type { IssueStatus, FetchedPRStatus, ProjectCategory, IssueScope, StateEventType, RepoSignals, RepoScore, StateEvent, StoredMergedPR, StoredClosedPR, ContributionGuidelines, IssueVettingResult, TrackedIssue, ShelvedPRRef, StatusOverride, AgentConfig, LocalRepoCache, ClosedPR, MergedPR, DailyDigest, AgentState, } from './state-schema.js';
|
|
12
6
|
/** CI pipeline status for a PR's latest commit. */
|
|
13
7
|
export type CIStatus = 'passing' | 'failing' | 'pending' | 'unknown';
|
|
14
8
|
/**
|
|
@@ -82,14 +76,6 @@ export type ActionReason = 'needs_response' | 'needs_changes' | 'failing_ci' | '
|
|
|
82
76
|
export type WaitReason = 'pending_review' | 'pending_merge' | 'changes_addressed' | 'ci_blocked' | 'stale_ci_failure';
|
|
83
77
|
/** How stale is the PR based on days since activity. Orthogonal to status. */
|
|
84
78
|
export type StalenessTier = 'active' | 'approaching_dormant' | 'dormant';
|
|
85
|
-
/**
|
|
86
|
-
* Top-level classification of a PR's state. Only two values:
|
|
87
|
-
* - `needs_addressing` — Contributor's turn. See `actionReason` for what to do.
|
|
88
|
-
* - `waiting_on_maintainer` — Maintainer's turn. See `waitReason` for why.
|
|
89
|
-
*
|
|
90
|
-
* Staleness (active/approaching_dormant/dormant) is tracked separately in `stalenessTier`.
|
|
91
|
-
*/
|
|
92
|
-
export type FetchedPRStatus = 'needs_addressing' | 'waiting_on_maintainer';
|
|
93
79
|
/**
|
|
94
80
|
* Hints about what a maintainer is asking for in their review comments.
|
|
95
81
|
* Extracted from comment text by keyword matching.
|
|
@@ -158,74 +144,6 @@ export interface FetchedPR {
|
|
|
158
144
|
/** Hints extracted from maintainer comments about what actions they are requesting. */
|
|
159
145
|
maintainerActionHints: MaintainerActionHint[];
|
|
160
146
|
}
|
|
161
|
-
/**
|
|
162
|
-
* Lightweight reference used in {@link DailyDigest} for shelved and auto-unshelved PRs.
|
|
163
|
-
* Contains only the fields needed for display, avoiding duplication of the full
|
|
164
|
-
* {@link FetchedPR} objects already present in `openPRs` and the status-specific arrays.
|
|
165
|
-
*/
|
|
166
|
-
export interface ShelvedPRRef {
|
|
167
|
-
number: number;
|
|
168
|
-
url: string;
|
|
169
|
-
title: string;
|
|
170
|
-
repo: string;
|
|
171
|
-
daysSinceActivity: number;
|
|
172
|
-
status: FetchedPRStatus;
|
|
173
|
-
}
|
|
174
|
-
/** An issue tracked through the contribution pipeline from discovery to PR submission. */
|
|
175
|
-
export interface TrackedIssue {
|
|
176
|
-
id: number;
|
|
177
|
-
url: string;
|
|
178
|
-
repo: string;
|
|
179
|
-
number: number;
|
|
180
|
-
title: string;
|
|
181
|
-
status: IssueStatus;
|
|
182
|
-
labels: string[];
|
|
183
|
-
createdAt: string;
|
|
184
|
-
updatedAt: string;
|
|
185
|
-
/** Whether the issue has been through the vetting process (checking for existing PRs, activity, etc.). */
|
|
186
|
-
vetted: boolean;
|
|
187
|
-
vettingResult?: IssueVettingResult;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Result of vetting an issue for contribution suitability.
|
|
191
|
-
* An issue passes vetting when all checks are true (no existing PR, not claimed, etc.).
|
|
192
|
-
*/
|
|
193
|
-
export interface IssueVettingResult {
|
|
194
|
-
passedAllChecks: boolean;
|
|
195
|
-
checks: {
|
|
196
|
-
noExistingPR: boolean;
|
|
197
|
-
notClaimed: boolean;
|
|
198
|
-
projectActive: boolean;
|
|
199
|
-
clearRequirements: boolean;
|
|
200
|
-
contributionGuidelinesFound: boolean;
|
|
201
|
-
};
|
|
202
|
-
contributionGuidelines?: ContributionGuidelines;
|
|
203
|
-
/** Free-text observations from the vetting process (e.g., "Issue has 3 linked PRs, all closed"). */
|
|
204
|
-
notes: string[];
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Structured representation of a project's contribution guidelines,
|
|
208
|
-
* extracted from CONTRIBUTING.md or similar files during issue vetting.
|
|
209
|
-
*/
|
|
210
|
-
export interface ContributionGuidelines {
|
|
211
|
-
branchNamingConvention?: string;
|
|
212
|
-
commitMessageFormat?: string;
|
|
213
|
-
prTitleFormat?: string;
|
|
214
|
-
requiredChecks?: string[];
|
|
215
|
-
testFramework?: string;
|
|
216
|
-
testCoverageRequired?: boolean;
|
|
217
|
-
/** Expected test file naming pattern (e.g., `"*.test.ts"`, `"*_spec.rb"`). */
|
|
218
|
-
testFileNaming?: string;
|
|
219
|
-
linter?: string;
|
|
220
|
-
formatter?: string;
|
|
221
|
-
styleGuideUrl?: string;
|
|
222
|
-
/** How to claim an issue (e.g., "Comment on the issue before starting work"). */
|
|
223
|
-
issueClaimProcess?: string;
|
|
224
|
-
reviewProcess?: string;
|
|
225
|
-
claRequired?: boolean;
|
|
226
|
-
/** Raw CONTRIBUTING.md content for reference when structured fields are insufficient. */
|
|
227
|
-
rawContent?: string;
|
|
228
|
-
}
|
|
229
147
|
/** Health snapshot of a GitHub repository, used to determine if a project is worth contributing to. */
|
|
230
148
|
export interface ProjectHealth {
|
|
231
149
|
repo: string;
|
|
@@ -245,38 +163,6 @@ export interface ProjectHealth {
|
|
|
245
163
|
checkFailed?: boolean;
|
|
246
164
|
failureReason?: string;
|
|
247
165
|
}
|
|
248
|
-
/**
|
|
249
|
-
* Quality score for a repository, used to prioritize issue search results.
|
|
250
|
-
* Score is on a 1-10 scale: base 5, logarithmic merge bonus (max +5: 1->+2, 2->+3, 3->+4, 5+->+5),
|
|
251
|
-
* -1 per closed-without-merge (max -3), +1 if lastMergedAt is set and within 90 days,
|
|
252
|
-
* +1 if responsive, -2 if hostile.
|
|
253
|
-
* Repos below `AgentConfig.minRepoScoreThreshold` are deprioritized.
|
|
254
|
-
*/
|
|
255
|
-
export interface RepoScore {
|
|
256
|
-
repo: string;
|
|
257
|
-
/** Overall score from 1 (avoid) to 10 (excellent track record). */
|
|
258
|
-
score: number;
|
|
259
|
-
/** Number of the contributor's PRs that were merged in this repo. */
|
|
260
|
-
mergedPRCount: number;
|
|
261
|
-
/** Number of the contributor's PRs closed without merge (indicates friction). */
|
|
262
|
-
closedWithoutMergeCount: number;
|
|
263
|
-
/** Average days for maintainers to respond; null if no data. */
|
|
264
|
-
avgResponseDays: number | null;
|
|
265
|
-
lastMergedAt?: string;
|
|
266
|
-
lastEvaluatedAt: string;
|
|
267
|
-
/** Qualitative signals about the repo's maintainer culture. */
|
|
268
|
-
signals: RepoSignals;
|
|
269
|
-
/** GitHub star count, fetched during daily check for dashboard filtering. */
|
|
270
|
-
stargazersCount?: number;
|
|
271
|
-
/** Primary programming language of the repo, fetched during daily check. */
|
|
272
|
-
language?: string | null;
|
|
273
|
-
}
|
|
274
|
-
/** Full set of qualitative signals about a repo's maintainer culture. */
|
|
275
|
-
export interface RepoSignals {
|
|
276
|
-
hasActiveMaintainers: boolean;
|
|
277
|
-
isResponsive: boolean;
|
|
278
|
-
hasHostileComments: boolean;
|
|
279
|
-
}
|
|
280
166
|
/** Signals computed from observed open PR data, suitable for merging into RepoScore.signals. */
|
|
281
167
|
export type ComputedRepoSignals = Pick<RepoSignals, 'isResponsive' | 'hasActiveMaintainers'>;
|
|
282
168
|
/**
|
|
@@ -300,141 +186,6 @@ export interface RepoMetadataEntry {
|
|
|
300
186
|
stars?: number;
|
|
301
187
|
language?: string | null;
|
|
302
188
|
}
|
|
303
|
-
/**
|
|
304
|
-
* Event types recorded in the {@link AgentState} audit log.
|
|
305
|
-
* - `pr_tracked` — A new PR was added to tracking
|
|
306
|
-
* - `pr_merged` — A tracked PR was merged
|
|
307
|
-
* - `pr_closed` — A tracked PR was closed without merge
|
|
308
|
-
* - `pr_dormant` — A PR crossed the dormant threshold
|
|
309
|
-
* - `daily_check` — A daily digest run completed
|
|
310
|
-
* - `comment_posted` — The agent posted a comment on a PR
|
|
311
|
-
*/
|
|
312
|
-
export type StateEventType = 'pr_tracked' | 'pr_merged' | 'pr_closed' | 'pr_dormant' | 'daily_check' | 'comment_posted';
|
|
313
|
-
/** An entry in the state audit log. Events are append-only and used for history tracking. */
|
|
314
|
-
export interface StateEvent {
|
|
315
|
-
id: string;
|
|
316
|
-
type: StateEventType;
|
|
317
|
-
/** ISO 8601 timestamp of when the event occurred. */
|
|
318
|
-
at: string;
|
|
319
|
-
/** Event-specific payload (e.g., `{ repo: "owner/repo", number: 42 }` for PR events). */
|
|
320
|
-
data: Record<string, unknown>;
|
|
321
|
-
}
|
|
322
|
-
/** Minimal record of a PR that was closed without being merged, used in the daily digest and dashboard detail view. */
|
|
323
|
-
export interface ClosedPR {
|
|
324
|
-
url: string;
|
|
325
|
-
repo: string;
|
|
326
|
-
number: number;
|
|
327
|
-
title: string;
|
|
328
|
-
closedAt: string;
|
|
329
|
-
closedBy?: string;
|
|
330
|
-
}
|
|
331
|
-
/** Minimal merged PR data persisted in state.json. Repo/number derived from URL at display time. */
|
|
332
|
-
export interface StoredMergedPR {
|
|
333
|
-
url: string;
|
|
334
|
-
title: string;
|
|
335
|
-
mergedAt: string;
|
|
336
|
-
}
|
|
337
|
-
/** Minimal closed PR data persisted in state.json. Repo/number derived from URL at display time. */
|
|
338
|
-
export interface StoredClosedPR {
|
|
339
|
-
url: string;
|
|
340
|
-
title: string;
|
|
341
|
-
closedAt: string;
|
|
342
|
-
}
|
|
343
|
-
/** Minimal record of a PR that was merged, used in the daily digest and dashboard detail view. */
|
|
344
|
-
export interface MergedPR {
|
|
345
|
-
url: string;
|
|
346
|
-
repo: string;
|
|
347
|
-
number: number;
|
|
348
|
-
title: string;
|
|
349
|
-
mergedAt: string;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* The daily report produced by `PRMonitor.generateDigest()`.
|
|
353
|
-
* Contains all open PRs fetched fresh from GitHub, categorized by status,
|
|
354
|
-
* plus recently closed PRs and summary statistics. This is persisted in
|
|
355
|
-
* `AgentState.lastDigest` so the HTML dashboard can render it.
|
|
356
|
-
*/
|
|
357
|
-
export interface DailyDigest {
|
|
358
|
-
generatedAt: string;
|
|
359
|
-
/** All open PRs authored by the user, fetched from GitHub Search API. */
|
|
360
|
-
openPRs: FetchedPR[];
|
|
361
|
-
/** PRs where the contributor needs to take action. Subset of openPRs where status === 'needs_addressing'. */
|
|
362
|
-
needsAddressingPRs: FetchedPR[];
|
|
363
|
-
/** PRs waiting on the maintainer. Subset of openPRs where status === 'waiting_on_maintainer'. */
|
|
364
|
-
waitingOnMaintainerPRs: FetchedPR[];
|
|
365
|
-
/** PRs closed without merge in the last 7 days. Surfaced to alert the contributor. */
|
|
366
|
-
recentlyClosedPRs: ClosedPR[];
|
|
367
|
-
/** PRs merged in the last 7 days. Surfaced as wins in the dashboard. */
|
|
368
|
-
recentlyMergedPRs: MergedPR[];
|
|
369
|
-
/**
|
|
370
|
-
* PRs manually shelved by the user (excluded from capacity and actionable issues).
|
|
371
|
-
* Stored as lightweight references — full data is available in `openPRs`.
|
|
372
|
-
*/
|
|
373
|
-
shelvedPRs: ShelvedPRRef[];
|
|
374
|
-
/**
|
|
375
|
-
* PRs that were auto-unshelved this run because a maintainer engaged.
|
|
376
|
-
* Stored as lightweight references — full data is available in `openPRs`.
|
|
377
|
-
*/
|
|
378
|
-
autoUnshelvedPRs: ShelvedPRRef[];
|
|
379
|
-
summary: {
|
|
380
|
-
totalActivePRs: number;
|
|
381
|
-
/** Count of PRs requiring contributor action (response, CI fix, conflict resolution, etc.). */
|
|
382
|
-
totalNeedingAttention: number;
|
|
383
|
-
/** Lifetime merged PR count across all repos, derived from RepoScore data. */
|
|
384
|
-
totalMergedAllTime: number;
|
|
385
|
-
/** Percentage of all-time PRs that were merged (merged / (merged + closed)). */
|
|
386
|
-
mergeRate: number;
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Root state object persisted to `~/.oss-autopilot/state.json`.
|
|
391
|
-
*
|
|
392
|
-
* In v2 (current), PRs are fetched fresh from GitHub on each run via the Search API.
|
|
393
|
-
* The primary runtime data lives in `lastDigest` and `repoScores`.
|
|
394
|
-
*/
|
|
395
|
-
export interface AgentState {
|
|
396
|
-
/** Schema version. `2` = v2 fresh-fetch architecture. Used by `StateManager` for migrations. */
|
|
397
|
-
version: number;
|
|
398
|
-
/** Per-repo quality scores keyed by `"owner/repo"`. Used to prioritize issue search results. */
|
|
399
|
-
repoScores: Record<string, RepoScore>;
|
|
400
|
-
config: AgentConfig;
|
|
401
|
-
/** Append-only audit log of significant events (PR merged, daily check, etc.). */
|
|
402
|
-
events: StateEvent[];
|
|
403
|
-
/** ISO timestamp of the last CLI invocation. */
|
|
404
|
-
lastRunAt: string;
|
|
405
|
-
/** ISO timestamp of the last daily digest generation. */
|
|
406
|
-
lastDigestAt?: string;
|
|
407
|
-
/** Cached daily digest so the HTML dashboard can render without re-fetching from GitHub. */
|
|
408
|
-
lastDigest?: DailyDigest;
|
|
409
|
-
/** Monthly merged PR counts keyed by `"YYYY-MM"`. Powers the contribution timeline chart. */
|
|
410
|
-
monthlyMergedCounts?: Record<string, number>;
|
|
411
|
-
/** Monthly closed (without merge) PR counts keyed by `"YYYY-MM"`. Powers the timeline and success rate charts. */
|
|
412
|
-
monthlyClosedCounts?: Record<string, number>;
|
|
413
|
-
/** Monthly opened PR counts keyed by `"YYYY-MM"`. Combines PRs opened across merged+closed+open sets. */
|
|
414
|
-
monthlyOpenedCounts?: Record<string, number>;
|
|
415
|
-
/** Daily activity counts keyed by `"YYYY-MM-DD"`. Powers the activity heatmap chart. */
|
|
416
|
-
dailyActivityCounts?: Record<string, number>;
|
|
417
|
-
/** Cached local repo scan results (#84). Avoids re-scanning the filesystem every session. */
|
|
418
|
-
localRepoCache?: LocalRepoCache;
|
|
419
|
-
/** All merged PRs stored incrementally. Source of truth for the merged PR detail view. */
|
|
420
|
-
mergedPRs?: StoredMergedPR[];
|
|
421
|
-
/** All closed PRs stored incrementally. Source of truth for the closed PR detail view. */
|
|
422
|
-
closedPRs?: StoredClosedPR[];
|
|
423
|
-
activeIssues: TrackedIssue[];
|
|
424
|
-
}
|
|
425
|
-
/** Cached results from scanning the filesystem for local git clones (#84). */
|
|
426
|
-
export interface LocalRepoCache {
|
|
427
|
-
/** Map of "owner/repo" -> local repo info */
|
|
428
|
-
repos: Record<string, {
|
|
429
|
-
path: string;
|
|
430
|
-
exists: boolean;
|
|
431
|
-
currentBranch: string | null;
|
|
432
|
-
}>;
|
|
433
|
-
/** Directories that were scanned */
|
|
434
|
-
scanPaths: string[];
|
|
435
|
-
/** ISO 8601 timestamp of when the scan was performed */
|
|
436
|
-
cachedAt: string;
|
|
437
|
-
}
|
|
438
189
|
/** Filter for excluding repos below a minimum star count from PR count queries. */
|
|
439
190
|
export interface StarFilter {
|
|
440
191
|
minStars: number;
|
|
@@ -445,68 +196,6 @@ export interface StarFilter {
|
|
|
445
196
|
* Returns true if the repo is below the threshold or has unknown star count.
|
|
446
197
|
*/
|
|
447
198
|
export declare function isBelowMinStars(stargazersCount: number | undefined, minStars: number): boolean;
|
|
448
|
-
/** Manual status override for a PR, set via dashboard or CLI. Auto-clears when new activity is detected. */
|
|
449
|
-
export interface StatusOverride {
|
|
450
|
-
status: FetchedPRStatus;
|
|
451
|
-
setAt: string;
|
|
452
|
-
/** PR's updatedAt at the time the override was set. Used to detect new activity for auto-clear. */
|
|
453
|
-
lastActivityAt: string;
|
|
454
|
-
}
|
|
455
|
-
/** User-configurable settings, populated via `/setup-oss` and stored in {@link AgentState}. */
|
|
456
|
-
export interface AgentConfig {
|
|
457
|
-
/** False until the user completes initial setup via `/setup-oss`. */
|
|
458
|
-
setupComplete: boolean;
|
|
459
|
-
setupCompletedAt?: string;
|
|
460
|
-
maxActivePRs: number;
|
|
461
|
-
/** Days of inactivity before a PR is marked `dormant`. Default 30. */
|
|
462
|
-
dormantThresholdDays: number;
|
|
463
|
-
/** Days of inactivity before a PR is marked `approaching_dormant`. Default 25. */
|
|
464
|
-
approachingDormantDays: number;
|
|
465
|
-
/** Issues older than this (by `updated_at`) are filtered from search results. Default 90. */
|
|
466
|
-
maxIssueAgeDays: number;
|
|
467
|
-
/** Programming languages to search for issues in (e.g., `["typescript", "javascript"]`). */
|
|
468
|
-
languages: string[];
|
|
469
|
-
/** GitHub labels to filter issues by (e.g., `["good first issue", "help wanted"]`). */
|
|
470
|
-
labels: string[];
|
|
471
|
-
/** Issue scope tiers to search (e.g., `["beginner", "intermediate"]`). When set, scope tier labels are merged with custom `labels`. When absent, only `labels` is used (legacy behavior). */
|
|
472
|
-
scope?: IssueScope[];
|
|
473
|
-
/** Repos to exclude from issue discovery/search, in `"owner/repo"` format. */
|
|
474
|
-
excludeRepos: string[];
|
|
475
|
-
/** Organizations to exclude from issue discovery/search (case-insensitive match on owner segment). */
|
|
476
|
-
excludeOrgs?: string[];
|
|
477
|
-
/** Repos where the contributor has had PRs merged. Used for prioritization. */
|
|
478
|
-
trustedProjects: string[];
|
|
479
|
-
githubUsername: string;
|
|
480
|
-
/** Minimum {@link RepoScore} to include a repo in search results. Default 4. */
|
|
481
|
-
minRepoScoreThreshold: number;
|
|
482
|
-
/** User's GitHub starred repos, fetched periodically for prioritized issue discovery. */
|
|
483
|
-
starredRepos: string[];
|
|
484
|
-
starredReposLastFetched?: string;
|
|
485
|
-
/** Whether to show the health check notification on session start. Default true. */
|
|
486
|
-
showHealthCheck?: boolean;
|
|
487
|
-
/** Whether to squash commits before marking PR ready. `true` (default), `false`, or `"ask"`. */
|
|
488
|
-
squashByDefault?: boolean | 'ask';
|
|
489
|
-
/** Directories to scan for local git clones (#84). Falls back to default paths if not set. */
|
|
490
|
-
localRepoScanPaths?: string[];
|
|
491
|
-
/** Minimum GitHub star count for Phase 2 (general search) results. Default 50. Phases 0/1 are exempt. */
|
|
492
|
-
minStars?: number;
|
|
493
|
-
/** Whether to include documentation-only issues in search results. Default true. */
|
|
494
|
-
includeDocIssues?: boolean;
|
|
495
|
-
/** Repos known to have anti-AI contribution policies, in `"owner/repo"` format. Filtered from search results automatically. */
|
|
496
|
-
aiPolicyBlocklist?: string[];
|
|
497
|
-
/** PR URLs manually shelved by the user. Shelved PRs are excluded from capacity and actionable issues. Auto-unshelved when maintainers engage. */
|
|
498
|
-
shelvedPRUrls?: string[];
|
|
499
|
-
/** Issue URLs dismissed by the user, mapped to ISO timestamp of when dismissed. Issues with new responses after the dismiss timestamp resurface automatically. */
|
|
500
|
-
dismissedIssues?: Record<string, string>;
|
|
501
|
-
/** Manual status overrides for PRs. Maps PR URL to override metadata. Auto-clears when the PR has new activity. */
|
|
502
|
-
statusOverrides?: Record<string, StatusOverride>;
|
|
503
|
-
/** Path to the user's curated issue list file. Replaces config.md as the primary source for detectIssueList(). */
|
|
504
|
-
issueListPath?: string;
|
|
505
|
-
/** Project categories the user is interested in (e.g., devtools, nonprofit). Used to prioritize search results. */
|
|
506
|
-
projectCategories?: ProjectCategory[];
|
|
507
|
-
/** GitHub organizations the user wants to prioritize in issue search. Org names only (not owner/repo). */
|
|
508
|
-
preferredOrgs?: string[];
|
|
509
|
-
}
|
|
510
199
|
/** Status of a user's comment thread on a GitHub issue. */
|
|
511
200
|
export type IssueConversationStatus = 'new_response' | 'waiting' | 'acknowledged';
|
|
512
201
|
/** Base fields shared by all issue conversation states. */
|
|
@@ -544,10 +233,8 @@ export type CommentedIssue = CommentedIssueWithResponse | CommentedIssueWithoutR
|
|
|
544
233
|
export declare const DEFAULT_CONFIG: AgentConfig;
|
|
545
234
|
/** Initial state written to `~/.oss-autopilot/state.json` on first run. Uses v2 architecture. */
|
|
546
235
|
export declare const INITIAL_STATE: AgentState;
|
|
547
|
-
export declare const PROJECT_CATEGORIES:
|
|
548
|
-
export
|
|
549
|
-
export declare const ISSUE_SCOPES: readonly ["beginner", "intermediate", "advanced"];
|
|
550
|
-
export type IssueScope = (typeof ISSUE_SCOPES)[number];
|
|
236
|
+
export declare const PROJECT_CATEGORIES: ("nonprofit" | "devtools" | "infrastructure" | "web-frameworks" | "data-ml" | "education")[];
|
|
237
|
+
export declare const ISSUE_SCOPES: ("advanced" | "beginner" | "intermediate")[];
|
|
551
238
|
export declare const SCOPE_LABELS: Record<IssueScope, string[]>;
|
|
552
239
|
/** Priority tier for issue search results. Ordered: merged_pr > preferred_org > starred > normal. */
|
|
553
240
|
export type SearchPriority = 'merged_pr' | 'preferred_org' | 'starred' | 'normal';
|
|
@@ -561,4 +248,3 @@ export interface IssueCandidate {
|
|
|
561
248
|
viabilityScore: number;
|
|
562
249
|
searchPriority: SearchPriority;
|
|
563
250
|
}
|
|
564
|
-
export {};
|
package/dist/core/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for the Open Source Contribution Agent
|
|
3
3
|
*/
|
|
4
|
+
import { AgentConfigSchema, AgentStateSchema, ProjectCategorySchema, IssueScopeSchema } from './state-schema.js';
|
|
4
5
|
/**
|
|
5
6
|
* Check if a repo should be excluded based on its star count.
|
|
6
7
|
* Returns true if the repo is below the threshold or has unknown star count.
|
|
@@ -8,49 +9,14 @@
|
|
|
8
9
|
export function isBelowMinStars(stargazersCount, minStars) {
|
|
9
10
|
return stargazersCount === undefined || stargazersCount < minStars;
|
|
10
11
|
}
|
|
12
|
+
// ── Schema-derived constants ─────────────────────────────────────────
|
|
11
13
|
/** Default configuration applied to new state files. All fields can be overridden via `/setup-oss`. */
|
|
12
|
-
export const DEFAULT_CONFIG = {
|
|
13
|
-
setupComplete: false,
|
|
14
|
-
maxActivePRs: 10,
|
|
15
|
-
dormantThresholdDays: 30,
|
|
16
|
-
approachingDormantDays: 25,
|
|
17
|
-
maxIssueAgeDays: 90,
|
|
18
|
-
languages: ['typescript', 'javascript'],
|
|
19
|
-
labels: ['good first issue', 'help wanted'],
|
|
20
|
-
excludeRepos: [],
|
|
21
|
-
trustedProjects: [],
|
|
22
|
-
githubUsername: '',
|
|
23
|
-
minRepoScoreThreshold: 4,
|
|
24
|
-
starredRepos: [],
|
|
25
|
-
squashByDefault: true,
|
|
26
|
-
minStars: 50,
|
|
27
|
-
includeDocIssues: true,
|
|
28
|
-
aiPolicyBlocklist: ['matplotlib/matplotlib'],
|
|
29
|
-
shelvedPRUrls: [],
|
|
30
|
-
dismissedIssues: {},
|
|
31
|
-
projectCategories: [],
|
|
32
|
-
preferredOrgs: [],
|
|
33
|
-
};
|
|
14
|
+
export const DEFAULT_CONFIG = AgentConfigSchema.parse({});
|
|
34
15
|
/** Initial state written to `~/.oss-autopilot/state.json` on first run. Uses v2 architecture. */
|
|
35
|
-
export const INITIAL_STATE = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
config: DEFAULT_CONFIG,
|
|
40
|
-
events: [],
|
|
41
|
-
lastRunAt: new Date().toISOString(),
|
|
42
|
-
};
|
|
43
|
-
// -- Project category types --
|
|
44
|
-
export const PROJECT_CATEGORIES = [
|
|
45
|
-
'nonprofit',
|
|
46
|
-
'devtools',
|
|
47
|
-
'infrastructure',
|
|
48
|
-
'web-frameworks',
|
|
49
|
-
'data-ml',
|
|
50
|
-
'education',
|
|
51
|
-
];
|
|
52
|
-
// -- Issue scope types --
|
|
53
|
-
export const ISSUE_SCOPES = ['beginner', 'intermediate', 'advanced'];
|
|
16
|
+
export const INITIAL_STATE = AgentStateSchema.parse({ version: 2 });
|
|
17
|
+
// ── Const arrays (derived from Zod schemas for runtime iteration) ────
|
|
18
|
+
export const PROJECT_CATEGORIES = ProjectCategorySchema.options;
|
|
19
|
+
export const ISSUE_SCOPES = IssueScopeSchema.options;
|
|
54
20
|
export const SCOPE_LABELS = {
|
|
55
21
|
beginner: ['good first issue', 'help wanted', 'easy', 'up-for-grabs', 'first-timers-only', 'beginner'],
|
|
56
22
|
intermediate: ['enhancement', 'feature', 'feature-request', 'contributions welcome'],
|
|
@@ -6,6 +6,7 @@ import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, She
|
|
|
6
6
|
import type { ContributionStats } from '../core/stats.js';
|
|
7
7
|
import type { PRCheckFailure } from '../core/pr-monitor.js';
|
|
8
8
|
import type { SearchPriority } from '../core/types.js';
|
|
9
|
+
import type { CIFormatterDiagnosis, FormatterDetectionResult } from '../core/formatter-detection.js';
|
|
9
10
|
export interface JsonOutput<T = unknown> {
|
|
10
11
|
success: boolean;
|
|
11
12
|
data?: T;
|
|
@@ -304,6 +305,10 @@ export interface LocalReposOutput {
|
|
|
304
305
|
cachedAt: string;
|
|
305
306
|
fromCache: boolean;
|
|
306
307
|
}
|
|
308
|
+
/** Output of the detect-formatters command. Extends FormatterDetectionResult with optional CI diagnosis. */
|
|
309
|
+
export interface DetectFormattersOutput extends FormatterDetectionResult {
|
|
310
|
+
ciDiagnosis?: CIFormatterDiagnosis;
|
|
311
|
+
}
|
|
307
312
|
/** Output of the stats command */
|
|
308
313
|
export interface StatsOutput extends ContributionStats {
|
|
309
314
|
mergeRateFormatted: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,13 +50,15 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@octokit/plugin-throttling": "^11.0.3",
|
|
52
52
|
"@octokit/rest": "^22.0.1",
|
|
53
|
-
"commander": "^14.0.3"
|
|
53
|
+
"commander": "^14.0.3",
|
|
54
|
+
"zod": "^4.3.6"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@types/node": "^25.
|
|
57
|
+
"@types/node": "^25.4.0",
|
|
57
58
|
"@vitest/coverage-v8": "^4.0.18",
|
|
58
59
|
"esbuild": "^0.27.3",
|
|
59
60
|
"tsx": "^4.21.0",
|
|
61
|
+
"typedoc": "^0.28.17",
|
|
60
62
|
"typescript": "^5.9.3",
|
|
61
63
|
"vitest": "^4.0.16"
|
|
62
64
|
},
|
|
@@ -68,6 +70,8 @@
|
|
|
68
70
|
"typecheck": "tsc --noEmit",
|
|
69
71
|
"test": "vitest run",
|
|
70
72
|
"test:coverage": "vitest run --coverage",
|
|
71
|
-
"test:watch": "vitest"
|
|
73
|
+
"test:watch": "vitest",
|
|
74
|
+
"docs": "typedoc",
|
|
75
|
+
"docs:check": "typedoc --emit none"
|
|
72
76
|
}
|
|
73
77
|
}
|