/** * Updater Service * * Handles checking for updates and providing update instructions. * Similar to Claude Code's self-update mechanism. */ import { type InstallMethod } from './install-method.js'; /** * npm registry package info (from /latest endpoint) */ export interface NpmPackageInfo { name: string; version: string; description?: string; } /** * Update information returned by the update check */ export interface UpdateInfo { currentVersion: string; latestVersion: string; updateAvailable: boolean; releaseUrl: string; installMethod: InstallMethod; updateCommand: string | null; } /** * Cached update check result */ export interface UpdateCheckCache { lastCheck: string; latestVersion: string; releaseUrl: string; } /** * Updater Service - handles self-update functionality */ export declare class UpdaterService { private currentVersion; private registryUrl; constructor(registryUrl?: string); /** * Get the current installed version */ getCurrentVersion(): string; /** * Check if enough time has passed since the last check */ private shouldCheck; /** * Save the update check result to cache */ private saveCheckCache; /** * Load cached update info */ private loadCache; /** * Fetch the latest version from the npm registry */ fetchLatestVersion(): Promise; /** * Check for available updates * @param force - Force check even if recently checked * @returns Update info or null if check failed/skipped */ checkForUpdates(force?: boolean): Promise; /** * Check for updates and format instructions (performs I/O: writes cache) * @returns Object with success status and message */ fetchUpdateInstructions(): Promise<{ success: boolean; message: string; }>; /** * Get a brief update notification message (for startup) */ getUpdateNotification(): Promise; /** * Perform auto-update: check for updates, run update command, return result. * Caller is responsible for re-exec and process.exit on success. */ performAutoUpdate(): Promise<{ updated: boolean; version?: string; message: string; }>; /** * Clear the update cache (for testing) */ clearCache(): void; } /** * Get the singleton updater service */ export declare function getUpdaterService(): UpdaterService; /** * Create a new updater service (for testing) */ export declare function createUpdaterService(registryUrl?: string): UpdaterService; /** * Reset the singleton (for testing) */ export declare function resetUpdaterService(): void; //# sourceMappingURL=updater-service.d.ts.map