+
    .pÐjÒP  ã                  óZ  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
HtHtHtHtHt ^ RIHt RtRtRtR	tR
tRtRRRRRRRRRR/t]! RR04      t]! R04      tRtRtRtRtRt Rt!Rt"Rt#Rt$Rt%Rt&R t'R!t(R"t)])R#,           t*R$ R% lt+]! R&R'7       ! R( R)4      4       t,]! R&R'7       ! R* R+],4      4       t-]! R&R'7       ! R, R-],4      4       t.]! R&R'7       ! R. R/],4      4       t/]! R&R'7       ! R0 R1],4      4       t0]! R&R'7       ! R2 R3],4      4       t1]! R&R'7       ! R4 R5],4      4       t2]! R&R'7       ! R6 R7],4      4       t3]! R&R'7       ! R8 R9],4      4       t4]! R&R'7       ! R: R;],4      4       t5]! R&R'7       ! R< R=],4      4       t6R> R? lt7R@ RA lt8RB RC lt9RDRERFRRGR&RHRRIRRJR/RK RL llt:R# )MzMShared sign-in states, copy, and connector-preserving account promotion flow.)ÚannotationsN)Ú	dataclass)ÚAnyÚCallableÚClassVarÚContextManagerÚDictÚIteratorÚOptional)Úhttpxz<Sign in with a Nous account to unlock more models and tools.zAlready signed in.zDo not share this code.zAThat sign-in link has expired. Start again whenever you're ready.z7Sign-in didn't finish. Try again whenever you're ready.zPThe free tier is not available right now; run `hermes auth add nous` to sign in.Úuser_declinedzQNo problem, you're still on the free Nous service. Sign in whenever you're ready.Ú
supersededzKA newer sign-in code replaced this one. Use the newest one, or start again.Úaccount_retiredzqYour session ended before the sign-in finished. A new one starts on its own; sign in again whenever you're ready.Úaccount_not_anonymousÚaccount_busyzaSomething's still finishing up on your account. Give it a few seconds, then try signing in again.z}Signing in couldn't finish because the Nous service is busy. Try again in {wait}. Your session is still here in the meantime.zˆThe Nous service couldn't be reached to finish signing you in. Check your internet connection and try again. Your session is still here.z<No default model is set yet; run `hermes model` to pick one.z4No default model is set yet; run /model to pick one.zWaiting for sign-in...z%Waiting for sign-in, up to {minutes}.z
Sign-in cancelled.zGThe free tier is not available right now. Try /login again in a moment.z/loginzStarting sign-in...z*Sign in from a direct message with Hermes.zNAnother sign-in is already running on this Hermes. Try again in a few minutes.z/Only an operator of this Hermes can sign it in.z�You've used up the allowance for chatting without signing in. It refreshes in {reset}. Sign in for a bigger allowance, it's free.z To sign in: /login.c               ó    € V ^8„  d   QhRRRR/# )é   Ú
expires_inÚintÚreturnÚstr© )Úformats   "Ú&/opt/hermes/hermes_cli/anon_sign_in.pyÚ__annotate__r   9   s   € ÷ ]ñ ] ð ]¨ñ ]ó    c                óÊ   € \        ^\        P                  ! \        ^ \        V 4      4      ^<,          4      4      p\        P                  V^8X  d   V R2R7      # V R2R7      # )zLThe honest "up to N minutes" line; N = ceil(expires_in / 60), singular at 1.z minutez minutes)Úminutes)ÚmaxÚmathÚceilr   ÚUPGRADE_WAITING_UP_TOr   )r   Úns   & r   Úformat_wait_liner#   9   sZ   € äˆAŒt�yŠyœ˜Q¤ J£Ó0°2Õ5Ó6Ó7€AÜ ×'Ñ'ÀÀaÄ°1°#°W°Ð'Ó\Ð\ÐPQÈsÐRZÈ^Ð'Ó\Ð\r   T)Úfrozenc                  ó€   € ] tR t^Gt$ RtRtR]R&   RtR]R&   RtR]R	&   Rt	R]R
&   ]
R R l4       t]
R R l4       tRtR# )ÚSignInStatezROne step of a sign-in. Every state carries its own user copy; renderers never map.Ú úClassVar[str]ÚkindTúClassVar[bool]ÚterminalFÚokÚpreconditionc               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   ÚSignInState.__annotate__Q   s   € ÷ ñ �cñ r   c                ó   € R# )zThe in-chat form.r'   r   ©Úselfs   &r   ÚcopyÚSignInState.copyP   s   € ñ r   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   r0   V   s   € ÷ ñ ˜sñ r   c                ó   € V P                   # )zAThe terminal form; differs for Completed, Failed and Unavailable.)r4   r2   s   &r   Úcopy_terminalÚSignInState.copy_terminalU   s   € ð �y‰yÐr   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r)   Ú__annotations__r+   r,   r-   Úpropertyr4   r8   Ú__static_attributes__r   r   r   r&   r&   G   sS   ‡ á\à€Dˆ-ÓØ#€HˆnÓ#Ø€BˆÓØ#(€L�.Ó(àôó ðð ôó ôr   r&   c                  óŒ   € ] tR t^[t$ RtR]R&   R]R&   R]R&   R]R&   RtR]R	&   R
tR]R&   ]R R l4       t	]R R l4       t
RtR# )ÚCodezJThe consent link and the sign-in code, plus the clock the caller may show.r   ÚlinkÚcoder   r   Úintervalr(   r)   Fr*   r+   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚCode.__annotate__g   s   € ÷ $ñ $�cñ $r   c                	ó   € \         # ©N)ÚUPGRADE_DO_NOT_SHAREr2   s   &r   r4   Ú	Code.copyf   s   € ä#Ð#r   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   rH   k   s   € ÷ Mñ M ñ Mr   c                ó>   € \          R\        V P                  4       2# )z\The do-not-share line plus the honest "up to N minutes"; composed here, never in a renderer.Ú )rK   r#   r   r2   s   &r   Úcopy_with_waitÚCode.copy_with_waitj   s!   € ô 'Ð' qÔ)9¸$¿/¹/Ó)JÐ(KÐLÐLr   r   N)r:   r;   r<   r=   r>   r?   r)   r+   r@   r4   rP   rA   r   r   r   rC   rC   [   sU   ‡ áTà
ƒIØ
ƒIØƒOØƒMØ €Dˆ-Ó Ø$€HˆnÓ$àô$ó ð$ð ôMó ôMr   rC   c                  óJ   € ] tR t^pt$ RtR]R&   RtR]R&   ]R R l4       tR	t	R
# )ÚWaitingÚwaitingr(   r)   Fr*   r+   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚWaiting.__annotate__v   s   € ÷ ñ �cñ r   c                	ó   € \         # rJ   )ÚUPGRADE_WAITINGr2   s   &r   r4   ÚWaiting.copyu   s   € äÐr   r   N)
r:   r;   r<   r=   r)   r?   r+   r@   r4   rA   r   r   r   rS   rS   p   s(   ‡ à#€Dˆ-Ó#Ø$€HˆnÓ$àôó ôr   rS   c                  ó–   € ] tR t^zt$ RtR]R&   RtR]R&   RtR]R&   RtR	]R
&   Rt	R]R&   R R lt
]R R l4       t]R R l4       tRtR# )Ú	Completedr'   r   ÚemailÚmodelFÚboolÚmodel_changedÚ	completedr(   r)   Tr*   r,   c               ó    € V ^8„  d   QhRRRR/# )r   Ú
no_defaultr   r   r   )r   s   "r   r   ÚCompleted.__annotate__‚   s   € ÷  ñ   ð  ¨ñ  r   c                	óø   € V P                   '       d   R V P                    R2MR.pV P                  '       d4   TP                  V P                  '       d   RV P                   R2MT4       RP	                  V4      # )zSigned in as Ú.z
Signed in.zDefault model is now Ú
)r\   r_   Úappendr]   Újoin)r3   rb   Úliness   && r   Ú_linesÚCompleted._lines‚   sa   € Ø26·*·*°*�= §¡ ¨AÑ.À,ÐOˆØ××ÐØ�L‰LÀ$Ç*Ç*À*Ð0°·±°¸AÑ>ÐR\Ô]Ø�y‰y˜ÓÐr   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   rc   ‰   ó   € ÷ 4ñ 4�cñ 4r   c                	ó,   € V P                  \        4      # rJ   )rj   ÚUPGRADE_NO_DEFAULT_CHATr2   s   &r   r4   ÚCompleted.copyˆ   s   € à�{‰{Ô2Ó3Ð3r   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   rc   �   s   € ÷ 8ñ 8˜sñ 8r   c                	ó,   € V P                  \        4      # rJ   )rj   ÚUPGRADE_NO_DEFAULT_TERMINALr2   s   &r   r8   ÚCompleted.copy_terminalŒ   s   € à�{‰{Ô6Ó7Ð7r   r   N)r:   r;   r<   r=   r\   r?   r]   r_   r)   r,   rj   r@   r4   r8   rA   r   r   r   r[   r[   z   s_   ‡ à€Eˆ3ƒOØ€Eˆ3ƒOØ€M�4ÓØ%€Dˆ-Ó%Ø€BˆÓõ ð ô4ó ð4ð ô8ó ô8r   r[   c                  ó<   € ] tR t^‘t$ RtR]R&   ]R R l4       tRtR# )ÚDeclinedÚdeclinedr(   r)   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚDeclined.__annotate__–   rm   r   c                	ó   € \         R ,          # )r   ©ÚUPGRADE_REASON_COPYr2   s   &r   r4   ÚDeclined.copy•   s   € ä" ?Õ3Ð3r   r   N)	r:   r;   r<   r=   r)   r?   r@   r4   rA   r   r   r   rv   rv   ‘   s   ‡ à$€Dˆ-Ó$àô4ó ô4r   rv   c                  ó@   € ] tR t^št$ RtRtR]R&   ]R R l4       tRt	R# )	Ú
SupersededzTStopped from outside before it could persist: a newer code, a cancel, or a shutdown.r   r(   r)   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚSuperseded.__annotate__¡   s   € ÷ 1ñ 1�cñ 1r   c                	ó   € \         R ,          # )r   r{   r2   s   &r   r4   ÚSuperseded.copy    s   € ä" <Õ0Ð0r   r   N©
r:   r;   r<   r=   r>   r)   r?   r@   r4   rA   r   r   r   r   r   š   s!   ‡ á^à&€Dˆ-Ó&àô1ó ô1r   r   c                  óJ   € ] tR t^¥t$ RtR]R&   RtR]R&   ]R R l4       tR	t	R
# )ÚTimedOutr'   r   ÚdetailÚ	timed_outr(   r)   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚTimedOut.__annotate__¬   s   € ÷ !ñ !�cñ !r   c                	ó   € \         # rJ   )ÚUPGRADE_TIMED_OUTr2   s   &r   r4   ÚTimedOut.copy«   s   € ä Ð r   r   N)
r:   r;   r<   r=   r‡   r?   r)   r@   r4   rA   r   r   r   r†   r†   ¥   s*   ‡ ð €FˆCÓØ%€Dˆ-Ó%àô!ó ô!r   r†   c                  ó@   € ] tR t^°t$ RtRtR]R&   ]R R l4       tRt	R# )	ÚRetiredzOThe identity this sign-in started from is gone; run_sign_in already cleared it.Úretiredr(   r)   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚRetired.__annotate__·   s   € ÷ 6ñ 6�cñ 6r   c                	ó   € \         R ,          # )r   r{   r2   s   &r   r4   ÚRetired.copy¶   s   € ä"Ð#4Õ5Ð5r   r   Nr„   r   r   r   r�   r�   °   s!   ‡ áYà#€Dˆ-Ó#àô6ó ô6r   r�   c                  ó–   € ] tR t^»t$ RtRtR]R&   RtR]R&   RtR]R&   R	t	R
]R&   ]
R R l4       t]
R R l4       t]
R R l4       tRtR# )ÚFaileda`  ``reason``: a promotion outcome reason (``account_busy``...), an ``anon_*`` code from the
account service (busy, paused, unreachable...), or "" for anything unnamed. ``retry_after``:
the wait the service asked for, in seconds (0 when it named none). ``retryable``: whether a
later attempt can succeed, so a renderer knows to offer "try again" and when.r'   r   Úreasonr‡   ç        ÚfloatÚretry_afterÚfailedr(   r)   c               ó   € V ^8„  d   QhRR/# )r   r   r^   r   )r   s   "r   r   ÚFailed.__annotate__È   s   € ÷ fñ f˜4ñ fr   c                	óÆ   € ^ RI Hp V P                  \        9   d   R# \	        V P                  P                  R4      ;'       d    V P                  VP                  9  4      # )é    ©Ú	anon_authTÚanon_)Ú
hermes_clir¡   r—   ÚRETRYABLE_SIGN_IN_REASONSr^   Ú
startswithÚANON_TERMINAL_CODES)r3   Ú_cores   & r   Ú	retryableÚFailed.retryableÇ   sF   € å1Ø�;‰;Ô3Ô3ÙÜ�D—K‘K×*Ñ*¨7Ó3×dÐd¸¿¹È5×KdÑKdÑ8dÓeÐer   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   r�   Ï   s   € ÷ %ñ %�cñ %r   c                	óò  € ^ RI Hp \        P                  V P                  4      pV'       d   V# V P                  VP
                  9   d   \        # V P                  VP                  VP                  39   d:   \        P                  TP                  V P                  ;'       g    ^<4      R7      # V P                  VP                  9   d(   VP                  V P                  V P                  R7      # \        # )rŸ   r    )Úwait)rš   )r£   r¡   r|   Úgetr—   ÚANON_UNREACHABLE_CODESÚUPGRADE_SERVICE_UNREACHABLEÚANON_RATE_LIMITEDÚANON_GATE_PAUSEDÚUPGRADE_SERVICE_BUSYr   Úfriendly_waitrš   ÚANON_FAILURE_COPYÚanon_failure_copyÚUPGRADE_NOT_COMPLETED)r3   r§   Úruleds   &  r   r4   ÚFailed.copyÎ   s¼   € å1Ü#×'Ñ'¨¯©Ó4ˆßØˆLØ�;‰;˜%×6Ñ6Ô6Ü.Ð.Ø�;‰;˜5×2Ñ2°E×4JÑ4JÐKÔKÜ'×.Ñ.°E×4GÑ4GÈ×HXÑHX×H^ÐH^Ð\^Ó4_Ð.Ó`Ð`Ø�;‰;˜%×1Ñ1Ô1Ø×*Ñ*¨4¯;©;ÀD×DTÑDTÐ*ÓUÐUÜ$Ð$r   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   r�   Ý   s   € ÷ Zñ Z˜sñ Zr   c                	ó¶   € V P                   '       d"   V P                  \        8w  d   V P                  # V P                  '       d   R V P                   2# \        # )zSign-in failed: )r—   r4   r¶   r‡   r2   s   &r   r8   ÚFailed.copy_terminalÜ   sA   € à�;�;ˆ;˜4Ÿ9™9Ô(=Ô=Ø—9‘9ÐØ37·;·;°;Ð! $§+¡+ Ð/ÐYÔDYÐYr   r   N)r:   r;   r<   r=   r>   r—   r?   r‡   rš   r)   r@   r¨   r4   r8   rA   r   r   r   r–   r–   »   sp   ‡ ñUð
 €FˆCÓØ€FˆCÓØ€K�ÓØ"€Dˆ-Ó"àôfó ðfð ô%ó ð%ð ôZó ôZr   r–   c                  óX   € ] tR t^ãt$ RtR]R&   RtR]R&   RtR]R&   ]R R	 l4       t	R
