+
    jHàj³t  ã                   óê  € R t ^ RIHt ^ RIH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IHt ^ RIHt ^ RIHt ]	P0                  ! ]4      t]P6                  ! R	4      t]P6                  ! R
4      t]! 4       t]P>                  ! 4       t ]! RRR7      t! ! R R]"4      t#]R=R l4       t$R=RR/R llt%R t&R t'R t(R t)])t*]+! 0 R>m4      t,^
t-RRRRRRRR/t.R t/RR/R  lt0R=R! lt1R"R/R# lt2R$ t3R% t4R& t5R' t6R( t7R) t8R* t9R+t:]P6                  ! ]Pv                  ! ]:4      R,,           4      t<R- t=R. t>R/ t?R0 t@R1 tAR2 tBR3tC/ tDR4R/R5 ltER6 tFR?R7 ltGR8 tHR9R:/R; ltIR< tJR# )@aƒ  Immutable local-media references for owner-only native admission.

The existing managed document cache supplies profile routing, delivery eligibility
and upload limits. Its flat age-based cleanup skips this retained subdirectory:
native bytes are released by ``release_admission_media`` once their row is
terminal and no live native input or retained API image context still holds them.
)ÚCounter)Úcontextmanager)Ú
ContextVarN)ÚPath)Úmake_user_dir)ÚRuntimeStoreError)Úfsync_directoryz$api_[0-9a-f]{32}\.(png|jpg|gif|webp)z[0-9a-f]{64}Únative_media_lease_scope)Údefaultc                   ó>   a a€ ] tR t^(t oV 3R ltV 3R ltRtVtV ;t# )Ú_CaptureScopec                óZ   <€ \         SV `  4        Wn        . V n        R V n        R V n        R# )FN)ÚsuperÚ__init__Ú	authorityÚ	all_pathsÚ	abandonedÚwrite_started)Úselfr   Ú	__class__s   &&€ÚB/home/ubuntu/.hermes/hermes-agent/gateway/session_ingress_media.pyr   Ú_CaptureScope.__init__)   s)   ø€ Ü‰ÑÔØ"ŒØˆŒØˆŒØ"ˆÖó    c                ó\   <€ \         SV `  V4       V P                  P                  V4       R # ©N)r   Úappendr   )r   Úpathr   s   &&€r   r   Ú_CaptureScope.append0   s!   ø€ Ü‰‰�tÔØ�‰×Ñ˜dÖ#r   )r   r   r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r   (   s   ù‡ € õ#÷$õ $r   r   c              #  óÞ   "  € \        V 4      p\        P                  V4      p Vx € \        4        \        P	                  V4       R#   \        4        \        P	                  T4       i ; i5i)a  Hold every path captured inside this block (capture through admission commit or refusal)
against a concurrent release: an older turn's settlement or cancellation that names the same
content-addressed bytes would otherwise unlink them before the new admission holds them.N)r   Ú_lease_scopeÚsetÚdrop_capture_leaseÚreset)r   ÚscopeÚtokens   &  r   Úcapture_leaser-   5   sV   é € ô
 ˜)Ó$€EÜ×Ñ˜UÓ#€Eð"ØŠäÔÜ×Ñ˜5Ö!øô 	ÔÜ×Ñ˜5Õ!üs   ‚!A-¤A	 ¨!A-Á	!A*Á*A-r+   c               ó€  € Ve   TM\         P                  4       pV'       g   R# \        ;_uu_ 4        V Uu. uF  q0e	   W09   g   K  VNK  	  up FH  pVP                  V4       \        V;;,          ^,          uu&   \        V,          ^ 8:  g   KA  \        V KJ  	  RRR4       R# u upi   + '       g   i     R# ; i)z­End this scope's lease on *paths* (default: all) early, e.g. before a refused admission
releases its own fresh capture, which its lease would otherwise keep from collection.N)r'   ÚgetÚ_lease_lockÚremoveÚ_leases)Úpathsr+   Úheldr   s   &$  r   r)   r)   C   s‡   € ð Ò%‰5¬<×+;Ñ+;Ó+=€DßÙß	ŽÙ&*ÓM¡d˜dªm¸t¹}—T�T¡dÔMˆDØ�K‰K˜ÔÜ�D�M˜QÕ‹MÜ�t�} Ö!Ü˜D’Mñ	 N÷ 
‰ùÚM÷ 
�ˆús(   ³B,¸B'ÁB'Á?B,ÂB,Â'B,Â,B=	c              ƒ  ó’   "  € V e!   V P                   e   V P                  '       d   R# RV n        \        V 4      G Rj  x€L
  R#  L5i)zÁMark *scope*'s capture abandoned and release it, once: no row can own these bytes. A no-op for no
scope, a scope without an authority, or one already abandoned (its release ran or is arranged).NT)r   r   Úrelease_abandoned_capture©r+   s   &r   Úabandon_capturer8   Q   s5   é € ð ‚}˜Ÿ™Ò/°5·?·?°?ÙØ€E„OÜ
# EÓ
*×*Ô*ùs   ‚$A§A¾A¿Ac           	   ƒ  ó`  "  € V P                   f   R# \        V R7       \        V P                  4       Uu. uF&  pRVR\	        V4      P
                  P                  /NK(  	  ppV'       d:   ^ RIpVP                  \        V P                   P                  V4      G Rj  x€L
  R# R# u upi  L5i)zUCollect every path published by an abandoned worker, including after its caller left.Nr7   r   Úsha256)r   r)   r(   r   r   ÚparentÚnameÚasyncioÚ	to_threadÚrelease_unheld_mediaÚdb)r+   r   Ú
referencesr=   s   &   r   r6   r6   Z   s�   é € à‡�ÒÙÜ˜UÕ#ÜORÐSX×SbÑSbÔOcÓdÑOcÀt�6˜4 ¬4°«:×+<Ñ+<×+AÑ+AÓBÑOc€JÐdßÛØ×ÑÔ 4°e·o±o×6HÑ6HÈ*ÓU×UÒUñ ùò eñ 	Vùs   ‚4B.¶,B'Á"<B.ÂB,ÂB.c                 ó*   € ^ RI Hp  V ! 4       R,          # )a  The store's path as the profile names it, unresolved. The one value ``make_user_dir`` gets:
``resolve()`` erases a link planted below the Hermes home (``cache/documents`` -> elsewhere),
and an elevated grant on the resolved path would land outside the home with no home fence.©Úget_document_cache_dirznative-inputs)Úgateway.platforms.baserD   rC   s    r   Únative_inputs_storerF   e   s   € õ >Ù!Ó# oÕ5Ð5r   c                 ó2   € \        4       P                  4       # )z’This profile's content-addressed store of retained native inputs (``<root>/<sha256>/<name>``),
resolved: what the identity checks compare against.)rF   Úresolve© r   r   Únative_inputs_rootrJ   m   s   € ô Ó ×(Ñ(Ó*Ð*r   ú	image/pngú
image/jpegú	image/gifú
image/webpz.pngz.jpgz.gifz.webpc                óÆ   € V P                  R4      '       d   R# V P                  R4      '       d   R# V R,          R9   d   R# V R,          R8X  d   V R	,          R
8X  d   R# R# )zQThe admission image type the bytes really are (png/jpeg/gif/webp), else ``None``.s   ‰PNG

rK   s   ÿØÿrL   :Né   NrM   :Né   Ns   RIFF:é   é   Ns   WEBPrN   N)s   GIF87as   GIF89a)Ú
startswith)Údatas   &r   Úsniff_image_mimerV      sT   € à‡�Ð+×,Ò,ÙØ‡��×'Ò'ÙØˆB…xÐ)Ô)ÙØˆB…x�7Ô˜t D�z¨WÔ4ÙÙr   Úadmittedc               óÜ  a€ V f   / # \        V \        4      '       dW   V '       dO   \        V 4      \        8”  g;   \        ;QJ d    R V  4       F  '       g   K   RM	  RM! R V  4       4      '       d   \        R4      h^ RIHp V! 4       P                  4       oV  Uu. uF  p\        VR,          4      NK  	  pp\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   \        R4      hV  Uu. uF  q3R	,          NK  	  ppVe   V! 4       MRpVe   VR
,          P                  R4      MRp \        V4      pRT9   d×   Te`   TR,           U
u. uF  p
\        T
R,          4      P                  NK!  	  up
T Uu. uF  q»P                  NK  	  up8w  g   TR,          T8w  d   \        R4      h\        ;QJ d,    R \        Y‡R,          4       4       F  '       g   K   RM!	  RM! R \        Y‡R,          4       4       4      '       d   \        R4      hRpMBTRJ;'       d7    TR,          T8H  ;'       d#    TR,           U
u. uF  qªR,          NK  	  up
T8H  pT'       d%   TR,          R8w  d   \!        TR,          4       RT/# RR\#        T4      RT//# u upi u upi   \        \        3 d   p	\        R4      T	hRp	?	ii ; iu up
i u upi u up
i )a	  Wire ``attachments: [{path, mime}]`` -> committed payload fields (``{}`` when absent).

