+
    …WÝj!  ã                  óŽ   € R t ^ RIH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 R R ltRtR R	 ltR
 R ltR R ltR# )u   pm.shell(): the one place Hermes resolves the shell it runs commands with.

Owned by pm because the shell is a bundled tool on Windows (Git for Windows
carries bash.exe), and the store is the authority on whether it exists.
Callers that need bash (the terminal backend, `_find_bash`) call this instead
of hunting fixed locations.

Resolution order:
  1. Windows: the git Package's staged bash (via facts.json) â€” the store
     structurally guarantees it in a bundle; no hunt.
  2. Windows: explicit override, Program Files, per-user and PortableGit,
     then PATH â€”
     minus C:\Windows\System32ash.exe (the WSL launcher stub, first on PATH
     on most machines; #116818) and WindowsAppsash.exe (an MSIX alias that
     only spawns inside its package). See windows_bash_candidates().
  3. Provisioned PATH: shutil.which("bash") â€” the store dirs are on the
     process PATH after pm.activate() ran.
  4. POSIX fallback table for non-bundle / daemon-launch PATH edge cases
     (/usr/bin/bash, /bin/bash, $SHELL, /bin/sh). A systemd/cron-launched
     gateway may have a minimal PATH and macOS /bin/bash is not on PATH by
     default, so `which` alone is not enough there.
)ÚannotationsN)ÚMapping)Úpaths)ÚFactsc               ó   € V ^8„  d   QhRR/# ©é   Úreturnú
str | None© )Úformats   "Ú<C:\Users\johnn\AppData\Local\hermes\hermes-agent\pm\shell.pyÚ__annotate__r   $   s   € ÷ ñ �jñ ó    c                 óö  € ^ RI p V P                  4       R8w  d   R# \        P                  ! 4       pVP	                  4       '       g   R#  \        V4      pVP                  R4      pVe   RV9  d   R# \        P                  ! 4       VR,          ,          pVR,          R,          R,          VR,          R,          3 F&  pVP	                  4       '       g   K  \        V4      u # 	  R#   \         d     R# i ; i)zBThe git Package's bash.exe under the store (Windows bundles only).NÚWindowsÚgitÚentryÚusrÚbinúbash.exe)
ÚplatformÚsystemr   Ú
facts_pathÚis_filer   ÚgetÚ
store_rootÚstrÚ	Exception)r   r   ÚfactsÚfactr   Ú	candidates         r   Ú_staged_bashr"   $   s×   € ãà‡�Ó˜IÔ%ÙÜ×!Ò!Ó#€JØ×Ñ×ÒÙðÜ�jÓ!ˆØ�y‰y˜ÓˆØŠ<˜7¨$Ô.ÙÜ× Ò Ó" T¨'¥]Õ2ˆà�E�M˜EÕ! JÕ.Ø�E�M˜JÕ&ó
ˆIð × Ñ ×"Ô"Ü˜9“~Ò%ñ
ñ øô ô Úðús%   Á
'C) Á3A C) ÃC) Ã%C) Ã)C8Ã7C8c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úon_pathr
   ÚenvzMapping[str, str]r	   z	list[str]r   )r   s   "r   r   r   D   s"   € ÷ +ñ + Zð +Ð6Gð +ÈIñ +r   c           
     óâ  a€ VP                  RR4      p. pVP                  R4      '       d   VP                  VR,          4       \        P                  ! VR4      .pVP                  R4      '       d.   VP                  \        P                  ! VR,          R4      4       VP                  R4      '       dN   VP	                  \        P                  ! VR,          RR4      \        P                  ! VR,          R	R4      34       V FC  pVP	                  \        P                  ! VR
R4      \        P                  ! VRR
R4      34       KE  	  V '       d~   \        P
                  ! V 4      P                  4       o\        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       g   VP                  V 4       \        \        P                  V4      4      # )zïOrdered bash.exe candidates for a Windows host, as pure data: the
