"use strict";
/**
 * Environment Health Checks
 *
 * Check platform, SSH, TTY, and browser capability.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkEnvironment = void 0;
const environment_diagnostics_1 = require("../../management/environment-diagnostics");
/**
 * Check environment (platform, SSH, TTY, browser capability)
 */
function checkEnvironment() {
    const diag = (0, environment_diagnostics_1.getEnvironmentDiagnostics)();
    let status = 'ok';
    let message = 'Browser available';
    if (diag.detectedHeadless) {
        if (diag.platform === 'win32' && diag.ttyStatus === 'undefined') {
            status = 'warning';
            message = 'Possible headless false positive (Windows)';
        }
        else if (diag.sshSession) {
            status = 'info';
            message = 'SSH session (headless mode)';
        }
        else {
            status = 'info';
            message = 'Headless environment';
        }
    }
    return {
        id: 'environment',
        name: 'Environment',
        status,
        message,
        details: `${diag.platformName} | SSH: ${diag.sshSession ? 'Yes' : 'No'} | Browser: ${diag.browserReason}`,
    };
}
exports.checkEnvironment = checkEnvironment;
//# sourceMappingURL=environment-checks.js.map