@oss-autopilot/core 0.50.0 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,7 +41,7 @@ export interface RepoGroup {
41
41
  }
42
42
  /** GitHub's pull request review decision (from the reviewDecision GraphQL field). */
43
43
  export type ReviewDecision = 'approved' | 'changes_requested' | 'review_required' | 'unknown';
44
- /** Input options for `PRMonitor.determineStatus()`. */
44
+ /** Input options for `determineStatus()` (see status-determination.ts). */
45
45
  export interface DetermineStatusInput {
46
46
  ciStatus: CIStatus;
47
47
  hasMergeConflict: boolean;
@@ -61,6 +61,13 @@ export interface DetermineStatusInput {
61
61
  /** True if at least one failing CI check is classified as 'actionable'. */
62
62
  hasActionableCIFailure?: boolean;
63
63
  }
64
+ /** Result of `determineStatus()` — the PR's computed status classification. */
65
+ export interface DetermineStatusResult {
66
+ status: FetchedPRStatus;
67
+ actionReason?: ActionReason;
68
+ waitReason?: WaitReason;
69
+ stalenessTier: StalenessTier;
70
+ }
64
71
  /**
65
72
  * Granular reason why a PR needs addressing (contributor's turn).
66
73
  * Active values (produced by determineStatus): needs_response, needs_changes,
@@ -97,7 +104,7 @@ export interface FetchedPR {
97
104
  repo: string;
98
105
  number: number;
99
106
  title: string;
100
- /** Computed by `PRMonitor.determineStatus()` based on the fields below. */
107
+ /** Computed by `determineStatus()` based on the fields below. */
101
108
  status: FetchedPRStatus;
102
109
  /** Granular reason for needs_addressing status. Undefined when waiting_on_maintainer. */
103
110
  actionReason?: ActionReason;
@@ -414,12 +421,6 @@ export interface LocalRepoCache {
414
421
  /** ISO 8601 timestamp of when the scan was performed */
415
422
  cachedAt: string;
416
423
  }
417
- /** Metadata for a snoozed PR's CI failure. */
418
- export interface SnoozeInfo {
419
- reason: string;
420
- snoozedAt: string;
421
- expiresAt: string;
422
- }
423
424
  /** Filter for excluding repos below a minimum star count from PR count queries. */
424
425
  export interface StarFilter {
425
426
  minStars: number;
@@ -479,10 +480,8 @@ export interface AgentConfig {
479
480
  aiPolicyBlocklist?: string[];
480
481
  /** PR URLs manually shelved by the user. Shelved PRs are excluded from capacity and actionable issues. Auto-unshelved when maintainers engage. */
481
482
  shelvedPRUrls?: string[];
482
- /** Issue/PR URLs dismissed by the user, mapped to ISO timestamp of when dismissed. Issues with new responses after the dismiss timestamp resurface automatically. Named dismissedIssues for state backward compatibility (#416). */
483
+ /** Issue URLs dismissed by the user, mapped to ISO timestamp of when dismissed. Issues with new responses after the dismiss timestamp resurface automatically. */
483
484
  dismissedIssues?: Record<string, string>;
484
- /** PR URLs with snoozed CI failures, mapped to snooze metadata. Snoozed PRs are excluded from actionable CI failure list until expiry. */
485
- snoozedPRs?: Record<string, SnoozeInfo>;
486
485
  /** Manual status overrides for PRs. Maps PR URL to override metadata. Auto-clears when the PR has new activity. */
487
486
  statusOverrides?: Record<string, StatusOverride>;
488
487
  /** Project categories the user is interested in (e.g., devtools, nonprofit). Used to prioritize search results. */
@@ -28,7 +28,6 @@ export const DEFAULT_CONFIG = {
28
28
  aiPolicyBlocklist: ['matplotlib/matplotlib'],
29
29
  shelvedPRUrls: [],
30
30
  dismissedIssues: {},
31
- snoozedPRs: {},
32
31
  projectCategories: [],
33
32
  preferredOrgs: [],
34
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "0.50.0",
3
+ "version": "0.51.1",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,21 +0,0 @@
1
- /**
2
- * Override command
3
- * Manually override a PR's status (needs_addressing ↔ waiting_on_maintainer).
4
- * Overrides auto-clear when the PR has new activity.
5
- */
6
- import type { FetchedPRStatus } from '../core/types.js';
7
- export interface OverrideOutput {
8
- url: string;
9
- status: FetchedPRStatus;
10
- }
11
- export interface ClearOverrideOutput {
12
- url: string;
13
- cleared: boolean;
14
- }
15
- export declare function runOverride(options: {
16
- prUrl: string;
17
- status: string;
18
- }): Promise<OverrideOutput>;
19
- export declare function runClearOverride(options: {
20
- prUrl: string;
21
- }): Promise<ClearOverrideOutput>;
@@ -1,35 +0,0 @@
1
- /**
2
- * Override command
3
- * Manually override a PR's status (needs_addressing ↔ waiting_on_maintainer).
4
- * Overrides auto-clear when the PR has new activity.
5
- */
6
- import { getStateManager } from '../core/index.js';
7
- import { PR_URL_PATTERN, validateGitHubUrl, validateUrl } from './validation.js';
8
- const VALID_STATUSES = ['needs_addressing', 'waiting_on_maintainer'];
9
- export async function runOverride(options) {
10
- validateUrl(options.prUrl);
11
- validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR');
12
- if (!VALID_STATUSES.includes(options.status)) {
13
- throw new Error(`Invalid status "${options.status}". Must be one of: ${VALID_STATUSES.join(', ')}`);
14
- }
15
- const status = options.status;
16
- const stateManager = getStateManager();
17
- // Use current time as lastActivityAt — the CLI doesn't have cached PR data.
18
- // This means the override will auto-clear on the next daily run if the PR's
19
- // updatedAt is after this timestamp (which is the desired behavior: the override
20
- // will persist until new activity occurs on the PR).
21
- const lastActivityAt = new Date().toISOString();
22
- stateManager.setStatusOverride(options.prUrl, status, lastActivityAt);
23
- stateManager.save();
24
- return { url: options.prUrl, status };
25
- }
26
- export async function runClearOverride(options) {
27
- validateUrl(options.prUrl);
28
- validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR');
29
- const stateManager = getStateManager();
30
- const cleared = stateManager.clearStatusOverride(options.prUrl);
31
- if (cleared) {
32
- stateManager.save();
33
- }
34
- return { url: options.prUrl, cleared };
35
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Snooze/Unsnooze commands
3
- * Manages snoozing CI failure notifications for PRs with known upstream/infrastructure issues.
4
- * Snoozed PRs are excluded from the actionable CI failure list until the snooze expires.
5
- */
6
- export interface SnoozeOutput {
7
- snoozed: boolean;
8
- url: string;
9
- days: number;
10
- reason: string;
11
- expiresAt: string | undefined;
12
- }
13
- export interface UnsnoozeOutput {
14
- unsnoozed: boolean;
15
- url: string;
16
- }
17
- export declare function runSnooze(options: {
18
- prUrl: string;
19
- reason: string;
20
- days?: number;
21
- }): Promise<SnoozeOutput>;
22
- export declare function runUnsnooze(options: {
23
- prUrl: string;
24
- }): Promise<UnsnoozeOutput>;
@@ -1,40 +0,0 @@
1
- /**
2
- * Snooze/Unsnooze commands
3
- * Manages snoozing CI failure notifications for PRs with known upstream/infrastructure issues.
4
- * Snoozed PRs are excluded from the actionable CI failure list until the snooze expires.
5
- */
6
- import { getStateManager } from '../core/index.js';
7
- import { PR_URL_PATTERN, validateGitHubUrl, validateUrl, validateMessage } from './validation.js';
8
- const DEFAULT_SNOOZE_DAYS = 7;
9
- export async function runSnooze(options) {
10
- validateUrl(options.prUrl);
11
- validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR');
12
- validateMessage(options.reason);
13
- const days = options.days ?? DEFAULT_SNOOZE_DAYS;
14
- if (!Number.isFinite(days) || days <= 0) {
15
- throw new Error('Snooze duration must be a positive number of days.');
16
- }
17
- const stateManager = getStateManager();
18
- const added = stateManager.snoozePR(options.prUrl, options.reason, days);
19
- if (added) {
20
- stateManager.save();
21
- }
22
- const snoozeInfo = stateManager.getSnoozeInfo(options.prUrl);
23
- return {
24
- snoozed: added,
25
- url: options.prUrl,
26
- days,
27
- reason: options.reason,
28
- expiresAt: snoozeInfo?.expiresAt,
29
- };
30
- }
31
- export async function runUnsnooze(options) {
32
- validateUrl(options.prUrl);
33
- validateGitHubUrl(options.prUrl, PR_URL_PATTERN, 'PR');
34
- const stateManager = getStateManager();
35
- const removed = stateManager.unsnoozePR(options.prUrl);
36
- if (removed) {
37
- stateManager.save();
38
- }
39
- return { unsnoozed: removed, url: options.prUrl };
40
- }