``admitted()`` returns the durable admission already holding this request's identity (or
``None``): a lost-ACK retry whose disposable staging file is gone reconciles against it.Nc              3   óô   "  € T Fn  p\        V\        4      '       * ;'       gM    \        V4      R R08g  ;'       g5    \        VR ,          \        4      '       * ;'       g    VR,          \        9  x € Kp  	  R# 5i)r   ÚmimeN)Ú
isinstanceÚdictr(   ÚstrÚ_ATTACHMENT_MIMES)Ú.0Úitems   & r   Ú	<genexpr>Ú$admit_attachments.<locals>.<genexpr>”   sy   é € ð ,á*�tô " $¬Ó-Ô-÷ að a´°T³¸vÀvÐ>NÑ1N÷ að aÜ$ T¨&¥\´3Ó7Ô7÷að aØ;?À½<ÔO`Ñ;`ôaã*ùs   ‚ A8£A8»#A8ÁA8TFÚinvalid_params)Úget_image_cache_dirr   c              3   ó–   <"  € T F>  qP                  4       '       * ;'       g    VP                  4       P                  S8g  x € K@  	  R # 5ir   )Úis_absoluterH   r;   )r_   r   Ústagings   & €r   ra   rb   ›   s9   øé € Ð
XÑRWÈ$×ÑÓ!Ô!×EÐE T§\¡\£^×%:Ñ%:¸gÑ%EÔEÓRWùs
   ƒA	£&A	rZ   ÚpayloadÚattachments_v1ÚmediaÚmedia_typesc              3   óT   "  € T F  w  rVR J;'       d    WR,          8g  x € K   	  R # 5i)Nr:   rI   )r_   ÚdigestÚ	references   &  r   ra   rb   ¨   s3   é € ð IÙ(GÑ$�6ð ˜TÐ!×CÐC f¸(Õ0CÑ&CÔCÛ(Gùs   ‚(”(Úadmission_conflictr:   ÚstatusÚterminal)r[   ÚlistÚlenÚ_ATTACHMENT_LIMITÚanyr   rE   rd   rH   r   r/   Ú_attachment_hashesÚOSErrorÚ