t
R# )ÚAlreadySignedInÚalready_signed_inr(   r)   Tr*   r,   r-   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚAlreadySignedIn.__annotate__ê   s   € ÷ )ñ )�cñ )r   c                	ó   € \         # rJ   )ÚUPGRADE_ALREADY_SIGNED_INr2   s   &r   r4   ÚAlreadySignedIn.copyé   s   € ä(Ð(r   r   N)r:   r;   r<   r=   r)   r?   r,   r-   r@   r4   rA   r   r   r   r½   r½   ã   s2   ‡ à-€Dˆ-Ó-Ø€BˆÓØ#'€L�.Ó'àô)ó ô)r   r½   c                  ón   € ] tR t^ît$ RtR]R&   RtR]R&   RtR]R	&   ]R
 R l4       t	]R R l4       t
RtR# )ÚUnavailabler'   r   r‡   Úunavailabler(   r)   Tr*   r-   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   ÚUnavailable.__annotate__õ   s   € ÷ (ñ (�cñ (r   c                	ó   € \         # rJ   )ÚUPGRADE_UNAVAILABLE_CHATr2   s   &r   r4   ÚUnavailable.copyô   s   € ä'Ð'r   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   rÈ   ù   s   € ÷ `ñ `˜sñ `r   c                	ó^   € V P                   '       d   \         R V P                    R2# \        # )z (Ú))r‡   ÚUPGRADE_UNAVAILABLEr2   s   &r   r8   ÚUnavailable.copy_terminalø   s)   € à;?¿;¿;¸;Ô%Ð& b¨¯©¨°QÐ7Ð_ÔL_Ð_r   r   N)r:   r;   r<   r=   r‡   r?   r)   r-   r@   r4   r8   rA   r   r   r   rÅ   rÅ   î   sH   ‡ à€FˆCÓØ'€Dˆ-Ó'Ø#'€L�.Ó'àô(ó ð(ð ô`ó ô`r   rÅ   c               ó    € V ^8„  d   QhRRRR/# )r   ÚexcÚBaseExceptionr   r–   r   )r   s   "r   r   r   ý   s   € ÷ ]ñ ] ð ]°&ñ ]r   c                óX  € ^ RI Hp VP                  V 4      p\        VP                  ;'       g    R4      pW1P
                  8X  d2   \        WP                  4      '       g   \        R\        V 4      R7      # \        T\        V 4      \        VP                  ;'       g    R4      R7      # )a  A ``Failed`` that keeps the account service's own verdict: the ``anon_*`` code and wait hint
