+
    jHàj2Œ  ã            	       óŽ  a € Rx tr0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHt ^ RI H!t!H"t" ^ R	I#H$t$H%t%H&t&H't' ^ R
I(H)t) ]PT                  ! ]+4      t,]! ]-4      P\                  P\                  P_                  4       t0Rt1]Pd                  ! R4      t3RR/R R llt4R R lt5R R lt6R R lt7R R lt8R R lt9RyR R llt:R R lt;RzR R  llt< ! R! R"]=4      t> ! R# R$]>4      t? ! R% R&]>4      t@ ! R' R(4      tA]! R)RR*7      tB] ^ k RyR+ R, lltC]
R- 4       tDR. R/ ltER0R1/R2 R3 lltFR{R4 R5 lltGR{R6 R7 lltHR8 R9 ltIR|R: R; lltJRyR< R= lltKR> R? ltLR@ RA ltMRB RC ltNRD RE ltORF RG ltPRHR/RI RJ lltQRK RL ltR]S3RM RN lltTRO RP ltUR}tVRQ RR ltWR~RS RT lltXRtYRV RW ltZRX RY lt[^ RZI\H]t] ^ R[I^H_t_ ^ R\I`Hata ^ R]IbHctc ^ R^IdHete ^ R_IfHgtg ^ R`IhHitiHjtj RaRb]Q3RcRd]]3ReRf]_3RgRh]a3RiRj]X3RkRl]Z3RmRn]W3.tkRo tlRp Rq ltmRrRU/Rs Rt lltnR€toRu tpRv Rw ltqR# )�a…  Interactive setup wizard for Hermes Agent (config lives in ~/.hermes/).

