import type { GhWrapper, Issue } from '@generacy-ai/cockpit'; import type { PrLifecycle, PrSnapshot, Snapshot } from './snapshot.js'; export type PrChecksNeededReason = 'no-prev' | 'lifecycle-flip' | 'head-changed' | 'label-changed' | 'safety-cycle' | 'not-terminal' | 'skip-terminal'; export interface PrChecksNeededDecision { fetch: boolean; reason: PrChecksNeededReason; } export interface DerivePrChecksNeededInput { prevSnapshot: PrSnapshot | undefined; currentLifecycle: PrLifecycle; currentLabels: string[]; currentHeadRefOid: string | undefined; cyclesSinceLastCheckFetch: number; safetyCycles?: number; } export declare function derivePrChecksNeeded(input: DerivePrChecksNeededInput): PrChecksNeededDecision; export interface DerivePrLifecycleDeps { getPullRequest: GhWrapper['getPullRequest']; } /** * Derive the lifecycle of a PR (`open` | `closed` | `merged`). * * Plan D5: avoid an extra `gh pr view` call per cycle for stable PRs. Only call * `getPullRequest` when: * - the previous snapshot was OPEN (or absent) AND the current issue state is * CLOSED — i.e. the PR just flipped to closed and we don't yet know if it * was merged. * Otherwise reuse the prior lifecycle (or default 'open' if no prev). */ export declare function derivePrLifecycle(repo: string, prev: Snapshot | undefined, issue: Pick, deps: DerivePrLifecycleDeps): Promise; //# sourceMappingURL=pr-state.d.ts.map