/**
 * SELF-UPDATE SYSTEM FOR UNIVERSAL CAPABILITY FRAMEWORK
 *
 * Implements automatic self-update capabilities as per AGI Code rules.
 * Provides version checking, state persistence, and seamless updates.
 */
import { UniversalCapabilityModule } from './universalCapabilityFramework.js';
import { UniversalCapabilityFramework } from './universalCapabilityFramework.js';
export interface UpdateManifest {
    version: string;
    timestamp: string;
    changes: string[];
    dependencies: Record<string, string>;
    breakingChanges: boolean;
    rollbackSupported: boolean;
}
export interface UpdateState {
    currentVersion: string;
    updateInProgress: boolean;
    lastUpdateAttempt: string | null;
    lastSuccessfulUpdate: string | null;
    pendingUpdate: UpdateManifest | null;
    errorHistory: Array<{
        timestamp: string;
        error: string;
    }>;
}
export interface SelfUpdateOptions {
    /** Enable automatic update checking */
    enableAutoUpdate: boolean;
    /** Check for updates interval (minutes) */
    checkIntervalMinutes: number;
    /** Auto-install minor updates */
    autoInstallMinor: boolean;
    /** Require confirmation for major updates */
    requireConfirmationMajor: boolean;
    /** Backup before update */
    enableBackup: boolean;
    /** Rollback on failure */
    enableRollback: boolean;
    /** Update channel: stable, beta, alpha */
    updateChannel: 'stable' | 'beta' | 'alpha';
}
export declare class SelfUpdateCapability extends UniversalCapabilityModule {
    readonly id = "capability.self-update";
    readonly metadata: {
        id: string;
        version: string;
        description: string;
        author: string;
        dependencies: string[];
        provides: string[];
        requires: string[];
        category: string;
        tags: string[];
    };
    private options;
    private stateFile;
    private updateDir;
    constructor(framework: UniversalCapabilityFramework, config?: Partial<SelfUpdateOptions>);
    create(context: any): Promise<any>;
    execute(params: {
        operation: string;
        parameters: Record<string, any>;
        operationId?: string;
    }): Promise<any>;
    private createUpdateTools;
    /**
     * Check for available updates
     */
    checkForUpdates(force?: boolean): Promise<any>;
    /**
     * Install an update
     */
    installUpdate(version?: string, confirm?: boolean): Promise<any>;
    /**
     * Rollback to previous version
     */
    rollbackUpdate(targetVersion?: string): Promise<any>;
    /**
     * Get current update status
     */
    getUpdateStatus(): Promise<any>;
    /**
     * Configure update settings
     */
    configureUpdates(config: Partial<SelfUpdateOptions>): Promise<any>;
    loadState(): Promise<UpdateState>;
    private saveState;
    private getCurrentVersion;
    private checkNpmRegistry;
    private mockNpmRegistryCheck;
    private compareVersions;
    private shouldAutoUpdate;
    private fetchUpdateManifest;
    private createBackup;
    private copyDirectory;
    private downloadUpdate;
    private applyUpdate;
    private performRollback;
    /**
     * Perform manual update using npm commands
     */
    performManualUpdate(command: string): Promise<any>;
    /**
     * Check system requirements
     */
    checkSystemRequirements(): Promise<any>;
    /**
     * Schedule automatic update check
     */
    scheduleAutoUpdateCheck(): void;
}
/**
 * Quick self-update utility
 */
export declare function quickSelfUpdate(options?: Partial<SelfUpdateOptions>): Promise<any>;
/**
 * Register self-update capability with framework factory
 */
export declare function registerSelfUpdateCapability(): void;
//# sourceMappingURL=selfUpdateSystem.d.ts.map