o
    PL
j©  ã                   @   sF   d Z ddlZddlZdefdd„ZG dd„ dƒZdedefd	d
„ZdS )z3Shared ANSI color utilities for Hermes CLI modules.é    NÚreturnc                   C   s:   t j d¡dur
dS t j d¡dkrdS tj ¡ sdS dS )z¶Return True when colored output is appropriate.

    Respects the NO_COLOR environment variable (https://no-color.org/)
    and TERM=dumb, in addition to the existing TTY check.
    ÚNO_COLORNFÚTERMÚdumbT)ÚosÚenvironÚgetÚsysÚstdoutÚisatty© r   r   ú5/home/kuhnn/.hermes/hermes-agent/hermes_cli/colors.pyÚshould_use_color   s   
r   c                   @   s0   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )ÚColorsz[0mz[1mz[2mz[31mz[32mz[33mz[34mz[35mz[36mN)Ú__name__Ú
__module__Ú__qualname__ÚRESETÚBOLDÚDIMÚREDÚGREENÚYELLOWÚBLUEÚMAGENTAÚCYANr   r   r   r   r      s    r   Útextc                 G   s   t ƒ s| S d |¡|  tj S )zBApply color codes to text (only when color output is appropriate).Ú )r   Újoinr   r   )r   Úcodesr   r   r   Úcolor"   s   r    )Ú__doc__r   r	   Úboolr   r   Ústrr    r   r   r   r   Ú<module>   s    