Independently-runnable sections: Model & Provider, Terminal Backend, Agent Settings, Messaging
Platforms, Tools. Section bodies live in sibling setup_* modules and are re-exported here; they
resolve shared prompt/config helpers lazily through this module so test patches on
``hermes_cli.setup.<name>`` keep working.
N)Úcontextmanager)Ú
ContextVar)ÚPath)ÚCallable)ÚMenuNavigationEventÚMenuNavigationStart)Úcfg_getÚDEFAULT_CONFIGÚget_hermes_homeÚget_config_pathÚget_env_pathÚload_configÚsave_configÚsave_env_valueÚremove_env_valueÚget_env_valueÚensure_hermes_home)ÚColorsÚcolor)Úprint_errorÚ
print_infoÚprint_successÚprint_warning)Úmasked_secret_promptz*https://hermes-agent.nousresearch.com/docsz\x1b\[\s*200~|\x1b\[\s*201~ÚgapFc                ó0   € V ^8„  d   QhR\         R\        /# )é   Útitler   ©ÚstrÚbool)Úformats   "Ú5/home/ubuntu/.hermes/hermes-agent/hermes_cli/setup.pyÚ__annotate__r#   '   s   € ÷ ;ñ ;œð ;¤Tñ ;ó    c               ó¨   € V'       d   \        4        \        4        \        \        RV  2\        P                  \        P                  4      4       R# )zDPrint a section header (``gap`` adds an extra blank line before it).u   â—† N)Úprintr   r   ÚCYANÚBOLD)r   r   s   &$r"   Úprint_headerr)   '   s.   € ç
ÜŒÜ	„GÜ	Œ%�$�u�g�¤§¡¬V¯[©[Ó
9Ö:r$   c                ó6   € V ^8„  d   QhR\         R,          RR/# )r   ÚlinesNÚreturn©r   )r!   s   "r"   r#   r#   /   s   € ÷ 6ñ 6”#˜•*ð 6 ñ 6r$   c                 óN   € V  F  pVf   \        4        K  \        V4       K   	  R# )zGprint_info each line in order; ``None`` emits a bare blank ``print()``.N)r&   r   ©r+   Úlines   * r"   Ú_infor1   /   s   € ãˆØ’<ŒŽ¤Z°Ö%5ó r$   c                ó<   € V ^8„  d   QhR\         R\        R\         /# )r   ÚparentÚkeyr,   ©Údictr   )r!   s   "r"   r#   r#   5   s!   € ÷ ñ ”dð ¤ð ¬ñ r$   c                ó`   € V P                  V4      p\        V\        4      '       g   / ;q V&   V# )zM``parent[key]`` as a dict, replacing a missing or non-dict value with ``{}``.)ÚgetÚ
isinstancer6   )r3   r4   Úchilds   && r"   Ú	_sub_dictr;   5   s-   € à�J‰J�s‹O€EÜ�eœT×"Ò"Ø Ð ˆ�s‘Ø€Lr$   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úconfigr,   r5   )r!   s   "r"   r#   r#   =   s   € ÷ 	-ñ 	-¤dð 	-¬sñ 	-r$   c                 ó„  € V P                  R 4      p\        V\        4      '       g   R# VP                  R4      p\        V\        4      '       dA   ^ RIHp V! V4      ;'       g    / pVP                  R4      RJ d   RMVP                  R4      p\        T;'       g    R4      P                  4       P                  4       # )ÚagentÚ Úreasoning_effort)Úparse_reasoning_effortÚenabledFÚnoneÚeffort)r8   r9   r6   Úhermes_constantsrB   r   ÚstripÚlower)r=   Ú	agent_cfgrE   rB   Úparseds   &    r"   Ú_current_reasoning_effortrK   =   s”   € Ø—
‘
˜7Ó#€IÜ�i¤×&Ò&ÙØ�]‰]Ð-Ó.€FÜ�&œ$×ÒÝ;Ù'¨Ó/×5Ð5°2ˆØ!Ÿ:™: iÓ0°EÓ9‘¸v¿z¹zÈ(Ó?SˆÜˆv�|ˆ|˜Ó×"Ñ"Ó$×*Ñ*Ó,Ð,r$   c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   r=   rE   r,   Nr5   )r!   s   "r"   r#   r#   I   s!   € ÷ <ñ <¤$ð <´ð <¸ñ <r$   c                 ó$   € V\        V R 4      R&   R# )r?   rA   N)r;   )r=   rE   s   &&r"   Ú_set_reasoning_effortrN   I   s   € Ø5;„Iˆf�gÓÐ1Ó2r$   c                ó$   € V ^8„  d   QhR\         /# ©r   r,   ©r    )r!   s   "r"   r#   r#   M   s   € ÷ ñ œdñ r$   c                 óv   €  \        \        P                  P                  4       4      #   \         d     R# i ; i)z;Return True when stdin looks like a usable interactive TTY.F)r    ÚsysÚstdinÚisattyÚ	Exception© r$   r"   Úis_interactive_stdinrX   M   s1   € ðÜ”C—I‘I×$Ñ$Ó&Ó'Ð'øÜô Úðús   ‚&) ©8·8c                ó6   € V ^8„  d   QhR\         R,          RR/# )r   ÚreasonNr,   r-   )r!   s   "r"   r#   r#   U   s"   € ÷ Yñ Y´°dµ
ð YÀdñ Yr$   c                óà   € \        4        \        \        R\        P                  \        P                  4      4       \        4        V '       d   \        V 4       \        RRRRRRRRR	R4
       R# )
z8Print guidance for headless/non-interactive setup flows.u)   â˜¤ Hermes Setup â€” Non-interactive modez+The interactive wizard cannot be used here.Nz@Configure Hermes using environment variables or config commands:z)  hermes config set model.provider customz;  hermes config set model.base_url http://localhost:8080/v1z1  hermes config set model.default your-model-namezUOr set OPENROUTER_API_KEY (OpenRouter) / OPENAI_API_KEY (OpenAI) in your environment.zERun 'hermes setup' in an interactive terminal to use the full wizard.)r&   r   r   r'   r(   r   r1   )rZ   s   &r"   Ú#print_noninteractive_setup_guidancer\   U   sV   € ä	„GÜ	Œ%Ð;¼V¿[¹[Ì&Ï+É+Ó
VÔWÜ	„GßÜ�6ÔÜ	Ð
7¸Ø
LØ
5Ø
GØ
=¸tØ
aØ
QÐSWöYr$   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úvaluer,   r-   )r!   s   "r"   r#   r#   e   s   € ÷ bñ b¤#ð b¬#ñ br$   c                ón   € \        V \        4      '       d   V '       d   \        P                  RV 4      # T # )z@Strip terminal bracketed-paste control markers from pasted text.r@   )r9   r   Ú_BRACKETED_PASTE_PATTERNÚsub)r^   s   &r"   Ú_sanitize_pasted_inputrb   e   s+   € ä6@ÀÌ×6LÒ6L×QVÔ#×'Ñ'¨¨EÓ2ÐaÐ\aÐar$   c                óV   € V ^8„  d   QhR\         R\         R,          R\        R\         /# )r   ÚquestionÚdefaultNÚpasswordr,   r   )r!   s   "r"   r#   r#   j   s-   € ÷ ñ ”Sð ¤3¨¥:ð Äð ÔQTñ r$   c                ól  € \        V'       d	   V  RV R2MV  R2\        P                  4      p V'       d   \        V4      pM^ RIHp V! V4      p\        V4      P                  4       ;'       g    T;'       g    R#   \        \        3 d%    \        4        \        P                  ! ^4        R# i ; i)z'Prompt for input with optional default.ú [ú]: z: )Ú
line_inputr@   N)r   r   ÚYELLOWr   Úhermes_cli.cli_outputrj   rb   rG   ÚKeyboardInterruptÚEOFErrorr&   rS   Úexit)rd   re   rf   Údisplayr^   rj   s   &&&   r"   Úpromptrq   j   s“   € ä·7�x�j  7 )¨3Ñ/À8À*ÈBÀÔQW×Q^ÑQ^Ó_€Gð	ßÜ(¨Ó1‰Eå8Ù˜wÓ'ˆEÜ% eÓ,×2Ñ2Ó4×EÐE¸×EÐEÀ2ÐEøÜœxÐ(ô ÜŒÜ�Š��ðús"   ¯A> ·9A> Á1	A> Á;A> Á>1B3Â2B3c                   ó   € ] tR t^}tRtRtR# )Ú_SetupControlFlowz¡Bypass provider error handlers that intentionally catch ``Exception`` so navigation reaches
the outer state machine unchanged and it can replay the prior prompt.rW   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__rW   r$   r"   rs   rs   }   s   † õMr$   rs   c                   ó   € ] tR t^‚tRtRtR# )Ú_SetupCancelledzBInternal control flow for cancelling the interactive setup wizard.rW   Nrt   rW   r$   r"   r|   r|   ‚   s   † ÝLr$   r|   c                   óB   a a€ ] tR t^†t oRtV3R lV 3R lltRtVtV ;t# )Ú_SetupGoBackz?Internal control flow for returning to an earlier setup choice.c                ó    <€ V ^8„  d   QhRS[ /# )r   Úprompt_index©Úint)r!   Ú__classdict__s   "€r"   r#   Ú_SetupGoBack.__annotate__‰   s   ø€ ÷ )ñ )¡Sñ )r$   c                ó2   <€ \         SV `  V4       Wn        R # ©N)ÚsuperÚ__init__r€   )Úselfr€   Ú	__class__s   &&€r"   rˆ   Ú_SetupGoBack.__init__‰   s   ø€ Ü‰Ñ˜Ô&Ø(Ör$   )r€   )	ru   rv   rw   rx   ry   rˆ   rz   Ú__classdictcell__Ú__classcell__)rŠ   rƒ   s   @@r"   r~   r~   †   s   ù‡ € ÙI÷)÷ )ó )r$   r~   c                   óX   a € ] tR t^Žt o RtRR
R^ /V 3R lR lltRV 3R lR lltR	tV tR# )Ú_SetupNavigationStatezAPer-invocation navigation state for the synchronous setup wizard.Úsection_indexr€   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   r�   r€   r�   )r!   rƒ   s   "€r"   r#   Ú"_SetupNavigationState.__annotate__‘   s   ø€ ÷ )ñ )©ð )Áñ )r$   c               ó4   € V P                  V4       W n        R # r†   )Úresetr€   )r‰   r�   r€   s   &$$r"   rˆ   Ú_SetupNavigationState.__init__‘   s   € Ø�
‰
�=Ô!Ø(Ör$   Nc                ó8   <€ V ^8„  d   QhRS[ RS[R,          RR/# )r   r�   ÚreplayNr,   )r‚   Úlist)r!   rƒ   s   "€r"   r#   r’   •   s+   ø€ ÷ Hñ H¡3ð H±T¸Dµ[ð HÈDñ Hr$   c                ó†   € Wn         ^ V n        RV n        . V n        \        P
                  ! T;'       g    . 4      V n        R# )zHRewind per-section counters (entering a section, or leaving the wizard).Néÿÿÿÿ)r�   r€   Úactive_prompt_indexÚresolved_choicesÚcopyÚdeepcopyÚreplay_choices)r‰   r�   r—   s   &&&r"   r”   Ú_SetupNavigationState.reset•   s7   € à*ÔØˆÔØ#%ˆÔ Ø.0ˆÔÜ,0¯MªM¸&¿,¸,ÀBÓ,GˆÖr$   )r›   r€   rŸ   rœ   r�   rš   )rš   N)	ru   rv   rw   rx   ry   rˆ   r”   rz   rŒ   )rƒ   s   @r"   r�   r�   Ž   s2   ø‡ € ÙKð)¨rð )Àq÷ )ò )÷H÷ Hð Hr$   r�   Úhermes_setup_navigation©re   c                óJ   € V ^8„  d   QhR\         R\        R\        R,          /# )r   Úeventr^   r,   N)r   Úobjectr   )r!   s   "r"   r#   r#   ¡   s)   € ÷ ñ Ô)<ð ÄVð ÔWjÐmqÕWqñ r$   c                ó  € \         P                  4       pVf   R# V \        P                  J dÂ   VP                  ^ 8  d   RVn        \        4       # VP                  ;q2n        V;P                  ^,          un        VP                  ^ 8„  ;'       g    V^ 8„  pV\        VP                  4      8  d3   \        V\        P                  ! VP                  V,          4      R7      # \        VR7      # V \        P                  J d:   VP
                  pV^ 8¼  d%   \        P                  ! V4      .VP                  VR% R# V \        P                  J d   \        4       hV \        P                   J d   \#        VP
                  4      hR# )z<Translate shared curses menu events into setup control flow.N)Ú
allow_backÚreplay_value)r§   rš   )Ú_SETUP_NAVIGATIONr8   r   ÚBEGINr�   r›   r   r€   ÚlenrŸ   r�   rž   ÚRESOLVErœ   ÚCANCELr|   ÚBACKr~   )r¤   r^   ÚstateÚidxr§   r€   s   &&    r"   Ú_handle_setup_menu_navigationr±   ¡   sC  € ä×!Ñ!Ó#€EØ‚}ÙØÔ#×)Ñ)Ó)Ø×Ñ Ô"Ø(*ˆEÔ%Ü&Ó(Ð(Ø*/×*<Ñ*<Ð<ˆÔ'Ø×Ò˜aÕÕØ×(Ñ(¨1Ñ,×7Ð7°°a±ˆ
Ø”�U×)Ñ)Ó*Ô*Ü&°*Ì4Ï=Ê=ÐY^×YmÑYmÐnqÕYrÓKsÔtÐtÜ"¨jÔ9Ð9ØÔ#×+Ñ+Ó+Ø×0Ñ0ˆØ˜1ÔÜ59·]²]À5Ó5IÐ4JˆE×"Ñ" < =Ð1ÙØÔ#×*Ñ*Ó*ÜÓÐØÔ#×(Ñ(Ó(Ü˜5×4Ñ4Ó5Ð5Ùr$   c               #  óø   "  € ^ RI Hp Hp \        P	                  \        4       4      pV! \        4      p Rx € V ! V4       \        P                  V4       R#   T ! T4       \        P                  T4       i ; i5i)z?Install and reliably restore the setup menu navigation context.)Úreset_menu_navigation_handlerÚset_menu_navigation_handlerN)Úhermes_cli.curses_uir³   r´   r©   Úsetr�   r±   r”   )r³   r´   ÚtokenÚ
menu_tokens       r"   Ú_setup_navigation_scoper¹   ¼   sa   é € ÷ `Ü×!Ñ!Ô"7Ó"9Ó:€EÙ,Ô-JÓK€Jð'Ûá% jÔ1Ü×Ñ Ö&øñ 	& jÔ1Ü×Ñ Õ&üs   ‚2A:µA ¹A:ÁA7Á7A:c                ór   € V ^8„  d   QhR\         \        \        \        . R3,          3,          ,          RR/# )r   ÚstepsNr,   )r˜   Útupler   r   )r!   s   "r"   r#   r#   É   s2   € ÷ )ñ )œD¤¤s¬H°R¸°XÕ,>Ð'>Õ!?Õ@ð )ÀTñ )r$   c           
     óR  aa	a
€ \         P                  4       o
^ o	/ o/ pR VV	V
3R llp S	\        V 4      8  dL   V S	,          w  r4S
e#   S
P                  S	VP	                  S	. 4      4        V! 4        T! 4        S	^,          o	K[   S
e   S
P                  4        R# R#   \
         dä   pT! 4        TP                  ^ 8”  d   S	pTP                  ^,
          pM?\        ^ S	^,
          4      p\        ^ \        SP                  T. 4      4      ^,
          4      p\        P                  ! SP                  T. 4      RT 4      Y&   \        4        TS	8X  d   \        RT R24       M\        RY,          ^ ,           R24       To	 Rp?EK]  Rp?ii ; i  S
e   S
P                  4        i i ; i)zÑRun setup sections with left-arrow navigation: at a section's first choice it returns to
the previous section; from a later choice it replays earlier selections invisibly and reopens
only the preceding prompt.c                ó   € V ^8„  d   QhRR/# ©r   r,   NrW   )r!   s   "r"   r#   Ú&_run_setup_steps.<locals>.__annotate__Ò   s   € ÷ Vñ V˜Tñ Vr$   c                  óZ   <€ Se&   \         P                  ! SP                  4      S S&   R # R # r†   )r�   rž   rœ   )Úanswers_by_sectionr�   r¯   s   €€€r"   Ú_record_answersÚ)_run_setup_steps.<locals>._record_answersÒ   s(   ø€ ØÒÜ04·²¸e×>TÑ>TÓ0UÐ˜}Ó-ñ r$   Nz$Returning to the previous choice in z...zReturning to )r©   r8   r«   r”   Úpopr~   r€   Úmaxr�   rž   r&   r   )r»   Úreplay_by_sectionrÃ   ÚlabelÚactionÚ
navigationÚprevious_indexÚtarget_promptrÂ   r�   r¯   s   &       @@@r"   Ú_run_setup_stepsrÍ   É   s›  ú€ ô ×!Ñ!Ó#€EØ€MØ24ÐØ13Ð÷Vò VðØœc %›jÔ(Ø! -Õ0‰MˆEØÒ Ø—‘˜MÐ+<×+@Ñ+@ÀÐPRÓ+SÔTðÙ”ñ$ ÔØ˜QÕŠMð1 )ð4 ÒØ�K‰KŽMñ øô)  ô ÙÔ!Ø×*Ñ*¨QÔ.Ø%2�NØ$.×$;Ñ$;¸aÕ$?‘Mä%(¨¨M¸AÕ,=Ó%>�NÜ$'¨¬3Ð/A×/EÑ/EÀnÐVXÓ/YÓ+ZÐ]^Õ+^Ó$_�MÜ48·M²MØ&×*Ñ*¨>¸2Ó>¸~ÀÐNó5PÐ!Ñ1ä”Ø! ]Ô2ÜÐ!EÀeÀWÈCÐPÕQä ¨uÕ/DÀQÕ/GÐ.HÈÐLÔMØ .�Þûð!ûð( ÒØ�K‰K�Mð ús7   ªAF Á,B Á3F ÂFÂ)CFÆ F ÆFÆF ÆF&Úcancelled_messagezSetup cancelled.c                óR   € V ^8„  d   QhR\         R\        . R3,          R\         RR/# )r   rÈ   rÉ   NrÎ   r,   )r   r   )r!   s   "r"   r#   r#   õ   s5   € ÷ 	+ñ 	+Üð	+Ü   T Õ*ð	+ÜBEð	+à	ñ	+r$   c               óº   € \        4       ;_uu_ 4         \        W3.4       RRR4       R#   \         d    \        RT4        L#i ; i  + '       g   i     R# ; i)u¨   Run a setup-style menu flow with Escape and nested Left navigation â€” for commands such as
``hermes model`` that use the wizard's pickers outside ``run_setup_wizard``.N)r¹   rÍ   r|   r1   )rÈ   rÉ   rÎ   s   &&$r"   Ú run_setup_action_with_navigationrÑ   õ   sO   € ô
 