ValueErrorr<   ÚzipÚrestore_native_mediaÚcapture_native_media)ÚattachmentsrW   rd   r`   r3   ÚmimesÚrowÚ	committedÚhashesÚexcÚrÚpÚretryrg   s   &$           @r   Úadmit_attachmentsr…   Œ   s²  ø€ ð
 ÒØˆ	Ü�{¤D×)Ò)·ÄÀKÓ@PÔSdÔ@dß‹sñ ,á*ó,�s�sŠsñ ,á*ó,÷ ,ò ,ô  Ð 0Ó1Ð1Ý:Ù!Ó#×+Ñ+Ó-€GÙ,7Ó8©K DŒT�$�v•,Ö©K€EÐ8ß
ƒsÔ
XÑRWÓ
X‡s‡s‚sÔ
XÑRWÓ
X×XÒXÜÐ 0Ó1Ð1Ù&1Ó2¡k˜d�&�\ˆ\¡k€EÐ2Ø Ò,‰(Œ*°$€CØ8;º��I•×"Ñ"Ð#3Ô4ÈT€Ið;Ü# EÓ*ˆð ˆv„~ØÒÀ	È'Ö@RÓ!SÑ@R¸1¤$ q¨¥y£/×"6Ô"6Ñ@RÑ!SÑhmÓWnÑhmÐcd×X^ÔX^ÑhmÑWnÔ!nØ˜]Õ+¨uÔ4Ü#Ð$4Ó5Ð5ß‹3ñ IÜ(+¨F¸gÕ4FÔ(GóI�3�3Š3ñ IÜ(+¨F¸gÕ4FÔ(GóI÷ Iò Iä#Ð$8Ó9Ð9Ø‰ð  $Ð&÷ Ið I¨9°]Õ+CÀuÑ+L÷ Ið IØ+4°WÖ+=Ó>Ñ+= a˜—k�kÑ+=Ñ>À&ÑHð 	çð ˆx�=˜JÔ&Ü  ¨7Õ!3Ô4Ø  )Ð,Ð,Ø˜wÔ(<¸UÓ(CÀ]ÐTYÐZÐ[Ð[ùò9 9ùò 3øô
 ”ZÐ ô ;ÜÐ 0Ó1°sÐ:ûð;üò "TùÒWnùò ?s6   ÂJ0Ä
J5Å	J: Å*%KÆK$ÉK)Ê:KËKËKc                ón  € / V R,          CpVP                  RR4       RV9   d,   VR,           Uu. uF  q3R,          VR,          .NK  	  upVR&   / V CRV/CpVe   RVRV/p\        P                  ! VR	R\        R
7      p\        P
                  ! VP                  4       4      P                  4       # u upi )aÁ  SHA-256 of a delivery as received: its prepared payload and the provider payload the hook also
sees (``raw_message``: a webhook's parsed, route-script-transformed body; None on relay, whose
wire fields are all in the payload). Transport headers (delivery id, signature, attempt counters,
timestamps) never reach the hook and are not hashed. Media count by bytes: a redelivery
re-captures them under a fresh staging name (``reconcile_native_retry``).Únative_text_v1Úingress_sha256Nrj   r:   Úsizerh   Úraw_messageT)Ú	sort_keysÚ
separatorsr
   )Ú,Ú:)ÚpopÚjsonÚdumpsÚreprÚhashlibr:   ÚencodeÚ	hexdigest)rh   ÚrawÚenveloperj   ÚreceivedÚ	canonicals   &&    r   Úingress_fingerprintrš   ¹   s¸   € ð -�'Ð*Õ+Ð,€HØ‡L�LÐ! 4Ô(Ø�(ÔØKSÐT[ÖK\Ó]ÑK\À% H�o¨u°V­}Ó=ÑK\Ñ]ˆ�ÑØ6�'Ð6Ð+¨XÑ6€HØ
‚Ø˜x¨¸Ð<ˆÜ—
’
˜8¨tÀ
ÔTXÔY€IÜ�>Š>˜)×*Ñ*Ó,Ó-×7Ñ7Ó9Ð9ùò ^s   °B2r–   c               ó\  € VP                  R/ 4      P                  R4      ;'       g    . pV P                  4       ;_uu_ 4       pVP                  RWV34      P                  4       pRRR4       Xe   \        P
                  ! V^,          4      M/ p	V	P                  R/ 4      P                  R4      p
V
e   V
\        WE4      8X  d   T	pM�V	P                  R/ 4      P                  R4      pV'       dN   V'       dF   V Uu. uF  qÝR,          VR,          3NK  	  upV Uu. uF  qÝR,          VR,          3NK  	  up8w  d   V# / VCR/ VR,          CRV/C/CpVR,          P                  R. 4      pV'       d   V^ ,          R8w  d   \        V4       V Uu0 uF  qîR	,          kK  	  ppV Uu. uF  qîR	,          V9  g   K  VNK  	  ppV'       d0   \        V Uu0 uF  qîR	,          kK  	  up4       \        V VR
R7       V#   + '       g   i     EL£; iu upi u upi u upi u upi u upi )a  A redelivered native message (lost provider ACK, Relay buffer replay) re-downloads its media
under a fresh disposable staging name, so its captured path differs from the committed one.
Retry identity is the committed bytes, not that name: when this exact identity already holds
the same digests and sizes in the same order, the committed references stand in for the fresh
capture (whose now-unowned copy is collected) and the admission digest decides the rest, so
changed bytes or any other changed field still conflict. A delivery committed in
``pre_gateway_dispatch``-rewritten form resolves to its committed payload when the resend matches
the fingerprint recorded at ingress (``ingress_fingerprint``); a changed resend, or a row
committed before fingerprints, is compared exactly as above.r‡   rj   zqSELECT status, payload_json FROM session_admissions WHERE principal_id=? AND target_session_id=? AND request_id=?Nrˆ   r:   r‰   rq   r   F©Úretain_history)
r/   Ú	_read_ctxÚexecuteÚfetchoner�   Úloadsrš   rz   r)   r?   )r@   Úprincipal_idÚ
session_idÚ
request_idrh   r–   ÚfreshÚconnr~   ÚretainedÚrecordedÚresolvedr   r‚   rn   ÚkeptÚunowneds   &$$$$$           r   Úreconcile_native_retryr¬   Ê   sý  € ð �K‰KÐ(¨"Ó-×1Ñ1°'Ó:×@Ð@¸b€EØ	�‰�Œ˜4Ø�l‰lð BØDPÐ^hÐCiókßksÑksÓkuð 	÷ 
ð &)¢_Œt�zŠz˜#˜a�&Ô!¸"€HØ�|‰|Ð,¨bÓ1×5Ñ5Ð6FÓG€HØÒ Ô,?ÀÓ,MÔ MØ‰à—L‘LÐ!1°2Ó6×:Ñ:¸7ÓCˆ	ßŸIÉIÓ)VÉIÀq¨X­;¸¸&½	Ó*BÉIÑ)VÙ27ó[9Ù27¨Q�8•˜a �iÓ(±%ñ[9ô *9àˆNØc�gÐcÐ/Ð1b°GÐ<LÕ4MÐ1bÈwÐXaÑ1bÑcˆØÐ)Õ*×.Ñ.¨w¸Ó;€Iß�S˜•V˜zÔ)ä˜YÔ'Ù/8Ó9©y )�f×Ð©y€DÐ9Ù*/ÓQ©%˜Y¸VÕ3DÈDÑ3P�yˆy©%€GÐQßÜ¹wÓG¹w°) f×-Ð-¹wÑGÔHÜ˜R ¸Õ?Ø€O÷- 
�ˆüò *Wùò [9ùò :ùÚQùâGs0   Á#HÃ?HÄHÆHÆ,H$Ç H$ÇH)ÈH	c                 óì   € . pV  FH  p VP                  4       P                  ^8w  d   \        R4      hVP                  \	        V4      4       KJ  	  V#   \
         d    TP                  R4        Km  i ; i)é   rc   N)ÚlstatÚst_nlinkr   r   Ú_sha256ÚFileNotFoundError)r3   r€   r   s   &  r   rv   rv   í   sj   € Ø€FÛˆð	 à�z‰z‹|×$Ñ$¨Ô)Ü'Ð(8Ó9Ð9Ø�M‰Mœ' $›-Ö(ñ ð €Møô !ô 	 à�M‰M˜$×ð	 ús   ‰AAÁA3Á2A3c                 ó°   € \        V 4      ;_uu_ 4       p\        P                  ! VR 4      P                  4       uuRRR4       #   + '       g   i     R# ; i©r:   N)Ú_open_regularr“   Úfile_digestr•   )r   Úsources   & r   r±   r±   û   s7   € Ü	�t×	Ô	 Ü×"Ò" 6¨8Ó4×>Ñ>Ó@÷ 
×	×	Ó	ús   ”%AÁA	c                ó„   € V P                  R4      pV'       g   / # R\        VR,          4      R\        VR,          4      /# )zYCommitted attachment fields -> ``MessageEvent`` media kwargs (``{}`` for text-only rows).ri   Ú
media_urlsrj   rk   )r/   rz   rr   )rh   rU   s   & r   Úrestore_attachmentsrº      s>   € à�;‰;Ð'Ó(€DßØˆ	ØÔ.¨t°G­}Ó=¸}ÌdÐSWÐXeÕSfÓNgÐhÐhr   c           	      óö  € V P                  4       '       d   V P                  4       '       d   \        R 4      h\        P                  ! V \        P
                  \        \        R^ 4      ,          \        \        R^ 4      ,          4      p\        P                  ! \        P                  ! V4      P                  4      '       g"   \        P                  ! V4       \        R4      h\        P                  ! VR4      # )z)native media must be a local regular fileÚ
O_NONBLOCKÚ
O_NOFOLLOWz#native media must be a regular fileÚrb)rf   Ú
is_symlinkrx   ÚosÚopenÚO_RDONLYÚgetattrÚstatÚS_ISREGÚfstatÚst_modeÚcloseÚfdopen)r   Úfds   & r   rµ   rµ     s    € Ø×Ñ×Ò §¡×!2Ò!2ÜÐDÓEÐEÜ	�Š�”r—{‘{¤W¬R°¸qÓ%AÕAÄGÌBÐP\Ð^_ÓD`Õ`Ó	a€BÜ�<Š<œŸš ›×,Ñ,×-Ò-Ü
�Š�ŒÜÐ>Ó?Ð?Ü�9Š9�R˜ÓÐr   c                 óæ  € ^ RI HpHp . p\        ^ V! 4       4      p^ p. p V  F+  p\	        \        V4      WEW64       \        R V 4       4      pK-  	  \        Wc4       EFÁ  w  r‰\        V	R,          4      p
V
P                  P                  pV
P                  P                  4       V
P                  8w  d   \        R4      h\        \        4       V
P                  P                  ,          RRR7       \        ;_uu_ 4        \        P!                  4       pVe=   VP#                  \%        V
4      4       \&        \%        V
4      ;;,          ^,          uu&   V
P)                  4       '       g   V
P+                  4       '       d$   \-        V	.4       \.        P0                  ! V
4       M\.        P2                  ! WŠ4       RRR4       V
P                  W»P                  VP                  P                  VP                  P                  P                  3 F  p\5        V4       K  	  EKÄ  	  V F  pVP7                  RR	7       K  	  V#   + '       g   i     L�; i  T F  pTP7                  RR	7       K  	  i ; i)
é    ©Úget_inbound_media_max_bytesÚvalidate_inbound_media_sizec              3   ó2   "  € T F  qR ,          x € K  	  R# 5i)r‰   NrI   ©r_   rn   s   & r   ra   Ú'capture_native_media.<locals>.<genexpr>  s   é € ÐF¹:¨i &×)Ò)»:ùó   ‚r   rc   éÀ  T)ÚmodeÚexist_okN)Ú
missing_ok)rE   rÎ   rÏ   ÚmaxÚ_capture_filer   Úsumry   r;   rH   r   r   rF   r<   r0   r'   r/   r   r]   r2   Úexistsr¿   rz   rÀ   ÚutimeÚreplacer   Úunlink)r3   rÎ   rÏ   rA   ÚlimitÚtotalÚstagedÚvalueÚ	temporaryrn   ÚtargetÚrootr+   Ú	directorys   &             r   r{   r{     s×  € ß_Ø€JÜ�Ñ.Ó0Ó1€Eð €Eð €Fð.ÛˆEÜœ$˜u›+ u°ZÔHÜÑF¹:ÓFÓFŠEñ ô %(¨×$;Ñ ˆIÜ˜) FÕ+Ó,ˆFØ—=‘=×'Ñ'ˆDØ�}‰}×$Ñ$Ó&¨&¯-©-Ô7Ü'Ð(8Ó9Ð9ÜÔ-Ó/°&·-±-×2DÑ2DÕDÈ5Ð[_Õ`ß–Ü$×(Ñ(Ó*�ØÒ$Ø—L‘L¤ V£Ô-ÜœC ›K×(¨AÕ-Ó(Ø—=‘=—?’? f×&7Ñ&7×&9Ò&9Ü(¨)¨Ô5Ü—H’H˜VÕ$ä—J’J˜yÔ1÷ ð %Ÿm™m¨T·;±;ÀÇÁ×@RÑ@RÐTX×T_ÑT_×TfÑTf×TmÑTmÓn�	Ü 	Ö*ô oñ! %<ó&  ˆIØ×Ñ¨ÐÖ-ñ  àÐ÷ —ûó  ˆIØ×Ñ¨ÐÖ-ò  ús2   ¡CI Ã>A*I Å)I Å?9I Æ8A+I É IÉI ÉI0c           	      óB  € ^ RI Hp  \        V 4      pT;_uu_ 4        \        4       pTP                  4       T8w  d   \        R4      h\        \        4       RRRR7       \        P                  ! RTR7      w  rš\        T
4      pTP                  T4       \        P                  ! T	R	4      ;_uu_ 4       p\         P"                  ! 4       ^ ríTP%                  R4      ;p'       dH   T\'        T4      ,          p T! Y.,           TR
7       TP)                  T4       TP+                  T4       K`  TP-                  4        \        P.                  ! TP1                  4       4       RRR4       TXP3                  4       ,          T P4                  ,          pTP6                  P                  4       TP6                  8w  d   \        R4      hR\9        T4      RTP3                  4       RX/pTP;                  4       '       g   TP=                  4       '       d   \?        T.4       TP                  T4       RRR4       R#   \        \        3 d   p\        R4      ThRp?ii ; i  \         d   p\        R4      ThRp?ii ; i  + '       g   i     EL#; i  + '       g   i     R# ; i)rÌ   )rÏ   rc   NrÔ   T)rÕ   ÚparentsrÖ   z	.capture-)ÚprefixÚdirÚwb©Ú	max_bytesr   r:   r‰   i   ) rE   rÏ   rµ   rw   rx   r   Ú_media_rootrH   r   rF   ÚtempfileÚmkstempr   r   rÀ   rÉ   r“   r:   Úreadrs   ÚupdateÚwriteÚflushÚfsyncÚfilenor•   r<   r;   r]   rÛ   r¿   rz   )r   rß   rà   rA   rá   rÏ   r·   r�   rå   rÊ   r<   rã   Úoutputrm   r‰   Úchunkrä   rn   s   &&&&&             r   rÙ   rÙ   8  sþ  € ÝBð;Ü˜tÓ$ˆ÷ 
ŠÜ‹}ˆØ�<‰<‹>˜TÔ!Ü#Ð$4Ó5Ð5ÜÔ)Ó+°%ÀÐPTÕUÜ×#Ò#¨;¸DÔA‰ˆÜ˜“Jˆ	Ø�‰�iÔ Ü�YŠY�r˜4× Ô  FÜ"Ÿ>š>Ó+¨Q�DØ!Ÿ;™; {Ó3Ð3�%Ö3Øœ˜E›
Õ"�ðGÙ/°µÈÕNð —‘˜eÔ$Ø—‘˜UÖ#Ø�L‰LŒNÜ�HŠH�V—]‘]“_Ô%÷ !ð ˜×(Ñ(Ó*Õ*¨T¯Y©YÕ6ˆØ�=‰=× Ñ Ó" f§m¡mÔ3Ü#Ð$4Ó5Ð5ØœS ›[¨(°F×4DÑ4DÓ4FÈÐPTÐUˆ	Ø�=‰=�?Š?˜f×/Ñ/×1Ò1Ü  ) Ô-Ø×Ñ˜)Ô$÷5 
‰øô ”ZÐ ô ;ÜÐ 0Ó1°sÐ:ûð;ûô  "ô GÜ+Ð,<Ó=À3ÐFûðGú÷ !× Ð ú÷ 
�ˆúsh   ˆH5 �BJÂ4AI9	Ã7IÄAI9	ÅB.JÈJÈ5IÉIÉIÉI6É%I1É1I6É6I9	É9J
Ê	JÊJ	c                óš   € ^ RI HpHp  V! \        V 4      \	        ^ V! 4       4      R7       R#   \
         d   p\        R4      ThRp?ii ; i)zIPreflight validated manifest sizes before materializing any batch member.rÍ   rì   rc   N)rE   rÎ   rÏ   rÚ   rØ   rx   r   )ÚsizesrÎ   rÏ   r�   s   &   r   Úvalidate_media_batch_sizerû   [  sA   € ç_ð;Ù#¤C¨£J¼#¸aÑA\ÓA^Ó:_×`øÜô ;ÜÐ 0Ó1°sÐ:ûð;ús   Š". ®A
¹AÁA
z
[Shared attachment] file: z
([^\n]+)\nc                ót  € \        V 4      P                  R4      '       d&   \        VP                  R4      \         4      '       g   . # \	        4       p. p\
        P                  VR,          4       FÄ  p\        V4      pVP                  4       '       g   K&  VP                  P                  V8X  g   KC  \        P                  VP                  P                  4      '       g   Kt  \        P                  VP                  4      '       d   K›  VP                  RVRVP                  P                  /4       KÆ  	  V# )aB  Retained document references a hosted admission's prompt names (``[]`` for other rows).

Only content-addressed names under this profile's retained root count, and never an API
image name: those are held by ``api_turn_v1`` in every status, so a member's prompt text
can name one without gaining deletion authority over it.zhosted:Útextr   r:   )r]   rT   r[   r/   rî   Ú_HOSTED_DOCUMENT_REÚfindallr   rf   r;   Ú_SHA256_NAMEÚ	fullmatchr<   Ú_API_IMAGE_NAMEr   )r¤   rh   rå   rA   râ   r   s   &&    r   Úhosted_document_referencesr  k  sÝ   € ô ˆz‹?×%Ñ% i×0Ò0¼
À7Ç;Á;ÈvÓCVÔX[×8\Ò8\Øˆ	Ü‹=€DØ€JÜ$×,Ñ,¨W°V­_Ö=ˆÜ�E‹{ˆØ×Ñ×Ô 4§;¡;×#5Ñ#5¸Ö#=Ä,×BXÑBXÐY]×YdÑYd×YiÑYi×BjÔBjÜ'×1Ñ1°$·)±)×<Ô<Ø×Ñ˜v u¨h¸¿¹×8HÑ8HÐIÖJñ	 >ð
 Ðr   c                ó¸   € \        V P                  R/ 4      P                  RR4      4      \        V P                  R/ 4      P                  RR4      4      ,           # )zLNative references eligible as deletion candidates after terminal settlement.ri   rj   r‡   rI   )rr   r/   )rh   s   &r   Úadmission_media_referencesr  }  sQ   € ä�—‘Ð,¨bÓ1×5Ñ5°g¸rÓBÓCÄdØ�‰Ð$ bÓ)×-Ñ-¨g°rÓ:óG<õ <ð <r   c                 ó°  € V P                  R 4      P                  4       p\        4       pV F¦  w  r4rV\        P                  ! V4      w  rxp	\        T	;'       g    R4      p
VR8w  dT   T
P                  T;'       g    R4       T
P                  T;'       g    R4       V
P                  \        VRV/4      4       VP                  R V
 4       4       K¨  	  V# )a›  SELECT status, request_id, json_extract(payload_json,
            '$.attachments_v1.media', '$.native_text_v1.media', '$.api_turn_v1.media'),
            CASE WHEN status!='terminal' AND request_id LIKE 'hosted:%'
                 THEN json_extract(payload_json, '$.text') END
            FROM session_admissions WHERE status!='terminal'
            OR json_type(payload_json, '$.api_turn_v1.media') IS NOT NULLrq   rý   c              3   ó2   "  € T F  qR ,          x € K  	  R# 5i)r   NrI   rÑ   s   & r   ra   Ú$_held_media_paths.<locals>.<genexpr>•  s   é € ÐB±z¨)˜f×%Ò%³zùrÓ   rI   )	rŸ   Úfetchallr(   r�   r¡   rr   Úextendr  rò   )r¦   Úrowsr4   rp   r¤   Úencodedrý   r|   ÚnativeÚapirA   s   &          r   Ú_held_media_pathsr  ƒ  sÆ   € ð �<‰<ð Mó N÷
 OWÉhËjð 	ô ‹5€DÛ-1Ñ)ˆ˜GÜ#'§:¢:¨gÓ#6Ñ ˆ˜Sä˜#Ÿ)˜) “_ˆ
