+
    …WÝj   ã                  óF  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	t	^ RI
t
^ RIt^ RIt^ RItRtR R ltRtRtR	 R
 ltR R ltR R ltRR/R R lltR R ltR R ltR R lt]! ]P4                  ]P6                  ]P8                  04      tRtR tR R lt R# )zçStdlib-only filesystem primitives PM needs before it can replace the caller's interpreter.

Boot-time dependency selection (``hermes_cli.runtime_state``) imports these, so nothing here
may import a dependency or another PM module.
)ÚannotationsN)ÚPathgš™™™™™©?c               ó    € V ^8„  d   QhRRRR/# )é   Úpathr   ÚreturnÚbool© )Úformats   "ÚAC:\Users\johnn\AppData\Local\hermes\hermes-agent\pm\filesystem.pyÚ__annotate__r      s   € ÷ ñ �dð ˜tñ ó    c                ó¸   € \         P                  R8w  d   R#  V P                  4       P                  \        P
                  8H  #   \        \        3 d     R# i ; i)aH  Keep junctions opaque even before Python 3.12's Path.is_junction exists.

A path that cannot be stat'ed is not a junction, matching ``os.path.isjunction``: callers
probe slots that do not exist yet (a first plugin install) and must get False, not a crash.
POSIX stat results carry no reparse tag, which lands in the same False.
ÚntF)ÚosÚnameÚlstatÚst_reparse_tagÚstatÚIO_REPARSE_TAG_MOUNT_POINTÚOSErrorÚAttributeError©r   s   &r   Úis_junctionr      sK   € ô 
‡w�w�$„ÙðØ�z‰z‹|×*Ñ*¬d×.MÑ.MÑMÐMøÜ”^Ð$ô Úðús   ™*A ÁAÁAz\\?\z\\?\UNC\c               ó    € V ^8„  d   QhRRRR/# )r   ÚtextÚstrr   r	   )r
   s   "r   r   r   )   s   € ÷ ñ �Sð ˜Sñ r   c                óØ   € V P                  \        4      '       d   V # \        P                  ! V 4      p V P                  R 4      '       d   \        V R,          ,           # \        V ,           # )ú\\:r   NN)Ú
startswithÚ	_VERBATIMÚntpathÚabspathÚ_VERBATIM_UNC)r   s   &r   Ú
_long_formr$   )   sO   € Ø‡�”y×!Ò!Øˆô �>Š>˜$Ó€DØ‡��v×ÒÜ˜t B�xÕ'Ð'Ü�tÕÐr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r	   )r
   s   "r   r   r   4   s   € ÷ Jñ J�Dð J˜Tñ Jr   c                ó€   € \         P                  R8X  d)   \        \        \         P                  ! V 4      4      4      # T # )zÛSpell a PM-owned root so Windows file calls beneath it are not cut at