!×	"Õ	"ð	+Ü˜u˜oÐ.Ô/÷ 
#Ñ	"øô ô 	+Ü�$Ð)Ö*ð	+ú÷ 
#×	"Ð	"ús&   “A	•,¬AÁA	ÁAÁA	Á	A	c          
      ób   € V ^8„  d   QhR\         R\        R\        R\         R,          R\        /# ©r   rd   Úchoicesre   ÚdescriptionNr,   ©r   r˜   r‚   )r!   s   "r"   r#   r#     s>   € ÷ mñ m¤Cð m´$ð mÄð mÔWZÐ]aÕWað mÔmpñ mr$   c                ó&   € ^ RI Hp V! WVRVR7      # )z?Single-select menu using curses. Delegates to curses_radiolist.)Úcurses_radiolist)ÚselectedÚcancel_returnsrÕ   rš   )rµ   rØ   )rd   rÔ   re   rÕ   rØ   s   &&&& r"   Ú_curses_prompt_choicerÛ     s   € å5Ù˜H¸ÐPRÐ`kÔlÐlr$   c          
      ób   € V ^8„  d   QhR\         R\        R\        R\         R,          R\        /# rÓ   rÖ   )r!   s   "r"   r#   r#   
  s5   € ÷ ñ œCð ¬$ð ¼ð ÌsÐUYÍzð Ôehñ r$   c                ón   € \        WW#R7      pV^ 8  d   V# WB8X  d   \        RR4       V# \        4        V# )a  Prompt for a choice from a list with arrow key navigation. Escape cancels an active setup
wizard; outside setup it keeps the default (the curses component owns its own numbered
fallback, so a cancel result must never open another prompt). Ctrl+C exits the wizard.©rÕ   z  Skipped (keeping current)N)rÛ   r1   r&   )rd   rÔ   re   rÕ   r°   s   &&&& r"   Úprompt_choicerß   
  s;   € ô   °7Ô
