+
    „WÝjÁh  ã                  ó´  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RIHtHtHtHtHtHt ]P$                  ! ]4      tRRJRRKRRLR	RM/tR
]R&   RtRNtR	RMRRJ/tR
]R&   ROtRPt]P8                  ! R4      t]P<                  R R l4       tR R lt R R lt!R R lt"RQR R llt#RQR R llt$R R lt%RRR R llt&R R  lt'RQR! R" llt(RQR# R$ llt)RSt*R% R& lt+RQR' R( llt,R) R* lt-R+ R, lt. ! R- R.4      t/R/ R0 lt0RQR1 R2 llt1R3 R4 lt2RQR5 R6 llt3RQR7 R8 llt4R9 R: lt5R;R/R< R= llt6R> R? lt7R@ RA lt8RB RC lt9RD RE lt:RTRF RG llt;RURH RI llt<R# )Vu¬  Messaging-channel settings a profile clone must NOT inherit.

A ``--clone``d profile that keeps the source's bot tokens, allowlists and platform state makes two
gateways fight over one bot (standalone) or blocks ``hermes gateway migrate --multiplex`` with a
duplicate-credential finding per platform.

The inventory is OWNERSHIP-based and evaluated in the SOURCE profile's plugin scope: every adapter
(built-in ``Platform`` member, a platform that left core â€” its ``LEFT_CORE`` row, plugin installed or
not â€” or a plugin registered under the source's ``HERMES_HOME``) owns the env
keys it declares outright (``required_env``, allowlist / allow-all / home-channel names, its
``env_overrides`` / ``env_enable_credentials``, core's ``config_env._ENV_ENABLE_CREDENTIALS``) plus every key
under its canonical ``<PLATFORM>_`` prefix and its historical alias prefixes. Gateway-wide channel
policy (``GATEWAY_ALLOW_ALL_USERS`` / ``GATEWAY_ALLOWED_USERS``) and relay enrollment identity
(``GATEWAY_RELAY_*``) are channel settings too. A prefix an adapter SHARES with a non-channel
capability (``TWILIO_*`` is also the telephony skill, ``EMAIL_*`` mail-sending scripts, and a plugin
platform's ``shared_env_prefixes`` its own tools) is stripped only when the source actually runs that adapter â€” the credential is
then the bot's identity; otherwise it is a tool key and survives. Model/provider keys, tool keys,
memory and general config are never touched.
)ÚannotationsN)Úpartial)ÚPath)ÚDictÚIterableÚListÚOptionalÚSetÚTupleÚemailÚqqbotÚrelayÚsmsúdict[str, tuple[str, ...]]Ú_PLATFORM_ENV_PREFIX_ALIASESÚgatewayÚ_SHARED_WITH_TOOLSz.^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=c               ó   € V ^8„  d   QhRR/# )é   Ú
source_dirúOptional[Path]© )Úformats   "ÚOC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\profile_channels.pyÚ__annotate__r   >   s   € ÷ *ñ *˜nñ *ó    c              #  óˆ   "  € V f   Rx € R# ^ RI HpHp V! \        V 4      4      p Rx € V! V4       R#   T! T4       i ; i5i)z”Evaluate adapter discovery in ``source_dir``'s plugin scope (its private ``plugins/``), not the
ambient profile's. ``None`` keeps the ambient scope.N)Úreset_hermes_home_overrideÚset_hermes_home_override)Úhermes_constantsr   r   Ústr)r   r   r   Útokens   &   r   Ú_plugin_scoper"   =   s=   é € ð ÒÛÙßUÙ$¤S¨£_Ó5€Eð*Ûá" 5Ö)øÑ" 5Õ)üs   ‚$A§5 «
Aµ
?¿Ac               ó    € V ^8„  d   QhRRRR/# )r   Úplatform_idr    Úreturnztuple[str, ...]r   )r   s   "r   r   r   L   s   € ÷ Kñ K sð K¨ñ Kr   c                ó„   € V P                  4       P                  RR4      R,           pV.\        P                  V R4      O5# )zYEnv-var prefixes owned by one messaging platform: canonical ``<PLATFORM>_`` plus aliases.Ú-Ú_r   )ÚupperÚreplacer   Úget)r$   Ú	canonicals   & r   Úplatform_env_prefixesr-   L   s>   € à×!Ñ!Ó#×+Ñ+¨C°Ó5¸Õ;€IØÐJÔ4×8Ñ8¸ÀbÓIÑJÐJr   c               ó   € V ^8„  d   QhRR/# ©r   r%   Úlistr   )r   s   "r   r   r   R   s   € ÷ ñ ˜4ñ r   c                 óÜ   € \         P                  ! \        4      ;_uu_ 4        ^ RIHp  V ! 4        ^ RIHp \        VP                  4       4      uuRRR4       #   + '       g   i     . # ; i)é    )Údiscover_plugins)Úplatform_registryN)	Ú
contextlibÚsuppressÚ	ExceptionÚhermes_cli.pluginsr3   Úgateway.platform_registryr4   r0   Úall_entries)r3   r4   s     r   Ú_registry_entriesr;   R   sG   € Ü	×	Ò	œY×	'Õ	'Ý7ÙÔÝ?ÜÐ%×1Ñ1Ó3Ó4÷	 
(×	'×	'Ñ	'ð
 €Iús   £,AÁA+	c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   r   [   s   € ÷ Bñ B˜dñ Br   c                 ób   € ^ RI Hp  V  Uu. uF  qP                  '       g   K  VNK  	  up# u upi )z¯Rows of platforms that left core for a catalog plugin (``hermes_cli.left_core_migration``).
Their channel ownership comes from the row, so it holds while the plugin is absent.)Ú	LEFT_CORE)Úhermes_cli.left_core_migrationr>   Úplatform)r>   Úfeatures     r   Ú_left_core_platformsrB   [   s'   € õ 9Ù#,ÓA¡9˜×0@Õ0@�GˆG¡9ÑAÐAùÒAs   ‹,£,c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r%   r   r   )r   s   "r   r   r   b   s   € ÷ 
ñ 
 >ð 
Ð=Wñ 
r   c           
     óÂ  € \        \        4      pTP                  \        4        Uu/ uF-  q"P                  '       g   K  VP
                  VP                  bK/  	  up4       \        V 4      ;_uu_ 4        \        4        F;  p\        \        VRR4      ;'       g    R4      pV'       g   K-  WAVP                  &   K=  	  RRR4       V# u upi   + '       g   i     T# ; i)z…``_SHARED_WITH_TOOLS``, left-core platforms' prefixes, and every plugin platform's
``shared_env_prefixes`` in ``source_dir``'s scope.Úshared_env_prefixesNr   )Údictr   ÚupdaterB   Úchannel_env_prefixesr@   r"   r;   ÚtupleÚgetattrÚname)r   ÚsharedÚfÚentryÚprefixess   &    r   Ú_shared_with_toolsrP   b   s­   € ô Ô$Ó%€FØ
‡M�MÔ?SÔ?UÓpÑ?U¸!×YoÕYoÔ5�1—:‘:˜q×5Ñ5Ò5Ñ?UÑpÔqÜ	�z×	"Õ	"Ü&Ö(ˆEÜœW UÐ,AÀ2ÓF×LÐLÈ"ÓMˆHß‰xØ%-�u—z‘zÓ"ñ )÷ 
#ð
 €Mùò qß	"Ö	"ð
 €Mús   §C¿CÁ43CÂ,CÃC	c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r%   ú	list[str]r   )r   s   "r   r   r   o   s   € ÷ ñ ˜^ð °yñ r   c                ó–  € ^ RI Hp VP                  P                  4        Uu0 uF!  q"P                  R8w  g   K  VP                  kK#  	  ppVP                  R \        4        4       4       \        V 4      ;_uu_ 4        VP                  R \        4        4       4       RRR4       \        V4      # u upi   + '       g   i     L ; i)z²Every messaging platform id: built-in ``Platform`` members, platforms that left core, plus the
