import { summarizeError } from '../../utils/error-display.js';
/** @internal Run a check safely — never throws. */
export async function safeCheck(fn) {
    try {
        return await fn();
    }
    catch (err) {
        return {
            passed: false,
            summary: `Check threw unexpectedly: ${summarizeError(err)}`,
            severity: 'error',
        };
    }
}
