+
    jHàj»  ã                  ó8  € R t ^ RIHt ^ RIHtHtHt ]! 0 R'm4      tRRRRRRR	R
/t	 ! R R]
4      t]! RR04      t ! R R]4      tR R ltR R ltR R ltRR/R R lltR R lt]]].]3,          ]3,          tR R ltRR RR/R! R" lltRR#/R$ R% lltR&# )(am  Plain-language copy for sign-in and provider-setup failures (CLI).

One table of ``(predicate, lead sentence)`` classifies an exception into a sentence a first-time
user can act on; the raw exception is demoted to a ``Details:`` line so nothing is lost for
support. Callers print ``sign_in_failure_lines(...)`` / ``provider_setup_failure_lines(...)``
line by line.
)Úannotations)ÚCallableÚSequenceÚTupleÚexpired_tokenz`The sign-in code expired before it was approved in the browser. Run `{retry}` to get a new code.Úaccess_deniedzpSign-in was declined in the browser. Run `{retry}` to try again, or `hermes model` to pick a different provider.Úinvalid_grantzQThe sign-in code was not accepted by the server. Run `{retry}` to get a new code.Úinvalid_clientz\The server did not recognize this copy of Hermes. Run `hermes update`, then `{retry}` again.c                  ó   € ] tR t^!tRtRtRtR# )ÚDeviceCodeExpiredz[The device code ran out before the user approved it in the browser (not a network timeout).Údevice_code_timeout© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚcodeÚ__static_attributes__r   ó    Ú?/home/ubuntu/.hermes/hermes-agent/hermes_cli/auth_error_copy.pyr   r   !   s
   † Ùeà „Dr   r   r   Útimeoutc                  ó:   a € ] tR t^+tRtRR/R V 3R llltRtV ;t# )ÚSignInCopyErrorzOException whose ``str()`` is already user copy (lead line + ``Details:`` line).Úoauth_error_codeÚ c               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚmessageÚstrr   ÚreturnÚNoner   )Úformats   "r   Ú__annotate__ÚSignInCopyError.__annotate__.   s!   € ÷ 1ñ 1 ð 1¸#ð 1Àtñ 1r   c               	ó2   <€ \         SV `  V4       W n        R # ©N)ÚsuperÚ__init__r   )Úselfr   r   Ú	__class__s   &&$€r   r(   ÚSignInCopyError.__init__.   s   ø€ Ü‰Ñ˜Ô!Ø 0Ör   ©r   )r   r   r   r   r   r(   r   Ú__classcell__)r*   s   @r   r   r   +   s   ø† ÙYð1À÷ 1÷ 1ð 1r   r   c               ó    € V ^8„  d   QhRRRR/# ©r   ÚexcÚBaseExceptionr    Úboolr   )r"   s   "r   r#   r#   3   s   € ÷ bñ b˜-ð b¨Dñ br   c                ó
  € \        V \        \        34      '       d   R# \        V 4      P                   Uu0 uF  qP
                  kK  	  pp\        V\        ,          4      ;'       g    \        V \        \        34      # u upi )zLTrue for connection/DNS/timeout failures from httpx, requests or the stdlib.F)