plugin adapters registered in ``source_dir``'s scope (ambient scope when ``None``).)ÚPlatformÚlocalc              3  ó8   "  € T F  qP                   x € K  	  R # 5i©N)r@   )Ú.0rA   s   & r   Ú	<genexpr>Úplatform_ids.<locals>.<genexpr>t   s   é € ÐFÑ/E G×ÖÓ/Eùó   ‚c              3  ó8   "  € T F  qP                   x € K  	  R # 5irW   )rK   )rX   rN   s   & r   rY   rZ   v   s   é € Ð?Ñ+> %—:–:Ó+>ùr[   N)
Úgateway.configrT   Ú__members__ÚvaluesÚvaluerG   rB   r"   r;   Úsorted)r   rT   ÚmÚidss   &   r   Úplatform_idsrd   o   sŽ   € õ (Ø$×0Ñ0×7Ñ7Ô9Ó
PÑ9�q¿W¹WÈÑ=OŒ7ˆ1�7Œ7Ñ9€CÐ
PØ‡J�JÑFÔ/CÔ/EÓFÔFÜ	�z×	"Õ	"Ø�
‰
Ñ?Ô+<Ô+>Ó?Ô?÷ 
#ä�#‹;Ðùò	 Qç	"×	"ús   £B3ºB3Á?!B8Â8C	c               ó   € V ^8„  d   QhRR/# )r   r%   úset[str]r   )r   s   "r   r   r   z   s   € ÷ ñ ˜8ñ r   c                ó$  aa€ \        4       oR VV3R lloS! V P                  4       V P                  '       d   SP                  V P                  4       . V P                  OV P
                  OV P                  O F  pS! V^,          4       K  	  V P                  '       d#   SP                  V P                  ^ ,          4       V P                  '       d9   SP                  V P                  V P                   R2V P                   R204       S# )z<Every env name a ``gateway.platform_env.EnvCred`` row reads.c               ó   € V ^8„  d   QhRR/# )r   r%   ÚNoner   )r   s   "r   r   Ú$_cred_row_envs.<locals>.__annotate__~   s   € ÷ ñ ˜$ñ r   c                ó¸   <€ \        V \        4      '       d   SP                  V 4       R # \        V \        \        34      '       d   V  F  pS! V4       K  	  R # R # rW   )Ú
isinstancer    ÚaddrI   r0   )ÚspecÚitemÚ_flattenÚnamess   & €€r   rp   Ú _cred_row_envs.<locals>._flatten~   sB   ø€ Ü�dœC× Ò Ø�I‰I�dŽOÜ˜œu¤d˜m×,Ò,Û�Ù˜–ó ñ -r   Ú_NAMEÚ
_THREAD_ID)
ÚsetÚcredsr!   rm   ÚfixedÚoptionalÚoptional_strippedÚwarn_missingÚhomerG   )ÚrowÚkey_envrp   rq   s   & @@r   Ú_cred_row_envsr~   z   sÍ   ù€ ä“e€E÷ñ ñ ˆS�Y‰YÔØ
‡y‡y€yØ�	‰	�#—)‘)ÔØF�S—Y‘YÐF §¡ÐF°×0EÑ0EÓFˆÙ�˜•Öñ Gà
××ÐØ�	‰	�#×"Ñ" 1Õ%Ô&Ø
‡x‡x€xØ�‰�c—h‘h 3§8¡8 *¨EÐ 2°s·x±x°jÀ
Ð4KÐLÔMØ€Lr   c               ó    € V ^8„  d   QhRRRR/# )r   Úentriesr   r%   údict[str, str]r   )r   s   "r   r   r   ‘   s   € ÷ ñ  8ð °^ñ r   c           
     óD  € ^ RI Hp ^ RIHp / pVP                  P                  4        F3  w  rEVP                  \        P                  WTP                  4      4       K5  	  V  Fº  pTP                  \        P                  \        VRR4      ;'       g    RVP                  4      4       \        VRR4      ;'       g    R FX  p\        Wr4      '       g   K  VP                  \        P                  \        V4      VP                  P                  4      4       KZ  	  K¼  	  V# )aj  ``{ENV_KEY: platform_id}`` for the names the gateway env overrides read outright: core's
