+
    -pÐjSV  ã                  ó  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHt ^ RIHt ^ RIHtHtHtHtHt ^ RIHt RsR	]R
&   Rs]! RRR7      tR]R&   R R ltR R ltR R ltR R lt ! R R]4      tR R lt ]! RRR7      t!R]R&    ! R R]"4      t#RR/R R  llt$R! R" lt%R# R$ lt&R% R& lt'](! 0 R'kR(kR)kR*kR+kR,kR-kR.kR/kR0kR1kR2kR3kR4kR5kR6kR7kR8kR9kR:kR;kR<kR=kR>kR?kR@kRAkRBkRCkRDkREkRFkRGkRHkRIkRJk4      t)Rgt*RK RL lt+RM RN lt,RhRO RP llt-RiRQ RR llt.RS RT lt/RU RV lt0]	! 4       t1RW]RX&   ]Pd                  ! 4       t3^@t4RhRY RZ llt5R[ R\ lt6R] R^ lt7R_ R` lt8Ra Rb lt9Rc Rd lt:Re Rf lt;R# )jaÓ  Profile-scoped credential resolution for multi-profile gateway multiplexing.

The multiplexing gateway serves many profiles from one process; each profile's
``.env`` keys **cannot** be unioned into ``os.environ`` (profile A's keys would
leak into profile B's turns and subprocesses). This module is a fail-closed,
context-local secret scope: ``set_secret_scope(mapping)`` installs the active
profile's secrets for the current task (a contextvar, so it propagates into the
agent's worker thread via ``copy_context()``); ``get_secret(name)`` reads from
it and, when multiplexing is active with no scope set, RAISES rather than
falling back to ``os.environ``. Design: ``website/docs/developer-guide/multiplexing-gateway.md``.
)ÚannotationsN)ÚOrderedDict)Ú
ContextVarÚToken)ÚPath)ÚDictÚMappingÚ
NamedTupleÚOptionalÚTuple)Úfile_signatureFÚboolÚ_MULTIPLEX_ACTIVEÚ_MULTIPLEX_CONTEXT)ÚdefaultzContextVar[bool]c               ó    € V ^8„  d   QhRRRR/# )é   Úactiver   ÚreturnÚNone© )Úformats   "Ú!/opt/hermes/agent/secret_scope.pyÚ__annotate__r   )   s   € ÷ !ñ ! ð !¨$ñ !ó    c                óØ   € ^ RI HpHpHp \	        V 4      s\
        '       d%   V! 4       '       g   V! 4       sV! \        4       R# R# \        e   V! 4       \        8X  d	   V! R4       RsR# R# )u}  Mark whether the process is a profile multiplexer (get_secret fails closed).

