+
    „WÝjÝ  ã                  ó\  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIt^ RI	t	^ RI
Ht ^ RIt^ RIHt ^ RIHt Rt]P$                  ! R4      tR	RR
R/tR]R&   ]	P,                  ! 4       ]	P,                  ! 4       utt]P2                  R R l4       tR R ltRR R lltRR/R R lltRR.tR# )zEStable opaque identity shared by every profile in one Hermes install.)ÚannotationsN)ÚPath)ÚOptional)Úget_default_hermes_root)Úatomic_write_textÚ
install_idz^[0-9a-f]{32}$ÚrootÚvaluezdict[str, Optional[str]]Ú_INSTALL_ID_CACHEc               ó   € V ^8„  d   QhRR/# )é   r   r   © )Úformats   "ÚOC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\install_identity.pyÚ__annotate__r      s   € ÷ ñ  ñ ó    c              #  ó¬  "  € \         P                  ! V R,          \         P                  \         P                  ,          R4      p\         P                  R8H  p V'       dš   ^ RIp\         P                  ! V4      P                  ^ 8X  d.   \         P                  ! VR4       \         P                  ! V4       \         P                  ! V^ \         P                  4       VP                  WP                  ^4       M^ RIpVP                  WP                   4       Rx €  V'       dD   \         P                  ! V^ \         P                  4       XP                  WP"                  ^4       MXP                  WP$                  4       \         P&                  ! V4       R#   \         P&                  ! T4       i ; i   T'       dD   \         P                  ! T^ \         P                  4       XP                  YP"                  ^4       MXP                  YP$                  4       \         P&                  ! T4       i   \         P&                  ! T4       i ; i; i5i)zESerialize identity publication across processes on POSIX and Windows.z.install_id.locké€  ÚntNó    )ÚosÚopenÚO_RDWRÚO_CREATÚnameÚmsvcrtÚfstatÚst_sizeÚwriteÚfsyncÚlseekÚSEEK_SETÚlockingÚLK_LOCKÚfcntlÚflockÚLOCK_EXÚLK_UNLCKÚLOCK_UNÚclose)r   ÚfdÚwindowsr   r$   s   &    r   Ú_install_id_file_lockr,      sX  é € ô 
�Š�Ð*Õ*¬B¯I©I¼¿
¹
Õ,BÀEÓ	J€BÜ�g‰g˜‰o€GðßÛÜ�xŠx˜‹|×#Ñ# qÔ(Ü—’˜˜UÔ#Ü—’˜”Ü�HŠH�R˜œBŸK™KÔ(Ø�N‰N˜2Ÿ~™~¨qÕ1ãØ�K‰K˜ŸM™MÔ*Ûð	ßÜ—’˜˜Q¤§¡Ô,Ø—‘˜r§?¡?°AÕ6à—‘˜B§¡Ô.ä�HŠH�RŽLøŒB�HŠH�R�Lûð	ßÜ—’˜˜Q¤§¡Ô,Ø—‘˜r§?¡?°AÕ6à—‘˜B§¡Ô.ä�HŠH�R�LøŒB�HŠH�R�LÿsK   ‚AIÁCF7 ÄA&F ÆIÆF4Æ4IÆ7IÆ9A&H6ÈIÈ6IÉIÉIc               ó    € V ^8„  d   QhRRRR/# )r   Úpathr   Úreturnztuple[Optional[str], bool]r   )r   s   "r   r   r   2   s   € ÷ Uñ U˜ð UÐ"<ñ Ur   c                óð   €  V P                  RR7      P                  4       P                  4       p\        P                  T4      '       d   TR3# R#   \         d    Ru # \        \
        3 d    Ru # i ; i)u_   ``(valid id or None, mint?)`` â€” mint on a missing or malformed file, never on a read failure.ú	utf-8-sig©ÚencodingF)NT)NF)Ú	read_textÚstripÚlowerÚFileNotFoundErrorÚOSErrorÚUnicodeDecodeErrorÚ_INSTALL_ID_REÚ	fullmatch)r.   Úexistings   & r   Ú_read_existingr=   2   sv   € ðØ—>‘>¨;�>Ó7×=Ñ=Ó?×EÑEÓGˆô
 !/× 8Ñ 8¸× BÒ BˆH�eÐÐTÈÐTøô	 ô ØÒÜÔ'Ð(ô ØÒðús   ‚.A ÁA5Á A5Á/A5Á4A5c               ó    € V ^8„  d   QhRRRR/# )r   r   zPath | Noner/   úOptional[str]r   )r   s   "r   r   r   =   s   € ÷ ñ  Kð ¸=ñ r   c                óò  € V f   \        4       MT p V \        ,          p\        ;_uu_ 4        \        V4      w  r#Ve   VuuRRR4       #  ^ RIHp V! V 4       \        V 4      ;_uu_ 4        \        V4      w  r%V'       g   VuuRRR4       uuRRR4       # \        V\        P                  ! 4       P                  R,           RRRR7       VP                  RR	7      P                  4       P                  4       p\        P                  V4      '       d   TMRuuRRR4       uuRRR4       #   + '       g   i     M; i  \          d     RRR4       R# i ; i RRR4       R#   + '       g   i     R# ; i)
