+
    jHàj¸  ã                  óZ  € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHt ^ RI	H
t
Ht R R lt]! R]
P                  4      ]! R	]
P                  4      ]! R
]
P                  4      utttR R ltRR/R R lltR R ltR R lt]R]3R R ll4       t] ! R R4      4       tRR R lltR R ltR# )zHDoctor output primitives shared by every ``hermes_cli.doctor_*`` module.)ÚannotationsN)Úcontextmanager)Ú	dataclassÚfield)ÚColorsÚcolorc               ó    € V ^8„  d   QhRRRR/# )é   ÚglyphÚstrÚcol© )Úformats   "Ú=/home/ubuntu/.hermes/hermes-agent/hermes_cli/doctor_report.pyÚ__annotate__r      s   € ÷ @ñ @�ð @˜3ñ @ó    c                ó   a a€ RVV 3R ll# )Ú c                ó¦   <€ \        R \        SS4       RV  2V'       d(   R\        V\        P                  4       2,           4      # R,           4      # )z  Ú r   )Úprintr   r   ÚDIM)ÚtextÚdetailr   r
   s   &&€€r   Ú<lambda>Ú_mark.<locals>.<lambda>   sH   ø€ ¤5¨2¬e°E¸3Ó.?Ð-@ÀÀ$ÀÐ)H×ouÈaÔPUÐV\Ô^d×^hÑ^hÓPiÐOjÐLkÕ)~Ô#Ð{}Õ)~Ô#r   )r   r   )r
   r   s   ffr   Ú_markr      s	   ù€ ßÐr   u   âœ“u   âš u   âœ—c               ó   € V ^8„  d   QhRR/# )r	   r   r   r   )r   s   "r   r   r      s   € ÷ 5ñ 5�Sñ 5r   c                óX   € \        R \        R\        P                  4       RV  24       R# )z    u   â†’r   N)r   r   r   ÚCYAN)r   s   &r   Ú
check_infor       s#   € Ü	ˆD”�uœfŸk™kÓ*Ð+¨1¨T¨FÐ
3Ö4r   ÚfailFc               ó   € V ^8„  d   QhRR/# )r	   r!   Úboolr   )r   s   "r   r   r      s   € ÷ ñ  tñ r   c               ó®   € V '       d   TMTpV '       d   \         MV'       d   \        M\        ! \        V\        4      '       d   V3MT!   \        V 4      # )zª``check_ok(*ok)`` when *cond* else ``check_warn(*bad)`` (``check_fail`` with fail=True); returns bool(cond).
*ok* / *bad* are a text string or a ``(text, detail)`` tuple.)Úcheck_okÚ
check_failÚ
check_warnÚ
isinstancer   r#   )ÚcondÚokÚbadr!   Úargss   &&&$ r   Ú
check_boolr-      s=   € ÷ ‰2˜3€Dß…X¯$�J´JÐ?ÌjÐY]Ô_b×NcÒNcÀDÁ7ÐimÒoÜ�‹:Ðr   c               ó    € V ^8„  d   QhRRRR/# )r	   Útitler   ÚreturnÚNoner   )r   s   "r   r   r      s   € ÷ ;ñ ;�Cð ;˜Dñ ;r   c                ó„   € \        4        \        \        RV  2\        P                  \        P                  4      4       R# )u@   Print a doctor section banner: blank line + bold cyan â—† title.u   â—† N)r   r   r   r   ÚBOLD)r/   s   &r   Ú_sectionr4      s&   € ä	„GÜ	Œ%�$�u�g�¤§¡¬V¯[©[Ó
9Ö:r   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r	   r   r   r   ÚfixÚissuesz	list[str]r0   r1   r   )r   s   "r   r   r   %   s/   € ÷ ñ ˜#ð  sð °ð ¸ið ÈDñ r   c                ó>   € \        W4       VP                  V4       R# )z?Emit a check_fail and append the corresponding fix instruction.N)r&   Úappend)r   r   r6   r7   s   &&&&r   Ú_fail_and_issuer:   %   s   € äˆtÔØ
‡M�M�#Ör   z({e})c               ó    € V ^8„  d   QhRRRR/# )r	   r   r   r   r   )r   s   "r   r   r   ,   s   € ÷ 9ñ 9˜ð 9 Sñ 9r   c              #  ó¸   "  €  Rx € R#   \          dC   pT '       d0   T! T P                  TR7      TP                  TR7      4        Rp?R#  Rp?R# Rp?ii ; i5i)zºBest-effort block: an exception prints ``report(text.format(e=e), detail.format(e=e))`` (nothing when
*text* is ``""``) instead of propagating. ``{e}`` in either string is the exception.N)Úe)Ú	Exceptionr   )r   r   Úreportr=   s   &&& r   Úwarn_on_errorr@   +   sG   é € ð9ÝøÜô 9ßÙ�4—;‘; �;Ó# V§]¡]°Q ]Ó%7×8Ò8õ ûð9üs*   ‚A„
 ˆAŠA•1AÁAÁAÁAc                  ón   € ] tR t^6t$ Rt]! ]R7      tR]R&   ]! ]R7      t	R]R&   ^ t
