+
    iHàj7  ã            	      ó   a € 0 t $ R t^ RIHt ^ RIt^ RIHtHt ^ RIH	t	H
t
 ^ RIHt ]P                  ! ]4      t]! 0 Rm4      tR R lt]	! R]]]
]]R	7      tR
]R&   ]P+                  ]! 4       4       RR/R R lltRRR/R R llltR R ltR# )aÏ  Terminal Environment Registry.

Central map of registered pluggable terminal backends, populated by plugins via
:meth:`PluginContext.register_terminal_environment_provider` and consumed by
:func:`tools.terminal_tool_backends._create_environment` plus the classification helpers across the
terminal/file/approval/prompt surfaces. Unlike the image/video/web/browser registries there
is **no active-provider resolution**: the active backend is whatever ``TERMINAL_ENV`` /
``terminal.backend`` names. Built-in names are reserved (registration raises) so a plugin can
never shadow the in-tree docker/modal/... implementations. Scope semantics mirror
:mod:`agent.browser_registry` (per-profile scope or the global base map).
)ÚannotationsN)ÚListÚOptional)ÚProviderRegistryÚ	lower_key)ÚTerminalEnvironmentProviderc               ó    € V ^8„  d   QhRRRR/# )é   ÚnameÚstrÚreturnÚNone© )Úformats   "Ú@/home/ubuntu/.hermes/hermes-agent/agent/terminal_env_registry.pyÚ__annotate__r       s   € ÷ =ñ = Cð =¨Dñ =ó    c                ó&   € \        R V  RV  R24      h)zTerminal backend name 'z' is reserved for the built-in z- backend and cannot be registered by a plugin)Ú
ValueError)r
   s   &r   Ú_reject_builtin_collisionr       s*   € Ü
Ð.¨t¨fÐ4SÐTXÐSYð Z<ð <ó =ð =r   zTerminal environment)ÚlabelÚprovider_clsÚloggerÚ	normalizeÚbuiltin_namesÚon_builtin_collisionz-ProviderRegistry[TerminalEnvironmentProvider]Ú	_registryÚscopec               ó    € V ^8„  d   QhRRRR/# )r	   r   úOptional[str]r   z	list[str]r   )r   s   "r   r   r   0   s   € ÷ Sñ S =ð S¸Iñ Sr   c                ó¢   € \         P                  V R7       Uu. uF*  qP                  P                  4       P	                  4       NK,  	  up# u upi )z1Names of all registered plugin backends (sorted).©r   )r   Úlist_providersr
   ÚstripÚlower)r   Úps   $ r   Úplugin_backend_namesr&   0   s;   € ä,5×,DÑ,DÈ5Ð,DÔ,QÓRÑ,Q q�F‰F�L‰L‹N× Ñ Ö"Ñ,QÑRÐRùÒRs   ™0Ac               ó$   € V ^8„  d   QhRRRRRR/# )r	   r
   r   Úattrr   r   r   )r   s   "r   r   r   5   s!   € ÷ ñ ˜ð  3ð Àñ r   c               óª   € \         P                  WR7      pVf   V#  \        WAV4      #   \         d    \        P                  RYRR7       Tu # i ; i)a›  Read a classification attribute off the provider for *name*.

Fail-soft: unknown backend or a raising property returns *default* so a misbehaving
plugin degrades to built-in-equivalent behavior instead of taking the terminal tool down.
*scope* names the profile home whose registrations to consult (default: the active home);
a caller deciding for a session bound to another profile passes that profile's home.
r!   z8Terminal environment provider '%s' attribute '%s' raisedT©Úexc_info)r   Úget_providerÚgetattrÚ	Exceptionr   Údebug)r
   r(   Údefaultr   Úproviders   &&&$ r   Úprovider_flagr2   5   s]   € ô ×%Ñ% dÐ%Ó8€HØÒØˆðÜ�x wÓ/Ð/øÜô Ü�‰ÐOÐQUÐfjˆÔkØŠðús   ž* ª%AÁAc               ó   € V ^8„  d   QhRR/# )r	   r   Ú	frozensetr   )r   s   "r   r   r   G   s   € ÷ ñ ˜yñ r   c                 ó  € \        4       p \        P                  ;_uu_ 4        \        \        P                  P                  4       4      p\        P                  P                  4        F"  pVP                  VP                  4       4       K$  	  RRR4       X F  p V P                  VP                  4       K!  	  \        V 4      #   + '       g   i     L@; i  \         d    \        P                  RRR7        Kf  i ; i)uÿ   Union of every registered provider's ``strip_env_keys`` â€” across ALL scopes, not
just the active backend: a token in the process environment is strippable regardless of
which backend is selected (as MODAL_*/DAYTONA_API_KEY sit in the static tier-1 set).Nz3Terminal environment provider strip_env_keys raisedTr*   )Úsetr   Ú_lockÚlistÚ
_providersÚvaluesÚ_scoped_providersÚextendÚupdateÚstrip_env_keysr.   r   r/   r4   )ÚkeysÚall_providersÚscopedr1   s       r   Úplugin_strip_env_keysrB   G   s»   € ô “€DÜ	��‹ÜœY×1Ñ1×8Ñ8Ó:Ó;ˆÜ×1Ñ1×8Ñ8Ö:ˆFØ× Ñ  §¡£Ö1ñ ;÷ 
ó "ˆð	_Ø�K‰K˜×/Ñ/Ö0ñ "ô
 �T‹?Ð÷ 
�ûô ô 	_Ü�L‰LÐNÐY]ˆL×^ð	_ús   £A,CÂCÃC	Ã"D Ã?D >   ÚsshÚlocalÚmodalÚdockerÚdaytonaÚmanaged_modalÚvercel_sandbox)F)Ú__conditional_annotations__Ú__doc__Ú
__future__r   ÚloggingÚtypingr   r   Úagent.provider_registryr   r   Úagent.terminal_env_providerr   Ú	getLoggerÚ__name__r   r4   ÚBUILTIN_BACKEND_NAMESr   r   Ú__annotations__ÚexportÚglobalsr&   r2   rB   )rJ   s   @r   Ú<module>rW      s¡   øðô
õ #ã ß !ç ?Ý Cà	×	Ò	˜8Ó	$€ñ
 "ò #ó Ð õ=ñ
 <LØ
 Ø,ØØØ'Ø2ô<€	Ð8ó ð 
× Ñ ‘“Ô ðS°4÷ Sñ
ÐQU÷ ð ÷$r   