an ``AuthError`` carries, or the wire's shape for a transport error. The raw detail never
reaches a chat; ``copy_terminal`` may show it when nothing better is known.r    r'   ©r—   r‡   r˜   )r—   r‡   rš   )r£   r¡   Úclassify_mint_exceptionr   rE   ÚANON_SERVER_ERRORÚ
isinstanceÚ	AuthErrorr–   r™   rš   )rÒ   r§   Úerrr—   s   &   r   Ú_failed_from_exceptionrÛ   ý   s}   € õ .Ø
×
'Ñ
'¨Ó
,€CÜ�—‘—�˜RÓ €FØ×(Ñ(Ô(´¸CÇÁ×1QÒ1Qô ˜R¬¨C«Ô1Ð1Ü˜¬¨C«¼eÀCÇOÁO×DZÐDZÐWZÓ>[Ô\Ð\r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úoutcomezdict[str, Any]Ú
anon_tokenr   r   r&   r   )r   s   "r   r   r     s!   € ÷ !ñ !˜Nð !¸ð !Àñ !r   c                ó€  € ^ RI Hp \        V P                  R4      ;'       g    R4      p\        V P                  R4      ;'       g    R4      pVR8X  d   \	        4       # V\
        9   d(   TP                  RT;'       g    RR	7       \        4       # VR
8X  d   \        4       # VR8X  d   \        4       # \        VR7      # )zèThe one reason -> state mapping in the tree, for a promotion that did not complete.

A retiring outcome clears the dead identity here, pinned to the token this attempt started
from, so a losing attempt can never remove a newer one.
r    ÚstatusÚunknownr—   r'   Útimeoutr�   N©Ú
dead_tokenr   r   )r—   )r£   r¡   r   r­   r†   Ú_RETIRED_REASONSÚclear_dead_guestr�   rv   r   r–   )rÝ   rÞ   r§   rà   r—   s   &&   r   Ú_outcome_staterç     s¤   € õ .ä�—‘˜XÓ&×3Ð3¨)Ó4€FÜ�—‘˜XÓ&×,Ð,¨"Ó-€FØ�ÔÜ‹zÐØÔ!Ô!Ø×Ñ˜y°Z×5GÐ5GÀ4ÐÔHÜ‹yÐØ�Ô Ü‹zÐØ�ÔÜ‹|ÐÜ˜Ô Ð r   c               ó    € V ^8„  d   QhRRRR/# )r   Úis_cancelledzCallable[[], bool]r   z"Callable[[], ContextManager[bool]]r   )r   s   "r   r   r   !  s   € ÷ ñ Ð);ð Ð@bñ r   c                ó:   a € \         P                  V 3R l4       pV# )zZThe persist guard used when a surface brings none: proceed unless the attempt was stopped.c               3  ó,   <"  € S ! 4       '       * x € R # 5irJ   r   )ré   s   €r   Ú_guardÚ&_default_persist_guard.<locals>._guard#  s   øé € á“.Ô Ô ùs   ƒ)Ú
contextlibÚcontextmanager)ré   rì   s   f r   Ú_default_persist_guardrð   !  s    ø€ ä×Ñô!ó ð!à€Mr   Útimeout_secondsg      .@Ú	cancelledÚcancel_wins_after_promotionÚpersist_guardÚscopeÚclient_factoryc               ó4   € V ^8„  d   QhRRRRRRRRR	R
RRRR/# )r   rñ   r™   rò   zOptional[Callable[[], bool]]ró   r^   rô   z,Optional[Callable[[], ContextManager[bool]]]rõ   z+Optional[Callable[[], ContextManager[Any]]]rö   z>Optional[Callable[[float, Any], ContextManager[httpx.Client]]]r   zIterator[SignInState]r   )r   s   "r   r   r   )  s[   € ÷ e4ñ e4àðe4ð ,ðe4ð "&ð	e4ð
 @ðe4ð 7ðe4ð Sðe4ð ñe4r   c              #  ó`  "  € ^ RI Hp ^ RIHpHp ^ RIHp	 ^ RIHp
 T;'       g    R pV'       d   TMR pT;'       g    \        P                  pRpRp V! 4       ;_uu_ 4        VP                  4       pV'       d#   VP                  V4      '       g   \        4       pM(V'       d   VP                  4       '       g   \        4       pRRR4       Te   Tx € R# \#        TP%                  R	4      ;'       g    R