Ø�ZÔØ×Ñ˜k×/Ð/¨RÔ0Ø×Ñ˜fŸl˜l¨Ô+Ø×ÑÔ8¸ÀfÈdÀ^ÓTÔUØ�‰ÑB±zÓBÖBñ .2ð €Kr   c                 óÜ   € V P                  R R7      p\         P                  ! VP                  4      '       d   VP                  '       g   \	        R4      hVP
                  VP                  3# )F©Úfollow_symlinkszuncertain native file identity)rÄ   rÅ   rÇ   Úst_inorx   Úst_dev)r   Úsaveds   & r   Ú_file_identityr  ™  sL   € Ø�I‰I eˆIÓ,€EÜ�<Š<˜Ÿ™×&Ò&¨e¯l¯l¨lÜÐ9Ó:Ð:Ø�<‰<˜Ÿ™Ð%Ð%r   c                 ó6  € \        4       p V  Fo  p\        V4      pVP                  P                  V8w  g*   VP                  P                  4       VP                  8w  d    R # VP	                  \        V4      4       Kq  	  V#   \        \        3 d     R # i ; ir   )r(   r   r;   rH   Úaddr  rw   rx   )r3   rå   Ú
identitiesrâ   r   s   &&   r   Ú_held_file_identitiesr     s€   € Ü“€JðÛˆEÜ˜“;ˆDØ�{‰{×!Ñ! TÔ)¨T¯[©[×-@Ñ-@Ó-BÀdÇkÁkÔ-QÚØ�N‰Nœ>¨$Ó/Ö0ñ	 ð Ðøô ”ZÐ ô Úðús   ŒAB Á#B ÂBÂBc           	     óÀ  € ^ RI Hp V! WR7      pVe   VR,          R8w  d   ^ # VR,          P                  R/ 4      pVP                  R4      '       g&   \        VP                  R4      \        4      '       d   ^ R	IHp V! W4       \        V \        VR,          4      4      pV\        V \        VR
,          VR,          4      4      ,          pV\        V 4      ,           # )ao  Delete eligible terminal native bytes unless another retained input holds them.

Terminal rows are exact-retry evidence by digest only; their bytes are not
replayed. Rows that are not terminal (queued, started, unknown) may still
execute, so any path they reference stays on disk; API image references stay
on disk in every status because they remain history context after settlement,
and are holders only (see ``collect_unheld_api_images``). Different regular
files can collect independently; physical aliases and uncertain stat results
retain conservatively. A shared hardlink can consequently retain an extra old alias.
)Úget_session_admission)Úadmission_idrp   rq   rh   Úapi_turn_v1rj   Úhistory)Úcompact_settled_api_payloadsr¤   )Úhermes_state_runtimer  r/   r[   rr   Úgateway.session_api_mediar   r?   r  r  Úsweep_settled_media)r@   r  r  r~   Úapi_turnr   Úreleaseds   &&     r   Úrelease_admission_mediar&  ­  s¸   € õ ;Ù
 Ô
