
    `gj
              	           d Z ddlmZmZ ddl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.
    )Colorscolor)masked_secret_prompttextreturnNc                 P    t        t        d|  t        j                               y)z"Print a dim informational message.  N)printr   r   DIMr   s    H/root/.hermes/venv/lib/python3.12/site-packages/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        |      }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   r   inputstripKeyboardInterruptEOFErrorr
   )r   r   r   suffixdisplayvalues         r   promptr*   +   s     !(r'!_RFb
6("-v}}=G	(1E'NEu2GMr2x( s   ,A A A;:A;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   G   sA    5Dxj4&*+F<<>$$S))r   )NF)T)__doc__hermes_cli.colorsr   r   hermes_cli.secret_promptr   strr   r   r   r   r   boolr*   r2    r   r   <module>r9      s    , 9*S *T *
. . .
/ / /
,c ,d ,
/s /t / 4Z  		8*C *$ *$ *r   