Activation also pins the launch home for routed-profile decisions
(``hermes_constants.pin_process_hermes_home``) unless an embedding host already pinned one:
from here on "is this task routed" compares the override against the home the process was
launched with, not against whatever a host later mirrors into ``os.environ["HERMES_HOME"]``.
Deactivation releases only the pin activation itself created â€” a transient toggle
(``gateway_migrate._multiplex_read_mode``, a cron worker restoring the caller's mode) must not
drop the host's explicit pin (#119242).)Úget_routing_process_hermes_homeÚpin_process_hermes_homeÚprocess_hermes_home_is_pinnedN)Úhermes_constantsr   r   r   r   r   Ú_AUTO_PINNED_HOME)r   r   r   r   s   &   r   Úset_multiplex_activer!   )   se   € ÷ñ ô
 ˜V›ÐßÓÙ,×.Ò.Ù ?Ó AÐÙ#Ô$5Ö6ñ /ô 
Ò	&Ù*Ó,Ô0AÔAÙ# DÔ)Ø Òñ 
'r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r   D   s   € ÷ 0ñ 0 $ð 0¨5ñ 0r   c                ó>   € \         P                  \        V 4      4      # )z¡Run the current task under multiplex semantics regardless of the process flag.
Returns a reset token; pair with :func:`reset_multiplex_context` in a ``finally``.)r   Úsetr   )r   s   &r   Úset_multiplex_contextr%   D   s   € ô ×!Ñ!¤$ v£,Ó/Ð/r   c               ó    € V ^8„  d   QhRRRR/# ©r   Útokenr   r   r   r   )r   s   "r   r   r   J   s   € ÷ $ñ $ 5ð $¨Tñ $r   c                ó0   € \         P                  V 4       R # ©N)r   Úreset©r(   s   &r   Úreset_multiplex_contextr-   J   s   € Ü×Ñ˜UÖ#r   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r   N   s   € ÷ 9ñ 9˜Tñ 9r   c                 óF   € \         ;'       g    \        P                  4       # )zPTrue in a multiplexing process, or for a task running under multiplex semantics.)r   r   Úgetr   r   r   Úis_multiplex_activer2   N   s   € ä×8Ð8Ô 2× 6Ñ 6Ó 8Ð8r   c                  ó0   € ] tR t^St$ RtR]R&   R]R&   RtR# )Ú_BoundScopeuó   An installed secret scope plus the home it was built for, when the binder
declared one â€” the provenance ``serves_routed_profile`` needs when the binding
deliberately skips the HERMES_HOME override (kanban spawn-env builds, MCP
owner scopes).zMapping[str, str]ÚmappingúOptional[str]Úprofile_homer   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__r   r   r   r4   r4   S   s   ‡ ñð
 ÓØ×r   r4   c               ó   € V ^8„  d   QhRR/# r/   r   )r   s   "r   r   r   ]   s   € ÷ Eñ E˜tñ Er   c                 ó  € \        4       '       d   R# ^ RIHp HpHp V! V! 4       4      p\
        P                  4       pVe,   VP                  '       d   V! VP                  4      V8w  d   R# V ! 4       pVRJ;'       d    V! V4      V8g  # )aG  True when the current task runs for a profile other than the process's own: always under
