import type { FindStaleBranchesInput, StaleBranchInfo, SkippedBranchInfo } from '../../types/housekeeping.js';
/**
 * Delete stale .bak.* files from planu/specs/ that are older than 7 days.
 * Best-effort: per-file errors are silently skipped. Returns count of deleted files.
 */
export declare function cleanStaleBackups(projectPath: string): Promise<number>;
/**
 * Extract a canonical SPEC-NNN id (uppercase) from a branch name.
 * Returns null when the branch name contains no SPEC-NNN pattern.
 *
 * Examples:
 *   'feat/SPEC-762-foo'  → 'SPEC-762'
 *   'fix/spec-763-slug'  → 'SPEC-763'
 *   'tmp-bundle-A'       → null
 */
export declare function extractSpecIdFromName(branchName: string): string | null;
/**
 * Extract a canonical SPEC-NNN id from the tip commit message of `sha`.
 * Returns null on git error or when no SPEC-NNN pattern is found.
 *
 * Example commit message: 'feat(spec-728): implement foo' → 'SPEC-728'
 */
export declare function extractSpecIdFromCommit(projectPath: string, sha: string): Promise<string | null>;
/**
 * Look up the status of a spec by reading 'planu/specs/<specId>-star/spec.md' frontmatter.
 * Returns the raw status string, or null when not found.
 */
export declare function lookupSpecStatus(projectPath: string, specId: string): Promise<string | null>;
/**
 * Pass 2: for each branch in `skipped` with reason 'not_merged', check if its
 * SPEC ID (from name or tip commit message) is `done` or `discarded` in Planu.
 * Matching branches are moved from `skipped` to `stale` with reason 'spec-done'.
 * Mutates both arrays in-place.
 */
export declare function applySpecDonePass(projectPath: string, skipped: SkippedBranchInfo[], stale: StaleBranchInfo[], branchShas: Map<string, string>): Promise<void>;
export interface FindStaleBranchesResult {
    stale: StaleBranchInfo[];
    skipped: SkippedBranchInfo[];
}
export declare function findStaleBranches(input: FindStaleBranchesInput & {
    aggressive?: boolean;
}): Promise<FindStaleBranchesResult>;
//# sourceMappingURL=find-stale-branches.d.ts.map