enable-credential sets plus, for each given registry entry, its ``env_enable_credentials`` and
every ``EnvCred`` row of its ``env_overrides``. With no *entries* it is registry-free (core rows
only), so it stays cheap at import time; raises if the core table cannot be read.©Ú
config_env©ÚEnvCredÚenv_enable_credentialsÚenv_overridesr   )r   r„   Úgateway.platform_envr†   Ú_ENV_ENABLE_CREDENTIALSÚitemsrG   rF   Úfromkeysr`   rJ   rK   rl   r~   r@   )r€   r„   r†   Úkeysr@   rq   rN   Ústeps   &       r   Úconfig_env_table_keysr�   ‘   sÕ   € õ
 #Ý,Ø€DØ%×=Ñ=×CÑCÖE‰ˆØ�‰”D—M‘M %¯©Ó8Ö9ñ FãˆØ�‰”D—M‘M¤'¨%Ð1IÈ2Ó"N×"TÐ"TÐRTÐV[×V`ÑV`ÓaÔbÜ˜E ?°BÓ7×=Ð=¸2Ò=ˆDÜ˜$×(Ô(Ø—‘œDŸM™M¬.¸Ó*>ÀÇÁ×@SÑ@SÓTÖUó >ñ ð
 €Kr   c               ó    € V ^8„  d   QhRRRR/# )r   r€   r   r%   r0   r   )r   s   "r   r   r   £   s   € ÷ ]ñ ] ð ]¨dñ ]r   c           	     óp   € V  UUu. uF"  p\        VRR4      ;'       g    R F  q"NK  	  K$  	  upp# u uppi )z:Every step a registry entry declares in ``env_overrides``.rˆ   r   )rJ   )r€   rN   rŽ   s   &  r   Ú_env_override_stepsr’   £   s9   € á%Ô\™g�U´'¸%ÀÐRTÓ2U×2[Ð2[ÐY[Ò2[¨$ŠDÑ2[‰D™gÒ\Ð\ùÓ\s   †2Ÿ2c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r%   r�   r   )r   s   "r   r   r   ¨   s   € ÷ ñ ¨.ð ÀNñ r   c                óÚ  € \         P                  \        \        4      p\	        4        F<  pVP                  \         P                  VP                  VP                  4      4       K>  	  \        V 4      ;_uu_ 4        \        4       pV FT  p. VP                  OVP                  NVP                  NVP                  N F  pV'       g   K  VP                  W&   K  	  KV  	  RRR4       \        P                   ! \"        4      ;_uu_ 4        VP                  \%        X4      4       \'        V4       F‡  p\)        V\*        4      '       g   K  VP,                  P/                  R4      pR FK  pVP,                  P/                  V4      '       g   K&  Vf   K,  VP0                  WP,                  V,          &   KM  	  K‰  	  RRR4       V#   + '       g   i     Lí; i  + '       g   i     T# ; i)zÅ``{ENV_KEY: platform_id}`` for every env name an adapter declares outright (registry entry
fields, the gateway env-override table) plus gateway-wide channel policy. Prefix matching covers
the rest.Nr@   )ÚenvÚenv_base)rF   rŒ   Ú_GATEWAY_POLICY_KEYSÚGATEWAY_POLICY_IDrB   rG   Ú
enable_envr@   r"   r;   Úrequired_envÚallowed_users_envÚallow_all_envÚcron_deliver_env_varrK   r5   r6   r7   r�   r’   rl   r   Úkeywordsr+   r`   )	r   r�   rA   r€   rN   rK   rŽ   r@   Úkws	   &        r   Údeclared_channel_env_keysr    ¨   sc  € ô  Ÿ=™=Ô)=Ô?PÓQ€DÜ'Ö)ˆØ�‰”D—M‘M '×"4Ñ"4°g×6FÑ6FÓGÖHñ *ä	�z×	"Õ	"Ü#Ó%ˆÛˆEØw˜%×,Ñ,Ðw¨e×.EÑ.EÐwÀu×GZÑGZÐwÐ\a×\vÑ\vÓw�ß‘4Ø!&§¡�D“Jó xñ ÷ 
#ô 
×	Ò	œY×	'Õ	'Ø�‰Ô)¨'Ó2Ô3Ü'¨Ö0ˆDÜ˜$¤×(Ô(ØŸ=™=×,Ñ,¨ZÓ8�Û-�BØ—}‘}×(Ñ(¨×,Ô,°Ô1EØ2:·.±.˜Ÿ]™]¨2Õ.Ó/ó .ñ 1÷ 
(ð €K÷ 
#×	"ú÷ 
(Ö	'ð €Kús1   Á<A
GÃGÄ<GÅ>GÆGÆ'GÇG	ÇG*	c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r%   rf   r   )r   s   "r   r   r   À   s   € ÷ ñ  ð ¸8ñ r   c           	     óR  € \        \        4      p\        V 4      ;_uu_ 4        \        4       pV F<  pVP	                  R VP
                  VP                  VP                  3 4       4       K>  	  RRR4       \        P                  ! \        4      ;_uu_ 4        ^ RIHp \        X4       FÇ  p\        WT4      '       dM   VP                  '       d;   VP	                  VP                  VP                   R2VP                   R204       K`  \        V\         4      '       g   Kx  VP"                  P%                  R4      '       g   K›  VP"                  R,          pVP	                  Wf R2V R204       KÉ  	  RRR4       V#   + '       g   i     EL; i  + '       g   i     T# ; i)uW   Allowlist / allow-all / home-channel names adapters declare â€” channel-only by nature.c              3  ó8   "  € T F  q'       g   K  Vx € K  	  R # 5irW   r   )rX   Úns   & r   rY   Ú#_policy_env_keys.<locals>.<genexpr>Æ   s   é € ÐtÑ$n˜qÓrsŸšÓ$nùs   ‚	�
Nr…   rs   rt   r–   )ru   r—   r"   r;   rG   r›   rœ   r�   r5   r6   r7   r‰   r†   r’   rl   r{   r   rž   r+   )r   rq   r€   rN   r†   rŽ   Úbases   &      r   Ú_policy_env_keysr§   À   s5  € äÔ.Ó/€EÜ	�z×	"Õ	"Ü#Ó%ˆÛˆEØ�L‰LÑt U×%<Ñ%<¸e×>QÑ>QÐSX×SmÑSmÑ$nÓtÖtñ ÷ 
#ô 
×	Ò	œY×	'Õ	'Ý0Ü'¨Ö0ˆDÜ˜$×(Ò(¨T¯Y¯Y¨YØ—‘˜dŸi™i¨D¯I©I¨;°eÐ)<ÀÇÁÀÈ:Ð>VÐWÖXÜ˜D¤'×*Ô*¨t¯}©}×/@Ñ/@À×/LÔ/LØ—}‘} ZÕ0�Ø—‘˜d f¨E N°t°f¸JÐ4GÐHÖIñ 1÷ 
(ð €L÷ 
#×	"Ð	"ú÷ 
(Ö	'ð €Lús+   £AFÂ7FÃAFÄ$FÅ0FÆF	ÆF&	c               ó   € V ^8„  d   QhRR/# )r   r%   r�   r   )r   s   "r   r   r   Ø   s   € ÷ Yñ Y˜^ñ Yr   c            
     ó  € / p \        4        F<  pV P                  \        P                  VP                  VP
                  4      4       K>  	  \        4       pV F<  pV P                  \        P                  VP                  VP                  4      4       K>  	  \        P                  ! \        4      ;_uu_ 4        ^ RIHp ^ RIHp VP                   P#                  4        F3  w  rgV P                  \        P                  WvP$                  4      4       K5  	  V F<  pV P                  \        P                  VP&                  VP                  4      4       K>  	  \)        V4       FÂ  p\+        W…4      '       g   K  \-        4       p	VP.                   F-  p
T	P                  \+        V
\0        4      '       d   V
3MT
4       K/  	  VP2                  '       d   V	P5                  VP2                  4       V P                  \        P                  W˜P
                  P$                  4      4       KÄ  	  RRR4       V P#                  4        UUu/ uF$  w  r¼VP7                  \8        4      '       g   K"  W¼bK&  	  upp#   + '       g   i     LQ; iu uppi )uB  ``{ENV_KEY: platform_id}`` for the keys that make an adapter CONNECT AS a bot (token / app id /
client id / secret â€” the shape ``GatewayRunner._adapter_credential_fingerprint`` hashes). Enable
flags, URLs and hosts are excluded: two profiles pointing at one Mattermost server collide only
when they also share the token.rƒ   r…   N)rB   rG   rF   rŒ   r™   r@   r;   rš   rK   r5   r6   r7   r   r„   r‰   r†   rŠ   r‹   r`   r‡   r’   rl   ru   rv   r    r!   rm   ÚendswithÚ_CREDENTIAL_SUFFIXES)r�   rA   r€   rN   r„   r†   r@   rq   rŽ   rv   ÚgroupÚkeyÚpids                r   Úcredential_env_keysr¯   Ø   s¨  € ð
 €DÜ'Ö)ˆØ�‰”D—M‘M '×"4Ñ"4°g×6FÑ6FÓGÖHñ *äÓ!€GÛˆØ�‰”D—M‘M %×"4Ñ"4°e·j±jÓAÖBñ ä	×	Ò	œY×	'Õ	'Ý&Ý0Ø)×AÑA×GÑGÖI‰OˆHØ�K‰KœŸ™ e¯^©^Ó<Ö=ñ  JãˆEØ�K‰KœŸ™ e×&BÑ&BÀEÇJÁJÓOÖPñ ä'¨Ö0ˆDÜ˜$×(Ô(Ü"%£%�Ø!ŸZœZ�EØ—L‘L¬Z¸¼s×-CÒ-C %¡ÈÖOñ (à—:—:�:Ø—I‘I˜dŸj™jÔ)Ø—‘œDŸM™M¨%·±×1DÑ1DÓEÖFñ 1÷ 