multiplexing, else when a HERMES_HOME override names another home (dashboard/desktop backend,
per-profile cron ticker) or a secret scope stamped with a foreign home is bound. The MCP
registry scope and the check_fn cache key both follow this predicate so a served profile's
view never aliases the launch profile's (#111151). A host that mirrors the turn's profile into
``HERMES_HOME`` pins its own home with ``hermes_constants.pin_process_hermes_home`` so the
mirror cannot flip this predicate.T)Úget_hermes_home_overrider   Úhermes_home_keyN)r2   r   rA   r   rB   Ú_SECRET_SCOPEr1   r7   )rA   r   rB   ÚownÚboundÚoverrides         r   Úserves_routed_profilerG   ]   s~   € ô ×ÒÙßkÑkÙ
Ñ9Ó;Ó
<€CÜ×ÑÓ€EØÒ˜U×/×/Ð/±OÀE×DVÑDVÓ4WÐ[^Ô4^ÙÙ'Ó)€HØ˜4Ð×DÐD¡O°HÓ$=ÀÑ$DÐDr   rC   z!ContextVar[Optional[_BoundScope]]c                  ó6   a € ] tR t^stRtRR V 3R llltRtV ;t# )ÚUnscopedSecretErrorak  A secret was read in multiplex mode with no scope installed.

The fix is to wrap the call path in ``set_secret_scope(...)`` (the per-turn
/ per-adapter profile scope), not to widen the global allowlist.

``str(exc)`` is the ONE sentence an end user can act on; the developer diagnosis
(which secret, which doc) rides ``__notes__`` so tracebacks and logs keep it.
c               ó    € V ^8„  d   QhRRRR/# )r   Úsecret_nameÚstrÚdeveloper_detailr   )r   s   "r   r   Ú UnscopedSecretError.__annotate__}   s   € ÷ ,ñ , Cð ,Àñ ,r   c                	ó4  <€ V'       dF   V'       g>   \         ;QJ d    R  V 4       F  '       g   K   RM	  RM! R  V 4       4      '       d   RTr!V'       d   RV 2MRp\        SV `	  RV R24       Wn        W n        V'       d   V P                  V4       R# R# )	c              3  ó@   "  € T F  qP                  4       x € K  	  R # 5ir*   )Úisspace)Ú.0Úchs   & r   Ú	<genexpr>Ú/UnscopedSecretError.__init__.<locals>.<genexpr>�   s   é € Ð7[É{È¿
¹
¿¸Ë{ùs   ‚TFÚ zthis profile's zthis profile's API keyzHermes could not read z° (an internal profile-scoping bug on the multiplexed gateway, not your configuration). Run `hermes gateway restart`; if it keeps happening, report it with `hermes debug share`.N)ÚanyÚsuperÚ__init__rK   rM   Úadd_note)ÚselfrK   rM   ÚwhatÚ	__class__s   &&& €r   rY   ÚUnscopedSecretError.__init__}   s…   ø€ ÷ ×/·C³CÑ7[É{Ó7[·C·C²CÑ7[É{Ó7[×4[Ò4[Ø,.°Ð)ß2=�  Ñ.ÐC[ˆÜ‰ÑØ$ T Fð +3ð 3ô	
ð
 'ÔØ 0ÔßØ�M‰MÐ*Ö+ñ r   )rM   rK   )rV   rV   )r8   r9   r:   r;   r<   rY   r>   Ú__classcell__)r]   s   @r   rI   rI   s   s   ø† ñ÷,÷ ,ð ,r   rI   r7   c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚsecretsúOptional[Mapping[str, str]]r7   r6   r   r   r   )r   s   "r   r   r   �   s(   € ÷ `ñ `Ð9ð `ÈMð `Ðejñ `r   c               ó¦   € V f   \         P                  R4      # \         P                  \        Y'       d   \        V4      4      4      # R4      4      # )a  Install the active profile's secret mapping; ``None`` clears. Returns a reset token.

``profile_home`` stamps the home the mapping was built for so
``serves_routed_profile`` detects a foreign-home scope even when the binder
deliberately skips the HERMES_HOME override.N)rC   r$   r4   rL   )ra   r7   s   &$r   Úset_secret_scoperd   �   sE   € ð ‚Ü× Ñ  Ó&Ð&Ü×Ñœ[¨Æ|´#°lÓ2CÓ^Ó_Ð_ÐY]Ó^Ó_Ð_r   c               ó    € V ^8„  d   QhRRRR/# r'   r   )r   s   "r   r   r   š   s   € ÷ ñ ˜eð ¨ñ r   c                ó0   € \         P                  V 4       R # r*   )rC   r+   r,   s   &r   Úreset_secret_scoperg   š   s   € Ü×Ñ˜Ör   c               ó   € V ^8„  d   QhRR/# )r   r   rb   r   )r   s   "r   r   r   ž   s   € ÷ 8ñ 8Ð9ñ 8r   c                 óN   € \         P                  4       p V e   V P                  # R# )z>The active secret mapping, or None when no scope is installed.N)rC   r1   r5   ©rE   s    r   Úcurrent_secret_scoperk   ž   s$   € ä×ÑÓ€EØ!Ò-ˆ5�=‰=Ð7°4Ð7r   c               ó   € V ^8„  d   QhRR/# )r   r   r6   r   )r   s   "r   r   r   ¤   s   € ÷ =ñ = =ñ =r   c                 óN   € \         P                  4       p V e   V P                  # R# )zKThe home the active scope was stamped with, or None when unstamped/unbound.N)rC   r1   r7   rj   s    r   Úcurrent_secret_scope_homern   ¤   s&   € ä×ÑÓ€EØ!&Ò!2ˆ5×ÑÐ<¸Ð<r   ÚHERMES_HOMEÚHERMES_PROFILEÚHERMES_GATEWAY_LOCK_DIRÚHERMES_MAX_ITERATIONSÚHERMES_API_TIMEOUTÚHERMES_REDACT_SECRETSÚHERMES_NOUS_TIMEOUT_SECONDSÚ_HERMES_GATEWAYÚPATHÚHOMEÚUSERÚLANGÚLC_ALLÚTZÚPWDÚSHELLÚTMPDIRÚVIRTUAL_ENVÚ
PYTHONPATHÚSSL_CERT_FILEÚHERMES_KANBAN_DBÚHERMES_KANBAN_WORKSPACES_ROOTÚHERMES_KANBAN_BOARDÚAPI_SERVER_ENABLEDÚAPI_SERVER_HOSTÚAPI_SERVER_PORTÚAPI_SERVER_CORS_ORIGINSÚGATEWAY_RELAY_URLÚGATEWAY_RELAY_ENDPOINTÚ$GATEWAY_RELAY_ALLOW_DIRECT_PLATFORMSÚGATEWAY_RELAY_PLATFORMSÚGATEWAY_RELAY_BOT_IDSÚGATEWAY_RELAY_ROUTE_KEYSÚGATEWAY_RELAY_INSTANCE_IDÚGATEWAY_RELAY_WAKE_URLÚGATEWAY_RELAY_DISPLAY_NAMEc               ó    € V ^8„  d   QhRRRR/# )r   ÚnamerL   r   r   r   )r   s   "r   r   r   Ñ   s   € ÷ Nñ N˜ð N ñ Nr   c                óN   € V \         9   ;'       g    V P                  \        4      # )z@True for genuinely process-global (non-profile-secret) env vars.)Ú_GLOBAL_ENV_EXACTÚ
startswithÚ_GLOBAL_ENV_PREFIXES)r”   s   &r   Ú_is_global_envr™   Ñ   s    € àÔ$Ñ$×MÐM¨¯©Ô8LÓ(MÐMr   c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r”   rL   r   r6   r   r   )r   s   "r   r   r   Ö   s!   € ÷ /ñ /�cð / Mð /°mñ /r   c                óP   € \         P                  P                  V 4      pVe   V# T# r*   )ÚosÚenvironr1   ©r”   r   Úvals   && r   Ú_environ_orr¡   Ö   s#   € Ü
�*‰*�.‰.˜Ó
€CØ’/ˆ3Ð. wÐ.r   c               ó$   € V ^8„  d   QhRRRRRR/# r›   r   )r   s   "r   r   r   Û   s!   € ÷ &ñ &�Sð & =ð &¸Mñ &r   c                ó>  € \        V 4      '       d   \        W4      # \        P                  4       pVe?   VP                  P                  V 4      pVe   V# \        4       '       d   V# \        W4      # \        4       '       d   \        V RV : R24      h\        W4      # )u  Resolve a credential by env-var name, honoring the active profile scope.

Global vars always read ``os.environ``. With a scope installed, a miss returns
``default`` under multiplexing (never another profile's ``os.environ`` value)
but falls through to ``os.environ`` otherwise â€” single-profile deployments
inject credentials via the process env (systemd, ``op run``), so the scope
must stay a ``.env`` overlay, not a blindfold (otherwise cron 401s). With no
scope: multiplex INACTIVE reads ``os.environ``; ACTIVE raises (fail closed).
zget_secret(aB  ) called with no profile secret scope active while multiplexing is on. This credential read must run inside a set_secret_scope(...) block (the per-turn / per-adapter profile scope). Reading os.environ here would risk leaking another profile's value. See website/docs/developer-guide/multiplexing-gateway.md (Workstream A).)r™   r¡   rC   r1   r5   rG   r2   rI   )r”   r   rE   r    s   &&  r   Ú
get_secretr¤   Û   s›   € ô �d×ÒÜ˜4Ó)Ð)Ü×ÑÓ€EØÒØ�m‰m×Ñ Ó%ˆØŠ?ØˆJÜ/×1Ò1ˆwÐQ´{À4Ó7QÐQÜ×ÒÜ!ØØ˜$™ð "ð ó
ð 	
ô �tÓ%Ð%r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r”   rL   r   r   r   )r   s   "r   r   r   ú   s!   € ÷ +ñ +˜ð + sð +°Cñ +r   c                ó(   € \        W4      pVf   V# T# )u³   ``get_secret`` for callers that want a ``str``: ``default`` only when the secret is genuinely
unset. Still raises ``UnscopedSecretError`` â€” swallowing it hides a spawn-site bug.)r¤   rŸ   s   && r   Úget_secret_strr§   ú   s   € ô �TÓ
#€CØ’kˆ7Ð* sÐ*r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚvaluerL   r   r   )r   s   "r   r   r     s   € ÷ ;ñ ; ð ;¨ñ ;r   c                ó¶  € V P                  4       p V '       g   V # V ^ ,          pVR9   dƒ   ^pV\        V 4      8  do   W,          pVR8X  d   VR8X  d   V^,          pK1  W18X  d=   W^,           R P                  4       P                  R4      '       d   V RV^,            # T # V^,          pK~  V # \        P
                  ! RV ^R7      ^ ,          P                  4       # )u:  Strip a dotenv-style inline comment (python-dotenv semantics): quoted values
scan to the matching close quote (backslash-aware for double quotes) and drop a
trailing ``# ...``, else stay untouched; unquoted values truncate only at a
``#`` PRECEDED BY WHITESPACE (``foo#bar`` survives, ``value # c`` â†’ ``value``).Ú"Ú\NÚ#z\s+#)Úmaxsplit)Ú'r«   )ÚstripÚlenÚlstripr—   ÚreÚsplit)r©   ÚquoteÚirS   s   &   r   Ú_strip_inline_commentr·     sÃ   € ð
 �K‰K‹M€EßØˆØ�!�H€EØ�
ÔØˆØ”#�e“*ŒnØ•ˆBØ˜Œ|  d¤
Ø�Q•�ÙØŒ{Ø).°1­u¨v¨×)=Ñ)=Ó)?×)JÑ)JÈ3×)OÒ)O�u˜W˜q 1�u�~ÐZÐUZÐZØ��FŠAØˆÜ�8Š8�G˜U¨QÔ/°Õ2×8Ñ8Ó:Ð:r   c               ó    € V ^8„  d   QhRRRR/# )r   Ú	raw_valuerL   r   r   )r   s   "r   r   r     s   € ÷ ñ  ð ¨ñ r   c                ó  € V P                  4       p\        V4      ^8¼  dµ   V^ ,          VR,          u;8X  d   R8X  d˜   M M”V^R p. p^ pV\        V4      8  dk   W$,          R8H  ;'       d    W$^,           V^,            R9   pTP                  V'       d   W$^,           ,          MW$,          4       YE'       d   ^M^,          pKz  RP                  V4      # \        V4      ^8¼  d'   V^ ,          VR,          u;8X  d   R8X  d
   M V# V^R # V# )zrParse the small .env value subset Hermes writes itself (bare, 'single', or "double" with
