+
    jHàj(  ã            
      óª   € R t ^ RIHt ^ RIt^ RIHtHt ^ RIHtH	t	H
t
Ht RRRRR	]/R
 R lltRRRR/R R lltRRRRRRRRR	]/R R lltR R ltR# )z8Terminal and chat rendering for the shared sign-in flow.)ÚannotationsN)ÚIteratorÚOptional)ÚCodeÚSignInStateÚUPGRADE_CANCELLEDÚUPGRADE_STARTÚopen_browserFÚchatTÚprinterc               ó(   € V ^8„  d   QhRRRRRRRR/# )é   Ústater   r	   Úboolr
   ÚreturnÚNone© )Úformats   "Ú@/home/ubuntu/.hermes/hermes-agent/hermes_cli/anon_sign_in_cli.pyÚ__annotate__r      s2   € ÷ Añ AØðAØ"&ðAØ6:ðAØUYñAó    c               ó¤   € ^ RI Hp V! V P                  V P                  VRR7       T! RV'       d   V P                  MV P
                   24       R# )zNPrint the ``Code`` state alone: the link, the code, and the do-not-share line.)Ú_print_device_code_instructionsT)r	   Úswallow_open_errorsz  N)Úhermes_cli.auth_device_flowr   ÚlinkÚcodeÚcopy_with_waitÚcopy)r   r	   r
   r   r   s   &$$$ r   Úrender_sign_in_cli_coder      s@   € õ LÙ#Ø�
‰
�E—J‘J¨\ÈtõUáˆb¯�×%Ò%°5·:±:Ð>Ð?Ö@r   Úon_terminalc               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚgenzIterator[SignInState]r
   r   r   Ústrr   )r   s   "r   r   r      s#   € ÷ ñ Ð1ð ¸Dð Ð^añ r   c               ó  € RpV  Fp  pVP                   '       g   K  V'       d   VP                  MVP                  pVf   K=  \        P                  ! \
        4      ;_uu_ 4        V! V4       RRR4       Kr  	  V#   + '       g   i     K‡  ; i)u
  Iterate *gen* to its terminal state, discarding ``Waiting``, and return that state's copy.

``on_terminal`` is called with each terminal state â€” the CLI uses it to move the running
session off the free tier's model. A raising hook never costs the caller its copy.
Ú N)Úterminalr   Úcopy_terminalÚ
contextlibÚsuppressÚ	Exception)r"   r
   r    r   r   s   &$$  r   Údrain_sign_in_copyr+      si   € ð €DÛˆØ�>�>Š>ß!%�5—:’:¨5×+>Ñ+>ˆDØÔ&Ü×(Ò(¬×3Õ3Ù Ô&÷ 4Ñ3ñ	 ð €K÷ 4×3Ð3ús   Á$	A;Á;BÚtimeout_secondsç      .@Ústatesc          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   r,   Úfloatr	   r   r
   r.   zOptional[Iterator[SignInState]]r   Úintr   )r   s   "r   r   r   $   s4   € ÷  ñ  Øð Ø48ð ØHLð à+ð àFIñ r   c                óÎ  € ^ RI Hp Ve   TMVP                  V R7      pRp V FÐ  pV'       g!   VP                  '       g   V! \        4       RpVP
                  R8X  d   VP                  W�W$R7       KQ  VP
                  R8X  d   V'       g   V! VP                  4       K~  VP                  '       g   K’  T! V'       d   VP                  MVP                  4       VP                  '       d   ^ u # ^u # 	  ^#   \         d`    \        P                  ! \        4      ;_uu_ 4        TP                  4        RRR4       M  + '       g   i     M; iT! \         4        ^‚# i ; i)	züPrint a sign-in; returns the process exit code (0 ok, 1 not, 130 interrupted).

``chat=True`` renders the in-chat wording; *states* lets a caller hand in a partially drained
:func:`run_sign_in` generator; *printer* lets a caller pin the output target.
©Ú	anon_authN)r,   FTr   )r	   r
   r   Úwaiting)Ú
hermes_clir4   Úrun_sign_inÚpreconditionr   Úkindr   r   r&   r'   ÚokÚKeyboardInterruptr(   r)   r*   Úcloser   )	r,   r	   r
   r.   r   Ú_corer"   Ústartedr   s	   $$$$$    r   Úrender_sign_in_clir?   $   s  € õ .àÒ&‰&¨E×,=Ñ,=ÈoÐ,=Ó,^€CØ€GðÛˆEß 5×#5×#5Ð#5ÙœÔ&Ø�Ø�z‰z˜VÔ#Ø×-Ñ-¨eÐUYÐ-ÔkÙØ�z‰z˜YÔ&ßÙ˜EŸJ™JÔ'ÙØ�~�~Š~Ù§d˜Ÿ
š
°×0CÑ0CÔDØ!ŸHŸH˜H�qÒ+¨!Ò+ñ ñ& øô ô Ü× Ò ¤×+Õ+Ø�I‰IŒK÷ ,×+×+Ð+úáÔ!Ô"Úð	úsT   ¢C: ÁAC: Â#C: Â6	C: Ã -C: Ã.C: Ã2C: Ã6C: Ã:-E$Ä'EÄ8	E$ÅEÅE$Å#E$c               ó   € V ^8„  d   QhRR/# )r   r   r1   r   )r   s   "r   r   r   G   s   € ÷ Pñ P˜3ñ Pr   c                óæ   € ^ RI Hp ^ RIHp ^ RIHp V! 4        \        \        V RR4      ;'       g    R4      p\        V RR4      '       * ;'       d    V! 4       '       * pVP                  WERR	7      # )
zÛ``hermes auth upgrade``: sign in with a Nous account; a free tier it replaces hands its apps over.

Returns 0 on success (or when already signed in), 1 otherwise, 130 on Ctrl-C. Nothing is saved
before the token grant.
r3   )Ú_is_remote_session)ÚdrainÚtimeoutNr-   Ú
no_browserF)r,   r	   r
   )	r6   r4   r   rB   Úhermes_cli.guest_handoffrC   r0   Úgetattrr?   )Úargsr=   rB   rC   r,   r	   s   &     r   Úupgrade_guestrI   G   sl   € õ .Ý>Ý.Ù	„GÜœG D¨)°TÓ:×BÐB¸dÓC€OÜ˜t \°5Ó9Ô9×VÐVÑBTÓBVÔ>V€LØ×#Ñ#Ø'Èð $ó Pð Pr   )Ú__doc__Ú
__future__r   r(   Útypingr   r   Úhermes_cli.anon_sign_inr   r   r   r   Úprintr   r+   r?   rI   r   r   r   Ú<module>rO      s€   ðÙ >å "ã ß %ç WÓ WðAØ).ðAØ=AðAØKP÷AðÀ4ð ÐUY÷ ð  Ø $ð Ø;@ð ØOTð à.2ð à<A÷ ÷FPr   