MAX_PATH when LongPathsEnabled is 0 (the default). Every path joined onto the
result inherits the spelling; relative paths and digests are unchanged.r   )r   r   r   r$   Úfspathr   s   &r   Ú	long_rootr(   4   s+   € ô 13·±¸4´Œ4”
œ2Ÿ9š9 T›?Ó+Ó,ÐIÀTÐIr   c               ó    € V ^8„  d   QhRRRR/# )r   r   zstr | os.PathLike[str]r   r   r	   )r
   s   "r   r   r   ;   s   € ÷ (ñ (Ð'ð (¨Cñ (r   c                óÀ   € \         P                  ! V 4      pVP                  \        4      '       d   RV\	        \        4      R ,           # VP                  \        4      # )zˆThe ordinary spelling, for text that leaves PM's own file calls: argv, cwd,
environment values, hashed identities, records and messages.r   N)r   r'   r   r#   ÚlenÚremoveprefixr    )r   r   s   & r   Únativer-   ;   sI   € ô �9Š9�T‹?€DØ‡�”}×%Ò%Ø˜œS¤Ó/Ð0Ð1Õ1Ð1Ø×ÑœYÓ'Ð'r   Útimeoutc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   ÚfdÚintÚwaitr   r.   zfloat | Noner   r	   )r
   s   "r   r   r   D   s(   € ÷ +ñ +�ð +˜dð +¨\ð +ÀTñ +r   c               óP  € Vf   RM\         P                  ! 4       V,           p\        P                  R8X  dK   ^ RIp  \        P
                  ! V ^ \        P                  4       VP                  WP                  ^4       R# ^ RIp  VP#                  WP$                  VP&                  ,          4       R#   \         dJ   pTP                  \        P                  \        P                  \        P                  39  d   h  Rp?MRp?ii ; iT'       d   Te   \         P                  ! 4       T8¼  d   R# \         P                  ! \        4       EK    \(         d     Mi ; iT'       d   Te   \         P                  ! 4       T8¼  d   R# \         P                  ! \        4       EK"  )zYTake the byte lock; ``timeout`` bounds the retry loop (None waits forever, 0 tries once).Nr   TF)ÚtimeÚ	monotonicr   r   ÚmsvcrtÚlseekÚSEEK_SETÚlockingÚLK_NBLCKr   ÚerrnoÚEACCESÚEAGAINÚEDEADLKÚsleepÚ_LOCK_POLL_SECONDSÚfcntlÚflockÚLOCK_EXÚLOCK_NBÚBlockingIOError)r0   r2   r.   Údeadliner6   ÚexcrA   s   &$$    r   Úlock_fdrH   D   s  € à’‰t¬D¯NªNÓ,<¸wÕ,F€HÜ	‡w�w�$„ÛØðÜ—’˜˜Q¤§¡Ô,Ø—‘˜r§?¡?°AÔ6Ùó 	ØðØ—‘˜B§¡°·±Õ =Ô>Ùøô ô Ø—9‘9¤U§\¡\´5·<±<ÄÇÁÐ$OÔOØô Pûðú÷ ˜HÒ0´T·^²^Ó5EÈÔ5QÙÜ�JŠJÔ)×*øô #ô Ùðúç˜HÒ0´T·^²^Ó5EÈÔ5QÙÜ�JŠJÔ)×*s*   ¾AB6 Â,E Â6D
Ã?DÄD
ÅE ÅE c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   zbytes | Noner	   )r
   s   "r   r   r   a   s   € ÷ ñ ˜Tð  lñ r   c                óH   €  V P                  4       #   \         d     R # i ; i©N)Ú
read_bytesÚFileNotFoundErrorr   s   &r   Úread_bytes_or_nonerN   a   s&   € ðØ�‰Ó Ð øÜô Úðús   ‚ ’! !c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   z
str | Noner	   )r
   s   "r   r   r   h   s   € ÷ Jñ J�dð J˜zñ Jr   c                ól   € \        V 4      pVe%   \        P                  ! V4      P                  4       # R # rK   )rN   ÚhashlibÚsha256Ú	hexdigest)r   Údatas   & r   Úfile_digestrU   h   s.   € Ü˜dÓ#€DØ/3Ò/?Œ7�>Š>˜$Ó×)Ñ)Ó+ÐIÀTÐIr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   rT   Úbytesr   ÚNoner	   )r
   s   "r   r   r   m   s!   € ÷ 0ñ 0˜dð 0¨%ð 0°Dñ 0r   c                óD  € V P                   P                  RRR7       \        P                  ! V P                   RR7      w  r# \        P
                  ! VR4      ;_uu_ 4       pVP                  V4       VP                  4        \        P                  ! VP                  4       4       RRR4       \        P                  ! W04       \        P                  R8w  d]   \        P                  ! V P                   \        P                  4      p \        P                  ! V4       \        P                  ! V4       \        V4      P!                  RR7       R#   + '       g   i     L´; i  \        P                  ! T4       i ; i  \        T4      P!                  RR7       i ; i)	z[Replace ``path`` atomically and fsync file and directory so a crash keeps old or new bytes.T)ÚparentsÚexist_okz	.publish-)ÚdirÚprefixÚwbNr   )Ú
