/**
 * Version Check Service
 *
 * Singleton service that queries the npm registry for the latest published
 * version of Crewly and compares it against the locally installed version.
 * Results are cached in ~/.crewly/.update-check for 24 hours to avoid
 * hitting the network on every startup.
 *
 * @module services/system/version-check.service
 */
/**
 * Cached version check result persisted to disk
 */
export interface CachedVersionCheck {
    /** The latest version found on npm */
    latestVersion: string;
    /** ISO timestamp of when the check was performed */
    checkedAt: string;
}
/**
 * Result of a version comparison
 */
export interface VersionCheckResult {
    /** Currently installed version */
    currentVersion: string;
    /** Latest version on npm, or null if check failed */
    latestVersion: string | null;
    /** Whether a newer version is available */
    updateAvailable: boolean;
}
/**
 * Manages version checking against the npm registry with disk-based caching.
 *
 * Usage:
 * ```typescript
 * const service = VersionCheckService.getInstance();
 * const result = await service.checkForUpdate();
 * if (result.updateAvailable) {
 *   console.log(`Update available: ${result.latestVersion}`);
 * }
 * ```
 */
export declare class VersionCheckService {
    private static instance;
    private cachedResult;
    private constructor();
    /**
     * Returns the singleton instance of VersionCheckService.
     *
     * @returns The singleton instance
     */
    static getInstance(): VersionCheckService;
    /**
     * Resets the singleton instance (for testing).
     */
    static resetInstance(): void;
    /**
     * Reads the current Crewly version from the root package.json.
     *
     * @returns The version string from package.json
     * @throws Error if the package root or package.json cannot be found
     */
    getLocalVersion(): string;
    /**
     * Fetches the latest version of Crewly from the npm registry.
     * Uses the cached result if it is still fresh (within CACHE_TTL_MS).
     *
     * @returns The latest version string, or null if the request failed
     */
    getLatestVersion(): Promise<string | null>;
    /**
     * Compares the local version against the latest npm version and returns
     * a structured result indicating whether an update is available.
     *
     * @returns An object with currentVersion, latestVersion, and updateAvailable
     */
    checkForUpdate(): Promise<VersionCheckResult>;
    /**
     * Returns the in-memory cached result from the last checkForUpdate() call.
     * Does not perform any I/O.
     *
     * @returns The cached VersionCheckResult, or null if no check has been performed
     */
    getCachedCheckResult(): VersionCheckResult | null;
    /**
     * Reads the disk-cached version check result from ~/.crewly/.update-check.
     *
     * @returns The cached result, or null if the file does not exist or is malformed
     */
    getCachedResult(): CachedVersionCheck | null;
    /**
     * Writes a version check result to the disk cache.
     *
     * @param version - The latest version string to cache
     */
    writeCacheResult(version: string): void;
    /**
     * Compares two semver version strings to determine if `latest` is newer than `current`.
     *
     * @param latest - The version to compare against
     * @param current - The currently installed version
     * @returns true if latest is strictly newer than current
     */
    private isNewerVersion;
    /**
     * Returns the absolute path to the cache file.
     *
     * @returns Path to ~/.crewly/.update-check
     */
    private getCachePath;
}
//# sourceMappingURL=version-check.service.d.ts.map