``\"`` / ``\\`` escapes).r«   r¬   rV   r¯   éÿÿÿÿ)r«   r¬   )r°   r±   ÚappendÚjoin)r¹   r©   ÚquotedÚparsedr¶   Úescapeds   &     r   Ú_parse_env_valuerÁ     sà   € ð �O‰OÓ€EÜ
ˆ5ƒz�Q„˜5 �8 u¨R¥yÖ7°C×7Ø�q˜�ˆØˆØˆØ”#�f“+ŒoØ•i 4Ñ'×NÐN¨F°qµ5¸¸Q½Ð,?À;Ñ,NˆGØ�M‰M¯7˜& Q¥ž-¸½	ÔBØ–g‘ 1Õ$ŠAØ�w‰w�v‹ÐÜ
ˆ5ƒz�Q„˜5 �8 u¨R¥yÖ7°CÖ7à€Lð �Q�rˆ{ÐØ€Lr   z.OrderedDict[str, tuple[tuple, dict[str, str]]]Ú_ENV_FILE_CACHEc               ó    € V ^8„  d   QhRRRR/# )r   Úenv_pathzOptional[Path]r   r   r   )r   s   "r   r   r   ;  s   € ÷ 5ñ 5¨ð 5À$ñ 5r   c                óÌ   € \         ;_uu_ 4        V f   \        P                  4        M\        P                  \	        V 4      R4       RRR4       R#   + '       g   i     R# ; i)z@Drop one path from the ``load_env_file()`` memo, or all of them.N)Ú_ENV_FILE_CACHE_LOCKrÂ   ÚclearÚpoprL   )rÄ   s   &r   Úinvalidate_env_file_cacherÉ   ;  s=   € ç	Ö	ØÒÜ×!Ñ!Õ#ä×Ñ¤ H£¨tÔ4÷	 
×	×	Ò	ús   �9AÁA#	c               ó    € V ^8„  d   QhRRRR/# )r   ÚrawÚbytesr   rL   r   )r   s   "r   r   r   D  s   € ÷ %ñ %˜5ð % Sñ %r   c                ó¨   € V P                  \        P                  4      p  V P                  R4      #   \         d    T P                  R4      u # i ; i)z‡BOM stripped; invalid UTF-8 falls back to latin-1 exactly as
``env_loader._load_dotenv_with_fallback`` installs it into ``os.environ``.zutf-8zlatin-1)ÚremoveprefixÚcodecsÚBOM_UTF8ÚdecodeÚUnicodeDecodeError)rË   s   &r   Ú_decode_env_bytesrÓ   D  sJ   € ð ×
Ñ
œ6Ÿ?™?Ó
+€Cð%Ø�z‰z˜'Ó"Ð"øÜô %Ø�z‰z˜)Ó$Ò$ð%ús   ¡2 ²AÁAc               ó    € V ^8„  d   QhRRRR/# )r   ÚtextrL   r   údict[str, str]r   )r   s   "r   r   r   N  s   € ÷ ñ ˜#ð  .ñ r   c                óœ  € / pV P                  4        Fµ  pVP                  4       pV'       d   VP                  R4      '       d   K4  VP                  R4      '       d   V\        R4      R P	                  4       pVP                  R4      w  rEpVP                  4       pV'       g   K•  V'       g   KŸ  \        \        V4      4      W&   K·  	  V# )z?Tokenize already-read ``.env`` text. See :func:`load_env_file`.r­   zexport NÚ=)Ú
splitlinesr°   r—   r±   r²   Ú	partitionrÁ   r·   )rÕ   ra   Úraw_lineÚlineÚkeyÚsepr©   s   &      r   Ú_parse_env_textrß   N  sŸ   € à €GØ—O‘OÖ%ˆØ�~‰~Óˆß�t—‘ s×+Ò+ÙØ�?‰?˜9×%Ò%Øœ˜I›˜Ð(×/Ñ/Ó1ˆDØŸ.™.¨Ó-‰ˆ�%Ø�i‰i‹kˆß‰3—3‘3Ü+Ô,AÀ%Ó,HÓIˆG‹Lñ &ð €Nr   c               ó    € V ^8„  d   QhRRRR/# )r   rÄ   r   r   rÖ   r   )r   s   "r   r   r   ^  s   € ÷ %ñ %˜Dð % ^ñ %r   c           	     óò  € \        V 4      p \        V R4      ;_uu_ 4       p\        \        P                  ! VP                  4       4      4      p\        ;_uu_ 4        \        P                  V4      pVeJ   V^ ,          V8X  d<   \        P                  V4       \        V^,          4      uuRRR4       uuRRR4       # RRR4       VP                  4       p\        \        P                  ! VP                  4       4      4      V8H  pRRR4       \        \        X4      4      pX'       dt   \        ;_uu_ 4        X\        T4      3\        T&   \        P                  T4       \!        \        4      \"        8”  d   \        P%                  RR7       K0   RRR4       T# T#   + '       g   i     Lé; i  + '       g   i     L´; i  \         d    \        T 4       / u # i ; i  + '       g   i     T# ; i)u  THE ``.env`` tokenizer: every reader (profile scope, ``hermes_cli.config.load_env``, the dashboard
scrub, skill secret capture, managed .env, setup prompts) parses through here so no two boundaries
disagree on which keys/values a file defines. Dict only â€” never touches ``os.environ``. ``export``
prefix, ``#`` comments, quote escapes reversed; a BOM is stripped so it doesn't prefix the first key.
Invalid UTF-8 decodes as latin-1, exactly like ``env_loader._load_dotenv_with_fallback`` installs it
into ``os.environ``. Absent/unreadable â†’ ``{}``.