T€CØ
ˆQ„wØˆØ
„~ÜÐ+¨TÔ2ØˆÜ	„GØ€Jr$   c                ó$   € V ^8„  d   QhR\         /# rP   rQ   )r!   s   "r"   r#   r#     s   € ÷ eñ eœ4ñ er$   c                 ó€   € \         P                  P                  RR4      P                  4       P	                  4       R9   # )u  True when no human is available to answer a prompt: the dashboard/desktop spawn CLI actions
with ``stdin=DEVNULL`` and ``HERMES_NONINTERACTIVE=1`` (``hermes_cli/web_server.py``), where a
prompt that aborts on EOF would kill the spawned action â€” callers fall back to their default.ÚHERMES_NONINTERACTIVEr@   >   Ú1ÚonÚyesÚtrue)ÚosÚenvironr8   rG   rH   rW   r$   r"   Úis_noninteractiveré     s2   € ô �:‰:�>‰>Ð1°2Ó6×<Ñ<Ó>×DÑDÓFÐJdÑdÐdr$   c                óV   € V ^8„  d   QhR\         R\        R\         R,          R\        /# )r   rd   re   rÕ   Nr,   r   )r!   s   "r"   r#   r#     s-   € ÷ /ñ /œCð /¬$ð /ÄCÈ$ÅJð /ÔZ^ñ /r$   c           
     ó"  € \        4       '       d   V# \        P                  4       e   \        T RR.V'       d   ^ M^VR7      ^ 8H  # V'       d   RMRp  \	        \        V  RV R2\        P                  4      4      P                  4       P                  4       pR	TR
RRRRRRR/P                  X4      pTe   T# \        R4       Ku    \         d$    \        4        \        P                  ! ^4        L[\         d    \        4        Tu # i ; i)aX  Prompt for yes/no. Ctrl+C exits; empty input, ``HERMES_NONINTERACTIVE=1`` or a
closed/redirected stdin return ``default`` instead of aborting the whole process.
``description`` is the context the question refers to, shown above it in setup's full-screen
menu, which hides everything printed before it; the line prompt keeps that text on screen.ÚYesÚNorÞ   zY/nzy/NTrh   ri   r@   Úyrå   ÚnFÚnozPlease enter 'y' or 'n')ré   r©   r8   rÛ   Úinputr   r   rk   rG   rH   rm   r&   rS   ro   rn   r   )rd   re   rÕ   Údefault_strr^   Úanswers   &&&   r"   Úprompt_yes_norô     sú   € ô
 ×ÒØˆô ×ÑÓÒ*Ü$ X°°t¨}Ç7¹aÐPQÐ_jÔkÐopÑpÐpß"‘%¨€KØ
