import { isDesktopFramework, detectDesktopFramework, getEmbeddedWebFramework, } from './platform-detector/desktop.js';
import { isGameFramework, detectGameEngine, getGameEngineLanguage, } from './platform-detector/games.js';
import { detectExtensionPlatform, getBrowserExtensionManifestVersion, } from './platform-detector/extensions.js';
import { detectPlatformSpecialty } from './detectors/platform-specialty-detector.js';
export { isDesktopFramework, detectDesktopFramework, getEmbeddedWebFramework };
export { isGameFramework, detectGameEngine, getGameEngineLanguage };
export { detectExtensionPlatform, getBrowserExtensionManifestVersion };
const MOBILE_FRAMEWORKS = new Set([
    'swiftui',
    'uikit',
    'flutter',
    'react-native',
    'compose',
    'xml-views',
    'kmp',
]);
/**
 * Determine the overall project category based on framework and filesystem signals.
 * Priority order: game > desktop > extension > mobile > web (fallback).
 */
export async function detectProjectCategory(projectPath, framework) {
    // Game engines have highest priority (Unity C# is not .NET web)
    if (isGameFramework(framework)) {
        return 'game';
    }
    const gameEngine = await detectGameEngine(projectPath, null);
    if (gameEngine !== null) {
        return 'game';
    }
    // Desktop frameworks
    if (isDesktopFramework(framework)) {
        return 'desktop';
    }
    const desktopFw = await detectDesktopFramework(projectPath, null);
    if (desktopFw !== null) {
        return 'desktop';
    }
    // Extension platforms
    const extensionPlatform = await detectExtensionPlatform(projectPath);
    if (extensionPlatform !== null) {
        if (extensionPlatform === 'vscode' || extensionPlatform === 'jetbrains') {
            return 'ide-extension';
        }
        return 'browser-extension';
    }
    // Mobile check by framework name
    if (framework !== null && MOBILE_FRAMEWORKS.has(framework)) {
        return 'mobile';
    }
    // SPEC-015a: Specialty platforms (bots, smart contracts, ML/AI, IoT)
    const specialty = await detectPlatformSpecialty(projectPath);
    if (specialty.botPlatform !== null) {
        return 'bot';
    }
    if (specialty.smartContractFramework !== null) {
        return 'smart-contract';
    }
    if (specialty.mlFrameworks.length > 0) {
        return 'ml';
    }
    if (specialty.iotPlatform !== null) {
        return 'iot';
    }
    return 'web';
}
//# sourceMappingURL=platform-detector.js.map