"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectUnrealProject = detectUnrealProject;
exports.isAmplitudePluginPresent = isAmplitudePluginPresent;
const fast_glob_1 = __importDefault(require("fast-glob"));
/**
 * Returns true when the directory contains an Unreal Engine project.
 * Primary signal: a .uproject file at the project root (Unreal-specific JSON manifest).
 */
async function detectUnrealProject(options) {
    const uprojectFiles = await (0, fast_glob_1.default)('*.uproject', {
        cwd: options.installDir,
        deep: 1,
    });
    return uprojectFiles.length > 0;
}
/**
 * Returns true if the Amplitude plugin is already extracted into the project.
 */
async function isAmplitudePluginPresent(options) {
    const upluginFiles = await (0, fast_glob_1.default)('Plugins/AmplitudeUnreal/Amplitude.uplugin', {
        cwd: options.installDir,
        deep: 3,
    });
    return upluginFiles.length > 0;
}