>€CØ
‚{�c˜(•m zÔ1ÙØ�9�~×!Ñ! -°Ó4€HØ‡|�|�G×Ò¤
¨8¯<©<¸	Ó+BÄD× IÒ IåJÙ$ RÔ6ô
 $ BÔ(BÀ3ÀyÅ>Ó(RÓS€HØÔ$ RÔ)CÀCÈÕDUÐWZÐ[dÕWeÓ)fÓgÕg€HØÔ)¨"Ó-Õ-Ð-r   é  Únowc               ó"  € ^ RI p^ RIHp Vf   VP                  4       MTpV\        P	                  V P
                  ^ 4      ,
          \        8  d   ^ # V\        V P
                  &   V P                  4       ;_uu_ 4       pVP                  R4      P                  4       pRRR4       WR,          ,
          p/ pX F€  w  p\        P                  ! V4      w  ršT	;'       g    . T
;'       g    . ,            FB  p \        VR,          4      P                  RR7      P                  V8  d   W·VR,          &   KB  KD  	  K‚  	  V'       d&   \!        V \#        VP%                  4       4      RR7      # ^ #   + '       g   i     LÖ; i  \         d     Kš  i ; i)	a[  At most hourly per store: collect settled native/attachment inputs older than
``MEDIA_CACHE_MAX_AGE_HOURS`` whatever the transcript says, as main's age-based document cache
cleanup did for the staging copy the note used to name. A live admission or an in-flight capture
still holds its bytes; API images and hosted documents keep their own owners.N)ÚMEDIA_CACHE_MAX_AGE_HOURSa"  SELECT json_extract(payload_json, '$.attachments_v1.media', '$.native_text_v1.media')
            FROM session_admissions WHERE status='terminal' AND (json_type(payload_json, '$.attachments_v1.media')
            IS NOT NULL OR json_type(payload_json, '$.native_text_v1.media') IS NOT NULL)r'  r   Fr  rœ   )ÚtimeÚagent.provider_mediar*  Ú_last_sweepr/   Údb_pathÚ_SWEEP_INTERVAL_Srž   rŸ   r	  r�   r¡   r   rÄ   Úst_mtimerw   r?   rr   Úvalues)r@   r(  r+  r*  r¦   r  ÚcutoffÚstaler  r|   r  rn   s   &$          r   r#  r#  Î  sN  € ó
 Ý>Øšˆ$�)‰)Œ+¨#€CØ