4      pTP%                  R4      ;'       g    TP'                  4       P)                  R4      p/ pRp TR,          pTP*                  TP,                  ppT! RRRR7      pT;'       g    T
pT! T T4      ;_uu_ 4       pT	! TTTT4      pTP/                  TTT\#        TR,          4      \#        TR,          4      R7      p\#        TP%                  R4      ;'       g    R
4      pTP1                  R4      '       d   T T 2pT;'       g    \#        TR,          4      p\3        \5        TR,          4      \5        TP%                  R4      ;'       g
    TR,          4      4      p\5        TP%                  R4      ;'       g    TP%                  R4      ;'       g    ^4      p\6        P8                  ! 4       \;        ^T4      ,           p \=        T\#        TR,          4      TTR7      x € T! 4       '       d   \?        4       x €  RRR4       R# \A        4       x € \;        ^\5        T \6        P8                  ! 4       ,
          4      4      p!TPC                  TT\#        TR,          4      T!TTR7      p\#        TP%                  R4      ;'       g    R4      p"T"R8w  dX   T! 4       '       d   \?        4       x €  RRR4       R# T! 4       ;_uu_ 4        \E        TT4      p#RRR4       X#x €  RRR4       R# T! 4       '       d   \?        4       x €  RRR4       R# \;        ^\5        T \6        P8                  ! 4       ,
          4      4      p!TPG                  TTT\#        TR,          4      T!TR7      p$RRR4       TPI                  X$TTTTT R7      p T! 4       '       d   \?        4       x € R# T;'       g    \_        T4      p&T! 4       ;_uu_ 4        T&! 4       ;_uu_ 4       p'T''       d   TPa                  T4       RRR4       X''       d   TPc                  T4      p(RRR4       X''       g   \?        4       x € R# \g        \#        TP%                  R!4      ;'       g    R
