+
    jHàj¤:  ã                   óª  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RIHt ]P                  ! R4      tR7R R lltR R	 ltR
 R ltR R ltR R ltR R ltR R ltRtR R ltR R ltR R ltR R ltRtRtR R  ltR! R" ltR8t R# R$ lt!R% R& lt"R7R' R( llt#R) R* lt$R+ R, lt%R- R. lt&R7R/ R0 llt'R1 R2 lt(R3 R4 lt)R5 R6 lt*R# )9zPUpdate dependency diagnostics, historical markers and Windows launcher recovery.N©ÚPath©ÚNoReturn)Ú_early_recoveryzhermes_cli.mainc                óL   € V ^8„  d   QhR\         R,          R\        R,          /# )é   Ú	debug_fmtNÚreturn)ÚstrÚdict)Úformats   "ÚC/home/ubuntu/.hermes/hermes-agent/hermes_cli/main_install_repair.pyÚ__annotate__r      s"   € ÷ :ñ :¤#¨¥*ð :¼¸t½ñ :ó    c                ó¦  € ^ RI Hp VR,          pVP                  4       '       g   R#  ^ RIpVP	                  R4      ;_uu_ 4       pVP                  V4      P                  R/ 4      pRRR4       \        X\        4      '       d   T# R#   + '       g   i     L*; i  \         d)   pT '       d   \        P                  Y4        Rp?R# Rp?ii ; i)zJ``[project]`` table of pyproject.toml, or ``None`` when absent/unreadable.©ÚPROJECT_ROOTzpyproject.tomlNÚrbÚproject)Úhermes_cli.mainr   Úis_fileÚtomllibÚopenÚloadÚgetÚ	ExceptionÚloggerÚdebugÚ
isinstancer   )r	   r   Ú	pyprojectr   Úhandler   Úexcs   &      r   Ú_pyproject_projectr#      sž   € å,ØÐ/Õ/€IØ×Ñ×ÒÙðÛØ�^‰^˜D×!Ô! VØ—l‘l 6Ó*×.Ñ.¨y¸"Ó=ˆG÷ "ô ! ¬$×/Ò/ˆ7Ð9°TÐ9÷ "×!ûäô ßÜ�L‰L˜Ô(Ýûðús5   ©B Á"B
Á(B Â
B	ÂB ÂB ÂCÂ(CÃCc                ó$   € V ^8„  d   QhR\         /# ©r   r
   r   )r   s   "r   r   r   *   s   € ÷ /ñ /œTñ /r   c                  ó    € ^ RI Hp  V R,          # )é    r   z.update-incomplete©r   r   r   s    r   Ú_update_marker_pathr)   *   s   € Ý,ØÐ.Õ.Ð.r   c                ó$   € V ^8„  d   QhR\         /# r%   r   )r   s   "r   r   r   /   s   € ÷ 5ñ 5¤4ñ 5r   c                  ó    € ^ RI Hp  V R,          # )r'   r   z.lazy-refresh-incompleter(   r   s    r   Ú_lazy_refresh_marker_pathr,   /   s   € Ý,ØÐ4Õ4Ð4r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úrootr
   )r   Úbool)r   s   "r   r   r   4   s   € ÷ bñ b¤Tð b¬dñ br   c                ó    € R\         P                  9   ;'       d5    V \        \        4      P	                  4       P
                  P
                  8H  # )a  True under pytest when ``root`` is this checkout: unsandboxed update/recovery tests must
