+
    „WÝjŠ  ã                  ó®   a € 0 t $ R t^ RIHt ^ RIHt ^xtRRRRRRRRRRRRR	R	R
R
RRRR/
tR]R&   Rt	]3R R llt
R R ltRRRRRR/R R lltR R ltR# )a·  Plain-language copy for chat-turn failures shown in the CLI response panel.

The chat panel used to echo ``Error: HTTP 401: Invalid API key`` as the assistant's answer. These
helpers map the classifier verdict (``agent/error_classifier.py``) to WHAT happened + WHAT TO DO,
and demote the raw provider text to a ``Details:`` line. Copy lives in the i18n catalog under
``cli.error.*`` and is resolved at render time for the active language.
)Úannotations)ÚtÚauthÚauth_permanentÚbillingÚmodel_not_foundÚ
rate_limitÚupstream_rate_limitÚupstream_blockedÚ
overloadedÚserver_errorÚtimeoutzdict[str, str]Ú_REASON_KEYSÚunknownc               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚtextÚstrÚlimitz
int | NoneÚreturn© )Úformats   "ÚRC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\cli_chat_error_copy.pyÚ__annotate__r      s&   € ÷ bñ b�ð b˜Zð b¸Sñ bó    c                ó  € T ;'       g    R P                  4       '       d0   T ;'       g    R P                  4       P                  4       ^ ,          MR pVe   \        V4      V8:  d   V# VRV^,
           P                  4       R,           # )Ú Nu   â€¦)ÚstripÚ
splitlinesÚlenÚrstrip)r   r   Úfirsts   && r   Ú_shortr"      sn   € Ø59·Z°Z¸R×4FÑ4F×4HÒ4HˆT�ZˆZ�R×ÑÓ ×+Ñ+Ó-¨aÖ0Èb€EØ’M¤S¨£Z°5Ô%8ˆ5Ða¸eÀKÀeÈaÅiÐ>P×>WÑ>WÓ>YÐ\aÕ>aÐar   c               ó    € V ^8„  d   QhRRRR/# )r   ÚerrorzBaseException | strr   r   r   )r   s   "r   r   r   $   s   € ÷ Tñ TÐ+ð T°ñ Tr   c                óœ  € \        V RR4      p\        V\        4      '       d   TM/ p\        VP	                  R4      ;'       g    R4      P                  4       \        VP	                  R4      ;'       g    R4      P                  4       r2V'       g   V'       g   \        V 4      # T  RT;'       g    R V'       d   RV,            R	2# R R	2# )
a×  The refusal as the client shows it: the reason code, plus the check that fired when the owner
named one (``invalid_params (toolsets: unknown or invalid toolset name: 'mcp-codegraph')``).

The gateway sends ``field``/``detail`` in the JSON-RPC error's ``data``
(``gateway/session_controls.py``), and ``hermes_cli.gateway_client.rpc_error`` carries the
bounded scalars onto ``GatewayRPCError.data``. A refusal from anywhere else has no ``data`` and
reads exactly as before.ÚdataNÚfieldr   Údetailz (zunnamed fieldz: Ú))ÚgetattrÚ
isinstanceÚdictr   Úgetr   )r$   r&   r'   r(   s   &   r   Úrefusal_textr.   $   s°   € ô �5˜& $Ó'€DÜ˜d¤D×)Ò)‰4¨r€DÜ˜Ÿ™ Ó)×/Ð/¨RÓ0×6Ñ6Ó8¼#¸d¿h¹hÀxÓ>P×>VÐ>VÐTVÓ:W×:]Ñ:]Ó:_ˆ6ßŸÜ�5‹zÐØˆW�B�u×/Ð/ Ð0Ç&°¸µÐ0QÐQRÐSÐSÈbÐ0QÐQRÐSÐSr   Úproviderr   ÚmodelÚfailure_reasonNc          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   r$   zException | strr/   r   r0   r1   z
str | Noner   r   )r   s   "r   r   r   4   s;   € ÷ \ñ \Øð\Ø),ð\Ø:=ð\ØT^ð\àñ\r   c          	     ót  € \        T;'       g    R4      P                  4       pV'       d;   ^ RIHp \        T ;'       g    R4      P                  4       pWE9   d   V'       d   V# Md^ RIHp \        V \        4      '       d   T M\        \        V 4      4      pT! Y�;'       g    RT;'       g    RR7      P                  P                  p\        R\        P                  V\        4       2T;'       g    \        R4      T;'       g    \        R4      R7      p	\        RV	\        \        V 4      R	4      R
7      # )aû  Two-line panel text: plain sentence with the fix command, then ``Details: <raw>``.