ð		Üœ% 8 *¨B¨{¨m¸3Ð ?ÄÇÁÓOÓP×VÑVÓX×^Ñ^Ó`ˆEð �g˜s D¨%°°s¸EÀ4ÈÐO×SÑSÐTYÓZˆØÒØˆMÜÐ-Ö.øô !ô 	ÜŒGÜ�HŠH�QŽKÜô 	ô ŒGØŠNð		ús   ÁAC Ã+DÃ5DÃ>DÄDc                óV   € V ^8„  d   QhR\         R\        R\        R,          R\        /# )r   r   ÚitemsÚpre_selectedNr,   )r   r˜   )r!   s   "r"   r#   r#   <  s3   € ÷ Kñ KœCð K¬ð K¼DÀ4½Kð KÔSWñ Kr$   c           	     ó^   € ^ RI Hp \        T;'       g    . 4      p\        V! WWDR7      4      # )z¤Multi-select checklist; returns the sorted indices of selected items. ``pre_selected``
start checked; Space toggles, Enter confirms, cancel keeps the pre-selection.)Úcurses_checklist)rÚ   )rµ   rù   r¶   Úsorted)r   rö   r÷   rù   Úpres   &&&  r"   Úprompt_checklistrü   <  s,   € õ 6Ü
ˆl× Ð ˜bÓ
!€CÜÑ" 5°ÔIÓJÐJr$   c                ó(   € V ^8„  d   QhR\         RR/# )r   r   r,   Nr-   )r!   s   "r"   r#   r#   D  s   € ÷ ñ œð  ñ r$   c                ó|   € \        4        \        \        RV  R2\        P                  4      4       \        4        R# )uV   Blank-padded cyan ``â”€â”€â”€ title â”€â”€â”€`` divider used by the key-entry screens.u     â”€â”€â”€ u
    â”€â”€â”€N)r&   r   r   r'   )r   s   &r"   Ú_section_rulerÿ   D  s(   € ä	„GÜ	Œ%�,˜u˜g ZÐ0´&·+±+Ó
>Ô?Ü	†Gr$   c                ó$   € V ^8„  d   QhR\         /# )r   Úvar©r6   )r!   s   "r"   r#   r#   K  s   € ÷ dñ dœñ dr$   c                óª  € V P                  R. 4      pRP                  VR,          4      p\        V4      ^8”  d   VR\        V4      ^,
           R2,          p\        V P                  RV R,          4      4       V'       d   \	        RV 24       V P                  R	4      '       d   \	        R
V R	,           24       \        4        \        V RR4       R# )zEDisplay a nicely formatted API key input screen for a single env var.Útoolsú, :Né   Nz, +z morerÕ   Únamez  Enables: Úurlz  Get your key at: u     âœ“ Savedz/  Skipped (configure later with 'hermes setup')N)r8   Újoinr«   rÿ   r   r&   Ú_prompt_and_save_env_var)r  r  Ú	tools_strs   &  r"   Ú_prompt_api_keyr  K  s§   € à�G‰G�G˜RÓ €EØ—	‘	˜% �)Ó$€IÜ
ˆ5ƒz�A„~Ø�sœ3˜u›:¨�>Ð*¨%Ð0Õ0ˆ	Ü�#—'‘'˜-¨¨V­Ó5Ô6ßÜ�[  Ð,Ô-Ø
‡w�wˆu‡~‚~ÜÐ(¨¨U­¨Ð5Ô6Ü	„GÜ˜S -Ð1bÖcr$   c                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r   r  Ú	saved_msgÚskipped_msgr,   Nr5   )r!   s   "r"   r#   r#   Z  s(   € ÷ #ñ #¤$ð #´3ð #ÄSð #ÈTñ #r$   c                óê   € \        RV P                  RV R,          4       2\        V P                  R4      4      R7      pV'       d!   \        V R,          V4       \	        V4       R# \        V4       R# )z[Prompt for one env-var value (masked when secret); persist and confirm, or report the skip.z  rq   r  rf   )rf   N)rq   r8   r    r   r   r   )r  r  r  r^   s   &&& r"   r
  r
  Z  sU   € ä�R˜Ÿ™ ¨#¨f­+Ó6Ð7Ð8Ä4ÈÏÉÐPZÓH[ÓC\Ô]€EßÜ�s˜6•{ EÔ*Ü�iÖ ä�kÖ"r$   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r  r,   r   )r!   s   "r"   r#   r#   d  s   € ÷ ñ œCð ¤Dñ r$   c                 ój   €  \         P                  P                  V 4      R J#   \         d     R# i ; i©NF)Ú	importlibÚutilÚ	find_specrV   )r  s   &r"   Ú_module_installedr  d  s3   € ðÜ�~‰~×'Ñ'¨Ó-°TÐ9Ð9øÜô Úðús   ‚ # £2±2c                ó(   € V ^8„  d   QhR\         RR/# )r   r+   r,   Nr-   )r!   s   "r"   r#   r#   k  s   € ÷ Vñ Vœ#ð V $ñ Vr$   c                 óþ   € \        4        \        \        R\        P                  4      4       V  F&  p\        \        V\        P                  4      4       K(  	  \        \        R\        P                  4      4       R# )zNPrint the magenta box banner: top border, the given body lines, bottom border.u±   â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”�u±   â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜N)r&   r   r   ÚMAGENTAr/   s   * r"   Ú_print_bannerr  k  s|   € ä	„GÜ	Œ%ð  Dô  FL÷  FTñ  FTó  Uô  VÛˆÜŒe�Dœ&Ÿ.™.Ó)Ö*ñ ä	Œ%ð  Dô  FL÷  FTñ  FTó  Uö  Vr$   Úquickc                ó0   € V ^8„  d   QhR\         R\        /# )r   r=   r  ©r6   r    )r!   s   "r"   r#   r#   y  s   € ÷ ñ ¤ð ´ñ r$   c               ó*  € ^ RI HpHp \        R4       \	        RR\
         R2R4       ^ RIHp ^ RIH	p  V! R	4      ;_uu_ 4        V! 4        RRR4       T P'                  4        T P)                  T! 4       4       T! T 4       R#   + '       g   i     L@; i  \        \        3 d    \	        RR
4        Lb\         dQ   p\        P                  RT4       ^ RIHp T! TRR7      vr‰\#        T4       T	 F  p
\%        T
4       K  	   Rp?L·Rp?ii ; i)u  Configure the inference provider and default model via the ``hermes model`` flow (one code
path â€” any provider added there is available here). *quick* is accepted for the first-time
quick setup caller; rotation, vision and TTS keep safe defaults either way.)r   r   zInference Providerz.Choose how to connect to your main chat model.ú
   Guide: z/integrations/providersN)Úselect_provider_and_model)Úprovider_setup_surfaceÚ	cli_setupzProvider setup skipped.z0select_provider_and_model error during setup: %s)Úprovider_setup_failure_lineszhermes model)Úretry_command)Úhermes_cli.configr   r   r)   r1   Ú
_DOCS_BASEÚhermes_cli.mainr!  Ú-hermes_cli.observability.shared_metrics_setupr"  Ú
SystemExitrm   rV   ÚloggerÚdebugÚhermes_cli.auth_error_copyr$  r   r   ÚclearÚupdate)r=   r  r   r   r!  r"  Úexcr$  ÚleadÚrestr0   s   &$         r"   Úsetup_model_providerr3  y  sØ   € ÷ ;ÜÐ%Ô&Ü	Ð
:Ø”z�lÐ"9Ð
:¸DôBå9ÝTðÙ# K×0Õ0Ù%Ô'÷ 1ð ‡L�L„NØ
‡M�M‘+“-Ô Ù�Ö÷# 1×0ûäÔ)Ð*ô /ÜˆdÐ-Ö.Üô Ü�‰ÐGÈÔMÝKÙ2°3ÀnÔUˆˆÜ�dÔÛˆDÜ�tÖö ûðúsB   ¶B ÁBÁB ÂB	ÂB ÂB ÂDÂ8DÃDÃADÄDc                ó$   € V ^8„  d   QhR\         /# ©r   r=   r  )r!   s   "r"   r#   r#   �  s   € ÷ <ñ <¬$ñ <r$   c                óÎ   € ^–V P                  R/ 4      R&   \        R4       RV P                  R/ 4      R&   RV R,          R&   \        V 4       \        R	4       \	        R
RR4       R# )zDApply recommended defaults for all agent settings without prompting.r?   Ú	max_turnsÚHERMES_MAX_ITERATIONSTÚcompressionrC   ç      à?Ú	thresholdzApplied recommended defaults:z  Max iterations: 150z  Compression threshold: 0.50z.  Run `hermes setup agent` later to customize.N)Ú
setdefaultr   r   r   r1   ©r=   s   &r"   Ú_apply_default_agent_settingsr>  �  sl   € à25€F×Ñ�g˜rÓ" ;Ñ/ô Ð,Ô-Ø6:€F×Ñ�m RÓ(¨Ñ3Ø)-€Fˆ=Õ˜+Ñ&Ü�ÔÜÐ1Ô2Ü	Ð
!Ð#BØ
:ö<r$   c                ó$   € V ^8„  d   QhR\         /# )r   rÈ   r-   )r!   s   "r"   r#   r#   «  s   € ÷ ñ œ#ñ r$   c                ó^   €  V! \        V \        V4      4      4      #   \         d     R# i ; i)z=Prompt for a number; ``None`` when the answer does not parse.N)rq   r   Ú
ValueError)rÈ   ÚcurrentÚcasts   &&&r"   Ú_prompt_numberrD  «  s/   € ðÙ”F˜5¤# g£,Ó/Ó0Ð0øÜô Úðús   ‚ �,«,c                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r   Úsectionr4   rÈ   r,   Nr5   )r!   s   "r"   r#   r#   ³  s)   € ÷ ñ ¤ð ¬Cð ¼ð ÐQUñ r$   c                óP   € \        W#4      pVe   V! V4      '       d   WPV&   R# R# R# )zOPrompt for an int; store it under *key* only when it parses and *accept* holds.N)rD  )rF  r4   rÈ   rB  Úacceptr^   s   &&&&& r"   Ú_prompt_int_settingrI  ³  s)   € ä˜5Ó*€EØÒ™V EŸ]š]Ø�‹ñ +Ñr$   c                ó$   € V ^8„  d   QhR\         /# r5  r  )r!   s   "r"   r#   r#   Â  s   € ÷ 1ñ 1¤ñ 1r$   c           	     ó,  € \        R4       \        R\         R2R4       \        \	        V RR^ZR7      4      p\        RR	R
V R24       \        RV4      pVf   \        R4       MFV^ 8”  d@   W P                  R/ 4      R&   V P                  RR4       \        R4       \        RV 24       \        R.\        O5!   \	        V RR4      p\        V'       d   RMRV4      pV'       g   V'       g   \        R4       M|VP                  4       R&9   dL   VP                  4       V P                  R/ 4      R&   \        V 4       \        RVP                  4        24       M\        RT RT;'       g    R R24       \        R4       \        RR4       RV P                  R/ 4      R &   \	        V RR!R"R7      p\        R#V\         4      pVe   R"Tu;8:  d   R$8:  d   M MW`R,          R!&   \        R%V R,          P#                  R!R"4       24       \        V 4       R# )'zGConfigure agent behavior: iterations, progress display and compression.úAgent Settingsr   z/user-guide/configurationNr?   r7  r¢   z1Maximum tool-calling iterations per conversation.z3Higher = more complex tasks, but costs more tokens.zPress Enter to keep z5. Use 90 for most tasks or 150+ for open exploration.zMax iterationsz%Invalid number, keeping current valuer8  zMax iterations set to r@   rp   Útool_progresszTool progress modez6Tool progress mode (Enter keeps per-platform defaults)z-Keeping each platform's default tool progresszTool progress set to: zUnknown mode 'z', keeping 'zper-platform defaultsÚ'zContext CompressionzAAutomatically summarizes old messages when context gets too long.zNHigher threshold = compress later (use more context). Lower = compress sooner.Tr9  rC   r;  r:  z Compression threshold (0.5-0.95)gffffffî?z%Context compression threshold set to >   ÚallÚlogÚnewÚoffÚverbose)r)   r1   r'  r   r   rD  r   r<  rÅ   r   r   Ú_TOOL_PROGRESS_HELPrq   r   rH   r   Úfloatr8   )r=   Úcurrent_maxÚmax_iterÚcurrent_modeÚmodeÚcurrent_thresholdr;  s   &      r"   Úsetup_agent_settingsr[  Â  s  € äÐ!Ô"Ü	ˆJ”z�lÐ";Ð
<¸dÔCô
 ”g˜f g¨{ÀBÔGÓH€KÜ	Ð
=Ø
?Ø   Ð-bÐ
côeô Ð.°Ó<€HØÒÜÐ=Õ>Ø	�AŒà6>×Ñ˜' 2Ó& {Ñ3Ø�
‰
�; Ô%ÜÐ0Ô1ÜÐ.¨x¨jÐ9Ô:ô 
ˆ"Ð#Ô"Ô#ô ˜6 9¨oÓ>€LÜ¯,Ñ&Ð<tØó €DçŸÜÐBÕCØ	�‰‹Ð@Ô	@Ø<@¿J¹J»Lˆ×Ñ˜) RÓ(¨Ñ9Ü�FÔÜÐ.¨t¯z©z«|¨nÐ=Õ>ä˜ t f¨L¸×9`Ð9`ÐI`Ð8aÐabÐcÔdô Ð&Ô'Ü	Ð
MØ
Zô\à6:€F×Ñ�m RÓ(¨Ñ3Ü ¨°{ÈDÔQÐÜÐAÐCTÔV[Ó\€IØÒ ¨	Ö!9°T×!9Ø-6ˆ}Õ˜kÑ*ÜÐ9¸&ÀÕ:O×:SÑ:SÐT_ÐaeÓ:fÐ9gÐhÔiä�Ör$   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r=   Úfirst_installr  )r!   s   "r"   r#   r#   ù  s   € ÷ >ñ >œð >¬Tñ >r$   c                ó$   € ^ RI Hp V! WR7       R# )uÁ   `hermes setup tools` == `hermes tools`: platform selection â†’ toolset toggles â†’ provider keys.
``first_install`` selects the simplified flow (no platform menu, prompts for all missing keys).)Útools_command)r]  r=   N)Úhermes_cli.tools_configr_  )r=   r]  r_  s   && r"   Úsetup_toolsra  ù  s   € õ 6Ù ×=r$   r@   c                ó$   € V ^8„  d   QhR\         /# r5  r  )r!   s   "r"   r#   r#     s   € ÷ *ñ *œDñ *r$   c                ób  € \        R4       \        RRRRRRRR	R
RRRR4       \        \          ^ RIHp \        \        V R4      R4      pVP                  R4      RJ ;'       d    VP                  R4      RJ p\        RVR7      pV! WDV 4       V'       d   \        R4       R# \        R4       R# )zTTurn shared metrics on (collect and send to Nous) or off: one answer sets both keys.úShared MetricszGShared metrics contain only bounded counters: activity, session length,zHoutcomes, error classes (with a fixed-list reason when a memory write orzFcontext compression is refused, fails or is skipped), model routes andzFtoken totals, built-in tool, command and catalog names, bucketed setupzGcounts, update and install results and timing (with a fixed-list reasonzJand the stage when one fails; a fresh install is noted on this machine andz'counted only once you opt in), crashes,zHstartup and reply speed, messaging-platform health, how Hermes gets usedzK(agent accuracy and efficiency, active time per surface, which features andzGsettings are used or switched off, provider setup outcomes), and coarsezLmachine facts (RAM range, GPU type, version age and channel, updates behind,zJlocal model server yes/no). Never prompts, files, paths, setting values orzerror text.)Úsave_consentÚ	telemetryÚshared_metricsrC   TÚsendzSend shared metrics to Nous?r¢   z'Shared metrics sent to Nous once a day.zShared metrics off.N)
r)   r1   Ú_SEND_CONSENT_EXPLAINERÚ/hermes_cli.observability.shared_metrics_consentre  r;   r8   rô   r   r   )r=   re  rg  ÚsharingÚshares   &    r"   Úsetup_telemetryrm    s¹   € äÐ!Ô"Ü	Ð
SØ
TØ
RØ
RØ
SØ
VØ
3Ø
TØ
WØ
SØ
XØ
VØ
ôô 
Ô"Ñ#õ Mäœy¨°Ó=Ð?OÓP€NØ× Ñ  Ó+¨tÐ3×ZÐZ¸×8JÑ8JÈ6Ó8RÐVZÐ8Z€GäÐ8À'ÔJ€EÙ�˜vÔ&ßÜÐ?Ö@äÐ(Ö)r$   c                ó(   € V ^8„  d   QhR\         RR/# )r   rC   r,   NrQ   )r!   s   "r"   r#   r#   1  s   € ÷ Vñ V¬Dð V°Tñ Vr$   c           	     óX  €  ^ RI Hp ^ RIHp ^ RIHp V! 4       P                  4       ;_uu_ 4       qC! V4      ;_uu_ 4        V! W@4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i  \         d    \        P                  RRR7        R# i ; i)u£   Reconcile consent windows at the moment the user decides â€” same single writer as the relay
and the sender, so wizard, relay and mid-pass callers cannot disagree.)ÚSharedMetricsStore)Úreconcile_send_consent)Ú	write_txnNz.Unable to record shared-metrics consent changeT)Úexc_info)
Ú'hermes_cli.observability.shared_metricsrp  Ú.hermes_cli.observability.shared_metrics_senderrq  Úhermes_cli.sqlite_utilrr  Ú_connectionrV   r+  r,  )rC   rp  rq  rr  Ú
connections   $    r"   Ú_record_send_consent_changery  1  sw   € ðVÝNÝYÝ4ÙÓ!×-Ñ-×/Ô/°:¸yÈ×?TÕ?TÙ" :Ô7÷ @U×/Ñ/×?T×?Tú×/×/Ð/ûäô Vä�‰ÐEÐPTˆ×UðVúsF   ‚/B ±A/Á	A	Á
A/ÁB ÁA,Á'A/Á/B 	Á:B Â B Â"B)Â(B))Ú	setup_tts©Úsetup_terminal_backend)Úsetup_gateway)Ú_print_setup_summary)Ú_skip_configured_section)Úoffer_agent_import)Ú_run_portal_one_shotÚ_run_quick_setupÚmodelúModel & ProviderÚttszText-to-SpeechÚterminalúTerminal BackendÚgatewayzMessaging Platforms (Gateway)r  ÚToolsrf  rd  r?   rL  c                óÈ   € \        4       ;_uu_ 4         \        V 4      uuRRR4       #   \         d    \        RR4        RRR4       R# i ; i  + '       g   i     R# ; i)z<Run setup with navigation control scoped to this invocation.Nz5Setup cancelled. Remaining sections were not changed.)r¹   Ú_run_setup_wizard_implr|   r1   )Úargss   &r"   Úrun_setup_wizardr�  X  sS   € ä	 ×	"Õ	"ð	Ü)¨$Ó/÷ 
#Ò	"øô ô 	Ü�$ÐOÔPØ÷ 
#Ñ	"ð	ú÷ 
#×	"Ð	"ús&   “A•
*ªAÁAÁAÁAÁA!	c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   r=   rF  r,   Nr5   )r!   s   "r"   r#   r#   b  s!   € ÷ 6ñ 6œtð 6¬cð 6°dñ 6r$   c                óN  a aa€ \        V3R l\         4       R4      pVf9   \        RS 24       \        RRP	                  R \         4       4       24       R# Vw  po\        RVR R	24       \        VV V3R
 l3.4       \        S 4       \        4        \        V R24       R# )zJ``hermes setup <section>``: run one SETUP_SECTIONS entry under the banner.c              3   ó@   <"  € T F  w  rq1S8X  g   K  W#3x € K  	  R # 5ir†   rW   )Ú.0r4   rÈ   ÚfuncrF  s   &   €r"   Ú	<genexpr>Ú%_run_setup_section.<locals>.<genexpr>d  s   øé € ÐY¹Ñ$4 C°ÐQXÉ.”-�5•-»ùs   ƒ“NzUnknown setup section: zAvailable sections: r  c              3   ó,   "  € T F
  w  p q!x € K  	  R # 5ir†   rW   )r‘  ÚkÚ_s   &  r"   r“  r”  g  s   é € Ð3TÁ^¹'¸!¸QÀ´AÃ^ùs   ‚u   â”‚     â˜¤ Hermes Setup â€” z<34su    â”‚c                  ó   <€ S! S 4      # r†   rW   )r=   r’  s   €€r"   Ú<lambda>Ú$_run_setup_section.<locals>.<lambda>k  s	   ø€ ¡d¨6¤lr$   z configuration complete!)
