/** * Pure, deterministic planner for the `outfitter upgrade` command. * * Classifies each installed package into one of four bump categories * based on the installed version, the latest available version, and * metadata about whether the bump contains breaking changes. * * Pre-1.0 packages (major version 0) treat minor bumps as breaking * per semver convention. * * @packageDocumentation */ /** Classification of a version bump for a single package. */ type BumpClassification = "upToDate" | "upgradableNonBreaking" | "upgradableBreaking" | "blocked"; /** Describes the planned action for a single package. */ interface PackageUpgradeAction { /** Whether this update contains breaking changes */ readonly breaking: boolean; /** Bump classification */ readonly classification: BumpClassification; /** Currently installed version */ readonly currentVersion: string; /** Latest available version */ readonly latestVersion: string; /** Migration doc path if available */ readonly migrationDoc?: string; /** Full package name (e.g. "@outfitter/cli") */ readonly name: string; } /** The complete update plan with per-package actions and aggregate summary. */ interface UpgradePlan { /** Per-package update actions, sorted by name for deterministic output. */ readonly packages: PackageUpgradeAction[]; /** Aggregate counts by classification. */ readonly summary: { readonly upToDate: number; readonly upgradableNonBreaking: number; readonly upgradableBreaking: number; readonly blocked: number; }; } /** * Analyze installed packages against their latest versions and produce * a deterministic update plan. * * This function is **pure** — no side effects, no I/O, no process.env reads. * Same inputs always produce the same output. * * @param installed - Map of package name to currently installed version. * @param latest - Map of package name to latest version info (version string + breaking flag). * @param migrationDocs - Optional map of package name to migration doc path. * @returns A deterministic update plan with per-package actions and summary. */ declare function analyzeUpgrades(installed: Map, latest: Map, migrationDocs?: Map): UpgradePlan; export { analyzeUpgrades, UpgradePlan, PackageUpgradeAction, BumpClassification };