neither litter the live repo root with breadcrumbs (false-arming the developer's next launch)
nor run a real reinstall against the executing venv (cf. ``managed_scope._under_pytest``).ÚPYTEST_CURRENT_TEST)ÚosÚenvironr   Ú__file__ÚresolveÚparent)r.   s   &r   Ú_pytest_owns_live_checkoutr7   4   s9   € ð !¤B§J¡JÑ.×aÐa°4¼4Ä»>×;QÑ;QÓ;S×;ZÑ;Z×;aÑ;aÑ3aÐar   c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   ÚpathÚlabelr
   N)r   r   )r   s   "r   r   r   ;   s&   € ÷ Bñ BœTð B¬Sð B°Tñ Br   c               ó    €  V P                  4        R#   \         d     R# \         d"   p\        P	                  RY4        Rp?R# Rp?ii ; i)z3Remove an update-recovery breadcrumb. Never raises.zCould not clear %s marker: %sN)ÚunlinkÚFileNotFoundErrorÚOSErrorr   r   )r9   r:   r"   s   &$ r   Ú_clear_marker_filer?   ;   s@   € ðBØ�‰ŽøÜô ÚÜô BÜ�‰Ð4°e×AÒAûðBús   ‚ ”A¢A«A¬AÁAc                ó   € V ^8„  d   QhRR/# ©r   r
   N© )r   s   "r   r   r   E   s   € ÷ Iñ I¨ñ Ir   c                 ó0   € \        \        4       RR7       R# )z=Remove the interrupted core-install breadcrumb. Never raises.zupdate-incomplete©r:   N)r?   r)   rB   r   r   Ú_clear_update_incomplete_markerrE   E   s   € äÔ*Ó,Ð4G×Hr   c                ó   € V ^8„  d   QhRR/# rA   rB   )r   s   "r   r   r   J   s   € ÷ Uñ U¨tñ Ur   c                 ó0   € \        \        4       RR7       R# )z=Remove the interrupted lazy-refresh breadcrumb. Never raises.zlazy-refresh-incompleterD   N)r?   r,   rB   r   r   Ú%_clear_lazy_refresh_incomplete_markerrH   J   s   € äÔ0Ó2Ð:S×Tr   ÚHERMES_UPDATE_REEXECc                ó$   € V ^8„  d   QhR\         /# r%   r   )r   s   "r   r   r   S   s   € ÷ ñ ´(ñ r   c                 ó    € ^ RI Hp  V ! 4        R# )zEStop a mixed old-code/new-files updater at the retired sync boundary.©Ústop_for_relaunchN)Úhermes_cli._old_updaterrM   rL   s    r   Ú(_reexec_dependency_sync_off_windows_shimrO   S   s   € å9ÙÖr   c                ó$   € V ^8„  d   QhR\         /# r%   )r/   )r   s   "r   r   r   Y   s   € ÷ #ñ #”Tñ #r   c                  ó(   € \         P                  R 8H  # )Úwin32)ÚsysÚplatformrB   r   r   Ú_is_windowsrU   Y   s   € Ü�<‰<˜7Ñ"Ð"r   c                ó2   € V ^8„  d   QhR\         R,          /# rA   r   )r   s   "r   r   r   ]   s   € ÷ 	1ñ 	1œ4 $�;ñ 	1r   c                 óš   € ^ RI Hp  ^ RIHp ^ RIHp V! V 4      pVf   R# V! V\        4       R7      pVP                  4       '       d   V# R# )zKReturn the venv Scripts directory if we're running inside the project venv.r   )Úproject_venv_dir)Úvenv_bin_dirN)Úwindows)r   r   Úhermes_constantsrX   Úpm.environmentsrY   rU   Úis_dir)r   rX   rY   Úvenv_dirÚscriptss        r   Ú_venv_scripts_dirr`   ]   sC   € å,Ý1Ý,Ù Ó-€HØÒÙÙ˜8¬[«]Ô;€GØ—n‘n×&Ò&ˆ7Ð0¨DÐ0r   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# ©r   Úscripts_dirr
   )r   Úlist)r   s   "r   r   r   i   s"   € ÷ 	Cñ 	C¤4ð 	C¬D´­Jñ 	Cr   c                óØ   € \        4       '       g   . # \        \        4       4      ;'       g    0 RmpVP                  R4       \	        V4       Uu. uF  q V R2,          NK  	  up# u upi )u�   Entry-point shims uv may rewrite during ``pip install -e .`` â€” Windows .exe launchers