ÚnextÚSETUP_SECTIONSr   r   r	  r  rÍ   r   r&   r   )r=   rF  ÚentryrÈ   r’  s   ff  @r"   Ú_run_setup_sectionrž  b  s™   ú€ äÔY½ÓYÐ[_Ó`€EØ‚}ÜÐ-¨g¨YÐ7Ô8ÜÐ)¨$¯)©)Ñ3TÅ^Ó3TÓ*TÐ)UÐVÔWÙØ�K€Eˆ4ÜÐ1°%¸°¸TÐBÔCÜ�uÕ2Ð3Ð4Ô5Ü�ÔÜ	„GÜ�U�GÐ3Ð4Ö5r$   Úimported_fromc                ó@   € V ^8„  d   QhR\         R\        R\        RR/# )r   r=   Úis_existingrŸ  r,   N)r6   r    r   )r!   s   "r"   r#   r#   q  s0   € ÷ "^ñ "^œDð "^¼tð "^ÔTWð "^Ðaeñ "^r$   c               ó„  a aaa€ \        R4       \        R\        4        2R\        4        2RV 2R\         2RR4       S'       d   \        RRS R	2R
R4       S'       g   \        S 4       R V V3R lloR VV 3R llpR V3R llp\        V! RRV 3R l4      V! RRV 3R l4      RV3V! RRV V3R l4      .4       R# )uƒ   Full Setup â€” run all sections; after an import (*imported_from* names the agents) each
already-configured section offers to skip.zConfiguration LocationzConfig file:  zSecrets file: zData folder:  zInstall dir:  Nz=You can edit these files directly or use 'hermes config edit'zSettings were imported from Ú.u<   Each section below shows what is already set up â€” keep it,zor choose to reconfigure it.c                ó<   € V ^8„  d   QhR\         R\         R\        /# ©r   r4   rÈ   r,   r   )r!   s   "r"   r#   Ú%_run_full_setup.<locals>.__annotate__�  s&   € ÷ Tñ T”3ð Tœsð T¤tñ Tr$   c                 óB   <€ \        S4      ;'       d    \        SW4      # r†   )r    r  )r4   rÈ   r=   rŸ  s   &&€€r"   Ú_skipÚ_run_full_setup.<locals>._skip�  s   ø€ Ü�MÓ"×SÐSÔ'?ÀÈÓ'SÐSr$   c                ó   € V ^8„  d   QhRR/# r¿   rW   )r!   s   "r"   r#   r¦  „  s   € ÷ Qñ Q˜4ñ Qr$   c                  ób   <€ S! R R4      '       g   \        S4       R# ^ RIHp  V ! RRSR7       R# )rˆ  úMessaging PlatformsN)Úensure_gateway_serviceÚsetupT)ÚcontextÚinteractiver=   )r}  Ú hermes_cli.gateway_setup_servicer­  )r­  r¨  r=   s    €€r"   Ú_gateway_stepÚ&_run_full_setup.<locals>._gateway_step„  s+   ø€ Ù�YÐ 5×6Ò6Ü˜&Ô!ÙåKÙ w¸DÈ×Pr$   c                ó<   € V ^8„  d   QhR\         R\         R\        /# r¥  )r   r¼   )r!   s   "r"   r#   r¦  Œ  s&   € ÷ Cñ C”3ð Cœsð C¬Eñ Cr$   c                 ó    <a aa€ SVV VV3R  l3# )c                  ó4   <€ S ! SS4      '       d   R # S! 4       # r†   rW   )r¨  r4   rÈ   Úruns   €€€€r"   r™  Ú0_run_full_setup.<locals>._step.<locals>.<lambda>�  s   ø€ ¡e¨C°×&7Ò&7˜dÐB¹S»UÐBr$   rW   )r4   rÈ   r·  r¨  s   fff€r"   Ú_stepÚ_run_full_setup.<locals>._stepŒ  s   û€ Ø×BÐBÐBr$   rƒ  r„  c                  ó   <€ \        S 4      # r†   )r3  r=  s   €r"   r™  Ú!_run_full_setup.<locals>.<lambda>�  s   ø€ Ô3GÈÔ3Or$   r†  r‡  c                  ó   <€ \        S 4      # r†   r{  r=  s   €r"   r™  r¼  ‘  s   ø€ Ô6LÈVÔ6Tr$   r¬  r  r‰  c                  ó(   <€ \        S S'       * R 7      # ))r]  )ra  )r=   r¡  s   €€r"   r™  r¼  “  s   ø€ ¬°FÈkÌ/Õ(Zr$   )r)   r1   r   r   ÚPROJECT_ROOTr>  rÍ   )r=   Úhermes_homer¡  rŸ  r²  r¹  r¨  s   f&dd  @r"   Ú_run_full_setuprÁ  q  sÜ   û€ ô Ð)Ô*Ü	ˆNœ?Ó,Ð-Ð
.°.ÄÃÐ@PÐ0QØ˜;˜-Ð
(¨N¼<¸.Ð*IÈ4Ø
IôK÷ ÜˆdÐ2°=°/ÀÐCØLØ,ô	.÷
 Ü% fÔ-÷Tñ T÷Qñ Q÷Cð Cô ÙˆgÐ)Ô+OÓPÙˆjÐ,Ô.TÓUØ	 Ð.Ùˆg�wÕ ZÓ[ð	]ö ^r$   c           	     ó  aaaaa€ ^ RI HpHp V! 4       '       d   V! R4       R# \        4        \	        4       p^ RIHp V! VR4      p\        V RR4      '       dE   \        \        P                  ! \        4      4       \        R4       V'       d   \        R	V 24       \        \        V R