missing_ok)ÚparentÚmkdirÚtempfileÚmkstempr   ÚfdopenÚwriteÚflushÚfsyncÚfilenoÚreplacer   ÚopenÚO_RDONLYÚcloser   Úunlink)r   rT   r0   Ú	temporaryÚstreamÚ	directorys   &&    r   Údurable_write_bytesrq   m   s  € à‡K�K×Ñ˜d¨TÐÔ2Ü×$Ò$¨¯©¸[ÔI�M€Bð0Ü�YŠY�r˜4× Ô  FØ�L‰L˜ÔØ�L‰LŒNÜ�HŠH�V—]‘]“_Ô%÷ !ô 	�
Š
�9Ô#Ü�7‰7�dŒ?ÜŸš §¡¬R¯[©[Ó9ˆIð$Ü—’˜Ô#ä—’˜Ô#äˆY‹×Ñ¨$ÐÖ/÷ !× ûô —’˜Õ#ûäˆY‹×Ñ¨$ÐÕ/ús>   ÁF Á"AEÂ(A"F ÄE' Ä!F ÅE$	ÅF Å'E?Å?F ÆFc                óÊ   € . \         ORN F  p V ! 4       u # 	  R#   \         d<   pTe   TP                  \        9  d   h \        P
                  ! T4        Rp?KR  Rp?ii ; i)zURun a rename-like mutation, riding out a transient Windows hold (~3s) before raising.N)Ú_HELD_RETRY_DELAYSr   r;   Ú_HELD_ERRNOSr4   r?   )Ú	operationÚdelayÚerrors   &  r   Ú
retry_heldrx   ˆ   sX   € à,Ô%Ð, tÓ,ˆð	Ù“;Òó -øô ô 	ØŠ} §¡´<Ô ?ØÜ�JŠJ�u×Òûð	ús   �œA"§0AÁA"c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   rX   r	   )r
   s   "r   r   r   “   s   € ÷ #ñ #�dð #˜tñ #r   c                ót   € R p\         P                  R8¼  d   RV/MRV/p\        P                  ! V 3/ VB  R# )a   ``shutil.rmtree`` that clears a Windows read-only attribute and retries that one unlink.

Windows refuses to unlink read-only files (PortableGit ships ``etc/hosts`` read-only), and no
retry clears that bit. Every other failure, and every POSIX failure, raises as plain rmtree
would: a POSIX permission error is about the parent directory, and chmodding the path there
would follow a symlink out of the tree. Lives here, not in ``hermes_cli``: PM installs run
before the rest of the tree exists (the Docker toolchain stage copies only ``pm/``).
c                ó–  € \        V\        4      '       d
   V^,          MTp\        P                  R8w  g<   V \        P                  \        P
                  39  g   \        V\        4      '       g   Vh\        P                  ! V\        P                  3/ \        P                  \        P                  9   d   RR/M/ B  V ! V4       R# )é   r   Úfollow_symlinksFN)Ú
isinstanceÚtupler   r   rm   ÚrmdirÚPermissionErrorÚchmodr   ÚS_IWRITEÚsupports_follow_symlinks)ÚfuncÚfailedrw   s   &&&r   Ú_retry_writableÚ$remove_tree.<locals>._retry_writableœ   s„   € Ü& u¬e×4Ò4��a–¸%ˆÜ�7‰7�dŒ?˜d¬2¯9©9´b·h±hÐ*?Ô?ÄzÐRWÔYh×GiÒGiØˆKä
�Š�œŸ™ÑzÌÏÉÔUW×UpÑUpÔIpÐ,=¸uÑ+EÐvxÒzÙˆVŽr   ÚonexcÚonerrorN)é   é   )ÚsysÚversion_infoÚshutilÚrmtree)r   r‡   Úhandlers   &  r   Úremove_treer’   “   s9   € òô -0×,<Ñ,<ÀÔ,Gˆw˜Ñ(ÈiÐYhÐMi€GÜ
‡M‚M�$Ñ"˜'Ô"r   )gš™™™™™¹?gš™™™™™É?gš™™™™™Ù?gš™™™™™é?gš™™™™™ù?)!Ú__doc__Ú
__future__r   r;   rQ   r!   r   Úpathlibr   r�   r   r�   rb   r4   r@   r   r    r#   r$   r(   r-   rH   rN   rU   rq   Ú	frozensetr<   ÚEPERMÚEBUSYrt   rs   rx   r’   r	   r   r   Ú<module>r™      sŸ   ðñõ
 #ã Û Û Û 	Ý Û Û Û 
Û Û àÐ õð €	Ø€õõJõ(ð+¸D÷ +õ:õJõ
0ñ. ˜%Ÿ,™,¨¯©°U·[±[ÐAÓB€Ø.Ð ò÷#r   