
    
Bj	              	           d Z ddlZddlmZmZ deddfdZdeddfdZdeddfdZdeddfd	Z	deddfd
Z
	 	 ddededz  dedefdZddededefdZy)zShared CLI output helpers for Hermes CLI modules.

Extracts the identical ``print_info/success/warning/error`` and ``prompt()``
functions previously duplicated across setup.py, tools_config.py,
mcp_config.py, and memory_setup.py.
    N)Colorscolortextreturnc                 P    t        t        d|  t        j                               y)z"Print a dim informational message.  N)printr   r   DIMr   s    :/home/ubuntu/.hermes/hermes-agent/hermes_cli/cli_output.py
print_infor      s    	%"TFVZZ
()    c                 P    t        t        d|  t        j                               y)u.   Print a green success message with ✓ prefix.u   ✓ N)r	   r   r   GREENr   s    r   print_successr      s    	%$tfv||
,-r   c                 P    t        t        d|  t        j                               y)u/   Print a yellow warning message with ⚠ prefix.u   ⚠ Nr	   r   r   YELLOWr   s    r   print_warningr          	%$tfv}}
-.r   c                 P    t        t        d|  t        j                               y)u*   Print a red error message with ✗ prefix.u   ✗ N)r	   r   r   REDr   s    r   print_errorr      s    	%$tfvzz
*+r   c                 P    t        t        d|  t        j                               y)zPrint a bold yellow header.z
  Nr   r   s    r   print_headerr   $   r   r   questiondefaultpasswordc                    |rd| dnd}t        d|  | dt        j                        }	 |rt        j                  |      }nt	        |      }|j                         }|r|S |xs dS # t        t        f$ r t                Y yw xY w)a]  Prompt the user for input with optional default and password masking.

    Replaces the four independent ``_prompt()`` / ``prompt()`` implementations
    in setup.py, tools_config.py, mcp_config.py, and memory_setup.py.

    Returns the user's input (stripped), or *default* if the user presses Enter.
    Returns empty string on Ctrl-C or EOF.
    z [] r   z: )	r   r   r   getpassinputstripKeyboardInterruptEOFErrorr	   )r   r   r   suffixdisplayvalues         r   promptr*   ,   s     !(r'!_RFb
6("-v}}=G	OOG,E'NEu2GMr2x( s   6A) #A) )BBc                 v    |rdnd}t        |  d| d      }|s|S |j                         j                  d      S )z)Prompt for a yes/no answer. Returns bool.zY/nzy/Nz ()y)r*   lower
startswith)r   r   hintanswers       r   prompt_yes_nor2   H   sA    5Dxj4&*+F<<>$$S))r   )NF)T)__doc__r"   hermes_cli.colorsr   r   strr   r   r   r   r   boolr*   r2    r   r   <module>r8      s     +*S *T *
. . .
/ / /
,c ,d ,
/s /t / 4Z  		8*C *$ *$ *r   