R4      4      p\        \        V RR4      4      p\        4       o\!        4       o\        V RR4      '       g   \#        4       '       g   \%        R4       R# \        V RR4      '       d   \'        S4       R# \        V RR4      pV'       d   \)        SV4       R# ^ RIHp	 \        \/        R4      ;'       g    \/        R4      ;'       g
    V	! 4       RJ4      o\1        RRRR4       Rp
S'       dQ   V'       d!   \3        RVV3R l3.4       \5        S4       R# \7        RRR7       \        R4       \        RRRR R!4       M�\9        4        V'       g	   V'       d   \        R"R4       \;        S4      p
\        4       o\=        R#\>         UUu. uF  w  r¼VNK	  	  upp^ 4      p\>        V,          w  poSe*   ^ R$I H!o \3        VVVVVV3R% l3.4       \5        S4       R# \E        SSSV
R&7       \        S4       V'       d-   VPG                  4       '       d   \        R	V 2R'R(V R)V 24       \I        SS4       \5        S4       R# u uppi )*z‚Run the interactive setup wizard: full/quick (auto-detected), ``--portal``, or one
``hermes setup <section>`` from SETUP_SECTIONS.)Ú
is_managedÚmanaged_errorzrun setup wizardN)Úbackup_configz	pre-setupr”   Fz Configuration reset to defaults.zPrevious config backed up to: Úreconfigurer  Únon_interactivez;Running in a non-interactive environment (no TTY detected).ÚportalrF  )Úget_active_providerÚOPENROUTER_API_KEYÚOPENAI_BASE_URLu@   â”‚             â˜¤ Hermes Agent Setup Wizard                â”‚u±   â”œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¤u>   â”‚  Let's configure your Hermes Agent installation.       â”‚u>   â”‚  Press Ctrl+C at any time to exit.                     â”‚r@   zQuick Setupc                  ó   <€ \        S S4      # r†   )r‚  )r=   rÀ  s   €€r"   r™  Ú(_run_setup_wizard_impl.<locals>.<lambda>Ï  s   ø€ Ô6FÀvÈ{Ô6[r$   ÚReconfigureT)r   z#You already have Hermes configured.uA   Running the full wizard â€” each prompt shows your current value.z9Press Enter to keep it, or type a new value to change it.zBTip: jump straight to a section with 'hermes setup model|terminal|zC     gateway|tools|agent', or fill only missing items with --quick.u=   No existing configuration found â€” running first-time setup.z$How would you like to set up Hermes?)Úsetup_quickc                  ó,   <€ \        SS4      ! S SS4      # r†   )Úgetattr)r=   rÀ  r¡  ÚrunnerrÏ  s   €€€€€r"   r™  rÍ  å  s   ø€ ¬g°kÀ6Ô.JÈ6ÐS^Ð`kÔ.lr$   )r¡  rŸ  z9If setup changed a value you customized, restore it with:z  cp Ú )%r&  rÃ  rÄ  r   r   Úhermes_cli.config_backupsrÅ  rÑ  r   r�   rž   r	   r   r1   r    r   r
   rX   r\   r�  rž  Úhermes_cli.authrÉ  r   r  rÍ   Ú_record_setup_completedr)   r&   r€  rß   Ú_FIRST_TIME_MODESÚ
