import type { DevToolsSys } from "@builder.io/dev-tools/core";
import type { FusionConfig, WorkspaceFolder } from "$/ai-utils";
export interface InitConfig {
    fusionConfig: FusionConfig;
    sys: DevToolsSys;
    debug?: boolean;
    runSetupCommand: boolean;
}
export interface InitStatus {
    message: string;
    error?: string;
}
declare enum InitStateStep {
    Init = "init",
    Validation = "validation",
    CheckDirectories = "check-directories",
    CreateDirectories = "create-directories",
    ConfigureGitRepos = "configure-git-repos",
    CheckExistingGit = "check-existing-git",
    UpdateRemoteUrl = "update-remote-url",
    CloneRepo = "clone-repo",
    ConfigureGitUser = "configure-git-user",
    InstallDependencies = "install-dependencies",
    StashChanges = "stash-changes",
    InitSuccess = "init-success",
    InitFailed = "init-failed"
}
export interface InitStatusLog {
    id: number;
    timestamp: string;
    type: "status" | "log" | "error" | "complete";
    message: string;
    step?: InitStateStep;
    error?: string;
    success?: boolean;
}
export declare class InitStateMachine {
    logIdCounter: number;
    initStatusLogs: InitStatusLog[];
    initState: {
        isRunning: boolean;
        isComplete: boolean;
        success: boolean;
        currentStep: string;
        error: string | undefined;
    };
    init(config: InitConfig, signal?: AbortSignal): Promise<boolean>;
    addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
        step?: InitStateStep;
        error?: string;
        success?: boolean;
    }): void;
    clearInitLogs(): void;
    step1CheckDirectories(config: InitConfig, repositories: Required<WorkspaceFolder>[], signal?: AbortSignal): Promise<void>;
    step2ConfigureGitRepositories(config: InitConfig, repositories: Required<WorkspaceFolder>[], signal?: AbortSignal): Promise<void>;
    step3ConfigureGitUser(config: InitConfig, repositories: Required<WorkspaceFolder>[], signal?: AbortSignal): Promise<void>;
    step4InstallDependencies(config: InitConfig, signal?: AbortSignal): Promise<void>;
    step5StashChanges(config: InitConfig, repositories: Required<WorkspaceFolder>[], signal?: AbortSignal): Promise<void>;
    private isGitConfigured;
    private getGitRemoteUrl;
    private sanitizeGitRemoteUrl;
    cloneRepository(repo: Required<WorkspaceFolder>, repoPath: string, debug?: boolean, signal?: AbortSignal): Promise<boolean>;
}
export {};