Memoised per path on the open descriptor's stat identity (see the cache comment above). Always
returns a fresh dict: callers mutate what they get back (``build_profile_secret_scope`` layers
external secrets over it).
ÚrbNF)Úlast)rL   Úopenr   r�   ÚfstatÚfilenorÆ   rÂ   r1   Úmove_to_endÚdictÚreadÚOSErrorrÉ   rß   rÓ   r±   Ú_ENV_FILE_CACHE_MAXÚpopitem)rÄ   rÝ   ÚhandleÚfingerprintÚcachedrË   Úsettledra   s   &       r   Úload_env_filerñ   ^  sn  € ô ˆh‹-€CðÜ�(˜D×!Ô! VÜ(¬¯ª°&·-±-³/Ó)BÓCˆKß%Ö%Ü(×,Ñ,¨SÓ1�ØÒ%¨&°­)°{Ô*BÜ#×/Ñ/°Ô4Ü  q¥	›?÷	 &Ñ%÷ "Ò!ç%ð
 —+‘+“-ˆCô %¤R§X¢X¨f¯m©m«oÓ%>Ó?À;ÑNˆG÷ "ô  Ô/°Ó4Ó5€Gßß!Ö!Ø$/´°g³Ð#?ŒO˜CÑ Ü×'Ñ'¨Ô,Ü”oÓ&Ô)<Ô<Ü×'Ñ'¨UÐ'Ö3ð =÷ "ð
 €Nˆ7€N÷+ &×%ú÷ "×!ûô ô ä! (Ô+ØŠ	ðú÷ "Ö!ð
 €Núsa   �G ¡<F4ÁAF!	Â+
F4Â5
G Ã AF4ÄG Ä:AG%Æ!F1Æ,F4Æ4G	Æ?G ÇG ÇG"Ç!G"Ç%G6	c               ó    € V ^8„  d   QhRRRR/# )r   Úhermes_homer   r   rÖ   r   )r   s   "r   r   r   †  s   € ÷ ñ ¨Dð °^ñ r   c                ó¨  € \        \        V 4      R,          4      p ^ RIHp V! \        V 4      4      pTP                  R VP                  4        4       4       ^ RIHp V! 4       pVe$   \        V 4      '       d   VP                  RV4       ^ RIHp VP                  R V! 4       P                  4        4       4       V#   \         d    / p Lœi ; i)uÕ   Build a profile's secret mapping from ``<home>/.env`` plus its external
secret sources. Global vars are NOT copied in â€” ``get_secret`` reads those
from ``os.environ`` â€” so the scope holds only profile secrets.z.env)Úget_secret_source_valuesc              3  óR   "  € T F  w  r\        V4      '       d   K  W3x € K  	  R # 5ir*   ©r™   ©rR   ÚkÚvs   &  r   rT   Ú-build_profile_secret_scope.<locals>.<genexpr>�  s    é € ÐXÑ&>™d˜aÄnÐUV×FW”6�A•6Ó&>ùó   ‚'œ')Úbridged_allow_all_usersÚGATEWAY_ALLOW_ALL_USERS)Úload_managed_envc              3  óR   "  € T F  w  r\        V4      '       d   K  W3x € K  	  R # 5ir*   r÷   rø   s   &  r   rT   rû   ¡  s    é € ÐZÑ&@™d˜aÌÐWX×HY”6�A•6Ó&@ùrü   )rñ   r   Úhermes_cli.env_loaderrõ   Ú	ExceptionÚupdateÚitemsÚgateway.config_loaderrý   Ú_is_process_homeÚ
setdefaultÚhermes_cli.managed_scoperÿ   )ró   ra   rõ   Úexternal_secretsrý   Úbridgedrÿ   s   &      r   Úbuild_profile_secret_scoper  †  s½   € ô œD Ó-°Õ6Ó7€GðÝBÙ3´D¸Ó4EÓFÐð ‡N�NÑXÐ&6×&<Ñ&<Ô&>ÓXÔXõ >Ù%Ó'€GØÒÔ/°×<Ò<Ø×ÑÐ4°gÔ>õ :à‡N�NÑZÑ&6Ó&8×&>Ñ&>Ô&@ÓZÔZØ€Nøô) ô ØÒðús   �C ÃCÃCc               ó    € V ^8„  d   QhRRRR/# ©r   ró   r   r   r   r   )r   s   "r   r   r   ¥  s   € ÷ ñ  $ð ¨4ñ r   c                ó’   € ^ RI Hp  \        V 4      P                  4       V! 4       P                  4       8H  #   \         d     R# i ; i)a  Is *hermes_home* the profile this process serves as its own? Same launch-home identity as
``serves_routed_profile()``: a host that mirrors a served profile into ``HERMES_HOME`` would
otherwise seed the launch profile's bridged allow-all grant into that profile's scope.)r   F)r   r   r   Úresolverê   )ró   r   s   & r   r  r  ¥  sE   € õ AðÜ�KÓ ×(Ñ(Ó*Ñ.MÓ.O×.WÑ.WÓ.YÑYÐYøÜô Úðús   ˆ.7 ·AÁAc               ó    € V ^8„  d   QhRRRR/# r  r   )r   s   "r   r   r   °  s   € ÷ ñ °ð ¸ñ r   c                ó*  € \         P                  4       pVe   VP                  MRp\        V\        4      '       g   R# \        V 4      pVP                  V4       V Uu. uF  qDV9  g   K  VNK  	  up F  pVP                  VR4       K  	  R# u upi )a  Fold a fresh build of *hermes_home*'s secrets into the INSTALLED scope, in place.

A scope is frozen when installed, but a fire can learn of new values afterwards: a routed cron
fire's first agent build discovers plugin secret sources, and under multiplex semantics the
reload that follows is hydrate-only (never ``os.environ``), so nothing else would carry those
values into the scope this fire already holds. The caller names the home the installed scope
was built for. True when a scope was updated; False when none is installed.NFT)rC   r1   r5   Ú
isinstancerè   r  r  rÈ   )ró   rE   ÚscopeÚrebuiltÚnr”   s   &     r   Úrefresh_installed_secret_scoper  °  s€   € ô ×ÑÓ€EØ"Ò.ˆE�MŠM°D€EÜ�eœT×"Ò"Ùô )¨Ó5€Gà	‡L�L�ÔÙ!Ó6™E�q¨gÑ%5—�™EÔ6ˆØ�	‰	�$˜Öñ 7áùò 7s   ÁBÁ,B)ÚHERMES_KANBAN_ÚHERMES_TELEGRAM_Ú	TERMINAL_r*   )rV   )<Ú__conditional_annotations__r<   Ú
__future__r   rÏ   r�   r³   Ú	threadingÚcollectionsr   Úcontextvarsr   r   Úpathlibr   Útypingr   r   r	   r
   r   Úutilsr   r   r=   r    r   r!   r%   r-   r2   r4   rG   rC   ÚRuntimeErrorrI   rd   rg   rk   rn   Ú	frozensetr–   r˜   r™   r¡   r¤   r§   r·   rÁ   rÂ   ÚLockrÆ   rë   rÉ   rÓ   rß   rñ   r  r  r  )r  s   @r   Ú<module>r%     s¤  øðô
õ #ã Û 	Û 	Û Ý #ß )Ý ß =Õ =å  ð
  Ð �4Ó àÐ ñ (2Ð2FÐPUÔ'VÐ Ð$Ó Võ!õ60õ$õ9ô
 �*ô  õEñ& 4>¸oÐW[Ô3\€Ð0Ó \ô,˜,ô ,ð8`Ð\`÷ `õõ8õ=ñ ð àðà#ðà%>ðð ðð 2ðð ð	ð ;ð	ð
 ðð ðð ðð ðð #ðð %-ðð /3ðð 5:ðð <Cðð EMðð ðð  ðð "1ðð ðð 8ðð :Oðð ðð ,ðð .?ðð  ð!ð, ð-ð, 2ð-ð. +ð/ð0 ð1ð0  7ð1ð2 ð3ð2 !<ð3ð4 ð5ð4 ;ð5ó Ð ð8Ð õNõ
/÷
&÷>+õ;õ.ñ< CNÃ-€Ð?Ó OØ —~’~Ó'Ð ØÐ ÷5õ%õõ %õPõ>÷r   