import { Config } from '../types/core.js';
import { FileSystemManager } from './filesystem.js';
export interface GitHubAgent {
    name: string;
    path: string;
    download_url: string;
    sha: string;
}
export interface BootstrapResult {
    installed: Array<{
        name: string;
        success: boolean;
        error?: string;
    }>;
    skipped: string[];
    errors: string[];
}
export interface InstallationTransaction {
    id: string;
    agentName: string;
    startTime: Date;
    status: 'pending' | 'downloading' | 'validating' | 'installing' | 'completed' | 'failed' | 'rolled_back';
    tempFiles: string[];
    backupFiles: string[];
    checkpoints: Array<{
        step: string;
        timestamp: Date;
        status: 'success' | 'failure';
        data?: any;
    }>;
    rollbackSteps: Array<() => Promise<void>>;
    error?: string;
}
export declare class BootstrapManager {
    private config;
    private fsManager;
    private static readonly MAX_RETRIES;
    private static readonly RETRY_DELAYS;
    private static readonly GITHUB_API_BASE;
    private static readonly RAW_GITHUB_BASE;
    private static readonly CONNECTION_TIMEOUT;
    private static readonly DOWNLOAD_TIMEOUT;
    private static readonly MAX_PARALLEL_DOWNLOADS;
    private static readonly RATE_LIMIT_DELAY;
    private downloadQueue;
    private activeDownloads;
    private rateLimitLastCall;
    private integrityManager;
    private installationTransactions;
    constructor(config: Config, fsManager: FileSystemManager);
    initialize(): Promise<void>;
    checkAgentsInstalled(): Promise<boolean>;
    autoInstallAgents(): Promise<BootstrapResult>;
    fetchAvailableAgentsWithRetry(): Promise<GitHubAgent[]>;
    fetchAvailableAgents(): Promise<GitHubAgent[]>;
    private fetchAgentsWithFallbackEndpoint;
    private fetchAgentsDirectContent;
    private fetchOfflineAgentManifest;
    private installAgentsWithParallelProcessing;
    installAgentWithRetry(agent: GitHubAgent): Promise<void>;
    installAgentWithAtomicTransaction(agent: GitHubAgent): Promise<void>;
    private addCheckpoint;
    private rollbackTransaction;
    private cleanupTransactionTempFiles;
    installAgentFromUrl(url: string, agentName: string): Promise<void>;
    installAgentFromLocal(filePath: string, agentName: string): Promise<void>;
    getInstallationStatus(): Promise<{
        installed: string[];
        available: string[];
        missing: string[];
        invalid: string[];
        summary: {
            total: number;
            installed: number;
            valid: number;
            missing: number;
            invalid: number;
        };
    }>;
    private verifyAgentIntegrity;
    private verifyAgentFile;
    private enforceRateLimit;
    private handleRateLimitHeaders;
    private containsSuspiciousContent;
    private chunkArray;
    private handleApiError;
    private calculateSHA1;
    private delay;
    getInstallationTransactions(): Map<string, InstallationTransaction>;
    getTransaction(transactionId: string): InstallationTransaction | undefined;
    cancelTransaction(transactionId: string): Promise<boolean>;
}
//# sourceMappingURL=bootstrap.d.ts.map