hermes_clirÏ  rÁ  Úexistsr~  )rŒ  rÃ  rÄ  Úconfig_pathrÅ  Ú_backup_pathÚreconfigure_requestedÚquick_requestedrF  rÉ  rŸ  rÈ   r—  Ú
setup_moder=   rÀ  r¡  rÒ  rÏ  s   &             @@@@@r"   r‹  r‹  Ÿ  s¥  ü€ ÷ <Ù‡|‚|ÙÐ(Ô)ÙÜÔä!Ó#€KÝ7Ù  ¨kÓ:€LÜˆt�W˜e×$Ò$Ü”D—M’M¤.Ó1Ô2ÜÐ8Ô9ßÜÐ2°<°.ÐAÔBÜ ¤¨¨}¸eÓ!DÓEÐÜœ7 4¨°%Ó8Ó9€OÜ‹]€FÜ!Ó#€Kô ˆtÐ&¨×.Ò.Ô6J×6LÒ6LÜ+Ð,iÔjÙÜˆt�X˜u×%Ò%Ü˜VÔ$ÙÜ�d˜I tÓ,€GßÜ˜6 7Ô+Ùõ 4Ü”}Ð%9Ó:÷ <ð <¼mÐL]Ó>^÷ <ð <Ù-Ó/°tÐ;ó=€KäÐTð FØRØRôTð €Mß÷ Ü˜}Õ.[Ð\Ð]Ô^Ü# FÔ+ÙÜ�]¨Õ-ÜÐ;Ô<ÜÐQØIÈ2ØRØSõ	Uô 	Œß §OÜÐQÐSWÔXô +¨;Ó7ˆÜ“ˆÜ"Ð#IÕbsÔKtÑbsÑV^ÐV[ËEÑbsÒKtÐvwÓxˆ
Ü)¨*Õ5‰ˆˆvØÒÝ.Ü˜u×&lÐ&lÐmÐnÔoÜ# FÔ+ÙÜ�F˜K°[ÐP]Õ^ô �Ôß˜×+Ñ+×-Ò-ÜÐ.¨|¨nÐ=ØIØ�l�^ 1 [ MÐ2ô	4ô ˜ Ô-Ü˜FÖ#ùó! Lus   ÉK<c                ó(   € V ^8„  d   QhR\         RR/# )r   r=   r,   Nr  )r!   s   "r"   r#   r#   ô  s   € ÷ oñ o¤Dð o¨Tñ or$   c                ó²   € ^ RI Hp V! V 4       ^ RIHp V P	                  R4      pT! R\        V\        4      '       d   VP	                  R4      MRR7       R# )z¬Count a wizard run that finished. Every setup flow ends here, so the one-time
shared-metrics offer runs first: a user who opts in now is counted; the API checks enablement.)Úoffer_consent_if_undecided)Úrecord_setup_completedrƒ  ÚcliÚproviderN)Úsurfacerä  )rj  rá  Ú.hermes_cli.observability.shared_metrics_eventsrâ  r8   r9   r6   )r=   rá  râ  rƒ  s   &   r"   rÖ  rÖ  ô  sE   € õ [á˜vÔ&ÝUØ�J‰J�wÓ€EÙ 5ÌJÐW\Ô^b×LcÒLc°5·9±9¸ZÔ3HÐim×nr$   c                ód   € V ^8„  d   Qh/ ^ \         9   d   \        \        R,          ,          ;R&   # )r   Nr©   )Ú__conditional_annotations__r   r�   )r!   s   "r"   r#   r#      s,   € ÷ ñ ÷z rÒ q”:Ô3°dÕ:Õ;Ñ qò{r$   r†   r  )é    N)TN)zTool Progress Displayz=Controls how much tool activity is shown (CLI and messaging).u-     off     â€” Silent, just the final responseu>     new     â€” Show tool name only when it changes (less noise)u7     all     â€” Show every tool call with a short previewu0     verbose â€” Full args, results, and debug logsuc     log     â€” Silent in chat; write every tool call to ~/.hermes/logs/tool_calls.log (gateway only))F)r@   z8Sharing uploads each daily package to the Nous telemetryz9service. Packages carry your profile-scoped install ID, az;stable random UUID that identifies this profile across daysz=(it contains no personal information and is reset by deletingz9the shared-metrics directory). Only packages whose entirez<collection period falls inside a recorded consent window arez;ever sent. Apart from the fresh-install note (noted on thisz;machine and counted only once you opt in), data from beforez<you opt in is never sent. Sharing can be turned off again atz	any time.))uX   Quick Setup (Nous Portal) â€” free OAuth login, no API keys, model + tools (recommended)Ú_run_first_time_quick_setup)uU   Full setup â€” configure every provider, tool & option yourself (bring your own keys)N)uQ   Blank Slate â€” everything off except the bare minimum; opt in to each capabilityÚ_run_blank_slate_setup)srè  ry   Úimportlib.utilr  Úloggingrç   ÚrerS   r�   Ú
contextlibr   Úcontextvarsr   Úpathlibr   Útypingr   rµ   r   r   r&  r   r	   r
   r   r   r   r   r   r   r   r   Úhermes_cli.colorsr   r   rl   r   r   r   r   Úhermes_cli.secret_promptr   Ú	getLoggerru   r+  Ú__file__r3   Úresolver¿  r'  Úcompiler`   r)   r1   r;   rK   rN   rX   r\   rb   rq   ÚBaseExceptionrs   r|   r~   r�   r©   r±   r¹   rÍ   rÑ   rÛ   rß   ré   rô   rü   rÿ   r  r
  r  r  r3  r>  r‚   rD  rI  rT  r[  ra  ri  rm  ry  Úhermes_cli.setup_ttsrz  Úhermes_cli.setup_terminalr|  Úhermes_cli.setup_platformsr}  Úhermes_cli.setup_summaryr~  Úhermes_cli.setup_migrationr  Úhermes_cli.setup_agent_importr€  Úhermes_cli.setup_quickr�  r‚  rœ  r�  rž  rÁ  r×  r‹  rÖ  r#   )rè  s   @r"   Ú<module>r     s]  øðöó Û Û 	Û 	Û 
Û Ý %Ý "Ý Ý ç I÷÷ ÷ ñ ÷ ,ß WÓ WÝ 9à	×	Ò	˜8Ó	$€á�H‹~×$Ñ$×+Ñ+×3Ñ3Ó5€à9€
ØŸ:š:Ð&DÓEÐ ð;¨E÷ ;õ6õõ	-õ<õ÷Yõ b÷
ô&M˜ô Mô
MÐ'ô Mô)Ð$ô )÷Hñ Hñ  ?IÐIbÐlpÔ>qÐ Ó q÷ð6 ñ	'ó ð	'õ)ðX	+ØHZ÷	+÷m÷õe÷/÷:Kõõdõ#õõVð¸÷ õH<ð .1÷ õðÐ õ1÷n>ðÐ õ*õ@Võ" +Ý <Ý 4Ý 9Ý ?Ý <ß Ið Ð Ð"6Ð7Ø
Ð˜iÐ(ØÐ#Ð%;Ð<ØÐ/°Ð?Øˆg�{Ð#ØÐ" OÐ4ØÐÐ 4Ð5ð€òõ6ð"^ÐZ\÷ "^ðLÐ òR$÷jor$   