(ð &*§Z¡Z¤\ÔX¡\™˜°S·\±\ÔBV×5WŒHˆCŠH¡\ÒXÐX÷ 
(×	'üó Ys'   Â;B<I5Å<AI5ÇAI5ÉJÉ+JÉ5J	c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úenv_pathr   ÚwantedzOptional[dict[str, str]]r%   r�   r   )r   s   "r   r   r   õ   s"   € ÷ 
ñ 
˜$ð 
Ð(@ð 
ÈNñ 
r   c                óš  € / pV P                  4       '       g   V# ^ RIHp \        P                  ! \
        4      ;_uu_ 4        V! V RR7      ;'       g    / P                  4        FE  w  rEVe	   WA9   g   K  V'       g   K  VP                  4       '       g   K3  VP                  4       W$&   KG  	  RRR4       V#   + '       g   i     T# ; i)zQNon-blank assignments in ``env_path`` (restricted to ``wanted`` keys when given).)Údotenv_valuesú	utf-8-sig©ÚencodingN)Úis_fileÚdotenvr´   r5   r6   r7   r‹   Ústrip)r±   r²   r_   r´   r­   r`   s   &&    r   Ú_env_valuesr»   õ   s”   € à€FØ×Ñ×ÒØˆÝ$Ü	×	Ò	œY×	'Õ	'Ù(¨¸KÔH×NÐNÈB×UÑUÖW‰JˆCØ’ #¦-·U±U¸u¿{¹{¿}¼}Ø#Ÿk™k›m�“ñ X÷ 
(ð €M÷	 
(Ö	'ð €Mús   Á/B9Á7B9ÂB9ÂB9Â9C
	c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚrawrF   r®   r    r%   zOptional[bool]r   )r   s   "r   r   r     s!   € ÷ ñ ˜4ð  cð ¨nñ r   c                óp  € \        V P                  R4      \        4      '       d
   V R,          M/ pV P                  R4      VP                  R4      3 F_  p\        V\        4      '       d   VP                  V4      MRp\        V\        4      '       g   KD  RV9   g   KM  \        VR,          4      u # 	  R# )zY``platforms.<pid>.enabled`` (either nesting) when the source config states it, else None.r   Ú	platformsNÚenabled)rl   r+   rF   Úbool)r½   r®   r   ÚsectionÚblocks   &&   r   Ú_explicit_enabledrÄ     s‰   € ä *¨3¯7©7°9Ó+=¼t× DÒ Dˆc�)ŽnÈ"€GØ—G‘G˜KÓ(¨'¯+©+°kÓ*BÓCˆÜ$.¨w¼×$=Ò$=�—‘˜CÔ À4ˆÜ�eœT×"Ô" y°EÖ'9Ü˜˜iÕ(Ó)Ò)ñ Dñ r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   rL   r   r%   rf   r   )r   s   "r   r   r     s#   € ÷ %ñ %¨ð %Ð@Zð %Ð_gñ %r   c                ó¼  a€ V f   \        V4      # / pV R,          P                  4       '       dK   ^ RIHp \        P
                  ! \        4      ;_uu_ 4        V! V R,          4      ;'       g    / pRRR4       \        V R,          4      o/ p\        P
                  ! \        4      ;_uu_ 4        ^ RIH	p VP                  P                  4        F  w  rg\        V4      WFP                  &   K  	  RRR4       \        V 4      ;_uu_ 4        \        4       pRRR4       X FF  p	V	P                  '       g   K  VP!                  V	P"                  \        V	P                  4      4       KH  	  \%        4        F2  p
VP!                  V
P&                  \        V
P(                  4      4       K4  	  V F2  p	VP!                  V	P"                  \        V	P*                  4      4       K4  	  \        4       pV F­  p\-        W,4      pVe   V'       d   VP/                  V4       K-  VP1                  V4      ;'       g    \        4       pV'       g   KZ  \2        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   Kœ  VP/                  V4       K¯  	  V#   + '       g   i     EL9; i  + '       g   i     ELÎ; i  + '       g   i     EL¼; i)	u  Shared-prefix platforms the SOURCE runs as a channel: explicitly enabled in its config.yaml, or
auto-enabled by a complete credential set in its ``.env`` and not explicitly disabled â€” the same
gate ``gateway.platform_env.EnvCred`` applies at gateway start.Núconfig.yaml©Úread_user_config_rawú.envrƒ   c              3  óF   <"  € T F  pSP                  V4      x € K  	  R # 5irW   ©r+   )rX   rK   r•   s   & €r   rY   Ú*_shared_adapters_active.<locals>.<genexpr>/  s   øé € Ð9±5¨4˜Ÿ™ Ÿ˜³5ùs   ƒ!FT)ru   r¸   Úhermes_cli.configrÉ   r5   r6   r7   r»   r   r„   rŠ   r‹   r`   r"   r;   r‡   Ú
setdefaultrK   rB   r@   r™   rš   rÄ   rm   r+   Úall)r   rL   r½   rÉ   Úcreds_by_platformr„   r@   rq   r€   rN   rA   Úactiver®   Úexplicitrv   r•   s   &&             @r   Ú_shared_adapters_activerÔ     s
  ø€ ð ÒÜ�6‹{ÐØ€CØ�]Õ"×+Ñ+×-Ò-Ý:Ü× Ò ¤×+Õ+Ù& z°MÕ'AÓB×HÐHÀbˆC÷ ,ä
�j 6Õ)Ó
*€CØ-/ÐÜ	×	Ò	œY×	'Õ	'Ý&Ø)×AÑA×GÑGÖI‰OˆHÜ03°E³
ÐŸn™nÓ-ñ  J÷ 
(ô 
�z×	"Õ	"Ü#Ó%ˆ÷ 
#ó ˆØ×'×'Ò'Ø×(Ñ(¨¯©´S¸×9UÑ9UÓ5VÖWñ ô (Ö)ˆØ×$Ñ$ W×%5Ñ%5´s¸7×;MÑ;MÓ7NÖOñ *ãˆØ×$Ñ$ U§Z¡Z´°U×5GÑ5GÓ1HÖIñ ä“u€FÛˆÜ$ SÓ.ˆØÒßØ—
‘
˜3”ÙØ!×%Ñ% cÓ*×3Ð3¬c«eˆß‰5—S“SÔ9±5Ó9—S—S’SÔ9±5Ó9×9Ô9Ø�J‰J�sŽOñ ð €M÷9 ,×+Ð+ú÷ 
(×	'Ð	'ú÷ 
#×	"Ð	"ús%   ÁJ"Â0AJ6ÄK
Ê"J3	Ê6K	Ë
K	c                  óB   € ] tR tRtRtRR R lltR R ltR R	 ltR
tR# )ÚChannelKeyIndexi4  z²Resolves an env key to the messaging platform that owns it (``None`` = not a channel key),
evaluated in ``source_dir``'s plugin scope with the ownership rule for shared prefixes.Nc               ó    € V ^8„  d   QhRRRR/# )r   r   r   r%   ri   r   )r   s   "r   r   ÚChannelKeyIndex.__annotate__8  s   € ÷ 
ñ 
 >ð 
¸Tñ 
r   c                	ó  a € VS n         \        V4      S n        \        V4      S n        \        V4      S n        \        V4      S n        \        VS P                  4      S n
        \        V 3R  lS P                   4       R R7      S n        R# )c              3  ó²   <"  € T FL  p\         P                  . \        V4      OSP                  P	                  VR4      O54       F  pW!3x € K
  	  KN  	  R # 5i)Nr   )rF   rŒ   r-   rL   r+   )rX   r®   ÚprefixÚselfs   &  €r   rY   Ú+ChannelKeyIndex.__init__.<locals>.<genexpr>@  sQ   øé € ð d¡n˜sÜŸ=™=Ð)aÔ+@ÀÓ+EÐ)aÈÏÉÏÉÐX[Ð]_ÓH`Ñ)aÖb�ð �]Ùbñ £nùs   ƒAAc                ó(   € \        V ^ ,          4      ) # )r2   )Úlen)ro   s   &r   Ú<lambda>Ú*ChannelKeyIndex.__init__.<locals>.<lambda>B  s   € œc $ q¥'›l™]r   )r­   N)r   rd   r¿   r    Údeclaredr§   ÚpolicyrP   rL   rÔ   Úshared_activera   Ú	_prefixes)rÜ   r   s   f&r   Ú__init__ÚChannelKeyIndex.__init__8  sn   ø€ Ø$ˆŒÜ% jÓ1ˆŒÜ1°*Ó=ˆŒÜ& zÓ2ˆŒÜ(¨Ó4ˆŒÜ4°ZÀÇÁÓMˆÔÜ06ôd d§n¢nó dá*ô1
ˆŽr   c               ó    € V ^8„  d   QhRRRR/# )r   r­   r    r%   úOptional[str]r   )r   s   "r   r   rØ   E  s   € ÷ ñ  ð ¨ñ r   c                	ó`  a€ V P                   P                  S4      ;'       g!    \        V3R  lV P                   4       R4      pVf   R# V P                  P                  V4      pV'       dA   SP                  V4      '       d*   W P                  9  d   V P                  S4      '       g   R# V# )c              3  ó^   <"  € T F"  w  rSP                  V4      '       g   K  Vx € K$  	  R # 5irW   )Ú
startswith)rX   rÛ   r®   r­   s   &  €r   rY   Ú/ChannelKeyIndex.platform_for.<locals>.<genexpr>F  s$   øé € Ð-nÁ^±k°fÐWZ×WeÑWeÐfl×Wm¯cªcÃ^ùs   ƒ-£
-N)râ   r+   Únextrå   rL   rì   rä   Ú
_is_policy)rÜ   r­   r®   rL   s   &f  r   Úplatform_forÚChannelKeyIndex.platform_forE  s�   ø€ Ø�m‰m×Ñ Ó$×uÐu¬Ô-nÀTÇ^Â^Ó-nÐptÓ(uˆØŠ;ÙØ—‘—‘ Ó%ˆß�c—n‘n V×,Ò,°×<NÑ<NÔ1NÐW[×WfÑWfÐgj×WkÒWkÙØˆ
r   c               ó    € V ^8„  d   QhRRRR/# )r   r­   r    r%   rÁ   r   )r   s   "r   r   rØ   N  s   € ÷ Vñ V˜cð V dñ Vr   c                	ó¶   a€ SV P                   9   ;'       gC    \        ;QJ d#    V3R  l\         4       F  '       g   K   R# 	  R# ! V3R  l\         4       4      # )c              3  ó,   <"  € T F	  qS9   x € K  	  R # 5irW   r   )rX   Úmarkerr­   s   & €r   rY   Ú-ChannelKeyIndex._is_policy.<locals>.<genexpr>O  s   øé € Ð(UÁ_¸6°3®Ã_ùs   ƒTF)rã   ÚanyÚ_POLICY_MARKERS)rÜ   r­   s   &fr   rï   ÚChannelKeyIndex._is_policyN  s=   ø€ Ø�d—k‘kÑ!×UÐU§S£SÔ(UÅ_Ó(U§S¤SÐU¢SÐU SÔ(UÅ_Ó(UÓ%UÐUr   )rå   râ   r¿   rã   rL   rä   r   rW   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ræ   rð   rï   Ú__static_attributes__r   r   r   rÖ   rÖ   4  s   † ñ_÷
õ÷Vñ Vr   rÖ   c               ó    € V ^8„  d   QhRRRR/# )r   Úliner    r%   ré   r   )r   s   "r   r   r   R  s   € ÷ -ñ -˜3ð - =ñ -r   c                ób   € \         P                  V 4      pV'       d   VP                  ^4      # R# )é   N)Ú_ENV_LINE_REÚmatchr¬   )r  r  s   & r   Ú_env_key_of_liner  R  s'   € Ü×Ñ˜tÓ$€Eß"ˆ5�;‰;�q‹>Ð,¨Ð,r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r±   r   ÚindexúOptional[ChannelKeyIndex]r%   údict[str, list[str]]r   )r   s   "r   r   r   W  s#   € ÷ ñ  Tð Ð2Kð ÐWkñ r   c                ó"  € V P                  4       '       g   / # T;'       g    \        4       p/ p. pV P                  RRR7      pVP                  4        Fe  p\	        V4      pV'       d   VP                  V4      MRpVe   Vf   VP                  V4       KD  VP                  V. 4      P                  V4       Kg  	  V'       dK   T P                  RP                  V4      VP                  R4      '       g	   V'       d   RMR,           RR7       V# )	z§Drop every messaging-channel assignment from ``env_path`` in place; comments, blank lines and
every other key survive verbatim. Returns ``{platform: [keys removed]}``.rµ   r*   ©r·   ÚerrorsNÚ
Ú zutf-8r¶   )r¸   rÖ   Ú	read_textÚ
splitlinesr  rð   ÚappendrÏ   Ú
write_textÚjoinrª   )r±   r  ÚremovedÚkeptÚtextr  r­   r@   s   &&      r   Ústrip_channel_env_filer  W  så   € ð ×Ñ×ÒØˆ	Ø×&Ð&”_Ó&€EØ$&€GØ€DØ×Ñ {¸9ÐÓE€DØ—‘Ö!ˆÜ˜tÓ$ˆß.1�5×%Ñ% cÔ*°tˆØŠ;˜(Ò*Ø�K‰K˜Öà×Ñ˜x¨Ó,×3Ñ3°CÖ8ñ "÷ Ø×Ñ˜DŸI™I d›O°t·}±}ÀT×7JÒ7JÏd©tÐXZÕ[ÐfmÐÔnØ€Nr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r½   rF   r¿   zIterable[str]r%   zlist[tuple[str, ...]]r   )r   s   "r   r   r   l  s"   € ÷ ñ ˜tð °ð ÐBWñ r   c                óÂ  € . p\        V P                  R4      \        4      '       d
   V R,          M/ pRV 9   d   VP                  R4       RV9   d   VP                  R4       \         F6  pW@9   d   VP                  V34       WC9   g   K#  VP                  RV34       K8  	  V F6  pWP9   d   VP                  V34       WS9   g   K#  VP                  RV34       K8  	  V# )zøDotted paths in a raw config.yaml mapping that hold platform identity: ``platforms``, every
top-level ``<platform>:`` block, ``gateway.platforms`` / ``gateway.<platform>``, and the
multiplexer-owner keys (both spellings the gateway loader accepts).r   r¿   )r¿   )r   r¿   )rl   r+   rF   r  Ú_GATEWAY_OWNER_KEYS)r½   r¿   Úpathsr   r­   r®   s   &&    r   Ú_channel_config_pathsr  l  sÂ   € ð $&€EÜ&0°·±¸Ó1CÄT×&JÒ&J�C˜	–NÐPR€GØ�cÔØ�‰�^Ô$Ø�gÔØ�‰Ð-Ô.ß"ˆØŒ:Ø�L‰L˜#˜Ô ØŽ>Ø�L‰L˜) SÐ)Ö*ñ	 #ó
 ˆØŒ:Ø�L‰L˜#˜Ô ØŽ>Ø�L‰L˜) SÐ)Ö*ñ	 ð
 €Lr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úconfig_pathr   r  r	  r%   rR   r   )r   s   "r   r   r   ƒ  s#   € ÷ .ñ . dð .Ð3Lð .ÐXañ .r   c                ó  € V P                  4       '       g   . # ^ RIHpHp T;'       g    \	        4       pV! V 4      p\        WAP                  4      pV'       g   . # V F2  pTpVRR  F  pWx,          pK  	  VP                  VR,          R4       K4  	  \        VP                  R4      \        4      '       d!   VR,          '       g   VP                  R4       V! W4       V Uu. uF  pRP                  V4      NK  	  up# u upi )z_Remove platform sections from a raw ``config.yaml`` in place. Returns the dotted paths removed.)Úatomic_config_replacerÉ   Nr   Ú.éÿÿÿÿ)r¸   rÎ   r!  rÉ   rÖ   r  r¿   Úpoprl   r+   rF   r  )	r  r  r!  rÉ   r½   r  ÚpathÚnodeÚsegs	   &&       r   Ústrip_channel_configr(  ƒ  sÕ   € à×Ñ× Ò Øˆ	ßMØ×&Ð&”_Ó&€EÙ