z­Read or atomically mint the opaque id for the physical install.

``None`` = neither readable nor persistable; an ephemeral id would violate the authority/registry contract.
N)Úmkdir_under_hermes_homeÚ
z.install_id-Tr   )Ú
tmp_prefixÚ	fsync_dirÚmoder1   r2   )r   Ú_INSTALL_ID_FILENAMEÚ_INSTALL_ID_PUBLICATION_LOCKr=   Úhermes_constantsrA   r,   r   ÚuuidÚuuid4Úhexr4   r5   r6   r:   r;   r8   )r   r.   r<   Ú_rA   ÚmintÚ	committeds   &      r   Úread_or_create_install_idrO   =   s$  € ð
 )-ªÔ"Ô$¸$€DØÔ&Õ&€D÷ 
&Ö	%Ü$ TÓ*‰ˆØÒØ÷ 
&Ò	%ð	Ý@Ù# DÔ)Ü& t×,Õ,Ü!/°Ó!5‘�ßØ#÷ -Ñ,÷ 
&Ò	%ô " $¬¯
ª
«×(8Ñ(8¸4Õ(?ÈNÐfjÐqvÕwØ ŸN™N°K˜NÓ@×FÑFÓH×NÑNÓP�	Ü$2×$<Ñ$<¸Y×$GÒ$G‘yÈT÷ -Ñ,÷ 
&Ò	%÷ -×,ûô ô 	Ø÷ 
&Ñ	%ð	úð -÷ 
&×	%×	%Ò	%úsZ   ¬E%Á!E Á,D-	Â
E ÂB D-	Ä
E Ä-D=Ä8E Ä<E%Ä=E Å EÅE%ÅEÅE%Å%E6	Úcachec               ó    € V ^8„  d   QhRRRR/# )r   rP   zdict[str, Optional[str]] | Noner/   r?   r   )r   s   "r   r   r   X   s   € ÷ ñ Ð<ð Èñ r   c                óL  aa€ \        4       p\        V4      oV f   \        MT oR VV3R llpV! 4       ;p'       d   V# \        ;_uu_ 4        V! 4       ;p'       d   VuuRRR4       # \	        V4      pV'       d   SSR&   VSR&   VuuRRR4       #   + '       g   i     R# ; i)z?Return the process-cached stable id for the active Hermes root.Nc               ó   € V ^8„  d   QhRR/# )r   r/   r?   r   )r   s   "r   r   Ú$get_install_id.<locals>.__annotate__^   s   € ÷ [ñ [�]ñ [r   c                 ón   <€ SP                  R 4      p V '       d   SP                  R4      RS39   d   V # R# )r	   r   N)Úget)ÚcachedÚroot_keyÚtarget_caches    €€r   Ú_cachedÚget_install_id.<locals>._cached^   s8   ø€ Ø×!Ñ! 'Ó*ˆß L×$4Ñ$4°VÓ$<ÀÀxÐ@PÔ$PˆvÐZÐVZÐZr   r   r	   )r   Ústrr
   Ú_INSTALL_ID_LOCKrO   )rP   r   rZ   r	   rX   rY   s   $   @@r   Úget_install_idr^   X   s“   ù€ ä"Ó$€DÜ�4‹y€HØ(-ªÕ$¸5€L÷[ñ [ñ “	Ð€uÖØˆß	Ö	Ù“IÐˆ5ÖØ÷ 
Ò	ô *¨$Ó/ˆßØ#+ˆL˜Ñ Ø$)ˆL˜Ñ!Ø÷ 
×	×	Ó	ús   ÁBÁ)BÂB#	r^   rO   )N)Ú__conditional_annotations__Ú__doc__Ú
__future__r   Ú
contextlibr   Úpathlibr   ÚreÚ	threadingÚtypingr   rI   rH   r   Úutilsr   rF   Úcompiler:   r
   Ú__annotations__ÚLockr]   rG   Úcontextmanagerr,   r=   rO   r^   Ú__all__)r_   s   @r   Ú<module>rm      s«   øðÜ Kå "ã Û 	Ý Û 	Û Ý Û å 4Ý #à#Ð Ø—’Ð-Ó.€Ø/5°t¸WÀdÐ.KÐ Ð+Ó KØ1:·²Ó1AÀ9Ç>Â>ÓCSÐ .Ð Ð.ð ×Ñôó ðõ6U÷ð6¸t÷ ð, Ð8Ð
9‚r   