Œ[�_‰_˜RŸZ™Z¨Ó+Õ+Ô.?Ô?ÙØ!„K�—
‘
ÑØ	�‰�Œ˜4Ø�|‰|ð ]ó ^ç^fÑ^fÓ^hð 	÷ 
ð ¨tÕ3Õ3€FØ€EÛ‰
ˆÜ"Ÿjšj¨Ó1ÑˆØ%×+Ð+¨°·°¸"×=Ð=ˆIðÜ˜	 &Õ)Ó*×/Ñ/ÀÐ/ÓF×OÑOÐRXÔXØ/8˜) FÕ+Ó,ñ Yó >ñ ÷ TYÔ ¤D¨¯©«Ó$8ÈÔOÐ_Ð^_Ð_÷ 
�ûô ô Úðús   Á> E,Ã7<E?Å,E<	Å?FÆFc           
     óÞ  € ^ RI Hp \        V P                  4      P	                  4       P
                  V! 4       P	                  4       8w  d#   \        P                  RV P                  4       ^ # \        4       p \        T VP                  4       '       d   VP                  R4      MR	 Uu. uF‚  p\        P                  VP                  4      '       g   K*  VP                  R,          VP
                  P                  R,          8X  g   K_  R\        V4      RVP
                  P                  /NK„  	  up4      # u upi   \         P"                   d    \        P%                  R4        ^ # i ; i)