explicit override and Git for Windows roots first, then ``on_path``
(the ``shutil.which("bash")`` result) unless it is a stub. System32
precedes Git on most PATHs (#116818).ÚProgramFileszC:\Program FilesÚHERMES_GIT_BASH_PATHÚGitzProgramFiles(x86)ÚLOCALAPPDATAÚhermesr   ÚProgramsr   r   r   c              3  ó,   <"  € T F	  qS9   x € K  	  R # 5i©Nr   )Ú.0ÚstubÚnorms   & €r   Ú	<genexpr>Ú*windows_bash_candidates.<locals>.<genexpr>X   s   øé € ÐDÑ,C D˜4–<Ó,Cùs   ƒTF)r   ÚappendÚntpathÚjoinÚextendÚnormpathÚlowerÚanyÚ_WINDOWS_BASH_STUB_DIRSÚlistÚdictÚfromkeys)r$   r%   ÚprogramfilesÚ
candidatesÚrootsÚrootr1   s   &&    @r   Úwindows_bash_candidatesrC   D   sk  ø€ ð
 —7‘7˜>Ð+>Ó?€LØ€JØ
‡w�wÐ%×&Ò&Ø×Ñ˜#Ð4Õ5Ô6Ü�[Š[˜ uÓ-Ð.€EØ
‡w�wÐ"×#Ò#Ø�‰”V—[’[ Ð%8Õ!9¸5ÓAÔBØ
‡w�wˆ~×ÒØ�‰”f—k’k # nÕ"5°xÀÓGÜ—k’k # nÕ"5°zÀ5ÓIðKô 	LãˆØ×Ñœ6Ÿ;š; t¨U°JÓ?Ü!Ÿ;š; t¨U°E¸:ÓFðHö 	Iñ ÷ Ü�Š˜wÓ'×-Ñ-Ó/ˆß‹sÔDÕ,CÓD�s�sŠsÔDÕ,CÓD×DÒDØ×Ñ˜gÔ&Ü”—‘˜jÓ)Ó*Ð*r   c               ó    € V ^8„  d   QhRRRR/# )r   r!   r   r	   Úboolr   )r   s   "r   r   r   ]   s   € ÷ 
ñ 
˜Cð 
 Dñ 
r   c                ó  €  \         P                  ! V RR.\         P                  \         P                  \         P                  ^\        \         R^ 4      RR7      P                  ^ 8H  #   \
        \         P                  3 d     R# i ; i)z?An existing bash.exe can still be broken or be a launcher stub.z-czexit 0ÚCREATE_NO_WINDOWF)ÚstdinÚstdoutÚstderrÚtimeoutÚcreationflagsÚcheck)Ú
subprocessÚrunÚDEVNULLÚgetattrÚ
returncodeÚOSErrorÚTimeoutExpired)r!   s   &r   Ú_bash_startsrU   ]   sz   € ðÜ�~Š~Ø˜˜hÐ'¬z×/AÑ/AÜ×%Ñ%¬j×.@Ñ.@Ø¤W¬ZÐ9KÈQÓ%OØô	
÷
 ‰*˜ñð 	øô ”Z×.Ñ.Ð/ô Úðús   ‚A%A( Á(BÂBc               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   r   j   s   € ÷ ñ ˆjñ r   c                 ó$  € \        4       p V '       d   \        V 4      '       d   V # \        P                  ! R4      p\        P
                  R8X  d,   \        R \        V\        P                  4       4       R4      # V'       d   V# RR\        P                  P                  R4      R3 Fc  pV'       g   K  \        P                  P                  V4      '       g   K4  \        P                  ! V\        P                  4      '       g   Ka  Vu # 	  R# )	z=Resolve the bash binary to use, or None if none is available.ÚbashÚntc              3  óš   "  € T FA  p\         P                  P                  V4      '       g   K*  \        V4      '       g   K=  Vx € KC  	  R # 5ir.   )ÚosÚpathÚisfilerU   )r/   Úcs   & r   r2   Úbash.<locals>.<genexpr>r   s5   é € ð ?Ñ L˜1ÜŸ™Ÿ™ q×)ô Ü.:¸1¯o÷ ’QÓ Lùs   ‚'A®AÁ
ANz/usr/bin/bashz	/bin/bashÚSHELLz/bin/sh)r"   rU   ÚshutilÚwhichr[   ÚnameÚnextrC   Úenvironr   r\   r]   ÚaccessÚX_OK)Ústagedr$   r!   s      r   rX   rX   j   sÅ   € ä‹^€Fß”,˜v×&Ò&Øˆä�lŠl˜6Ó"€GÜ	‡w�w�$„Üñ ?Ô 7¸ÄÇÁÔ Ló ?Ø@DóFð 	FçØˆð 	ØÜ
�
‰
�‰�wÓØó	ˆ	÷ ‰9œŸ™Ÿ™¨	×2Ô2´r·y²yÀÌBÏGÉG×7TÔ7TØÒññ r   )Úsystem32Úwindowsapps)Ú__doc__Ú
__future__r   r5   r[   ra   rN   Úcollections.abcr   Úpmr   Úpm.lockr   r"   r;   rC   rU   rX   r   r   r   Ú<module>rp      s@   ðñõ. #ã Û 	Û Û Ý #å Ý õð: 6Ð õ+õ2
÷r   