/**
 * MK2 Dimensions - Single Source of Truth
 *
 * All dimension calculations and "too small" decisions must use this module
 * FIXED: Uses getSafeViewport() for consistent safe area calculation
 */
import { getSafeViewport, MIN_COLS, MIN_ROWS } from './safeViewport.js';
/**
 * Get terminal dimensions and gate decision
 * Single source of truth for all dimension checks
 * FIXED: Uses getSafeViewport() for consistent calculation
 *
 * CRITICAL: Compare safe dimensions to required dimensions (same basis)
 */
export function getDims(screen) {
    const viewport = getSafeViewport(screen);
    // Gate logic: tooSmall = safe.w < MIN_COLS OR safe.h < MIN_ROWS
    // CRITICAL: Compare safe dimensions to required minimums (same basis)
    // Never gate on raw detected values if using safe values for layout
    const wFail = viewport.safe.w < MIN_COLS;
    const hFail = viewport.safe.h < MIN_ROWS;
    const tooSmall = wFail || hFail;
    return {
        detectedW: viewport.cols,
        detectedH: viewport.rows,
        safeW: viewport.safe.w,
        safeH: viewport.safe.h,
        requiredW: MIN_COLS,
        requiredH: MIN_ROWS,
        tooSmall,
        wFail,
        hFail,
        stdoutW: process.stdout.columns || viewport.cols,
        stdoutH: process.stdout.rows || viewport.rows,
    };
}
//# sourceMappingURL=dimensions.js.map