only; POSIX shims are plain scripts replaced atomically.zhermes-gatewayú.exe>   Úhermesú
hermes-acpúhermes-agent)rU   ÚsetÚ_load_console_script_namesÚaddÚsorted)rc   ÚnamesÚnames   &  r   Ú_hermes_exe_shimsrp   i   s^   € ô �=Š=Øˆ	ÜÔ*Ó,Ó-×YÐYÒ1Y€Eð 
‡I�IÐÔÜ4:¸5´MÓB±M¨D˜T˜F $˜-×'Ð'±MÑBÐBùÒBs   ÁA'z0SYSTEM\CurrentControlSet\Control\Session ManagerÚPendingFileRenameOperationsc                ó    € V ^8„  d   QhR\         \        ,          R\         \        ,          R\        \         \        ,          \        3,          /# )r   ÚentriesÚshimsr
   )rd   r   r   ÚtupleÚint)r   s   "r   r   r   y   s;   € ÷ ñ ¬$¬s­)ð ¼DÄ½Jð Ì5ÔQUÔVYÕQZÔ\_ÐQ_ÕK`ñ r   c                óÞ  a€ ^ RI oR V3R llpV Uu0 uF  q2! \        V4      4      kK  	  pp. p^ p\        ^ \        V 4      ^,
          ^4       Fd  pW,          W^,           ,          r˜V! V4      p
W¤9   d,   V! V	4      P	                  V
 R24      '       d   V^,          pKR  VP                  W‰34       Kf  	  \        V 4      ^,          '       d   VP                  V R,          4       WV3# u upi )zçDrop our ``<shim>`` -> ``<shim>.old.<stamp>`` pairs from a PendingFileRenameOperations
value (a flat REG_MULTI_SZ of (source, target) pairs shared with other installers).
Returns the entries to keep and how many pairs were dropped.Nc                ó0   € V ^8„  d   QhR\         R\         /# )r   Úvaluer
   ©r   )r   s   "r   r   Ú2_filter_pending_shim_renames.<locals>.__annotate__   s   € ÷ 6ñ 6”Sð 6œSñ 6r   c                 óš   <€ \        V 4      P                  R 4      pVP                  R4      pSP                  SP	                  V4      4      # )Ú!z\??\)r   ÚlstripÚremoveprefixÚnormcaseÚnormpath)ry   r9   Úntpaths   & €r   Ú_normÚ+_filter_pending_shim_renames.<locals>._norm   s?   ø€ Ü�5‹z× Ñ  Ó%ˆØ× Ñ  Ó*ˆØ�‰˜vŸ™¨tÓ4Ó5Ð5r   ú.old.éÿÿÿÿ)r‚   r   ÚrangeÚlenÚ
startswithÚextendÚappend)rs   rt   rƒ   ÚshimÚ
shim_pathsÚkeptÚremovedÚindexÚsourceÚtargetÚsource_normr‚   s   &&         @r   Ú_filter_pending_shim_renamesr”   y   sØ   ø€ ó ÷6ð 6ñ
 05Ó5©u t�%œ˜D›	Ö"©u€JÐ5Ø€DØ€GÜ�qœ#˜g›,¨Õ*¨AÖ.ˆØ �¨¸µÕ);�Ù˜F“mˆØÔ$©¨v«×)AÑ)AÀ[ÀMÐQVÐBW×)XÒ)XØ�q�LŠGà�K‰K˜Ð(Ö)ñ /ô ˆ7ƒ|�a×ÔØ�‰�G˜B•KÔ Øˆ=Ðùò 6s   “C*c                ó0   € V ^8„  d   QhR\         R\        /# rb   ©r   rv   )r   s   "r   r   r   “   s   € ÷ ñ ¬tð ¼ñ r   c           	     ó–  € \        4       '       g   ^ #  ^ RIpVP                  VP                  \        ^ VP
                  VP                  ,          4      ;_uu_ 4       pVP                  V\        4      w  r4WAP                  8w  g   \        V\        4      '       g    RRR4       ^ # \        V\        V 4      4      w  rVV'       g    RRR4       ^ # V'       d%   VP                  V\        ^ VP                  V4       MVP                  V\        4       VuuRRR4       #   + '       g   i     R# ; i  \         \"        3 d     ^ # i ; i)u  Drop reboot renames older Hermes versions queued for our shims: ``MOVEFILE_DELAY_UNTIL_REBOOT``
