+
    iHàj[  ã                   óŽ   a € R t0 t R t^ RIt^ RIHtHt ^ RIHt RR R lltRR R llt	R R	 lt
R
tR]R]R]/t] ^ k R R ltR# )z>Endpoint identity for auxiliary custom-provider health checks.N)ÚAnyÚOptional)Únormalize_route_base_urlc                óR   € V ^8„  d   QhR\         R\        \         ,          R\        /# )é   ÚproviderÚbase_urlÚreturn)Ústrr   r   )Úformats   "Ú;/home/ubuntu/.hermes/hermes-agent/agent/auxiliary_health.pyÚ__annotate__r      s%   € ÷ ñ ¤3ð ´(¼3µ-ð Ì3ñ ó    c                ó€   € ^ RI Hp ^ RIHp V! V 4      p\	        \        W4      4      pV! 4       pV'       d   VRV3# Wd3# )uý   Provider-wide key, or endpoint-specific key for an explicit custom endpoint â€” prefixed with the
active profile home: a 402 on profile A's account must not hide the provider from profile B's
(differently funded) account in the same multiplexed process.©Ú_normalize_chain_label)Úhermes_home_keyzcustom-endpoint)Úagent.auxiliary_clientr   Úhermes_constantsr   r   Ú_custom_health_base_url)r   r   r   r   ÚlabelÚendpointÚhome_keys   &&     r   Ú_unhealthy_cache_keyr      sE   € õ >Ý0Ù" 8Ó,€EÜ'Ô(?ÀÓ(SÓT€HÙÓ €HßØÐ*¨HÐ4Ð4Øˆ?Ðr   c                óR   € V ^8„  d   QhR\         R\        \         ,          R\         /# )r   r   Úexplicit_base_urlr	   )r
   r   )r   s   "r   r   r      s&   € ÷ ñ ¤cð ¼hÄs½mð ÔWZñ r   c                ót  € ^ RI Hp \        T;'       g    R4      P                  4       p^ RI Hp V! V 4      pVR8X  d   T;'       g    V! 4       # VP                  R4      '       d   V'       d   V# \        P                  ! \        4      ;_uu_ 4        ^ RI	H
pHp V! V4      '       d   T;'       g    V! 4       uuRRR4       # V! V 4      pV'       dG   T;'       g3    \        VP                  R4      ;'       g    R4      P                  4       uuRRR4       #  RRR4       R#   + '       g   i     R# ; i)	zQReturn the concrete custom endpoint used to scope health and failed-route checks.)Ú_current_custom_base_urlÚ r   zlocal/customzcustom:)Ú_get_named_custom_providerÚ_resolves_to_customNr   )r   r   r
   Ústripr   Ú
startswithÚ
contextlibÚsuppressÚImportErrorÚhermes_cli.runtime_providerr   r    Úget)	r   r   r   Úexplicitr   r   r   r    Úentrys	   &&       r   r   r      sô   € å?ÜÐ$×*Ð*¨Ó+×1Ñ1Ó3€HÝ=Ù" 8Ó,€EØ�ÔØ×5Ð5Ñ3Ó5Ð5Ø×Ñ˜	×"Ò"§xØˆÜ	×	Ò	œ[×	)Õ	)ß_Ù˜u×%Ò%Ø×9Ð9Ñ7Ó9÷ 
*Ò	)ñ +¨8Ó4ˆßØ×GÐGœs 5§9¡9¨ZÓ#8×#>Ð#>¸BÓ?×EÑEÓG÷ 
*Ò	)ð
 ÷ 
*ñ ÷ 
*Ö	)ñ ús*   ÂD&Â3D&ÃD&ÃD&ÃD&Ã<D&Ä&D7	c                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r   Úexcr	   )Ú	Exceptionr   r
   )r   s   "r   r   r   +   s   € ÷ ñ ¬yð ¼XÄc½]ñ r   c                ó<   a € ^ RI Hp \        V 3R lV 4       R4      # )a  Why a fallback candidate cannot serve this walk (``_FALLBACK_REASONS`` label), or None.

The same capacity classes that admitted the primary failure into the chain (payment/quota,
rate limit, connection, route-incompatible model, malformed response) mean "this lane is out
for now, try the next configured one"; anything else (a 400 request-shape error, a ValueError)
is the caller's bug and must still propagate. Auth errors are excluded on purpose: they have
their own refresh-then-quarantine path in the candidate helpers (#106367).)Ú_FALLBACK_REASONSc              3   ó^   <"  € T F"  w  rVR 8w  g   K  V! S4      '       g   K  Vx € K$  	  R# 5i)z
auth errorN© )Ú.0Ú	predicater   r+   s   &  €r   Ú	<genexpr>Ú8fallback_candidate_unavailable_reason.<locals>.<genexpr>5   s*   øé € ÐeÑ'8Ñ#�9¸EÀ\Ñ<QŒÑV_Ð`c×Vd�ŠÓ'8ùs   ƒ-“-£
-N)r   r.   Únext)r+   r.   s   f r   Ú%fallback_candidate_unavailable_reasonr6   +   s!   ø€ õ 9ÜÜeÑ'8ÓeØóð r   g      N@z
rate limitzconnection errorzinvalid provider responsec                ó\   € V ^8„  d   QhR\         \        ,          R\         \        ,          /# )r   Úreasonr	   )r   r
   Úfloat)r   s   "r   r   r   F   s"   € ÷ 7ñ 7¬h´s­mð 7ÄÌÅñ 7r   c                ó@   € \         P                  T ;'       g    R4      # )z•Seconds to hide a fallback candidate for ``reason`` (a ``_FALLBACK_REASONS`` label, or None
for a stale credential); None means the long default TTL.r   )Ú_CANDIDATE_QUARANTINE_TTLr'   )r8   s   &r   Ú!fallback_candidate_quarantine_ttlr<   F   s   € ô %×(Ñ(¨¯¨°2Ó6Ð6r   c                óx   € V ^8„  d   Qh/ ^ \         9   d&   \        \        \        \        ,          3,          ;R&   # )r   r;   )Ú__conditional_annotations__Údictr
   r   r9   )r   s   "r   r   r      s/   € × DÑ D÷|ò œ4¤¤X¬e¥_Ð 4Õ5ñ ò} Er   )N)r>   Ú__doc__r#   Útypingr   r   Úhermes_cli.route_identityr   r   r   r6   Ú'_TRANSIENT_CANDIDATE_QUARANTINE_SECONDSr;   r<   r   )r>   s   @r   Ú<module>rD      sM   øðÞ DÛ ß  å >÷÷õ,ð& +/Ð 'àÐ9ØÐ?ØÐ!Hð9Ð ó ÷7r   