+
    jHàj	  ã                  ón   € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ]P                  ! R4      t
R R ltR# )z`Inbound attachment re-homing for multiplexed gateways (moved out of ``gateway/run_inbound.py``).)ÚannotationsN)ÚPath)ÚMessageEventzgateway.runc               ó    € V ^8„  d   QhRRRR/# )é   Úeventr   ÚreturnÚNone© )Úformats   "Ú>/home/ubuntu/.hermes/hermes-agent/gateway/run_inbound_media.pyÚ__annotate__r      s   € ÷ $!ñ $! ð $!°ñ $!ó    c           	     óŽ  € V P                   '       g   R# ^ RIHpHpHp \        V! 4       4      \        V! 4       4      rTV! V4      V! V4      8X  d   R# ^ RIHp \        V P                   4      p\        V P                   4       Fú  w  r‰\        V	4      p
 V
P                  VR,          4      pTR,          T,          p T
P                  4       '       g   KR  TP                  P                  RRR7       \        P                   ! \#        T
4      \#        T4      4       \#        T4      Yx&   T P*                  '       g   K¹  Y�P*                  9   g   KË  T P*                  P-                  Y–! \#        T4      4      4      T n        Kü  	  Wpn         R#   \         d     EK  i ; i  \$         d    \&        P)                  RT	RR7        EK@  i ; i)	u›  Move adapter-cached attachments into the ACTIVE profile's ``cache/`` and repoint the event.

Adapters download and cache an attachment BEFORE the gateway routes the event to a profile, so
on a multiplexed gateway the file lands under the launch home while the routed turn's sandbox
mounts (``get_cache_directory_mounts``) and vision's ``_media_cache_roots`` resolve the routed
profile's ``cache/`` â€” the agent is handed a mounted, empty directory (#101134). Runs inside the
routed scope at the shared preprocessing choke point (every adapter, every media kind); a no-op
when the active home is the launch home, and idempotent (a moved entry is no longer under it).
N)Úget_hermes_homeÚget_routing_process_hermes_homeÚhermes_home_key)Úto_agent_visible_cache_pathÚcacheT)ÚparentsÚexist_okzDCould not move inbound attachment %s into the routed profile's cache)Úexc_info)Ú
media_urlsÚhermes_constantsr   r   r   r   Útools.credential_filesr   ÚlistÚ	enumerateÚrelative_toÚ
ValueErrorÚis_fileÚparentÚmkdirÚshutilÚmoveÚstrÚOSErrorÚloggerÚwarningÚtextÚreplace)r   r   r   r   ÚactiveÚlaunchr   Ú	rewrittenÚiÚrawÚsrcÚrelÚdests   &            r   Úrehome_inbound_mediar2      sh  € ð ××ÐÙßbÑbÜ™/Ó+Ó,¬dÑ3RÓ3TÓ.UˆFÙ�vÓ¡/°&Ó"9Ô9ÙÝBÜ�U×%Ñ%Ó&€IÜ˜E×,Ñ,Ö-‰ˆÜ�3‹iˆð	Ø—/‘/ &¨7Õ"2Ó3ˆCð ˜Õ #Õ%ˆð	Ø—;‘;—=’=ÙØ�K‰K×Ñ d°TÐÔ:Ü�KŠKœ˜C›¤# d£)Ô,ô ˜4“yˆ	‰Ø�:�:Š:˜#§¡Ö+ØŸ™×+Ñ+¨CÐ1LÌSÐQUËYÓ1WÓXˆEŽJñ# .ð$ !Öøô ô 	Ûð	ûô ô 	Ü�N‰NÐaÐcfÐquˆNÔvÛð	ús+   ÂF	Â=FÃAFÆ	FÆFÆ#GÇG)Ú__doc__Ú
__future__r   Úloggingr"   Úpathlibr   Úgateway.platforms.eventr   Ú	getLoggerr&   r2   r
   r   r   Ú<module>r9      s.   ðÙ få "ã Û Ý å 0ð 
×	Ò	˜=Ó	)€÷$!r   