/**
 * Base error class for all Lisa errors
 */
export class LisaError extends Error {
    code;
    /**
     * Base Lisa error with error code
     * @param message - Error message description
     * @param code - Machine-readable error code
     */
    constructor(message, code) {
        super(message);
        this.code = code;
        this.name = "LisaError";
    }
}
/**
 * Error thrown when destination directory is not found
 */
export class DestinationNotFoundError extends LisaError {
    path;
    /**
     * Thrown when destination directory path does not exist
     * @param path - Path that was not found
     */
    constructor(path) {
        super(`Destination path does not exist: ${path}`, "DEST_NOT_FOUND");
        this.path = path;
        this.name = "DestinationNotFoundError";
    }
}
/**
 * Error thrown when destination is not a directory
 */
export class DestinationNotDirectoryError extends LisaError {
    path;
    /**
     * Thrown when destination path exists but is not a directory
     * @param path - Path that is not a directory
     */
    constructor(path) {
        super(`Destination is not a directory: ${path}`, "DEST_NOT_DIR");
        this.path = path;
        this.name = "DestinationNotDirectoryError";
    }
}
/**
 * Error thrown when JSON parsing fails
 */
export class JsonParseError extends LisaError {
    filePath;
    originalError;
    /**
     * Thrown when JSON file parsing fails
     * @param filePath - Path to the JSON file that failed to parse
     * @param originalError - Underlying parsing error
     */
    constructor(filePath, originalError) {
        super(`Failed to parse JSON file: ${filePath}`, "JSON_PARSE_ERROR");
        this.filePath = filePath;
        this.originalError = originalError;
        this.name = "JsonParseError";
    }
}
/**
 * Error thrown when JSON merge fails
 */
export class JsonMergeError extends LisaError {
    filePath;
    reason;
    /**
     * Thrown when JSON merge operation fails
     * @param filePath - Path to the JSON file that failed to merge
     * @param reason - Description of why the merge failed
     */
    constructor(filePath, reason) {
        super(`Failed to merge JSON: ${filePath} - ${reason}`, "JSON_MERGE_ERROR");
        this.filePath = filePath;
        this.reason = reason;
        this.name = "JsonMergeError";
    }
}
/**
 * Error thrown when file operation fails
 */
export class FileOperationError extends LisaError {
    operation;
    filePath;
    originalError;
    /**
     * Thrown when a file operation (read/write/copy) fails
     * @param operation - Name of the operation that failed
     * @param filePath - Path to the file involved in the operation
     * @param originalError - Underlying file system error
     */
    constructor(operation, filePath, originalError) {
        super(`File operation '${operation}' failed for: ${filePath}`, "FILE_OP_ERROR");
        this.operation = operation;
        this.filePath = filePath;
        this.originalError = originalError;
        this.name = "FileOperationError";
    }
}
/**
 * Error thrown when backup/restore fails
 */
export class BackupError extends LisaError {
    operation;
    reason;
    /**
     * Thrown when backup, restore, or cleanup operation fails
     * @param operation - Type of backup operation that failed
     * @param reason - Description of why the operation failed
     */
    constructor(operation, reason) {
        super(`Backup ${operation} failed: ${reason}`, "BACKUP_ERROR");
        this.operation = operation;
        this.reason = reason;
        this.name = "BackupError";
    }
}
/**
 * Error thrown when rollback fails
 */
export class RollbackError extends LisaError {
    reason;
    /**
     * Thrown when transaction rollback fails
     * @param reason - Description of why rollback failed
     */
    constructor(reason) {
        super(`Rollback failed: ${reason}`, "ROLLBACK_ERROR");
        this.reason = reason;
        this.name = "RollbackError";
    }
}
/**
 * Error thrown when a required dependency is missing
 */
export class DependencyMissingError extends LisaError {
    dependencies;
    /**
     * Thrown when required dependencies are not available
     * @param dependencies - List of missing dependency names
     */
    constructor(dependencies) {
        super(`Missing required dependencies: ${dependencies.join(", ")}`, "DEP_MISSING");
        this.dependencies = dependencies;
        this.name = "DependencyMissingError";
    }
}
/**
 * Error thrown when user aborts the operation
 */
export class UserAbortedError extends LisaError {
    reason;
    /**
     * Thrown when user cancels or aborts the operation
     * @param reason - Description of why the operation was aborted
     */
    constructor(reason = "User aborted the operation") {
        super(reason, "USER_ABORTED");
        this.reason = reason;
        this.name = "UserAbortedError";
    }
}
/**
 * Error thrown when git working directory has uncommitted changes
 */
export class DirtyGitError extends LisaError {
    status;
    /**
     * Thrown when git status shows uncommitted changes
     * @param status - Git status output showing the changes
     */
    constructor(status) {
        super("Working directory has uncommitted changes", "DIRTY_GIT");
        this.status = status;
        this.name = "DirtyGitError";
    }
}
//# sourceMappingURL=index.js.map