Ú
isinstancer   r   ÚtypeÚ__mro__r   r2   Ú_NETWORK_ERROR_TYPESÚConnectionErrorÚTimeoutError)r0   ÚclsÚnamess   &  r   Úis_network_errorr<   3   se   € ä�#œÔ):Ð;×<Ò<ÙÜ%)¨#£Y×%6Ò%6Ó7Ñ%6˜c�\Œ\Ñ%6€EÐ7Ü�Ô,Õ,Ó-×aÐa´¸CÄ/ÔS_ÐA`Ó1aÐaùò 8s   ¶B c               ó    € V ^8„  d   QhRRRR/# r/   r   )r"   s   "r   r#   r#   ;   s   € ÷ Hñ H ð H°$ñ Hr   c                óZ   € \        V RR4      \        9   ;'       g    \        V RR4      R8H  # )zNTrue when a device-code sign-in ended because its code ran out (any provider).r   Nr   r   r   )ÚgetattrÚ_DEVICE_CODE_EXPIRED_CODES©r0   s   &r   Úis_device_code_expiredrB   ;   s8   € ä�C˜ Ó&Ô*DÑD÷ Gð GÜ�sÐ.°Ó3°ÑFðHr   c               ó    € V ^8„  d   QhRRRR/# r/   r   )r"   s   "r   r#   r#   A   s   € ÷ Dñ D�mð D¨ñ Dr   c                óŒ   € \        V \        \        34      ;'       g(    \        V \        4      ;'       d    V P                  R9   # )é‚   )rE   Né    )r4   ÚKeyboardInterruptÚEOFErrorÚ
SystemExitr   rA   s   &r   Úis_cancelledrJ   A   s?   € Ü�cÔ-¬xÐ8Ó9÷ Dð DÜ�3œ
Ó#×BÐB¨¯©°NÑ(BðDr   Úretry_commandzhermes portalc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r   r   ÚdescriptionrK   r    r   r   )r"   s   "r   r#   r#   F   s/   € ÷ hñ h˜Cð h¨cð hÀSð hÐ_nñ hr   c               óê   € \         P                  V R4      P                  VR7      pV'       g   RT;'       g    R RV R2pV '       d   V  RV 2MTp\        V'       d   V RV 2V R	7      # TV R	7      # )
zÓException for an OAuth device-flow error code whose text is already user-facing.

Unknown codes keep the server's description as the lead (it is the only information available)
but still name the retry command.
r   )ÚretryzSign-in did not complete: zthe server rejected the requestz. Run `z` to try again.z: z
  Details: r,   )ÚDEVICE_FLOW_ERROR_COPYÚgetr"   r   )r   rM   rK   ÚleadÚdetailss   &&$  r   Údevice_flow_errorrT   F   s†   € ô "×%Ñ% d¨BÓ/×6Ñ6¸]Ð6ÓK€DßØ,¨[×-]Ð-]Ð<]Ð,^ð _Ø%� oð7ˆç*.���b˜˜Ñ&°K€GÜ¿g˜d˜V =°°	Ð:ÐbfÔgÐgÈ4ÐbfÔgÐgr   c               ó    € V ^8„  d   QhRRRR/# )r   r0   r1   r    r   r   )r"   s   "r   r#   r#   T   s   € ÷  ñ  �}ð  ¨ñ  r   c                óx   € \        V 4      P                  4       ;'       g    \        V 4      P                  pR V 2# )z  Details: )r   Ústripr5   r   )r0   Útexts   & r   Ú_details_linerY   T   s1   € Üˆs‹8�>‰>Ó×1Ð1œt C›y×1Ñ1€DØ˜˜ÐÐr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r0   r1   ÚruleszSequence[_Rule]Úotherr   r    r   )r"   s   "r   r#   r#   \   s.   € ÷ Dñ D�=ð D¨ð DÀð DÈñ Dr   c                ó0   a € \        V 3R  lV 4       V4      # )c              3  óL   <"  € T F  w  rV! S4      '       g   K  Vx € K  	  R # 5ir&   r   )Ú.0ÚpredÚcopyr0   s   &  €r   Ú	<genexpr>Ú_classify.<locals>.<genexpr>]   s   øé € Ð;©™*˜$±°c·—’«ùs   ƒ$š