a4  Collect retained API images no admission holds any more: deleting a chat retires its
admissions and erases their references, so those bytes have no owner left. Only the exact
name ``commit_api_images`` gives (``api_<sha256[:32]><ext>`` under its own digest) is a
candidate; retained hosted documents are held by prompt text, never by a media reference.

Candidates are enumerated from the ACTIVE home's media root while ownership is decided by
``db``: a sweep whose database belongs to another profile would see every image here as
unowned, so it collects nothing.)Úget_hermes_homezISkipped retained API image collection: %s is not the active profile storez*/api_*:rQ   é$   N:Né    Nr   r:   z:API image collection failed; files stay for the next sweeprI   )Úhermes_constantsr5  r   r.  rH   r;   ÚloggerÚwarningrî   r?   Úis_dirÚglobr  r  r<   r]   Úsqlite3ÚDatabaseErrorÚ	exception)r@   r5  rå   r   s   &   r   Úcollect_unheld_api_imagesr@  ê  s(  € õ 1ÜˆB�J‰JÓ×ÑÓ!×(Ñ(©OÓ,=×,EÑ,EÓ,GÔGÜ�‰ØWÐY[×YcÑYcô	eáÜ‹=€DðÜ# BØae×alÑal×anÒanÈÏÉÐS\ÔI]ÐtvÐIvó)bÙIvÀÜ×(Ñ(¨¯©×3ô <Ø8<¿	¹	À$½È4Ï;É;×K[ÑK[Ð\_ÕK`Ñ8`ô <ˆV”S˜“Y ¨$¯+©+×*:Ñ*:Ó;ÑIvñ)bó cð 	cùò )bøô × Ñ ô ô 	×ÑÐUÔVÚð	ús0   Á91D> Â*'D9
Ã0D9
Ä'D9
Ä2D> Ä9D> Ä>*E,Å+E,c                óV  aa
a€ / pV F@  oSR,          o
V
V3R lR
 4        F#  pS
;W4&   V\         P                  ! V4      ^R &   K%  	  KB  	  \        V Uu0 uF  qUR,          kK  	  up4      pRV'       d   RMR,           p\        4       pT P	                  T\         P                  ! V4      .V'       d   V3MRO54       Fa  w  p	\        V	\        4      '       d   V	P                  RR4      M
\        V	4      oVP                  V3R	 lVP                  4        4       4       Kc  	  V# u upi )a  Candidate paths any transcript row (id > after_id) mentions raw or JSON-escaped, in ONE
messages pass. Rows are prefiltered in SQL on the literal text before each candidate's digest
directory, so only rows that could name a candidate reach Python's exact substring test.r   c              3   óx   <"  € T F/  pSR ,          V,           \        S4      P                  ,           x € K1  	  R# 5ir´   )r   r<   )r_   Úsepr–   rn   s   & €€r   ra   Ú$_history_mentions.<locals>.<genexpr>  s+   øé € ÐWÉ;ÀC�Y˜xÕ(¨3Õ.´°c³·±×?Ò?Ë;ùs   ƒ7:r:   zªWITH digests(value) AS MATERIALIZED (SELECT value FROM json_each(?)) SELECT content FROM messages WHERE EXISTS (SELECT 1 FROM digests WHERE instr(content, digests.value))z	 AND id>?Ú zutf-8rÝ   c              3   ó>   <"  € T F  w  rVS9   g   K  Vx € K  	  R # 5ir   rI   )r_   Úneedler–   rý   s   &  €r   ra   rD    s   øé € ÐR±¡ À6ÈTÁ>Ÿš³ùs   ƒ“
)Ú/Ú\éÿÿÿÿrI   )r�   r‘   Úsortedr(   rŸ   r[   ÚbytesÚdecoder]   rò   Úitems)r¦   rA   Úafter_idÚneedlesÚtailrn   ÚprefixesÚqueryÚ	mentionedÚcontentr–   rý   s   &&&  `    @@r   Ú_history_mentionsrV    s  ú€ ð €GÛˆ	Ø˜ÕˆÝWÉ;ÖWˆDØ>AÐAˆG‰M˜G¤D§J¢J¨tÓ$4°Q°rÐ$:Ó;ó Xñ  ô ¹JÓG¹J¨y ×*Ð*¹JÑGÓH€HðXßjrÑ[fÐxzõ|€Eä“€IØ—l‘l 5¬4¯:ª:°hÓ+?Ð*d×RZÀHÁ;Ð`bÑ*dÖe‰
ˆÜ5?ÀÌ×5OÒ5Oˆw�~‰~˜g yÔ1ÔUXÐY`ÓUaˆØ×ÑÔR°·±´ÓRÖRñ fð Ðùò Hs   ÁD&c                 óB  € V  Uu. uFŽ  p\        VR ,          4      P                  P                  V8X  g   K0  \        VR ,          4      P                  P                  VR,          8X  g   Kd  \        VR ,          4      P                  4       '       g   KŒ  VNK�  	  up# u upi )r   r:   )r   r;   r<   rÛ   )rA   rå   rn   s   && r   Ú_collectablerX    s‹   € Ù'1ó q¡z˜)´T¸)ÀFÕ:KÓ5L×5SÑ5S×5ZÑ5ZÐ^bÑ5bŒIÜ�Y˜vÕ&Ó'×.Ñ.×3Ñ3°yÀÕ7JÑJô ÜOSÐT]Ð^dÕTeÓOf×OmÑOm×Oo÷ ˆI¡zñ qð qùò qs   …-B·/BÁ+#BÂBr�   Tc               ó¤  aaaa€ \        4       o\        S;'       g    RS4      oS'       g   ^ # \        4       ^ upoS'       d´   V P                  4       ;_uu_ 4       pVP	                  R4        VP	                  R4      P                  4       ^ ,          o\        VS4      pVP                  '       d   VP	                  R4       RRR4       S Uu. uF  qUR,          T9  g   K  TNK  	  upoS'       g   ^ # VVVV3R lpV P                  V4      #   TP                  '       d   TP	                  R4       i i ; i  + '       g   i     L~; iu upi )a¾  Delete unowned references, preserving accepted admission and retained transcript owners.

The history owner check is one read-snapshot pass over messages, outside the write lock; under
the lock only rows inserted after that snapshot (an indexed id range) are re-checked. A new
transcript mention of a retained image comes from an admission holding it (re-checked under the
lock) or from a copied row (branch/compress insert, caught by the range).ÚBEGINz)SELECT coalesce(max(id), 0) FROM messagesÚROLLBACKNr   c                 ón  <€ \        V 4      p\        VS	4      pVf   ^ # S'       d   V\        V SSR7      ,          p^ pS FÆ  p\        VR,          4      pVR,          V9   d   K%   \        ;_uu_ 4        VR,          \
        9   g:   VP                  P                  4       VP                  8w  g   \        V4      V9   d    R R R 4       K‹  VP                  4        R R R 4       V^,          pVP                  P                  4        KÈ  	  V#   + '       g   i     L9; i  \        \        3 d     Kó  i ; i)N)rO  r   )r  r  rV  r   r0   r2   r;   rH   r  rÞ   Úrmdirrw   rx   )
r¦   r4   r  r%  rn   r   Úlast_idrA   r�   rå   s
   &     €€€€r   ÚcollectÚ%release_unheld_media.<locals>.collect9  s  ø€ Ü  Ó&ˆÜ*¨4°Ó6ˆ
ØÒÙßØÔ% d¨JÀÔIÕIˆDØˆÛ#ˆIÜ˜	 &Õ)Ó*ˆDØ˜Õ  DÔ(Ùð	ß –[Ø! &Õ)¬WÔ4¸¿¹×8KÑ8KÓ8MÐQU×Q\ÑQ\Ô8\Ü-¨dÓ3°zÔAØ ÷ !‘[ð —K‘K”M÷	 !ð
 ˜A•�Ø—‘×!Ñ!Ö#ñ $ð ˆ÷ !—[ûô œZÐ(ô Úðús7   Á&DÁ4ADÃDÃDÃ+DÄDÄDÄD4Ä3D4rI   )	rî   rX  r(   rž   rŸ   r    rV  Úin_transactionÚ_execute_write)	r@   rA   r�   Úseenr¦   rn   r_  r^  rå   s	   &fd    @@r   r?   r?   !  s  û€ ô ‹=€DÜ˜j×.Ð.¨B°Ó5€JßÙÜ“E˜1€M€Dˆ'ßØ�\‰\�^Œ^˜tØ�L‰L˜Ô!ð-ØŸ,™,Ð'RÓS×\Ñ\Ó^Ð_`Õa�Ü(¨¨zÓ:�à×&×&Ð&Ø—L‘L Ô,÷ ñ 2<Ó]± IÈÕ?PÐX\Ñ?\—i�i±Ñ]ˆ
ßÙ÷ð ð. ×Ñ˜WÓ%Ð%øð9 ×&×&Ð&Ø—L‘L Õ,ð 'ú÷ �^üò ^s0   ÁD:Á/2DÂ!#D:ÃEÃ$EÄ&D7Ä7D:Ä:E
	c                 óV  € V '       g   . # \        4       p. p V  EFH  p\        V4      0 R	m8w  d   \        R4      h\        VR ,          4      pVP                  P                  V8w  g8   VP                  4       V8w  g#   VP                  P                  VR,          8w  d   \        R4      h\        V4      ;_uu_ 4       p\        P                  ! VP                  4       4      P                  VR,          8w  d   \        R4      h\        P                  ! VR4      P                  4       VR,          8w  d   \        R4      h RRR4       VP                  \!        V4      4       EKK  	  V#   + '       g   i     L1; i  \"        \        \$        \&        3 d   p\)        R4      ThRp?ii ; i)
r   r:   r‰   zinvalid media referencezforeign media referencezchanged media sizezchanged media bytesNÚstorage_unavailable>   r   r‰   r:   )rî   r(   rx   r   r;   rH   r<   rµ   rÀ   rÆ   rö   Úst_sizer“   r¶   r•   r   r]   rw   Ú	TypeErrorÚKeyErrorr   )rA   rå   r3   rn   r   r·   r�   s   &      r   rz   rz   S  sR  € ßØˆ	Ü‹=€DØ€Eð@Ü#ˆIÜ�9‹~Ò!;Ô;Ü Ð!:Ó;Ð;Ü˜	 &Õ)Ó*ˆDØ—‘×"Ñ" dÔ*¨d¯l©l«nÀÔ.DØ—{‘{×'Ñ'¨9°XÕ+>Ô>Ü Ð!:Ó;Ð;Ü˜t×$Ô$¨Ü—8’8˜FŸM™M›OÓ,×4Ñ4¸	À&Õ8IÔIÜ$Ð%9Ó:Ð:Ü×&Ò& v¨xÓ8×BÑBÓDÈ	ÐRZÕH[Ô[Ü$Ð%:Ó;Ð;ð \÷ %ð
 �L‰Lœ˜T›×#ñ $ð €L÷ %×$ûô ”Z¤¬HÐ5ô @ÜÐ 5Ó6¸CÐ?ûð@ús1   ˜B%E< Â=BE)Å 'E< Å)E9Å4E< Å<F(ÆF#Æ#F(r   >   rM   rK   rL   rN   )rÌ   )KÚ__doc__Úcollectionsr   Ú
