// Heuristic abandonment registry — no npm registry calls.
const KNOWN_ABANDONED = {
    request: { months: 60, alternative: 'axios or native fetch' },
    gulp: { months: 48, alternative: 'vite or esbuild' },
    grunt: { months: 72, alternative: 'vite or esbuild' },
    bower: { months: 84, alternative: 'npm workspaces' },
    tslint: { months: 60, alternative: 'eslint with typescript-eslint' },
    'babel-eslint': { months: 60, alternative: '@babel/eslint-parser or typescript-eslint' },
    moment: { months: 24, alternative: 'dayjs or date-fns (moment in maintenance mode)' },
    'node-uuid': { months: 84, alternative: 'uuid (v9+)' },
    'uglify-js': { months: 48, alternative: 'esbuild or terser' },
    coffeescript: { months: 60, alternative: 'TypeScript' },
};
export function getAbandonedInfo(name) {
    const entry = KNOWN_ABANDONED[name];
    if (!entry) {
        return { isAbandoned: false, reason: 'No abandonment signals detected.' };
    }
    return {
        isAbandoned: true,
        lastReleaseAge: entry.months,
        reason: `Package has had no meaningful release in ~${entry.months} months and is considered deprecated.`,
        suggestedAlternative: entry.alternative,
    };
}
export function classifyEntry(entry) {
    const hasCriticalVuln = entry.vulns.some((v) => v.severity === 'critical' || v.severity === 'high');
    const hasLicenseIssue = entry.license.compatibility === 'critical';
    if (hasCriticalVuln || hasLicenseIssue || entry.abandoned.isAbandoned) {
        return hasCriticalVuln || hasLicenseIssue ? 'critical' : 'warning';
    }
    const hasWarning = entry.vulns.some((v) => v.severity === 'medium' || v.severity === 'low') ||
        entry.license.compatibility === 'warning' ||
        entry.license.compatibility === 'unknown';
    return hasWarning ? 'warning' : 'clean';
}
//# sourceMappingURL=abandonment-data.js.map