Ë
    âß²jÜ  ã            	       óÞ   — d Z ddl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z  deddfd„Zdede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)zTShared CLI output helpers (``print_*`` + ``prompt()``) for the setup/config wizards.é    N)ÚColorsÚcolor)Úmasked_secret_promptÚtextÚreturnc                 óP   — t        t        d| › �t        j                  «      «       y )Nú  ©Úprintr   r   ÚDIM©r   s    ú:/home/ubuntu/.hermes/hermes-agent/hermes_cli/cli_output.pyÚ
print_infor   	   s   € Ü	Œ%�"�T�F�œVŸZ™ZÓ
(Õ)ó    c                 óP   — t        t        d| › �t        j                  «      «       y )Nu   âœ“ )r   r   r   ÚGREENr   s    r   Úprint_successr      s   € Ü	Œ%�$�t�f�œvŸ|™|Ó
,Õ-r   c                 óP   — t        t        d| › �t        j                  «      «       y )Nu   âš  ©r   r   r   ÚYELLOWr   s    r   Úprint_warningr      ó   € Ü	Œ%�$�t�f�œvŸ}™}Ó
-Õ.r   c                 óP   — t        t        d| › �t        j                  «      «       y )Nu   âœ— )r   r   r   ÚREDr   s    r   Úprint_errorr      s   € Ü	Œ%�$�t�f�œvŸz™zÓ
*Õ+r   c                 óP   — t        t        d| › �t        j                  «      «       y )Nz
  r   r   s    r   Úprint_headerr      r   r   ÚmoreÚhintc                 óz   — | �| › d�nd}|rd|› d�nd}t        t        d|› |› �t        j                  «      «       y)aI  Footer for a capped listing so a cut list never reads as the whole list.

    ``more`` is the exact number of hidden rows, or ``None`` when the caller only probed
    one row past its cap (``LIMIT n+1``) and knows just that at least one more exists.
    ``hint`` names how to see the rest (``"use --limit 40 to see more"``).
    Nz morezmore not shownú (ú)Ú u     â€¦ r
   )r   r   ÚcountÚsuffixs       r   Úprint_truncatedr&      sF   € ð #Ð.ˆtˆf�E‰NÐ4D€EÙ!ˆr�$��q‰\ r€FÜ	Œ%�&˜˜ ˜xÐ(¬&¯*©*Ó
5Õ6r   Úprompt_textc                 óN  — t         j                  j                  «       rt         j                  j                  «       st	        | «      S 	 ddlm} ddlm} 	  | || «      «      S # t        $ r t	        | «      cY S w xY w# t        t        f$ r ‚ t        $ r t	        | «      cY S w xY w)a0  Read non-secret text with normal cursor-editing keys on a real TTY.

    Setup/model-selection commands run outside the chat's prompt_toolkit application, so a
    short-lived prompt is safe here. Redirected stdin/stdout keep the built-in ``input`` used by
    scripts, tests and numbered fallbacks.
    r   )Úprompt)ÚANSI)ÚsysÚstdinÚisattyÚstdoutÚinputÚprompt_toolkitr)   Úprompt_toolkit.formatted_textr*   ÚImportErrorÚKeyboardInterruptÚEOFErrorÚ	Exception)r'   Úprompt_toolkit_promptr*   s      r   Ú
line_inputr7   )   s—   € ô �I‰I×ÑÔ¤3§:¡:×#4Ñ#4Ô#6Ü�[Ó!Ð!ð"ÝBÝ6ð"Ù$¡T¨+Ó%6Ó7Ð7øô ò "Ü�[Ó!Ò!ð"ûô œxÐ(ò ØÜò "ô �[Ó!Ò!ð	"ús$   Á	A$ ÁA> Á$A;Á:A;Á>#B$Â#B$Ú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)zMPrompt for input (stripped), or ``default`` on plain Enter; "" on Ctrl-C/EOF.z [ú]r#   r	   z: )	r   r   r   r   r7   Ústripr3   r4   r   )r8   r9   r:   r%   ÚdisplayÚvalues         r   r)   r)   B   s   € á 'ˆr�'�˜!‰_¨R€FÜ�b˜˜
 6 (¨"Ð-¬v¯}©}Ó=€GðÙ2:Ô% gÔ.Ä
È7Ó@S×ZÑZÓ\ˆÙˆuÐ2 G¢M¨rÐ2øÜœxÐ(ò ÜŒÙðús   ¬)A ÁA ÁA8Á7A8c                 ór   — t        | › d|rdnd› d�«      }|s|S |j                  «       j                  d«      S )Nr!   zY/nzy/Nr"   Úy)r)   ÚlowerÚ
startswith)r8   r9   Úanswers      r   Úprompt_yes_norE   N   s=   € Ü�x�j ©G¡5¸Ð"?¸qÐAÓB€FÙØˆØ�<‰<‹>×$Ñ$ SÓ)Ð)r   )r#   )NF)T)Ú__doc__r+   Úhermes_cli.colorsr   r   Úhermes_cli.secret_promptr   Ústrr   r   r   r   r   Úintr&   r7   Úboolr)   rE   © r   r   ú<module>rM      sá   ðÙ Zã 
ç +Ý 9ð*�Sð *˜Tó *ð.˜ð . ó .ð/˜ð / ó /ð,�cð ,˜dó ,ð/�sð /˜tó /ñ	7˜# ™*ð 	7¨Cð 	7¸ó 	7ð"˜Cð " Có "ñ2	�Sð 	 3¨¡:ð 	Àð 	ÐQTó 	ñ*˜Cð *¨$ð *¸$ô *r   