fallbacks outlive the update that queued them and move away whatever sits at the shim path
at next boot â€” even a shim a later repair just wrote. Needs elevation; a no-op otherwise.N)rU   ÚwinregÚOpenKeyÚHKEY_LOCAL_MACHINEÚ_PENDING_RENAME_KEYÚKEY_QUERY_VALUEÚKEY_SET_VALUEÚQueryValueExÚ_PENDING_RENAME_VALUEÚREG_MULTI_SZr   rd   r”   rp   Ú
SetValueExÚDeleteValuer>   Ú
ValueError)rc   r˜   Úkeyrs   Ú
value_typerŽ   r�   s   &      r   Ú_cleanup_pending_shim_renamesr¦   “   s  € ô �=Š=ÙðÛØ�^‰^Ø×%Ñ%Ô':¸AØ×"Ñ" V×%9Ñ%9Õ9÷
ô 
ð Ø"(×"5Ñ"5°cÔ;PÓ"QÑˆGØ×0Ñ0Ô0¼
À7ÌD×8QÒ8QØ÷
ñ 
ô 9¸ÔBSÐT_ÓB`Óa‰MˆDßØ÷
ñ 
÷ Ø×!Ñ! #Ô'<¸aÀ×ATÑATÐVZÕ[à×"Ñ" 3Ô(=Ô>Ø÷
÷ 
÷ 
ó 
ûô ”ZÐ ô ÚðúsO   ”A	D3 ÁA DÂD3 Â' DÃD3 ÃDÃ;DÄ
D3 ÄD0	Ä*D3 Ä0D3 Ä3EÅEc                ó>   € V ^8„  d   QhR\         R\        R,          /# )r   Ústaler
   Nr–   )r   s   "r   r   r   ²   s   € ÷ ñ ¤ð ¬¨t­ñ r   c                óŒ   €  \        V P                  P                  R^4      ^,          4      #   \        \        3 d     R# i ; i)uô   The ``.old.<unix-ms>`` stamp in a quarantine filename; ``None`` (not ours â€” neither rescued
nor deleted) otherwise. Parsed from the NAME, not ``st_mtime``: ``rename`` preserves the
shim's mtime (when uv wrote it), not when it was quarantined.r…   N)rv   ro   ÚrsplitÚ
IndexErrorr£   )r¨   s   &r   Ú_quarantine_stamp_msr¬   ²   s?   € ðÜ�5—:‘:×$Ñ$ W¨aÓ0°Õ3Ó4Ð4øÜœ
Ð#ô Úðús   ‚+. ®AÁAc                ó   € V ^8„  d   QhRR/# rA   rB   )r   s   "r   r   r   ¼   s   € ÷ ñ ¨$ñ r   c                 óÄ   € R\         P                  R,          9  d    ^ RIHp  V ! 4        ^ RIHp V! 4        R#   \         d    \
        P                  RRR7        L3i ; i)	zKThe startup half of a previous update, run on every launch before dispatch.Úupdate:é   NN)Ú&_warn_pending_fleet_restart_on_startupz"pending fleet restart check failedT)Úexc_info)ÚrecoverN)	rS   ÚargvÚhermes_cli.update_cmd_fleetr±   r   r   r   Úhermes_cli.update_pause_recordr³   )r±   Ú_recover_paused_gatewayss     r   Ú _recover_update_debts_on_startupr¸   ¼   sU   € ð ”s—x‘x •|Ô#ð	NÝZá2Ô4õ Sñ Öøô ô 	NÜ�L‰LÐ=ÈˆLÖMð	Nús   ž: º"AÁAc                ó6   € V ^8„  d   QhR\         R,          RR/# )r   rc   Nr
   r   )r   s   "r   r   r   Í   s   € ÷ +ñ +¬4°$­;ð +À$ñ +r   c                óÞ  € \        4       '       g   R# V e   T M	\        4       p V f   R# ^ RIHp ^ RIHp V! V4      '       d   R# \        V 4       \        P                  ! 4       p V P                  R4       Uu. uF  p\        V4      ;pf   K  WT3NK  	  ppTP                  R RR7       T F’  w  rT TP                  TP                  P                  R^4      ^ ,          4      pTP!                  4       '       g   \"        P$                  ! Yt3.4       Kh  Y5R	,          ,
          \&        8  d   K‚  TP)                  4        K”  	  R# u upi   \         d     R# i ; i  \         d     K½  i ; i)
uÅ  Sweep â€” and where necessary RESCUE â€” ``hermes.exe.old.*`` from updates.

Called early on every invocation. Two cases an unconditional ``unlink()`` gets wrong:
(1) orphan rescue â€” ``hermes.exe`` missing while ``hermes.exe.old.*`` exists means the .old
file is the ONLY surviving copy (update died between rename and uv's write); put it back via
the same retry-and-report helper the update-time restore uses. (2) concurrency â€” a fresh
quarantine file may belong to an update in flight in another process; leave anything inside
the grace window alone. Silent no-op on non-Windows, nothing to do, or locked/permission errors.

Deleting it converts a one-rename recovery into a full reinstall. See #75584.
Nr   )Úupdate_in_progressz*.exe.old.*c                 ó   € V ^ ,          # )r'   rB   )Úpairs   &r   Ú<lambda>Ú+_cleanup_quarantined_exes.<locals>.<lambda>ì   s   €  T¨!¦Wr   T)r¤   Úreverser…   g     @�@)rU   r`   r   r   Úhermes_cli.update_lockr»   r¦   Ú_timeÚtimeÚglobr¬   r>   ÚsortÚ	with_namero   rª   ÚexistsÚ_early_recovery_modÚrestore_quarantined_shimsÚ_QUARANTINE_GRACE_SECONDSr<   )rc   r   r»   Únowr¨   ÚstampÚ
candidatesÚoriginals   &       r   Ú_cleanup_quarantined_exesrÏ   Í   sF  € ô �=Š=ÙØ!,Ò!8‘+Ô>OÓ>Q€KØÒÙÝ,Ý9á˜,×'Ò'ÙÜ! +Ô.Ü
�*Š*‹,€Cðà(3×(8Ñ(8¸Ô(GóCÙ(G˜uÜ-¨eÓ4Ð4�ô ˆU‹NÑ(Gð 	ð Cð ‡O�OÑ,°d€OÔ;Û"‰ˆð
	Ø—‘ u§z¡z×'8Ñ'8¸À!Ó'DÀQÕ'GÓHˆHØ—?‘?×$Ò$ä#×=Ò=ÀÐ?PÐ>QÔRÙØ˜V•^Õ#Ô&?Ô?ÙØ�L‰LŽNó #ùòCøô ô Úðûô ô 	Úð	úsI   Á&E Á9EÂEÂE Â4A EÄEÄ0EÅE ÅEÅEÅE,Å+E,c                óf   € V ^8„  d   QhR\         \        \        \        \        3,          ,          /# r%   )rd   ru   r   )r   s   "r   r   r   û   s#   € ÷ ñ ¬4´´c¼3Ä°mÕ0DÕ+Eñ r   c                 óº  € . p  ^ RI Hp ^ RIHp V! 4       P	                  4        Fx  pVP                  VP                  4      pVf   K$  VP                  4       '       d   K<  T P                  VP                  VP                  ;'       g    RVP                  34       Kz  	   ^ RIp^ RIHp V! 4       P                  R4      '       g	   / '       d/   VP$                  P'                  R4      f   V P                  R
4       V #   \         d!   p\        P                  RT4        Rp?L…Rp?ii ; i  \         d"   p\        P                  R	T4        Rp?T # Rp?ii ; i)a@  Check configured platforms/MCP in the fresh, selected update-build child.

PM preserves recorded extras atomically, but configuration can reference an
unselected SDK. Never call this in the updater's stale import graph (#10651).
Rows are ``(label, hint, candidate extra)``: a platform's SDK is the extra named after it.
)Úload_gateway_config)Úplatform_registryNz&Run `hermes setup` to install support.z0configured-platform dependency check skipped: %s)Úload_config_readonlyÚmcp_serversÚmcpz+configured-MCP dependency check skipped: %s)zMCP serversz/Run `hermes pm install` to install MCP support.rÖ   )Úgateway.configrÒ   Úgateway.platform_registryrÓ   Úget_connected_platformsr   ry   Úcheck_fnr‹   r:   Úinstall_hintro   r   r   r   Úimportlib.utilÚhermes_cli.configrÔ   ÚutilÚ	find_spec)ÚmissingrÒ   rÓ   rT   Úentryr"   Ú	importlibrÔ   s           r   Ú!_configured_features_missing_depsrã   û   s  € ð +-€Gð
NÝ6Ý?á+Ó-×EÑEÖGˆHØ%×)Ñ)¨(¯.©.Ó9ˆEØÔ ¨¯©×)9Ô)9Ø—‘ §¡¨U×-?Ñ-?×-kÐ-kÐCkØ %§
¡
ð ,ö -ñ HðIÛÝ:á Ó"×&Ñ& }×5Ò5¿ÀÇÁ×AYÑAYÐZ_ÓA`ÒAhØ�N‰NÐdÔeð €Nøô ô NÜ�‰ÐGÈ×MÑMûðNûô ô IÜ�‰ÐBÀC×HÐHØ€NûðIúsN   „A D  Á	D  Á!(D  Â
D  Â"%D. ÃD. Ã.D. Ä D+ÄD&Ä&D+Ä.EÄ9EÅEc                ó(   € V ^8„  d   QhR\         RR/# )r   Úproject_rootr
   Nr   )r   s   "r   r   r     s   € ÷ .ñ .¼Dð .ÀTñ .r   c           
     óˆ  € ^ RI p^ RIHp ^ RIHp \        4       pV'       g   R# \        V! V 4      4      p\        V UUu0 uF1  Ev rgVP                  RR4      ;q…9   g   K  V! V4      '       g   K/  VkK3  	  upp4      p	V	'       dG    VP                  V	RV RR7       V U