˜{Ó
+€CÜ! #§¡Ó7€EßØˆ	ÛˆØˆØ˜˜“9ˆCØ•9ŠDñ à�‰��b•˜4Ö ñ	 ô
 �#—'‘'˜)Ó$¤d×+Ò+°C¸	·N´NØ�‰�	ÔÙ˜+Ô+Ù',Ó-¡u˜tˆC�H‰H�TŽN¡uÑ-Ð-ùÒ-s   Ã%Dc               ó$   € V ^8„  d   QhRRRRRR/# )r   Úrootr   r  r	  r%   z
list[Path]r   )r   s   "r   r   r   ˜  s(   € ÷ 
oñ 
o ð 
oÐ-Fð 
oÐR\ñ 
or   c                ó.  aa€ V P                  4       '       g   . # T;'       g    \        4       p0 Rmo\        ;QJ d    . R VP                   4       F  NK  	  5M! R VP                   4       4      o\	        VV3R lV P                  4        4       4      # )aZ  Root entries of a profile that hold per-bot runtime identity: pairing approvals and the
WhatsApp device session (``platforms/`` + legacy dirs), the gateway's per-platform ledgers,
channel directories and every ``<platform>_*`` file OR directory an adapter writes beside
config.yaml (Google Chat keeps user tokens in ``google_chat_user_tokens/``).c              3  ó*   "  € T F	  q R 2x € K  	  R# 5i)r(   Nr   )rX   r®   s   & r   rY   Ú(channel_state_entries.<locals>.<genexpr>¡  s   é € Ð:©/ 3�u˜A•Y«/ùs   ‚c              3  óŽ   <"  € T F:  qP                   S9   g$   VP                   P                  S4      '       g   K6  Vx € K<  	  R # 5irW   )rK   rì   )rX   rN   rw   rO   s   & €€r   rY   r-  ¢  s.   øé € Ðn¡^˜E·z±zÀUÔ7JÈeÏjÉj×NcÑNcÐdl×Nm—%’%£^ùs
   ƒ3A»