contextlibr   Úcontextvarsr   r“   r�   ÚloggingrÀ   Úpathlibr   Úrer=  rÄ   rï   Ú	threadingÚhermes_dir_aclr   r!  r   Úutilsr   Ú	getLoggerr   r9  Úcompiler  r   r2   ÚLockr0   r'   rr   r   r-   r)   r8   r6   rF   rJ   rî   Ú	frozensetr^   rt   Ú
_IMAGE_EXTrV   r…   rš   r¬   rv   r±   rº   rµ   r{   rÙ   rû   ÚHOSTED_DOCUMENT_LINEÚescaperþ   r  r  r  r  r  r&  r/  r-  r#  r@  rV  rX  r?   rz   rI   r   r   Ú<module>rz     sÍ  ðñõ  Ý %Ý "Û Û Û Û 	Ý Û 	Û Û Û Û Ý (å 2Ý !à	×	Ò	˜8Ó	$€à—*’*ÐDÓE€Ø�zŠz˜/Ó*€ñ ‹)€Ø�nŠnÓ€ÙÐ4¸dÔC€ô
$�Dô 
$ð ó
"ó ð
"ñ"¨Dõ "ò+òVò6ò+ð !€ñ ÒTÓUÐ ØÐ Ø˜6 <°¸ÀfÈlÐ\cÐd€
ò
ð*\¨tô *\ôZ:ð"!ÐUYô !òFòAò
iòò#òL %òF;ð 6Ð Ø—j’j §¢Ð+?Ó!@À=Õ!PÓQÐ òò$<òò,&ò
ò.ð: Ð Ø€ð` 4ô `ò8ô4ò0qð
/&¸4ô /&ôdr   