u. uF$  qª^,          P                  RR4      V	9  g   K"  V
NK&  	  pp
V'       d+   \        R4       V F  w  rÍp\        RV RV 24       K  	  R# R# u uppi u up
i   \         d+   p\        RR	P                  T	4       R
T 24        Rp?LoRp?ii ; i)zåAdd the extras configured features need to the dependency environment (#124228).

Recorded extras never follow config, so an enabled platform whose SDK is not
selected would come up without its adapter after the gateway restart.
N)Úextra_supported)Údeclared_extrasÚ_Ú-T)Úexplicitrå   Úevict_incompatible_pluginsu     âš  Could not install z, z for configured features: uq     âš  Configured features whose dependencies are still missing â€” the gateway will fail to load them on restart:z    - z: )ÚpmÚ	pm.extrasrç   Úpm.featuresrè   rã   rj   rm   ÚreplaceÚ	sync_venvr   ÚprintÚjoin)rå   rí   rç   rè   rà   Údeclaredré   ro   ÚextraÚextrasÚrowr"   ÚfeatureÚhintÚ_extras   &              r   Ú)_install_configured_features_missing_depsrû     sC  € ó Ý)Ý+ä/Ó1€GßÙÜ‘? <Ó0Ó1€HÜ©7ô b©7™x Ø"&§,¡,¨s°CÓ"8Ð8˜ÑEô ÙJYÐZ_×J`÷ �U©7ò bó c€Fçð	YØ�L‰L˜¨$¸\ÐfjˆLÔkñ '.ÓX¡g˜s°Qµ·±ÀÀSÓ1IÐQWÑ1W—s�s¡gˆGÐXßÜð  Bô  	CÛ%,Ñ!ˆG˜6Ü�F˜7˜) 2 d VÐ,Ö-ó &-ñ ùóbùò Yøô ô 	aÜÐ,¨T¯Y©Y°vÓ->Ð,?Ð?YÐZ]ÐY^Ð_×`Ñ`ûð	aús6   Á D
Á!D
Á1D
ÂD Â!DÃDÄEÄ D<Ä<Ec                ó:   € V ^8„  d   QhR\         \        ,          /# r%   )rd   r   )r   s   "r   r   r   6  s   € ÷ 3ñ 3¤D¬¥Iñ 3r   c                 ó¶   € \        R4      p T ;'       g    / P                  R/ 4      ;'       g    / pV Uu. uF  q"'       g   K  \        V4      NK  	  up# u upi )zCReturn ``[project.scripts]`` entry-point names from pyproject.toml.z>console script verification: failed to read pyproject.toml: %sr_   )r#   r   r   )r   r_   ro   s      r   rk   rk   6  sM   € ä Ð!aÓb€GØ�}ˆ}˜"×!Ñ! )¨RÓ0×6Ð6°B€GÙ")Ó2¡'˜$«TŒIŒC�ŽI¡'Ñ2Ð2ùÒ2s   ¶	AÁAc                ó`   € V ^8„  d   QhR\         \        \        3,          R,          R\        /# )r   ÚenvNr
   )r   r   r/   )r   s   "r   r   r   =  s'   € ÷ /ñ /œœS¤#˜X�¨Õ-ð /¼ñ /r   c                 ó   € ^ RI Hp V! V 4      # )r'   )Ú_is_termux_startup_environment)r   r  )rÿ   r  s   & r   Ú_is_termux_envr  =  s   € Ý>Ù)¨#Ó.Ð.r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Únpm_pathr
   )r   r/   )r   s   "r   r   r   B  s   € ÷ ñ ¤3ð ¬4ñ r   c                ó  € V P                  4       pVP                  R4      '       d   VP                  R^4      ^,          MRpVP                  R4      ;'       g4    \	        V4      ^8H  ;'       d    VP                  4       ;'       g    RV 9   # )u´   True if ``npm_path`` points at a Windows npm shim (WSL drive interop, ``.cmd``/``.exe``, UNC).