A>   r   ÚpairingÚwhatsappr¿   úchannel_aliases.jsonúchannel_directory.json)Úis_dirrÖ   rI   r¿   ra   Úiterdir)r*  r  rw   rO   s   &&@@r   Úchannel_state_entriesr5  ˜  sg   ù€ ð
 �;‰;�=Š=Øˆ	Ø×&Ð&”_Ó&€EÚm€EßŒuÑ:¨%¯/ª/Ó:�u‰uÑ:¨%¯/ª/Ó:Ó:€HÜÕn T§\¡\¤^ÓnÓnÐnr   c               ó    € V ^8„  d   QhRRRR/# )r   rN   r   r%   ri   r   )r   s   "r   r   r   ¥  s   € ÷ 1ñ 1˜ð 1 $ñ 1r   c                ó´   € ^ RI pV P                  4       '       g   V P                  4       '       g   V P                  RR7       R# VP	                  V RR7       R# )zµRemove a state entry without following symlinks (``rmtree`` refuses a symlinked dir and would
otherwise leave the copied link in place; unlinking the link never touches the source).NT)Ú
missing_ok)Úignore_errors)ÚshutilÚ
is_symlinkr3  ÚunlinkÚrmtree)rN   r:  s   & r   Ú_remove_entryr>  ¥  s>   € ó Ø×Ñ×Ò §¡§¢Ø�‰ ˆÖ%à�‰�e¨4ˆÖ0r   r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Úprofile_dirr   Úinclude_staterÁ   r   r   r%   r
  r   )r   s   "r   r   r   ¯  s.   € ÷ ñ ¨ð Àð ÐR`ð ð  mAñ r   c               ó.  € \        V4      p\        \        V R,          V4      4      p\        V R,          V4      pV'       d   WTR&   V'       dG   . p\	        W4       F)  p\        V4       VP                  VP                  4       K+  	  V'       d   WdR&   V# )zâStrip channel credentials/identity from a freshly cloned profile, judged in ``source_dir``'s
