/** * Deprecation Lifecycle Management * * Tracks tool deprecation status and warns consumers about deprecated tools. * Supports grace periods, replacement suggestions, and removal date enforcement. */ import type { ToolFingerprint, BehavioralBaseline, ChangeSeverity } from './types.js'; /** * Deprecation status for a tool. */ export type DeprecationStatus = 'active' | 'deprecated' | 'sunset' | 'removed'; /** * Deprecation warning for a single tool. */ export interface DeprecationWarning { /** Tool name */ toolName: string; /** Current deprecation status */ status: DeprecationStatus; /** Severity of the warning */ severity: ChangeSeverity; /** Warning message */ message: string; /** When the tool was deprecated (if applicable) */ deprecatedAt?: Date; /** Planned removal date (if applicable) */ removalDate?: Date; /** Days until removal (negative if past) */ daysUntilRemoval?: number; /** Suggested replacement tool */ replacementTool?: string; /** Full deprecation notice from the tool */ deprecationNotice?: string; /** Whether this tool is past its removal date */ isPastRemoval: boolean; /** Whether this tool is within grace period */ isInGracePeriod: boolean; } /** * Deprecation report for an entire baseline. */ export interface DeprecationReport { /** All deprecation warnings */ warnings: DeprecationWarning[]; /** Number of deprecated tools */ deprecatedCount: number; /** Number of tools past removal date */ expiredCount: number; /** Number of tools within grace period */ gracePeriodCount: number; /** Overall severity */ overallSeverity: ChangeSeverity; /** Human-readable summary */ summary: string; /** Whether there are any critical issues (past removal date) */ hasCriticalIssues: boolean; } /** * Deprecation configuration options. */ export interface DeprecationConfig { /** Warn when using deprecated tools */ warnOnUsage: boolean; /** Fail when using tools past their removal date */ failOnExpired: boolean; /** Default grace period in days after removal date */ gracePeriodDays: number; /** Severity for deprecated tools */ deprecatedSeverity: ChangeSeverity; /** Severity for tools past removal date */ expiredSeverity: ChangeSeverity; } export { DEPRECATION } from '../constants.js'; /** * Default deprecation configuration. * Uses values from centralized constants. */ export declare const DEPRECATION_DEFAULTS: DeprecationConfig; /** * Days thresholds for warning levels. * Uses values from centralized constants. */ export declare const DEPRECATION_THRESHOLDS: { /** Warn about upcoming removal within this many days */ readonly UPCOMING_REMOVAL_DAYS: 30; /** Critical warning within this many days */ readonly CRITICAL_REMOVAL_DAYS: 7; }; /** * Check all tools in a baseline for deprecation issues. */ export declare function checkDeprecations(baseline: BehavioralBaseline, config?: Partial): DeprecationReport; /** * Check a single tool for deprecation issues. */ export declare function checkToolDeprecation(tool: ToolFingerprint, now?: Date, config?: DeprecationConfig): DeprecationWarning | null; /** * Mark a tool as deprecated. */ export declare function markAsDeprecated(tool: ToolFingerprint, options?: { notice?: string; removalDate?: Date; replacementTool?: string; }): ToolFingerprint; /** * Clear deprecation status from a tool. */ export declare function clearDeprecation(tool: ToolFingerprint): ToolFingerprint; /** * Get all deprecated tools from a baseline. */ export declare function getDeprecatedTools(baseline: BehavioralBaseline): ToolFingerprint[]; /** * Get tools that are past their removal date. */ export declare function getExpiredTools(baseline: BehavioralBaseline, now?: Date): ToolFingerprint[]; /** * Get tools that will be removed within a specified number of days. */ export declare function getUpcomingRemovals(baseline: BehavioralBaseline, withinDays?: number, now?: Date): ToolFingerprint[]; /** * Format deprecation warning for display. */ export declare function formatDeprecationWarning(warning: DeprecationWarning): string; /** * Format deprecation report for console output. */ export declare function formatDeprecationReport(report: DeprecationReport): string; /** * Check if deprecation report should cause failure. */ export declare function shouldFailOnDeprecation(report: DeprecationReport, config?: Partial): boolean; //# sourceMappingURL=deprecation-tracker.d.ts.map