Callers use this only on a POSIX host â€” on native Windows ``npm.cmd`` is correct.
z/mnt/Ú/Ú Ú\)rf   z.cmdz.bat)Úlowerr‰   ÚsplitÚendswithrˆ   Úisalpha)r  ÚlowÚmounts   &  r   Ú_is_windows_npm_pathr  B  s|   € ð
 �.‰.Ó
€CØ$'§N¡N°7×$;Ò$;ˆC�I‰I�c˜1Ó˜aÖ À€Eà�‰Ð-Ó.÷ 	ð 	Ü�‹J˜!‰O×/Ð/ §¡£÷	ð 	à�8Ñðr   c                ó2   € V ^8„  d   QhR\         R,          /# rA   rz   )r   s   "r   r   r   P  s   € ÷ 	6ñ 	6¤3¨¥:ñ 	6r   c                 ó|   € ^ RI Hp  V ! R4      p\        4       '       g	   V'       g   V# \        V4      '       d   R# T# )z½PM's npm, refused on a POSIX host when it is a Windows shim (EISDIR over WSL UNC paths, #30271).

Never re-scans the user's PATH for another npm: Hermes runs only its PM-managed toolchain.
)Úfind_node_executableÚnpmN)r[   r  rU   r  )r  r  s     r   Ú_resolve_node_runtime_npmr  P  s4   € õ
 6Ù
