// cli/colors.ts — ANSI color helpers respecting NO_COLOR env and TTY detection (SPEC-124)
/**
 * Determine whether colored output should be used.
 * Returns false when NO_COLOR is set or stdout is not a TTY.
 */
export function shouldColor() {
    if (process.env.NO_COLOR !== undefined) {
        return false;
    }
    if (typeof process.stdout.isTTY === 'boolean') {
        return process.stdout.isTTY;
    }
    return false;
}
function wrap(code, reset) {
    return (s) => (shouldColor() ? `${code}${s}${reset}` : s);
}
export const red = wrap('\x1b[31m', '\x1b[39m');
export const green = wrap('\x1b[32m', '\x1b[39m');
export const yellow = wrap('\x1b[33m', '\x1b[39m');
export const blue = wrap('\x1b[34m', '\x1b[39m');
export const cyan = wrap('\x1b[36m', '\x1b[39m');
export const bold = wrap('\x1b[1m', '\x1b[22m');
export const dim = wrap('\x1b[2m', '\x1b[22m');
export const gray = wrap('\x1b[90m', '\x1b[39m');
//# sourceMappingURL=colors.js.map