``failure_reason`` is the verdict the turn loop already stamped on its result
(``agent/turn_failure_copy.stamp_failure``). When present it is used as-is instead of
re-classifying a summarised string (which has no status code and almost always lands on
'unknown'); for the loop's own site codes the ``error`` text is already the user-facing copy,
so it is returned verbatim rather than wrapped and demoted to a Details line.r   )ÚSITE_FAILURE_CODES)Úclassify_api_error)r/   r0   z
cli.error.zcli.error.the_providerzcli.error.the_current_modelzcli.error.with_detailsi,  )ÚleadÚdetails)r   r   Úagent.turn_failure_copyr4   Úagent.error_classifierr5   r+   Ú	ExceptionÚreasonÚvaluer   r   r-   Ú_UNKNOWN_KEYr"   r.   )
r$   r/   r0   r1   r;   r4   r   r5   Úexcr6   s
   &$$$      r   Úchat_error_responser?   4   só   € ô �×%Ð% 2Ó&×,Ñ,Ó.€FßÝ>ä�5—;�;˜BÓ×%Ñ%Ó'ˆØÔ'¯DØˆKøå=ä! %¬×3Ò3‰e¼Ä3ÀuÃ:Ó9NˆÙ# C·.°.¸bÈÏÈÐQSÔT×[Ñ[×aÑaˆÜØ
”\×%Ñ% f¬lÓ;Ð<Ð=Ø×8Ð8œQÐ7Ó8Ø×7Ð7”qÐ6Ó7ô€Dô
 Ð%¨D¼&ÄÈeÓATÐVYÓ:ZÔ[Ð[r   c               ó    € V ^8„  d   QhRRRR/# )r   r$   ÚBaseExceptionr   r   r   )r   s   "r   r   r   R   s   € ÷ 	nñ 	n mð 	n¸ñ 	nr   c                óº   € ^ RI Hp \        W4      '       d   RM\        p\	        R\        \        V 4      V4      ;'       g    \        V 4      P                  R7      # )a$  Copy for a failed AIAgent build on first message: the user's turn was dropped.

A gateway that cannot be reached keeps its whole first line: its discovery detail is already
bounded (``DiscoveryError.bounded_detail``) and ends in the repair command, which the summary
limit would cut mid-path.)ÚGatewayUnavailableErrorNzcli.error.agent_init_failed)r$   )	Úhermes_cli.gateway_clientrC   r+   Ú_SUMMARY_LIMITr   r"   r.   ÚtypeÚ__name__)r$   rC   r   s   &  r   Úagent_init_failure_messagerH   R   sH   € õ Bä˜u×>Ò>‰DÄN€EÜÐ*´&¼ÀeÓ9LÈeÓ2T×2lÐ2lÔX\Ð]bÓXc×XlÑXlÔmÐmr   )Ú__conditional_annotations__Ú__doc__Ú
__future__r   Ú
agent.i18nr   rE   r   Ú__annotations__r=   r"   r.   r?   rH   )rI   s   @r   Ú<module>rN      s›   øðôõ #å à€ð ˆFØ�fØˆyØÐ(Ø�,Ø˜<ØÐ*Ø�,Ø�NØˆyð €ˆnó ð €ð +9÷ bõ
Tð \Ø/1ð\Ø@Bð\Øae÷\÷<	nr   