R]R&   R R	 ltR
tR# )ÚFindingzZWhat one doctor check contributed: auto-fixable issues, manual-only issues, fixes applied.)Údefault_factoryÚlistr7   Úmanual_issuesÚintÚfixedc               ó    € V ^8„  d   QhRRRR/# )r	   ÚotherrB   r0   r1   r   )r   s   "r   r   ÚFinding.__annotate__>   s   € ÷ "ñ "˜7ð " tñ "r   c                	óà   € V P                   P                  VP                   4       V P                  P                  VP                  4       V ;P                  VP                  ,          un        R # ©N)r7   ÚextendrE   rG   )ÚselfrI   s   &&r   ÚmergeÚFinding.merge>   sD   € Ø�‰×Ñ˜5Ÿ<™<Ô(Ø×Ñ×!Ñ! %×"5Ñ"5Ô6Ø�
Š
�e—k‘kÕ!�
r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   rD   r7   Ú__annotations__rE   rG   rO   Ú__static_attributes__r   r   r   rB   rB   6   s6   ‡ ádá¨Ô.€FˆDÓ.Ù°Ô5€M�4Ó5Ø€Eˆ3ƒN÷"ñ "r   rB   c               ó    € V ^8„  d   QhRRRR/# )r	   Úon_errorz
str | Noner   r   r   )r   s   "r   r   r   D   s   € ÷ ñ ˜:ð °cñ r   c                ó   a a€ VV 3R lpV# )aG  Turn ``fn(should_fix, f: Finding)`` into a ``(should_fix) -> Finding`` doctor check.

*on_error* None: exceptions propagate (as they always did for that check). Otherwise the check is
best-effort via :func:`warn_on_error` (``""`` = silent) and the partial Finding is still returned,
so issues recorded before the crash survive.c                óR   <a € \         P                  ! S 4      R  VV V3R ll4       pV# )c               ó    € V ^8„  d   QhRRRR/# )r	   Ú
should_fixr#   r0   rB   r   )r   s   "r   r   Ú0doctor_check.<locals>.deco.<locals>.__annotate__L   s   € ÷ 	ñ 	˜dð 	 wñ 	r   c                óª   <€ \        4       pSf   S! W4       V# \        SS4      ;_uu_ 4        S! W4       R R R 4       V#   + '       g   i     T# ; irL   )rB   r@   )r]   Úfr   ÚfnrY   s   & €€€r   ÚcheckÚ)doctor_check.<locals>.deco.<locals>.checkK   sN   ø€ ä“	ˆAØÒÙ�:Ô!ð ˆHô # 8¨V×4Õ4Ù�zÔ%÷ 5àˆH÷ 5Ö4àˆHús   ®	AÁA	)Ú	functoolsÚwraps)ra   rb   r   rY   s   f €€r   ÚdecoÚdoctor_check.<locals>.decoJ   s*   ù€ Ü	�Š˜Ó	÷	ñ 	ó 
ð	ð ˆr   r   )rY   r   rf   s   ff r   Údoctor_checkrh   D   s   ù€ ö
ð €Kr   c               ó0   € V ^8„  d   QhRRRRRRRRRRR	R
/# )r	   r`   rB   r]   r#   Ú
exists_msgr   Úcreated_msgÚmissing_msgr0   r1   r   )r   s   "r   r   r   X   sA   € ÷ 	Bñ 	B�'ð 	B tð 	B¸sð 	BÐQTð 	BÐcfð 	BÐkoñ 	Br   c                óæ   € VP                  4       '       d   \        V4       R# V'       d:   VP                  RRR7       \        V4       V ;P                  ^,          un        R# \	        VR4       R# )zjok when *path* exists; with --fix create it (counts as fixed); else warn "(will be created on first use)".T)ÚparentsÚexist_okz(will be created on first use)N)Úexistsr%   ÚmkdirrG   r'   )r`   r]   Úpathrj   rk   rl   s   &&&&&&r   Ú
ensure_dirrs   X   sH   € à‡{�{‡}‚}Ü�Öß	Ø�
‰
˜4¨$ˆ
Ô/Ü�ÔØ	�Š�1��ä�;Ð @ÖAr   )Nr   )rU   Ú
__future__r   rd   Ú
contextlibr   Údataclassesr   r   Úhermes_cli.colorsr   r   r   ÚGREENÚYELLOWÚREDr%   r'   r&   r    r-   r4   r:   r@   rB   rh   rs   r   r   r   Ú<module>r{      s­   ðÙ Nå "ã Ý %ß (ç +õ@ñ $)¨°·±Ó#=¹uÀUÈFÏMÉMÓ?ZÑ\aÐbgÐio×isÑisÓ\tÐ  €ˆ*�jõ5ð¨e÷ õ;õð Ø+2¸:ö 9ó ð9ð ÷
"ð 
"ó ð
"÷÷(	Br   