plugin scope. ``include_state`` also drops the runtime state ``--clone-all`` copied. Returns
``{platform|"config"|"state": [what]}``.rÊ   rÇ   ÚconfigÚstate)rÖ   rF   r  r(  r5  r>  r  rK   )r@  rA  r   r  ÚstrippedÚconfig_pathsÚdroppedrN   s   &$$     r   Ústrip_channel_settingsrH  ¯  sƒ   € ô ˜JÓ'€EÜ%)Ô*@ÀÈvÕAUÐW\Ó*]Ó%^€HÜ'¨°mÕ(CÀUÓK€LßØ)�ÑßØˆÜ*¨;Ö>ˆEÜ˜%Ô Ø�N‰N˜5Ÿ:™:Ö&ñ ?÷ Ø '�WÑØ€Or   c               ó    € V ^8„  d   QhRRRR/# )r   r@  r   r%   rR   r   )r   s   "r   r   r   Â  s   € ÷ ñ ¨dð °yñ r   c                ó  € \        V 4      p\        4       pV R,          pVP                  4       '       dw   VP                  RRR7      P	                  4        FQ  p\        V4      pV'       d   VP                  V4      MRpV'       g   K3  V\        8w  g   K@  VP                  V4       KS  	  V R,          pVP                  4       '       d®   ^ RI	H
p V! V4      p	\        W‘P                  4       F†  p
T	pV
 F  pW¼,          pK  	  V
R
,          R8X  d1   \        V\        4      '       d   VP                  R	 V 4       4       KT  V
R
,          VP                  9   g   Kn  VP                  V
R
,          4       Kˆ  	  \!        V4      # )u½   Platform ids with any channel setting in ``profile_dir`` (.env keys or config.yaml sections) â€”
what a channel-less clone of it leaves behind. Pure read, in ``profile_dir``'s plugin scope.rÊ   rµ   r*   r  NrÇ   rÈ   r¿   c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5irW   )r    )rX   Úks   & r   rY   Ú/channel_platforms_configured.<locals>.<genexpr>×  s   é € Ð2©T¨œS ŸV˜V«Tùr[   r#  )rÖ   ru   r¸   r  r  r  rð   r˜   rm   rÎ   rÉ   r  r¿   rl   rF   rG   ra   )r@  r  Úfoundr±   r  r­   r@   r  rÉ   r½   r%  r&  r'  s   &            r   Úchannel_platforms_configuredrO  Â  s1  € ô ˜KÓ(€EÜ“e€EØ˜VÕ#€HØ×Ñ×ÒØ×&Ñ&°ÀIÐ&ÓN×YÑYÖ[ˆDÜ" 4Ó(ˆCß25�u×)Ñ)¨#Ô.¸4ˆHß‰x˜HÔ(9Ö9Ø—	‘	˜(Ö#ñ	 \ð
  Õ-€KØ×Ñ×ÒÝ:Ù" ;Ó/ˆÜ)¨#¯©Ö?ˆDØˆDÛ�Ø•y’ñ à�B�x˜;Ô&¬:°d¼D×+AÒ+AØ—‘Ñ2©TÓ2Ö2Ø�b•˜UŸ_™_Ö,Ø—	‘	˜$˜r�(Ö#ñ @ô �%‹=Ðr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   Úsource_labelr    r%   ré   r   )r   s   "r   r   r   Ý  s!   € ÷ ñ  tð ¸3ð À=ñ r   c                ó  € ^ RI Hp ^ RIHp V! 4       pV'       d3   \	        V4      ^8  g#   V! V4      V Uu0 uF
  qS! V4      kK  	  up9  d   R# \        V 4      pV'       g   R# RRP                  V4       RV R2# u upi )aS  Why ``--clone-channels`` must be refused for ``source_dir``: a live multiplexer already serves
the source, so the copied bot would be parked as a duplicate credential at once (the same finding
the migrate preflight reports). ``None`` when the copy is allowed. Shared by CLI, REST and TUI
through :func:`hermes_cli.profiles.create_profile`.)Úrecorded_served_profiles)Únormalize_profile_nameNz--clone-channels would copy ú, z from 'a-  ', which the running multiplexed gateway already serves: the bot can only belong to one profile, so the copy would be parked as a duplicate credential. Clone without --clone-channels and give the new profile its own bot (hermes -p <name> setup), or route its chats with gateway.profile_routes instead.)Ú#hermes_cli.gateway_multiplex_servedrS  Úhermes_cli.profilesrT  rß   rO  r  )r   rQ  rS  rT  ÚservedÚpr¿   s   &&     r   Úclone_channels_refusalrZ  Ý  s�   € õ
 MÝ:Ù%Ó'€Fß”S˜“[ 1”_Ñ(>¸|Ó(LÙ+1óUÙ+1 aÐ˜qÖ!©6ñUô )ñ Ü,¨ZÓ8€IßÙà
& t§y¡y°Ó';Ð&<¸GÀLÀ>ð R\ð 	\ðùòUs   ·A=c               ó    € V ^8„  d   QhRRRR/# )r   r  r   r%   r�   r   )r   s   "r   r   r   ô  s   € ÷ ñ ¨ð °.ñ r   c                ó†  € / pV P                  4       '       g   V# ^ RIHp V! V 4      p\        VP	                  R4      \
        4      '       d
   VR,          M/ pVP	                  R4      VP	                  R4      3 FÂ  p\        V\
        4      '       g   K  VP                  4        F“  w  rg\        V\
        4      '       g   K  VP	                  R4      ;'       g    VP	                  R4      p\        V\        4      '       g   K_  VP                  4       '       g   Kw  VP                  4       V\        V4      &   K•  	  KÄ  	  V# )zT``{platform: token}`` from ``platforms.<p>.token|api_key`` (both nesting spellings).rÈ   r   r¿   r!   Úapi_key)	r¸   rÎ   rÉ   rl   r+   rF   r‹   r    rº   )	r  ÚtokensrÉ   r½   r   rÂ   r®   rÃ   r!   s	   &        r   Ú_config_platform_tokensr_  ô  së   € à€FØ×Ñ× Ò ØˆÝ6Ù