$)Únext)r0   r[   r\   s   f&&r   Ú	_classifyre   \   s   ø€ ÜÔ;©Ó;¸UÓCÐCr   Úservice_hostzportal.nousresearch.comc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r0   r1   rf   r   rK   r    Úlistr   )r"   s   "r   r#   r#   `   s,   € ÷ ñ Ø	ðØ),ðØY\ðà	ñr   c               ó4  € ^ RI Hp V! V 4       \        V \        4      '       d   \	        V 4      P                  4       # \        R3\        R33p\        WR4      pVP                  WR7      .p\        V 4      '       g   VP                  \        V 4      4       V# )zULines to print when a device-code / browser sign-in fails for any non-timeout reason.)Únote_sign_in_failurez@Sign-in was cancelled. Run `{retry}` when you want to try again.ztCould not sign in: Hermes could not reach {host}. Check your internet connection or proxy, then run `{retry}` again.z^Could not sign in. Run `{retry}` to try again, or `hermes model` to pick a different provider.)ÚhostrO   )Ú-hermes_cli.observability.shared_metrics_setuprj   r4   r   r   Ú
splitlinesrJ   r<   re   r"   ÚappendrY   )r0   rf   rK   rj   r[   rR   Úliness   &$$    r   Úsign_in_failure_linesrp   `   s–   € õ Sá˜ÔÜ�#”×'Ò'Ü�3‹x×"Ñ"Ó$Ð$ä	ÐYÐZÜ	ð
%ð	&ð€Eô ØØhój€Dð �[‰[˜lˆ[Ó@ÐA€EÜ˜×ÒØ�‰”] 3Ó'Ô(Ø€Lr   zhermes modelc               ó$   € V ^8„  d   QhRRRRRR/# )r   r0   r1   rK   r   r    rh   r   )r"   s   "r   r#   r#   x   s"   € ÷ ñ  mð Àsð Ð`dñ r   c               ó^  € RV R2p\        V \        4      '       dB   \        V 4      P                  4       vr4RV^ ,          P	                  4        VR,           2V.VO# \
        R3\        R33p\        WR4      pRV R	2V.p\        V 4      '       g   VP                  \        V 4      4       V# )
zmLines to print when the setup wizard's provider step fails: reason, that nothing was saved,
and how to retry.zJYour provider settings were not changed. Continue the wizard now and run `z` afterwards to try again.z(Could not finish connecting a provider: :é   NNzsign-in was cancelledz<no internet connection, or the provider could not be reachedz2something went wrong while talking to the providerz(Could not finish connecting a provider (z).)
r4   r   r   rm   ÚlowerrJ   r<   re   rn   rY   )r0   rK   Únothing_savedrR   rS   r[   Úreasonro   s   &$      r   Úprovider_setup_failure_linesrw   x   sÅ   € ð	Øˆ?Ð4ð	6ð ô �#”×'Ò'Ü˜S›×,Ñ,Ó.ˆˆØ:¸4À½7¿=¹=»?Ð:KÈDÐQSÍHÈ:ÐVÐXeÐpÐhoÐpÐpä	Ð.Ð/Ü	ÐYÐZð€Eô �sÐ#WÓX€FØ7¸°x¸rÐBÀMÐR€EÜ˜×ÒØ�‰”] 3Ó'Ô(Ø€Lr   N>   Ú	ReadErrorÚ
ProxyErrorÚPoolTimeoutÚReadTimeoutÚConnectErrorÚNetworkErrorÚWriteTimeoutÚConnectTimeoutÚTimeoutExceptionÚRemoteProtocolErrorÚUnsupportedProtocol)r   Ú
__future__r   Útypingr   r   r   Ú	frozensetr7   rP   r9   r   r@   ÚRuntimeErrorr   r<   rB   rJ   rT   rY   Útupler1   r2   r   Ú_Rulere   rp   rw   r   r   r   Ú<module>r‰      sä   ðñõ #ç ,Ñ ,ñ !ò "ó Ð ð ØjØð	àØ[ØØfð
Ð ô!˜ô !ñ 'Ð(=¸yÐ'IÓJÐ ô1�lô 1õbõHõDð
hÈ?÷ hõ ð
 	ˆh˜�¨Ð,Õ-¨sÐ2Õ3€õDðØ/HðØ_n÷ð0È^÷ ñ r   