4      Pi                  4       \#        X(P%                  R"4      ;'       g    R
4      \k        T(P%                  R#4      4      R$7      x € R#   + '       g   i     ELó; i  \          d!   p\        \#        T4      R7      p Rp?ELRp?ii ; i  + '       g   i     EL ; i  + '       g   i     EL£; i  TPJ                   d™    \        PL                  ! \         4      ;_uu_ 4        T! 4       ;_uu_ 4        TPO                  RT;'       g    RR7       RRR4       M  + '       g   i     M; iRRR4       M  + '       g   i     M; i\Q        4       x €  R# \R         dd   p\U        TPV                  \X        4      '       d   TPV                  MRp%T%'       d   \[        T%4      M\]        \#        T4      R7      x €  Rp?R# Rp?i\          d   p\[        T4      x €  Rp?R# Rp?ii ; i  + '       g   i     ELg; i  + '       g   i     ELZ; i  \          d$   p\e        R
\#        T4      R 7      x €  Rp?R# Rp?ii ; i5i)%aä  Sign the free tier into a Nous account, keeping its connectors. Yields :class:`SignInState`s.

One composition behind every surface: it reads the current identity itself, mints one when there
is none, registers the connector transfer, holds ONE absolute deadline across both waits,
persists only after a completed transfer AND a token grant, and runs
:func:`settle_after_upgrade` exactly once per completion. It always ends by yielding exactly one
state whose ``terminal`` is True -- a persist or settle failure becomes ``Failed``, never an
exception out of ``next()``.

*cancelled* is polled between round trips and inside :func:`wait_for_promotion`.
*cancel_wins_after_promotion* rules what a cancel means once the account service has already
transferred the connectors: True (the desktop) aborts and persists nothing -- the install
re-mints a free tier on next use; False (a chat that was superseded) finishes, because a
transfer the user approved in the browser is irreversible and discarding it would leave the
connectors moved with no account to reach them.
*persist_guard* lets a surface make its own cancel check and the save atomic under its own lock.
*scope* is entered only around the two non-network blocks (preconditions/mint, persist/settle),
never across a ``yield``: ``run_in_executor`` does not carry contextvars, so the scope has to be
entered inside the generator, on whichever thread is advancing it.
*client_factory* is the HTTP client seam, ``client_factory(timeout_seconds, verify)``.
r    )ÚPROVIDER_REGISTRYÚ_resolve_verify)Ú_request_device_code)Ú_nous_http_clientc                 ó   € R # ©Fr   r   r   r   Ú<lambda>Úrun_sign_in.<locals>.<lambda>L  s   € ©r   c                 ó   € R # rþ   r   r   r   r   rÿ   r   O  s   € ÑY^r   N)r‡   rÞ   r'   Úportal_base_urlÚ/Únous)ÚinsecureÚ	ca_bundleÚ
auth_stateÚ	user_codeÚdevice_code)r  r	  Ú	claim_urlÚverification_uri_completer   rF   Ú
claim_code)rD   rE   r   rF   )r   rF   rò   rà   rá   r`   )Úclientr  Ú	client_idr	  r   Úpoll_interval)r  r  rõ   Úverifyrñ   r�   rã   rÕ   Úaccount_emailr]   Úchanged)r\   r]   r_   )6r£   r¡   Úhermes_cli.authrù   rú   Úhermes_cli.auth_device_flowrû   Úhermes_cli.auth_nousrü   rî   ÚnullcontextÚcurrent_nous_stateÚis_guest_stater½   Úguest_allowedrÅ   Ú	Exceptionr   r­   Ú_portal_base_urlÚrstripr  rõ   Úregister_promotion_intentr¥   Úminr   ÚtimeÚ	monotonicr   rC   r   rS   Úwait_for_promotionrç   Ú_poll_for_tokenÚ_account_state_from_tokenÚAnonCredentialDeadÚsuppressræ   r�   ÚTimeoutErrorrØ   Ú	__cause__ÚConnectionErrorrÛ   r†   rð   Úpersist_nous_credentialsÚsettle_after_upgrader–   r[   Ústripr^   ))rñ   rò   ró   rô   rõ   rö   r§   rù   rú   rû   rü   ré   Úpost_promotion_cancelledÚ
open_scopeÚprecondition_stateÚstaterÒ   rÞ   ÚportalrÝ   Úaccount_stateÚpconfigr  Ú	scope_strr  Úopen_clientr  ÚdeviceÚintentrD   r   rF   ÚdeadlineÚ	remainingrà   ÚendedÚ
token_dataÚoutageÚguardÚmay_persistÚsettleds)   $$$$$$                                   r   Úrun_sign_inr?  )  s  é € õ< .ßBÝ@Ý6à×/Ð/¡€L÷ 0K™|ÑQ^ÐØ×0Ð0œ*×0Ñ0€Jð 15ÐØ&*€Eð:Ù�\�\Ø×,Ñ,Ó.ˆEß˜U×1Ñ1°%×8Ò8Ü%4Ó%6Ñ"ß %×"5Ñ"5×"7Ò"7Ü%0£]Ð"÷ ð Ò%Ø Ò Ùä�U—Y‘Y˜|Ó,×2Ð2°Ó3€JØ�i‰iÐ)Ó*×FÐF¨e×.DÑ.DÓ.F×NÑNÈsÓS€Fà €GØ.2€MðGØ# FÕ+ˆØ&×0Ñ0°'·-±-�9ˆ	á ¨$¸$È4ÔPˆØ$×9Ð9Ð(9ˆÙ˜¨&×1Ô1°VÙ)¨&°&¸)ÀYÓOˆFØ×4Ñ4Ø˜ 
´c¸&ÀÕ:MÓ6NÜ  }Õ 5Ó6ð 5ó 8ˆFô �v—z‘z +Ó.×4Ð4°"Ó5ˆDØ�‰˜s×#Ò#Ø ˜ $ Ð(�Ø×CÐCœ3˜vÐ&AÕBÓCˆDÜœS ¨Õ!5Ó6¼¸F¿J¹JÀ|Ó<T×<lÐ<lÐX^Ð_kÕXlÓ8mÓnˆJÜ˜6Ÿ:™: jÓ1×PÐP°V·Z±ZÀ
Ó5K×PÐPÈqÓQˆHÜ—~’~Ó'¬#¨a°Ó*<Õ<ˆHÜ˜D¤s¨6°,Õ+?Ó'@ÈZÐbjÔkÒkÙ�~Š~Ü “lÒ"Ø÷% 2Ñ1ô& “)ŠOä˜Aœs 8¬d¯nªnÓ.>Õ#>Ó?Ó@ˆIØ×.Ñ.Ø˜¤ F¨<Õ$8Ó 9Ø$¨xÀ<ð /ó QˆGô ˜Ÿ™ XÓ.×;Ð;°)Ó<ˆFØ˜Ô$ñ  —>’>Ü$›,Ò&Ø÷? 2Ñ1ñB  —\•\Ü*¨7°JÓ?�E÷ "à’Ø÷I 2Ñ1ñJ (×)Ò)Ü “lÒ"Ø÷O 2Ñ1ôR ˜Aœs 8¬d¯nªnÓ.>Õ#>Ó?Ó@ˆIØ×.Ñ.Ø¨vÀÜ  }Õ 5Ó6À9Ð\dð /ó fˆJ÷U 2ðZ ×7Ñ7Ø¨¸)È9Ø¨?ð 8ó <ˆð,Ù#×%Ò%Ü“,ÒÙØ×QÐQÔ!7Ð8PÓ!QˆÙ�\�\Ù—”˜KßØ×2Ñ2°=ÔA÷ ÷ Ø×4Ñ4°]ÓC�÷ ÷ Ü‹lÒÙä
Ü�'—+‘+˜oÓ.×4Ð4°"Ó5×;Ñ;Ó=Ü�'—+‘+˜gÓ&×,Ð,¨"Ó-Ü˜7Ÿ;™; yÓ1Ó2ô4ô 4÷e �\ˆ\ûô ô :ô )´°C³Ô9Öûð	:ú÷j "—\�\ú÷C 2×1Ð1ûð` ×#Ñ#ô ô × Ò ¤×+Õ+Ù—•Ø×&Ñ& y¸Z×=OÐ=OÈ4Ð&ÔP÷ ——�ú÷ ,×+×+Ð+úô ‹iŠÚÜô ô #-¨S¯]©]¼O×"LÒ"L�—’ÐRVˆß06Ô$ VÔ,¼HÌCÐPSËHÔ<UÒUÝûÜô Ü$ SÓ)Ò)Ýûðú÷ —�ú÷ �\ˆ\ûô ô ô ˜B¤s¨3£xÔ0Ò0Ýûðüs=  ‚/^.²^.Á ^.ÁW Á%/V2ÂV2Â(V2Â>
V2ÃW Ã&^.Ã7^.Ä$^.Ä;4X Å0X ÆA<XÈXÈA4XÊXÊA(XÌX Ì^.ÌBXÎ*XÎ7X Î?^.ÏXÏW4	ÏXÏ*X Ï2^.Ï4XÐXÐX Ð^.ÐAXÑ.X Ò]= Ò]= Ò'^.Ò)]= Ò2]= Ó])Ó]	Ó7])Ô])Ô]= Ô ^.Ô(/^.Õ0^.Ö	)^.Ö2W	Ö=W ×^.×W ×W1×W,×&^.×,W1×1^.×4X×?	XØX	Ø	X Ø3]ÙZ"ÙZÙ=	Z"ÚZÚZ"Ú	]Ú"Z2Ú-]Û^.Û]Û]Û5\,Ü"\,Ü&^.Ü,]Ü9]Ü:]Ý^.Ý]Ý^.Ý]&Ý 	])Ý)]:	Ý4]= Ý8^.Ý:]= Ý=^+Þ^&Þ ^.Þ&^+Þ+^.);r>   Ú
__future__r   rî   r   r  Údataclassesr   Útypingr   r   r   r   r   r	   r
   Úhermes_cli.auth_constantsr   ÚUPGRADE_STARTrÂ   rK   rŒ   r¶   rÏ   r|   Ú	frozensetrå   r¤   r²   r¯   rs   ro   rX   r!   ÚUPGRADE_CANCELLEDrÊ   ÚLOGIN_COMMANDÚLOGIN_STARTINGÚLOGIN_DM_ONLYÚLOGIN_BUSY_ELSEWHEREÚLOGIN_NOT_ALLOWEDÚFREE_TIER_RATE_LIMIT_CARDÚFREE_TIER_RATE_LIMIT_CHATr#   r&   rC   rS   r[   rv   r   r†   r�   r–   r½   rÅ   rÛ   rç   rð   r?  r   r   r   Ú<module>rN     sÏ  ðÙ Så "ã Û Û Ý !ß T× TÑ Tå +ð O€Ø0Ð Ø0Ð ØWÐ ØQÐ ØhÐ àÐhØÐ_Øð >àð DàÐwðÐ ñ Ð/Ð1HÐIÓJÐ á% ~Ð&6Ó7Ð ð[Ð ð kÐ ð ]Ð ØPÐ Ø*€Ø?Ð Ø*Ð ØdÐ Ø€Ø&€Ø<€ØgÐ ØEÐ ð1ð ð 6Ð8NÕNÐ õ]ñ �$Ô÷ð ó ðñ& �$ÔôMˆ;ó Mó ðMñ( �$Ôôˆkó ó ðñ �$Ôô8�ó 8ó ð8ñ, �$Ôô4ˆ{ó 4ó ð4ñ �$Ôô1�ó 1ó ð1ñ �$Ôô!ˆ{ó !ó ð!ñ �$Ôô6ˆkó 6ó ð6ñ �$Ôô$Zˆ[ó $Zó ð$ZñN �$Ôô)�kó )ó ð)ñ �$Ôô`�+ó `ó ð`õ]õ!õ,ðe4à!ðe4ð /3ðe4ð )-ð	e4ð
 CGðe4ð :>ðe4ð VZ÷e4ñ e4r   