˜{Ó
+€CÜ&0°·±¸Ó1CÄT×&JÒ&J�C˜	–NÐPR€GØ—G‘G˜KÓ(¨'¯+©+°kÓ*BÓCˆÜ˜'¤4×(Ò(ÙØ!Ÿ-™-ž/‰JˆCÜ˜%¤×&Ô&ØŸ	™	 'Ó*×BÐB¨e¯i©i¸	Ó.B�Ü˜e¤S×)Ô)¨e¯k©k¯m¬mØ',§{¡{£}�Fœ3˜s›8Ó$ó	 *ñ Dð €Mr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r@  r   r   r%   rR   r   )r   s   "r   r   r     s!   € ÷ ñ ¨Dð ¸dð Àyñ r   c                ó†  a€ \        4       p\        V R,          V4      p\        VR,          V4      pV Uu0 uF(  qTP                  V4      W5,          8X  g   K   W%,          kK*  	  pp\        V R,          4      p\        VR,          4      oVP	                  V3R lVP                  4        4       4       \        V4      # u upi )u  Platforms whose CONNECTING credential (bot token / app id / account) in ``profile_dir`` is
byte-identical to ``source_dir``'s â€” the bots that will collide. Pure file reads: no secret
manager, no gateway config load, so ``hermes profile list`` can afford it per profile.rÊ   rÇ   c              3  ó\   <"  € T F!  w  rSP                  V4      V8X  g   K  Vx € K#  	  R # 5irW   rÌ   )rX   r®   r!   Ú
theirs_cfgs   &  €r   rY   Ú-shared_channel_credentials.<locals>.<genexpr>  s(   øé € ÐYÑ(8™*˜#¸J¿N¹NÈ3Ó<OÐSXÑ<X—#’#Ó(8ùs   ƒ,¢
,)r¯   r»   r+   r_  rG   r‹   ra   )	r@  r   r²   ÚmineÚtheirsr­   rL   Úmine_cfgrc  s	   &&      @r   Úshared_channel_credentialsrh    sŸ   ø€ ô !Ó"€FÜ�{ VÕ+¨VÓ4€DÜ˜ fÕ,¨fÓ5€FÙ%)ÓJ¡T˜c¯Z©Z¸«_ÀÅ	Ñ-IŒkˆf�kˆk¡T€FÐJÜ& {°]Õ'BÓC€HÜ(¨°mÕ)CÓD€JØ
‡M�MÔY¨¯©Ô(8ÓYÔYÜ�&‹>Ðùò	 Ks   ¶B>ÁB>c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Úprofiler    r¿   rR   Úsourcer%   r   )r   s   "r   r   r     s)   € ÷ ñ  sð °yð È#ð Ð^añ r   c                óJ   € R V  RRP                  V4       RV RV  RV  RV  R2# )u   âš  Profile 'z' shares its rU  z credential with z0: the bot can only belong to one profile. Give 'z' its own bot (hermes -p zC setup, or the dashboard Messaging page) or remove the token from 'zo'; a multiplexed gateway parks the duplicate and `hermes gateway migrate --multiplex` refuses until it is gone.©r  )rj  r¿   rk  s   &&&r   Úshared_credential_warningrn    sQ   € à
˜�y ¨d¯i©i¸	Ó.BÐ-CÐCTÐU[ÐT\ð ]-Ø-4¨IÐ5NÈwÈið X?Ø?F¸ið H[ð	\ðr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rj  r    r¿   rR   Ú
clone_flagr%   r   )r   s   "r   r   r     s)   € ÷ 
ñ 
 Cð 
°Ið 
È3ð 
Ð_hñ 
r   c                ó\   € V'       g   . # RRP                  V4       R2RV  R2RV  RV R2.# )	z€Lines printed after a channel-less clone so the user knows what was left behind and how to
configure the new profile's own bots.z$Messaging channels were NOT cloned (rU  zN): a copied bot token or allowlist would make two gateways fight over one bot.z0  Configure this profile's own bots:  hermes -p z* setup   (or the dashboard Messaging page)z?  To copy the source's channels anyway:  hermes profile create Ú z --clone-channelsrm  )rj  r¿   rp  s   &&&r   Úformat_stripped_noticers    sU   € ÷ Øˆ	à
.¨t¯y©y¸Ó/CÐ.Dð E6ð 	6à
:¸7¸)ÐCmÐnØ
IÈ'ÈÐRSÐT^ÐS_Ð_pÐqð	ð r   )ÚEMAIL_)ÚQQ_)ÚGATEWAY_RELAY_)ÚTWILIO_)ÚGATEWAY_ALLOW_ALL_USERSÚGATEWAY_ALLOWED_USERS)Ú_ALLOWED_USERSÚ_ALLOW_ALL_USERSÚ_ALLOWED_CHATSÚ_HOME_CHANNELÚ_HOME_ADDRESS)Úmultiplex_profilesÚprofile_routesrW   )r   )
Ú_TOKENÚ_SECRETÚ_KEYÚ	_PASSWORDÚ_APP_IDÚ
_CLIENT_IDÚ_BOT_IDÚ_ACCOUNT_SIDÚ_SERVICE_ACCOUNT_JSONÚ_PROJECT_ID)Údefault)z--clone)=Ú__conditional_annotations__rþ   Ú
__future__r   r5   ÚloggingÚreÚ	functoolsr   Úpathlibr   Útypingr   r   r   r   r	   r
   Ú	getLoggerrú   Úloggerr   Ú__annotations__r˜   r—   r   rø   r  Úcompiler  Úcontextmanagerr"   r-   r;   rB   rP   rd   r~   r�   r’   r    r§   r«   r¯   r»   rÄ   rÔ   rÖ   r  r  r  r(  r5  r>  rH  rO  rZ  r_  rh  rn  rs  )rŒ  s   @r   Ú<module>r˜     sm  øðôõ( #ã Û Û 	Ý Ý ß =× =à	×	Ò	˜8Ó	$€ð
 ˆ[ØˆXØÐ Ø	ˆ<ð	<Ð Ð8ó ð Ð ØKÐ ð
 
ˆ<Øˆ[ð2Ð Ð.ó ð m€ð ?Ð à�zŠzÐKÓL€ð ×Ñô*ó ð*õKõõB÷
÷õ÷.õ$]÷
÷0ð$Ð õY÷:
õõ%÷PVñ Võ<-÷
õ*÷..÷*
oõ1ðÐcg÷ õ&õ6õ.õ&÷÷
ñ 
r   