˜uÓ
%€CÜ‡}‚}ŸCØˆ
Ü'¨×,Ò,ˆ4Ð5°#Ð5r   c                ó$   € V ^8„  d   QhR\         /# r%   rz   )r   s   "r   r   r   \  s   € ÷ Gñ G¤Cñ Gr   c                ó`   € \        V RR4      ;'       g    RP                  4       ;'       g    R# )z]Normalize ``args.branch`` to a non-empty name (default ``main``; blank/whitespace = default).ÚbranchNÚmain)ÚgetattrÚstrip)Úargss   &r   Ú_resolve_update_branchr  \  s*   € ä�D˜( DÓ)×3Ð3¨V×:Ñ:Ó<×FÐFÀÐFr   )Ni„  )+Ú__doc__Úloggingr2   ÚshutilrS   rÃ   rÂ   Úpathlibr   Útypingr   Ú
hermes_clir   rÈ   Ú	getLoggerr   r#   r)   r,   r7   r?   rE   rH   Ú_UPDATE_REEXEC_ENVrO   rU   r`   rp   r›   rŸ   r”   r¦   rÊ   r¬   r¸   rÏ   rã   rû   rk   r  r  r  r  rB   r   r   Ú<module>r%     sÌ   ðÙ Vã Û 	Û Û 
Û å Ý Ý =ð 
×	Ò	Ð,Ó	-€÷:õ2/õ
5õ
bõBõIõ
Uð ,Ð õõ#õ	1õ	Cð JÐ Ø5Ð õõ4ð8 $Ð õõ÷"+õ\õ<.õ:3÷/õ
õ	6÷Gr   