+
    „WÝj«¤  ã                  ó´  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI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 ^ RIHtHtHtHtHtHtHtHt ^ RIHtHtH t  ^ RI!H"t" ^ R	I#H$t$H%t% ^ R
I&H't'H(t(H)t)H*t* ^ RI+H,t, ]'       d	   ^ RI-H.t.H/t/ ]	P`                  ! R4      t1Rt2]Pf                  ! 4       t4/ t5R]6R&   Rt7Rt8^t9Rt:. t;R]6R&   ]Px                  ! 4       t=]Px                  ! 4       t>]P~                  ! RRR7      t@R]6R&    ! R R]A4      tBR R ltCR R ltDR  R! ltER" R# ltFR$ R% ltGR& tH]R' R( l4       tIR) R* ltJR+ R, ltK ! R- R.4      tLR# )/uz  Plugin loading: directory/entry-point module import, deferred bundled platforms, portable packages,
dependency/config-schema warnings. Mixed into :class:`hermes_cli.plugins.PluginManager`.

Origin-internal names (``PluginContext``, ``LoadedPlugin``, ``_PLUGINS_DEBUG`` â€¦) are imported lazily
through ``hermes_cli.plugins`` so tests that patch them on the origin keep working.
)ÚannotationsN)Úcontextmanager©Úwraps)ÚPath)ÚTYPE_CHECKINGÚAnyÚCallableÚDictÚListÚMappingÚOptionalÚUnion)Úget_hermes_homeÚreset_hermes_home_overrideÚset_hermes_home_override)Úreplacement_coordinator)ÚENTRY_POINTS_GROUPÚ_select_entry_point_group)ÚPluginManifestÚmanifest_keyÚportable_mcp_server_nameÚvalidate_config_schema)Ú_plugin_settings_entry)ÚLoadedPluginÚPluginContextzhermes_cli.pluginsÚhermes_pluginszdict[str, str]Ú_BARE_MODULE_SCOPEg      $@g     À‚@zplugin-load:zlist[threading.Thread]Ú_ABANDONED_LOADERSÚhermes_plugin_load_scope)Údefaultz5contextvars.ContextVar[Optional[list[PluginContext]]]Ú_IN_PLUGIN_LOADc                  ó   € ] tR t^:tRtRtR# )ÚPluginLoadTimeoutzZRaised on the loading thread when a plugin's import + ``register()`` overran its deadline.© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r$   ó    ÚMC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\plugins_loader.pyr#   r#   :   s   † Ýdr+   r#   c               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚboolr$   )Úformats   "r,   Ú__annotate__r3   >   s   € ÷ -ñ -˜tñ -r+   c                 ó.   € \         P                  4       RJ# )zcTrue on a deadline worker thread; re-entrant discovery from there must not block on its own parent.N)r!   Úgetr$   r+   r,   Úin_plugin_load_workerr6   >   s   € ä×ÑÓ ¨Ð,Ð,r+   c               ó   € V ^8„  d   QhRR/# )r/   r0   Úfloatr$   )r2   s   "r,   r3   r3   C   s   € ÷ ñ  eñ r+   c                 óê  € \         p  ^ RIHp V! 4       ;'       g    / P                  R4      p\	        V\
        4      '       d   VP                  R4      f   V # \        VR,          4      pT^ 8  d   \        P                  RY04       T # T\        8”  d"   \        P                  RT\        4       \        # T#   \        \        3 d    \        P                  RT 4       T u # \         d    T u # i ; i)z¨Effective per-plugin load deadline from ``plugins.load_timeout_seconds`` (default 10s; ``0`` runs
loads inline with no deadline; clamped to ``_MAX_LOAD_TIMEOUT_SECS``).)Úload_config_readonlyÚpluginsÚload_timeout_secondsz?plugins.load_timeout_seconds is not a number; using default %gsz>plugins.load_timeout_seconds=%g is negative; using default %gsz9plugins.load_timeout_seconds=%g exceeds max %gs; clamping)Ú_LOAD_TIMEOUT_SECSÚhermes_cli.configr:   r5   Ú
isinstanceÚdictr8   Ú	TypeErrorÚ
ValueErrorÚloggerÚwarningÚ	ExceptionÚ_MAX_LOAD_TIMEOUT_SECS)r    r:   Úplugins_cfgÚtimeouts       r,   Ú_resolve_plugin_load_timeoutrI   C   sÜ   € ô !€Gð
Ý:Ù+Ó-×3Ð3°×8Ñ8¸ÓCˆÜ˜+¤t×,Ò,°·±Ð@VÓ0WÒ0_ØˆNÜ˜Ð$:Õ;Ó<ˆð �„{Ü�‰ÐWÐY`ÔjØˆØÔ'Ô'Ü�‰ÐRÐT[Ü-ô	/ä%Ð%Ø€Nøô ”zÐ"ô Ü�‰ÐXÐZaÔbØŠÜô ØŠðús(   ˆB8 œ<B8 ÁB8 Â8)C2Ã#C2Ã,C2Ã1C2c               ó   € V ^8„  d   QhRR/# ©r/   r0   ÚNoner$   )r2   s   "r,   r3   r3   \   s   € ÷ ñ ¨ñ r+   c                 ó6  € \         ;_uu_ 4        \         U u. uF  q P                  4       '       g   K  V NK  	  up \        R&   \        \        4      \        8  d    RRR4       R#  RRR4       \        R\         R24      hu up i   + '       g   i     L(; i)zõDrop finished abandoned loaders; refuse the load once the live cap is reached. Refusing beats
loading inline: at the cap the process already holds several hung loaders, so an inline load is the
exact startup hang this deadline exists to prevent.:NNNNznot loaded: zl abandoned plugin loader thread(s) are still running (plugins.load_timeout_seconds); restart Hermes to retry)Ú_ABANDONED_LOADERS_LOCKr   Úis_aliveÚlenÚ_MAX_ABANDONED_LOADERSr#   )Úts    r,   Ú_reserve_abandoned_loader_slotrS   \   sƒ   € ÷ 
!Ö	 Ý,>Ó OÑ,> qÇ*Á*Ç,§ Ñ,>Ñ OÔ˜1ÑÜÔ!Ó"Ô%;Ô;Ø÷ 
!Ñ	 à;÷ 
!ô Ø
Ô-Ð.ð /Bð 	Cóð ùò !P÷ 
!×	 ús    �	B˜B´Bº#BÂBÂB	c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r/   Ú
plugin_keyÚstrÚctxr   ÚfnzCallable[[], Any]r0   r   r$   )r2   s   "r,   r3   r3   j   s*   € ÷ /ñ / sð /°ð /ÐDUð /ÐZ]ñ /r+   c                ó  aaa	a
€ \         P                  4       pVe+   VP                  V4        S! 4       VP                  V4       # \	        4       pV^ 8:  d   S! 4       # \        4        . o	. oV.o
R VVV	V
3R llp\        P                  ! \        P                  ! 4       P                  V3\         V  2RR7      pVP                  4        VP                  V4       VP                  4       '       dV   S
 F  pVP                  4        K  	  \         ;_uu_ 4        \"        P                  V4       RRR4       \%        RVR R24      hS'       d
   S^ ,          hS	^ ,          #   TP                  T4       i ; i  + '       g   i     LP; i)	a»  Run ``fn`` (a plugin's import + ``register()``) under the per-plugin deadline.

The worker inherits the caller's context (the Hermes-home override is a ContextVar). On timeout the
worker is abandoned as a daemon, ``ctx`` is marked so any registration it still attempts is ignored,
and :class:`PluginLoadTimeout` is raised on the calling thread so the usual failure path records the
reason and disposes whatever was registered before the hang.
Nc               ó   € V ^8„  d   QhRR/# rK   r$   )r2   s   "r,   r3   Ú,run_with_load_deadline.<locals>.__annotate__ƒ   s   € ÷ )ñ )�Tñ )r+   c                 ó  <€ \         P                  S4      p  SP                  S! 4       4       \         P	                  V 4       R #   \         d   pSP                  T4        R p?L8R p?ii ; i  \         P	                  T 4       i ; i©N)r!   ÚsetÚappendÚBaseExceptionÚreset)ÚtokenÚexcÚfailurerX   ÚoutcomeÚscopes     €€€€r,   Ú_workerÚ'run_with_load_deadline.<locals>._workerƒ   sh   ø€ Ü×#Ñ# EÓ*ˆð	)Ø�N‰N™2›4Ô ô ×!Ñ! %Ö(øô ô 	 Ø�N‰N˜3×Ñûð	 ûô ×!Ñ! %Õ(ús)   ˜A ÁA+ÁA&Á!A. Á&A+Á+A. Á.BT)ÚtargetÚargsÚnameÚdaemonzload timed out after Úgz&s (import + register() never returned))r!   r5   r_   ÚremoverI   rS   Ú	threadingÚThreadÚcontextvarsÚcopy_contextÚrunÚ_LOADER_THREAD_PREFIXÚstartÚjoinrO   Ú_abandon_loadrN   r   r#   )rU   rW   rX   Úouter_scoperH   rg   ÚworkerÚ
loaded_ctxrd   re   rf   s   &&f     @@@r,   Úrun_with_load_deadliner{   j   sN  û€ ô "×%Ñ%Ó'€KØÒØ×Ñ˜3Ôð	$Ù“4à×Ñ˜sÕ#Ü*Ó,€GØ�!„|Ù‹tˆÜ"Ô$Ø€GØ#%€GàˆE€E÷)ó )ô ×ÒÜ×'Ò'Ó)×-Ñ-°W°JÔH]ÐG^Ð_iÐ^jÐEkÐtxô€Fð ‡L�L„NØ
‡K�K�ÔØ‡�×ÒÛˆJØ×$Ñ$Ö&ñ  ç$Ö$Ü×%Ñ% fÔ-÷ %äÐ"7¸À°{ÐBhÐ iÓjÐjßØ�a�jÐØ�1�:ÐøðA ×Ñ˜sÕ#ú÷6 %×$ús   ¯E" ÄE8Å"E5Å8F	c               ó    € V ^8„  d   QhRRRR/# )r/   Úmodule_namerV   r0   rL   r$   )r2   s   "r,   r3   r3   œ   s   € ÷ (ñ ( ð (¨ñ (r+   c                óÎ   € V  R2p\        \        P                  4       FB  pW 8X  g   VP                  V4      '       g   K"  \        P                  P	                  VR4       KD  	  R# )u{  Drop ``module_name`` and every ``module_name.*`` submodule from ``sys.modules``.

``sys.modules`` is process-global, so any concurrent import â€” another profile's plugin
load, a lazy import on a worker thread â€” mutates it while this runs. The ``list()`` is
load-bearing, not a style choice: it is one atomic C-level copy, where iterating the live
mapping raises ``RuntimeError: dictionary changed size during iteration`` and
``PluginLoaderMixin._load_plugin_scoped`` degrades that to a warning that loses the whole
plugin. ``pop`` (not ``del``) keeps the snapshot-to-delete window tolerant of a key another
evictor already removed.
Ú.N)ÚlistÚsysÚmodulesÚ
startswithÚpop)r}   Úprefixrk   s   &  r,   Ú_evict_modulesr†   œ   sI   € ð ˆ}˜AÐ€FÜ”S—[‘[Ö!ˆØÔ $§/¡/°&×"9Ô"9Ü�K‰K�O‰O˜D $Ö'ó "r+   c                ó0   a € \        S 4      V 3R l4       pV# )uD   Make snapshot â†’ write â†’ lease attachment one atomic transaction.c                 óŒ   <€ \         P                  ! 4       ;_uu_ 4        S! V / VB uuR R R 4       #   + '       g   i     R # ; ir]   )r   Útransaction)rj   ÚkwargsÚmethods   *,€r,   ÚwrappedÚ(_serialized_replacement.<locals>.wrapped¯   s.   ø€ ä$×0Ò0×2Õ2Ù˜4Ð* 6Ñ*÷ 3×2×2Ó2ús	   Ÿ2²A	r   )r‹   rŒ   s   f r,   Ú_serialized_replacementrŽ   ­   s    ø€ ä
ˆ6ƒ]ô+ó ð+ð €Nr+   c               ó   € V ^8„  d   QhRR/# )r/   Úhomer   r$   )r2   s   "r,   r3   r3   ¸   s   € ÷ *ñ *˜Tñ *r+   c              #  ód   "  € \        V 4      p Rx € \        V4       R#   \        T4       i ; i5i)zBBind discovery and loading to the manager's immutable Hermes home.N)r   r   )r�   rb   s   & r,   Ú_plugin_home_scoper’   ·   s*   é € ô % TÓ*€Eð*Ûä" 5Ö)øÔ" 5Õ)üs   ‚0�  “0 -­0c               ó    € V ^8„  d   QhRRRR/# )r/   rc   r`   r0   rV   r$   )r2   s   "r,   r3   r3   Á   s   € ÷ ñ ˜-ð ¨Cñ r+   c                óf   € \        V \        4      '       d   RV P                  : R2# \        V 4      # )z_Human-readable load failure; ``sys.exit(0)`` has an empty ``str()`` so name the class and code.zSystemExit(z!) raised during import/register())r?   Ú
SystemExitÚcoderV   )rc   s   &r,   Ú_load_error_textr—   Á   s,   € ä�#”z×"Ò"Ø˜SŸX™X™LÐ(IÐJÐJÜˆs‹8€Or+   c               ó    € V ^8„  d   QhRRRR/# )r/   ÚreqrV   r0   zOptional[bool]r$   )r2   s   "r,   r3   r3   È   s   € ÷ ñ ˜ð  ñ r+   c                ó  € \         P                  ! RV ^R7      ^ ,          P                  4       pV'       g   R#  \        P                  P                  V4       R#   \        P                  P                   d     R# \         d     R# i ; i)z[Best-effort presence probe on a requirement's distribution name; ``None`` when unprobeable.z[<>=!~\[;\s])ÚmaxsplitNTF)ÚreÚsplitÚstripÚ	importlibÚmetadataÚversionÚPackageNotFoundErrorrE   )r™   Údists   & r,   Ú_dist_installedr¤   È   sm   € ä�8Š8�O S°1Ô5°aÕ8×>Ñ>Ó@€DßÙðÜ×Ñ×"Ñ" 4Ô(ÙøÜ×Ñ×2Ñ2ô ÚÜô Úðús   ºA ÁBÁ=BÂBÂ
Bc                  óD  € ] tR t^ÖtR R ltR R lt]R R l4       tR R ltR	 R
 lt	]
R R l4       tR R ltR R ltR R ltR R ltR R lt]R R l4       tR R ltR R ltR R ltR R  ltR! R" ltR# R$ ltR% R& ltR' R( ltR)R*/R+ R, lltR- R. ltR/tR*# )0ÚPluginLoaderMixinc               ó    € V ^8„  d   QhRRRR/# )r/   Úcallbackz%Callable[[list[dict[str, Any]]], Any]r0   zCallable[[], None]r$   )r2   s   "r,   r3   ÚPluginLoaderMixin.__annotate__×   s   € ÷ ñ Ð)Nð ÐSeñ r+   c                ó�   aa€ \        S4      '       g   \        R4      hV P                  oSP                  S4       R VV3R llpV# )ut  Subscribe to "a discovery sweep loaded plugins this process did not have": fires from INSIDE
:meth:`discover_and_load` (never emitted by an install RPC) with one
``{name, key, activated_now, deferred}`` summary per NEWLY loaded plugin â€” every plugin at boot,
just the newcomer after a mid-run ``hermes plugins install/enable``, Desktop / dashboard /
``plugins.manage`` install-enable-update, a tool-triggered force re-discovery or the gateway's
``reload-plugins`` verb (all of which run ``discover_plugins(force=True)``; a non-forced call
short-circuits on ``_discovered`` and never fires). See
:func:`hermes_cli.plugins_activation.plugin_activation_summary` for the payload: ``activated_now``
(gateway commands/transforms/hooks/callbacks, live at once) vs ``deferred`` (``tools``/``prompt``
until the next session, ``mcp_servers`` â€” the plugin's mcp.json server names â€” until ``mcp.reload``).
Listeners belong to the process (gateway runner, TUI server), not to a plugin, so ``unload()``
never clears them. Returns an unsubscribe callable. Fires on the discovering thread with the
discovery lock released; marshal onto your own loop.z$on_plugin_loaded requires a callablec               ó   € V ^8„  d   QhRR/# rK   r$   )r2   s   "r,   r3   Ú8PluginLoaderMixin.on_plugin_loaded.<locals>.__annotate__ê   s   € ÷ 	ñ 	˜dñ 	r+   c                 óP   <€  SP                  S 4       R #   \         d     R # i ; ir]   )rn   rB   )r¨   Ú	listenerss   €€r,   Ú_unsubscribeÚ8PluginLoaderMixin.on_plugin_loaded.<locals>._unsubscribeê   s(   ø€ ðØ× Ñ  Ö*øÜô Úðús   ƒ –%¤%)ÚcallablerB   Ú_plugin_loaded_listenersr_   )Úselfr¨   r¯   r®   s   &f @r,   Úon_plugin_loadedÚ"PluginLoaderMixin.on_plugin_loaded×   sG   ù€ ô ˜×!Ò!ÜÐCÓDÐDØ×1Ñ1ˆ	Ø×Ñ˜Ô"÷	ñ 	ð
 Ðr+   c               ó    € V ^8„  d   QhRRRR/# )r/   Úloaded_beforeÚ	frozensetr0   rL   r$   )r2   s   "r,   r3   r©   ñ   s   € ÷ \ñ \°9ð \Àñ \r+   c                óB  € V P                   '       g   R# ^ RIHp V! V 4       Uu. uF  q3R,          V9  g   K  VNK  	  ppV'       g   R# \        V P                   4       F  p V! V4       K  	  R# u upi   \         d    \
        P                  RTRR7        K=  i ; i)zªFire every :meth:`on_plugin_loaded` listener for the plugins this sweep added over
``loaded_before``; nothing new = no event. One raising listener never starves the rest.N)Úactivation_summariesÚkeyz plugin-loaded listener %r raisedT©Úexc_info)r²   Úhermes_cli.plugins_activationrº   r€   rE   rC   rD   )r³   r·   rº   ÚsÚ	summariesr¨   s   &&    r,   Ú_notify_plugin_loadedÚ'PluginLoaderMixin._notify_plugin_loadedñ   s’   € ð ×,×,Ð,ÙÝFÙ 4°TÔ :Ó\Ñ :˜1À½hÈmÑ>[—Q�QÑ :ˆ	Ð\ßÙÜ˜T×:Ñ:Ö;ˆHð\Ù˜Ö#ó <ùò ]øô ô \Ü—‘ÐAÀ8ÐVZ�×[ð\ús   ¥A2¹A2Á$A7Á7#BÂBc               ó    € V ^8„  d   QhRRRR/# ©r/   Úmanifestr   r0   rV   r$   )r2   s   "r,   r3   r©     s   € ÷ Cñ C¨~ð CÀ#ñ Cr+   c                óà   € V P                   ;'       g    RpVP                  R4      '       d   VR\        R4      )  # V P                  '       d    \	        V P                  4      P                   # T# )z¤Derive the platform name without importing the adapter: strip a trailing ``-platform`` from the
manifest name, else the directory basename (the bundled convention).Ú z	-platformN)rk   ÚendswithrP   Úpathr   )rÅ   rk   s   & r,   Ú_platform_name_from_manifestÚ.PluginLoaderMixin._platform_name_from_manifest   s\   € ð �}‰}×"Ð" ˆØ�=‰=˜×%Ò%ØÐ+œ3˜{Ó+Ð+Ð,Ð,Ø+3¯=¯=¨=Œt�H—M‘MÓ"×'Ñ'ÐB¸dÐBr+   c               ó    € V ^8„  d   QhRRRR/# ©r/   rÅ   r   r0   rL   r$   )r2   s   "r,   r3   r©   	  s   € ÷ Añ A°Nð AÀtñ Ar+   c                óÐ   € ^ RI Hp \        V4      pV! VRRR7      pW@P                  V&   V P	                  W4      '       g   V P                  V4       R# V P                  W4       R# )zÔRegister a lazy loader for a bundled platform: the adapter imports only when the
``platform_registry`` is first asked for it; a placeholder ``LoadedPlugin`` keeps it visible in
``hermes plugins list`` until then.)r   T)rÅ   ÚenabledÚdeferredN)Úhermes_cli.pluginsr   r   Ú_pluginsÚ_lease_deferred_platformÚ_load_pluginÚ!_register_deferred_platform_tools)r³   rÅ   r   Ú
lookup_keyÚloadeds   &&   r,   Ú_register_deferred_platformÚ-PluginLoaderMixin._register_deferred_platform	  s]   € õ 	4Ü! (Ó+ˆ
Ù x¸ÈÔMˆØ$*�‰�jÑ!Ø×,Ñ,¨X×BÒBð ×Ñ˜hÔ'ÙØ×.Ñ.¨xÖ@r+   c               ó    € V ^8„  d   QhRRRR/# )r/   Úplatform_namerV   r0   r1   r$   )r2   s   "r,   r3   r©     s   € ÷ ñ °3ð ¸4ñ r+   c                ón  a aa€ ^ RI HpHpHp ^ RIHp S P                  ;_uu_ 4        \        S P                  4      ;_uu_ 4        \        VV 3R lS P                  P                  4        4       R4      oSe2   V! S4      '       g$   V! SV! 4       V! 4       4      P                  R	9  d    RRR4       RRR4       R# \        ;_uu_ 4        \        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       d    RRR4       RRR4       RRR4       R#  RRR4       \         P#                  RS4       S P%                  S4        RRR4       RRR4       R#   + '       g   i     LJ; i  + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)
aS  Re-lease the deferred loader of a platform plugin whose load failed, so the next registry lookup
retries the import. A failed load disposes its lease (the registry forgets the platform), so without
this a load that raised or overran its deadline at startup stays down until a forced re-discovery
(#126356). True when a loader was re-armed.)Ú_get_disabled_pluginsÚ_get_enabled_pluginsÚgate_manifest©Úrequires_hermes_errorc              3  ó
  <"  € T Fx  pVP                   '       g   K  VP                  '       d   K+  VP                  P                  R 8X  g   KH  SP	                  VP                  4      S8X  g   Kj  VP                  x € Kz  	  R# 5i)ÚplatformN)ÚerrorrÏ   rÅ   ÚkindrÊ   )Ú.0ÚprÛ   r³   s   & €€r,   Ú	<genexpr>Ú:PluginLoaderMixin.rearm_failed_platform.<locals>.<genexpr>!  sd   øé € ð _Ñ/E¨!ØŸg�gô &Ø./¯i­iô &Ø<=¿J¹J¿O¹OÈzÑ<Yô &à#×@Ñ@ÀÇÁÓLÐP]Ñ]ô &˜1Ÿ:ž:Ó/Eùs   ƒBœB°BÁBÁ/BNFc              3  ó’   <"  € T F<  qP                  4       ;'       d!    VP                  \         \        S4       28H  x € K>  	  R # 5ir]   )rO   rk   rt   r   )ræ   rR   Úfaileds   & €r,   rè   ré   *  s>   øé € ÐÑl~Ðgh—z‘z“|×bÐb¨¯©Ô5JÐ4KÌLÐY_ÓL`ÐKaÐ2bÑ(bÔbÓl~ùs
   ƒAž)ATz)Re-arming failed platform plugin load: %s)ÚdeferÚload)Úhermes_cli.plugins_discoveryrÝ   rÞ   rß   Úhermes_cli.plugins_manifestrá   Ú_discovery_lockr’   Ú	home_pathÚnextrÒ   ÚvaluesÚactionrN   Úanyr   rC   ÚinforØ   )r³   rÛ   rÝ   rÞ   rß   rá   rë   s   ff    @r,   Úrearm_failed_platformÚ'PluginLoaderMixin.rearm_failed_platform  s3  ú€ ÷
 	lÑkÝEØ×!×!Ó!Ô#5°d·n±n×#EÕ#EÜõ _¨t¯}©}×/CÑ/CÔ/Eó _à`dófˆFð
 Š~Ñ!6°v×!>Ò!>Á-ØÑ1Ó3Ñ5IÓ5KóCMßMSÉVÐ[lôCmà÷ $F×!Ñ!÷ )Ö(ß“3ÔÕl~Ó—3—3’3ÔÕl~Ó×ÒØ ÷ )÷ $F×!Ñ!ð @÷ )ô �K‰KÐCÀ]ÔSØ×,Ñ,¨VÔ4Ø÷ $F×!Ñ!÷ )×(ú÷ $F×#Eú×!×!×!Ò!úsf   ¨F#ÁAF	Â$F	Â,F#Â>F	Ã$E3Ã3!E3ÄE3ÄF	ÄF#Ä10F	Å!F#Å3FÅ>F	ÆFÆF#Æ#F4	c               ó$   € V ^8„  d   QhRRRRRR/# )r/   rÅ   r   rÖ   rV   r0   r1   r$   )r2   s   "r,   r3   r©   1  s"   € ÷ !ñ !°ð !ÈSð !ÐUYñ !r+   c           
     óÌ  a aaa	€ S P                  V4      o ^ RIHo S P                  o	V3R VVV	V 3R lllpSP	                  SS	R7      pSP                  SVS	R7       SP                  SVP                  ;'       g    R Uu. uF,  p\        V\        4      '       d   VP                  R4      MTNK.  	  up4       SP	                  SS	R7      pV^ ,          fE   V^,          VJ d8   S P                  P                  S4       S P                  VRSSWdVV 3R lR7       \        P                  R	SV4       R# u upi   \          d    \        P                  R
TRR7        R# i ; i)zXPublish the deferred loader as a ledger-owned lease; False when the registry refused it.)Úplatform_registryc               ó    € V ^8„  d   QhRRRR/# )r/   Ú	_manifestr   r0   rL   r$   )r2   s   "r,   r3   Ú@PluginLoaderMixin._lease_deferred_platform.<locals>.__annotate__8  s   € ÷ 8ñ 8 >ð 8Àñ 8r+   c           	     óV  <€ SP                   ;_uu_ 4        \        SP                  4      ;_uu_ 4        SP                  SSR 7      '       d    RRR4       RRR4       R# SP	                  V 4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)©rf   N)rð   r’   rñ   Úis_deferred_load_cancelledÚ_load_plugin_scoped)rý   rÛ   rû   rf   r³   s   &€€€€r,   Ú_loaderÚ;PluginLoaderMixin._lease_deferred_platform.<locals>._loader8  ss   ø€ ð ×)×)Ó)Ô+=¸d¿n¹n×+MÕ+MØ(×CÑCÀMÐY^ÐC×_Ò_Ø÷ ,N×)Ñ)ð ×,Ñ,¨YÔ7÷ ,N×)Ñ)×+M×+Mú×)×)Ð)ús.   –B´B	ÁBÁ!B	Á2BÂBÂBÂB(	r   rk   rã   c                 ó&   <€ SP                  S 4      # r]   )Ú _remove_platform_name_if_unowned)rÛ   r³   s   €€r,   Ú<lambda>Ú<PluginLoaderMixin._lease_deferred_platform.<locals>.<lambda>K  s   ø€  T×%JÑ%JÈ=Ô%Yr+   )Úfinalizez3Registered deferred platform loader: %s (plugin=%s)z=Deferred platform registration failed for '%s'; eager-loadingTr¼   Fr$   )rÊ   Úgateway.platform_registryrû   Ú	scope_keyÚsnapshot_registrationÚregister_deferredÚnote_activation_envÚrequires_envr?   r@   r5   Ú_plugin_platform_namesÚaddÚ_track_scoped_registrationrC   ÚdebugrE   )
r³   rÅ   rÖ   r  ÚpreviousÚeÚcurrentrÛ   rû   rf   s
   f&&    @@@r,   rÓ   Ú*PluginLoaderMixin._lease_deferred_platform0  sd  û€ ð ×9Ñ9¸(ÓCˆð	ÝCØ—N‘NˆEà4<÷ 8õ 8ð )×>Ñ>¸}ÐTYÐ>ÓZˆHØ×/Ñ/°¸wÈeÐ/ÔTð ×1Ñ1ØÐU]×UjÑUj×UpÐUpÐnpÐUpÓqÑUpÐPQ´¸A¼t×1DÒ1D §¡ f¤È!Ò KÑUpÑqôsà'×=Ñ=¸mÐSXÐ=ÓYˆGØ�q�zÒ! g¨a¥j°GÓ&;Ø×+Ñ+×/Ñ/°Ô>Ø×/Ñ/Ø˜j¨-Ð9JÈGÝYð 0ô ô �L‰LÐNÐP]Ð_iÔjñ
 ùò  røô ô 	Ü�L‰LØOÐQ[Ðfjð ô lâð	ús+   —A&D< Á>D< Â2D7
Â5B D< Ä7D< Ä<#E#Å"E#c               ó$   € V ^8„  d   QhRRRRRR/# ©r/   rÅ   r   r×   r   r0   rL   r$   )r2   s   "r,   r3   r©   T  s(   € ÷ Vñ V¸.ð VÐR^ð VÐcgñ Vr+   c           
     ó  a aaa€ ^ RI HpHp VP                  '       g   R# \	        V4      o\        VP                  4      pVP                  '       d   \        VP                  4      MRpVe   VR,          P                  4       '       g   \        P                  RSV4       R# \        S P                  4      oR VVVV 3R llp S P                  V4      pVSn        VS P                  S&   \         P"                  ! VP$                   R24      p	\'        V	RR4      p
V
f   \        P                  R	SV4       R# V
! V! VS 4      4       V! 4       p\        P)                  R
S\+        V4      V4       R#   \,        \.        3 d~   pT! 4       \+        T4      rí\+        T4      T8¬  pT'       g   RT R2MT'       d   RT R2MR\+        T4       RT R2p\        P                  RSTTT'       d   RMRTR7        Rp?R# Rp?ii ; i)uÒ  Register a deferred platform's *client* tools without its adapter. Deferring the plugin would
otherwise defer its outbound tools too, so CLI/TUI processes (which never materialize platforms)
would miss them in ``hermes tools`` / ``platform_toolsets``. Opt-in is explicit via ``provides_tools``;
tools live in a ``tools`` submodule so ``__init__`` stays import-light.

A platform plugin can ship two independent things: an inbound adapter (heavy â€” it imports the
platform SDK) and outbound client tools the agent calls like any other tool. Deferring the plugin
defers both, so in a CLI/TUI process the client tools never register at all: ``resolve_toolset()``
returns ``[]``, the toolset is missing from the ``hermes tools`` checklist, and even an explicit
``platform_toolsets`` entry is dropped because the key is unknown. The same tools work in
gateway/web processes only because those materialize every platform at startup (issue #78050).
Opting in is explicit: the manifest must declare ``provides_tools`` (the field the plugin list and
web server already read to name a plugin's tools, per #78538). Keying off the mere presence of a
``tools.py`` would opt a plugin in by accident â€” a platform is free to put internal helpers there â€”
and would leave the contract invisible to anyone reading the manifest. ``tools.py`` remains where
the code is imported from; ``provides_tools`` is what asks for it. A platform that does not declare
the field is untouched and stays fully deferred.
)r   Ú_PLUGINS_DEBUGNztools.pyzrPlugin '%s' declares provides_tools %s but has no tools.py; those tools will not be available in CLI/TUI sessions.c               ó   € V ^8„  d   QhRR/# )r/   r0   ú	list[str]r$   )r2   s   "r,   r3   ÚIPluginLoaderMixin._register_deferred_platform_tools.<locals>.__annotate__~  s   € ÷ 	ñ 	˜ñ 	r+   c                 ó”   <€ SP                    U u. uF  q S9  g   K  V NK  	  pp V'       d   VSn        VSP                  S&   V# u up i )z@Attribute every tool registered since ``before`` to this plugin.)Ú_plugin_tool_namesÚtools_registeredÚ_predeclared_tools)rR   Ú
registeredÚbeforer×   rÖ   r³   s     €€€€r,   Ú_creditÚDPluginLoaderMixin._register_deferred_platform_tools.<locals>._credit~  sL   ø€ à%)×%<Ò%<ÓPÑ%< ÈÁŸ!˜!Ñ%<ˆJÐPßØ*4�Ô'Ø6@�×'Ñ'¨
Ñ3ØÐùò	 Qs
   �A�Az.toolsÚregister_toolszŠPlugin '%s' declares provides_tools %s but its tools.py has no register_tools(ctx); those tools will not be available in CLI/TUI sessions.z;Deferred platform '%s': pre-registered %d client tool(s) %szbefore registering any of its z declared tool(s)zafter registering all zafter registering z of z;Plugin '%s': client-tool pre-registration failed %s (%s).%srÇ   z5 The remainder will be missing from CLI/TUI sessions.r¼   )rÑ   r   r  Úprovides_toolsr   r€   rÉ   r   Úis_filerC   rD   r^   r   Ú_load_directory_moduleÚmoduleÚ_predeclared_modulesrŸ   Úimport_moduler%   Úgetattrr  rP   rE   r•   )r³   rÅ   r×   r   r  ÚdeclaredÚ
plugin_dirr%  r+  Útools_moduler'  r#  rc   ÚpartialÚtotalÚcompleterf   r$  rÖ   s   f&f              @@r,   rÕ   Ú3PluginLoaderMixin._register_deferred_platform_toolsT  sç  û€ ÷& 	EØ×&×&Ð&ÙÜ! (Ó+ˆ
ô ˜×/Ñ/Ó0ˆØ,4¯M¯M¨M”T˜(Ÿ-™-Ô(¸tˆ
ØÒ j°:Õ&=×%FÑ%F×%HÒ%Hä�N‰NðIØJTÐV^ô	ñ Ü�T×,Ñ,Ó-ˆ÷	ó 	ð$	Ø×0Ñ0°Ó:ˆFð #ˆFŒMØ4:ˆD×%Ñ% jÑ1Ü$×2Ò2°f·o±oÐ5FÀfÐ3MÓNˆLÜ$ \Ð3CÀTÓJˆNØÒ%Ü—‘ð5à6@À(ôñ
 Ù™=¨°4Ó8Ô9Ù ›ˆJÜ�L‰LØMÈzÔ[^Ð_iÓ[jØöøô œ:Ð&ô 	ñ %›Y¬¨H«�UÜ˜7“| uÑ,ˆHçQXÐ0°°Ð7HÑIßJRÐ-¨e¨WÐ4EÑFØ)¬#¨g«,¨°t¸E¸7ÐBSÐTð ô
 �N‰NØMÈzÐ[`Ðbeß‘Ð$[Ø'ð ÷ ò ûð	ús+   ÃA2E3 Ä:7E3 Å3HÆ4G<Æ92G<Ç,
G<Ç<Hc               ó    € V ^8„  d   QhRRRR/# rÍ   r$   )r2   s   "r,   r3   r©   ¬  s   € ÷ ^ñ ^°.ð ^ÀTñ ^r+   c                óB  € VP                   pV'       g   R# \        V4      pV Uu. uF  p\        V4      RJ g   K  VNK  	  ppV'       d)   \        P	                  RVRP                  V4      4       R# \        P                  RVRP                  V4      4       R# u upi )zyReport missing dependencies without installing during discovery.

Plugin admission and PM repair own dependency changes.
NFz­Plugin %s declares Python dependencies that are not installed: %s. For an enabled plugin, run hermes pm repair, then restart Hermes. Discovery does not install dependencies.z, z+Plugin %s python_dependencies satisfied: %s)Úpython_dependenciesr   r¤   rC   rD   rv   r  )r³   rÅ   Údepsr»   r™   Úmissings   &&    r,   Ú_warn_python_dependenciesÚ+PluginLoaderMixin._warn_python_dependencies¬  sˆ   € ð
 ×+Ñ+ˆßÙÜ˜8Ó$ˆÙ"&ÓH¡$˜3¬/¸#Ó*>À%Ð*G—3�3¡$ˆÐHßÜ�N‰NðPð �T—Y‘Y˜wÓ'ö	ô �L‰LÐFÈÈTÏYÉYÐW[Ë_Ö]ùò Is
   ¦B¼Bc               ó    € V ^8„  d   QhRRRR/# rÍ   r$   )r2   s   "r,   r3   r©   À  s   € ÷ Gñ G°~ð GÈ$ñ Gr+   c                óÐ  € VP                   '       g   R# \        V4      p/ p ^ RIHp \	        V! 4       ;'       g    / V4      ;'       g    / pVP                  R4      p\        V\        4      '       g   VP                  R4      p\        V\        4      '       d   TM/ p\        W!P                   V4       F  p\        P                  RW'4       K  	  R#   \         d    / p LDi ; i)z]Warn (never block) on plugins.entries.<id> settings that violate config_schema.

See #64165.
N)Úload_configÚsettingsÚconfigzPlugin %s config: %s)Úconfig_schemar   r>   r?  r   r5   r?   r   rE   r   rC   rD   )r³   rÅ   Ú	plugin_idr@  r?  ÚentryÚrawrD   s   &&      r,   Ú_validate_plugin_config_schemaÚ0PluginLoaderMixin._validate_plugin_config_schemaÀ  sÄ   € ð
 ×%×%Ð%ÙÜ  Ó*ˆ	Ø&(ˆð	Ý5Ü*©;«=×+>Ð+>¸BÀ	ÓJ×PÐPÈbˆEØ—)‘)˜JÓ'ˆCÜ˜c¤7×+Ò+Ø—i‘i Ó)�Ü(¨¬g×6Ò6‘s¸BˆHô .¨i×9OÑ9OÐQYÖZˆGÜ�N‰NÐ1°9ÖFó [øô ô 	ØŠHð	ús   £C ¼C ÁAC ÃC%Ã$C%c               ó    € V ^8„  d   QhRRRR/# rÍ   r$   )r2   s   "r,   r3   r©   Õ  s   € ÷ /ñ / ^ð /¸ñ /r+   c           	     óü   € V P                   ;_uu_ 4        \        V P                  4      ;_uu_ 4        V P                  V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z?Import a plugin module and call its ``register(ctx)`` function.N)rð   r’   rñ   r  )r³   rÅ   s   &&r,   rÔ   ÚPluginLoaderMixin._load_pluginÕ  sH   € à×!×!Ó!Ô#5°d·n±n×#EÕ#EØ×$Ñ$ XÔ.÷ $F×!Ñ!×#E×#Eú×!×!Ð!ús"   •A*³A	ÁA*ÁA'Á"A*Á*A;	c               ó    € V ^8„  d   QhRRRR/# rÍ   r$   )r2   s   "r,   r3   r©   Ú  s   € ÷ W+ñ W+¨Nð W+¸tñ W+r+   c                ó  a aaaaaa€ ^ RI HpHpHp V! SR7      o\	        S4      o\
        P                  RSSP                  SP                  SP                  4       SP                  '       d   S P                  SS4       R# ^ RIHp V! S4      pV'       d0   VSn        \
        P                  RSV4       SS P                   S&   R# \#        S P$                  4      pS P'                  S4      oS P)                  SS4       V! SS 4      oS P+                  S4      oR VVVVVVV 3R llp \-        SSV4      '       dM   S P/                  SSV4       R	Sn        ^ R
IHp	 S P7                  V	! SP8                  SP:                  4      4       SP0                  '       g   S PJ                  PM                  SR4       SS P                   S&   R#   \<        \>        3 d­   p
S P$                   Uu. uF  q»P@                  S8X  g   K  TNK  	  Mu upi ppS PC                  T4       S PE                  T4       \G        T
4      Sn        S PI                  S4       \
        P                  RSP8                  \G        T
4      TR7        Rp
?
L÷Rp
?
ii ; i)z9Load one plugin with the manager's home bound as current.)r   r   r  ©rÅ   z1Loading plugin '%s' (source=%s, kind=%s, path=%s)Nrà   zPlugin '%s' skipped: %sc               ó   € V ^8„  d   QhRR/# r.   r$   )r2   s   "r,   r3   Ú;PluginLoaderMixin._load_plugin_scoped.<locals>.__annotate__ô  s   € ÷  	ñ  	 dñ  	r+   c                 ó  <€ SP                  SS4       S'       dJ   SP                  S4      '       g3   SP                  4       P                  SSSSP                  R9  R7       R# SP
                  P                  SR4      p V f?   SP                  R9   d.   SP                  S4      '       d   R# SP                  SSR7      p MV f   SP                  S4      p RpV e^   \        V \        P                  4      '       g>   \        V 4      '       d-   T p\        P                  P                  \!        VRR4      4      p V Sn        Vf   \!        V RR4      pVf*   RSn        \&        P)                  R	SP*                  4       R
# V! S4       R# )uT   Import + register() â€” the part a plugin controls, so the part the deadline covers.)r}   Ú
entrypointTN)r}   r&   rÇ   Úregisterzno register() functionz&Plugin '%s' has no register() functionF>   ÚuserÚproject>   rS  ÚbundledrT  )Ú_register_declared_localesÚ_is_manifest_only_language_packÚ_plugin_hostrí   Úsourcer,  r„   r*  Ú_load_entrypoint_moduler?   ÚtypesÚ
ModuleTyper±   r�   r‚   r5   r.  r+  rä   rC   rD   rk   )	r+  Úregister_fnrW   Úin_hostr×   rÅ   r}   rU   r³   s	     €€€€€€€r,   Ú_import_and_registerÚCPluginLoaderMixin._load_plugin_scoped.<locals>._import_and_registerô  sX  ø€ ð ×+Ñ+¨H°cÔ:ß˜t×CÑCÀH×MÒMØ×!Ñ!Ó#×(Ñ(¨°3ÀKØ4<·O±OÐK^Ñ4^ð )ô `áð ×.Ñ.×2Ñ2°:¸tÓDˆFØŠ~ (§/¡/Ð5SÔ"SØ×7Ñ7¸×AÒAÙØ×4Ñ4°XÈ;Ð4ÓW‘Ø’Ø×5Ñ5°hÓ?�ØˆKØÒ!¬*°V¼U×=MÑ=M×*NÒ*NÔS[Ð\b×ScÒScð %�ÜŸ™Ÿ™¬°¸lÈBÓ)OÓP�Ø"ˆFŒMØÒ"Ü% f¨j¸$Ó?�ØÒ"Ø7�”Ü—‘ÐGÈÏÉÔWÙÙ˜ÔÙr+   T)Ú_hook_source_ofzFailed to load plugin '%s': %sr¼   )'rÑ   r   r   r  r   rC   r  rY  rå   rÉ   ÚportableÚ_load_portable_pluginrï   rá   rä   rD   rÒ   rP   Ú_registration_orderÚ_policy_module_nameÚ_track_tool_override_policyÚ_runs_in_plugin_hostr{   Ú_attribute_registrationsrÏ   Úhermes_cli.plugins_ledgerra  Ú_drop_fallback_hooksrk   r+  rE   r•   rU   Ú_dispose_registrationsÚ_forget_registrationsr—   Ú_remove_plugin_subscriptionsr"  r„   )r³   rÅ   r   r   r  rá   ÚreasonÚregistration_startr_  ra  rc   ÚrÚownedrW   r^  r×   r}   rU   s   ff           @@@@@r,   r  Ú%PluginLoaderMixin._load_plugin_scopedÚ  s  þ€ çRÑRÙ xÔ0ˆÜ! (Ó+ˆ
Ü�‰Ø?Ø˜Ÿ™¨¯©¸¿¹ô	
ð ××ÐØ×&Ñ& x°Ô8ÙåEÙ& xÓ0ˆßØ!ˆFŒLÜ�N‰NÐ4°jÀ&ÔIØ(.ˆD�M‰M˜*Ñ%ÙÜ  ×!9Ñ!9Ó:ÐØ×.Ñ.¨xÓ8ˆØ×(Ñ(¨°;Ô?Ù˜H dÓ+ˆØ×+Ñ+¨HÓ5ˆ÷ 	ö  	ðD	|Ü% j°#Ð7K×LÒLØ×-Ñ-¨f°jÐBTÔUØ!%�”ÝEà×)Ñ)©/¸(¿-¹-ÈÏÉÓ*WÔXð& �~�~ˆ~Ø×#Ñ#×'Ñ'¨
°DÔ9Ø$*ˆ�‰�jÓ!øô) œ:Ð&ô 	|ð
 !%× 8Ò 8ÓWÑ 8˜1¿L¹LÈJÑ<V—Q�QÒ 8ùÒWˆEÐWØ×'Ñ'¨Ô.Ø×&Ñ& uÔ-Ü+¨CÓ0ˆFŒLð ×-Ñ-¨jÔ9Ü�N‰NÐ;¸X¿]¹]ÔL\Ð]`ÓLaÐlzˆN×{Ñ{ûð	|ús,   Ä*AG ÇJÇJ Ç'HÇ>HÈA7J Ê Jc               ó    € V ^8„  d   QhRRRR/# ©r/   rÅ   r   r0   r1   r$   )r2   s   "r,   r3   r©   4  s   € ÷ Mñ M°.ð MÀTñ Mr+   c                óÂ   € \        V P                  ;'       dD    V P                  ;'       d0    \        V P                  4      R,          P	                  4       '       * 4      # )u¡   A ``provides_locales`` plugin with no ``__init__.py`` is complete without Python â€” like a
manifest-only desktop plugin, it loads from its declared files alone.ú__init__.py)r1   Úprovides_localesrÉ   r   r)  rM  s   &r,   rW  Ú1PluginLoaderMixin._is_manifest_only_language_pack3  sV   € ô �H×-Ñ-÷ Lð L°(·-±-÷ Lð LÜ! (§-¡-Ó0°=Õ@×IÑIÓKÔKóMð 	Mr+   c               ó    € V ^8„  d   QhRRRR/# rÍ   r$   )r2   s   "r,   r3   r©   :  s   € ÷ Mñ M°>ð MÈ4ñ Mr+   c                ó¨  € VP                   '       d   VP                  '       g   R# \        VP                  4      R,          pVP                  W1P                  R7      pV Uu0 uF%  qUP
                  P                  R^4      ^ ,          kK'  	  ppVP                    F-  pWv9  g   K  \        P                  RVP                  WsV4       K/  	  R# u upi )zµ``provides_locales`` -> ``ctx.register_locale_dir(<plugin>/locales)``; a declared id with no file
is a warning (the pack promised a language it does not ship), never a load failure.NÚlocales)r    r   z>Plugin '%s' declares provides_locales %r but %s has no %s.yaml)
rw  rÉ   r   Úregister_locale_dirÚlocale_metadatar»   r�   rC   rD   rk   )r³   rÅ   rW   Úlocales_dirÚhandlesÚhandler#  Úlang_ids   &&&     r,   rV  Ú,PluginLoaderMixin._register_declared_locales:  s©   € ð ×(×(Ð(°··°ÙÜ˜8Ÿ=™=Ó)¨IÕ5ˆØ×)Ñ)¨+×@XÑ@XÐ)ÓYˆÙ@GÓHÁ°f—j‘j×&Ñ& s¨AÓ.¨q×1Ð1Áˆ
ÐHØ×0Ô0ˆGØÖ(Ü—‘Ð_Ø'Ÿ}™}¨gÀGöMó 1ùò Is   Á#+Cc               ó    € V ^8„  d   QhRRRR/# rt  r$   )r2   s   "r,   r3   r©   G  s   € ÷ Sñ S¨^ð SÀñ Sr+   c                óT   € ^ RI HpHp VP                  R8g  ;'       d    V! 4       V8H  # )zX``plugins.isolation: host`` sends every non-bundled Python plugin to the profile's host.)ÚISOLATION_HOSTÚisolation_moderU  )Úhermes_cli.plugin_isolationr…  r†  rY  )r³   rÅ   r…  r†  s   &&  r,   rg  Ú&PluginLoaderMixin._runs_in_plugin_hostG  s$   € çNØ�‰ )Ñ+×RÐR±Ó0@ÀNÑ0RÐRr+   c               ó   € V ^8„  d   QhRR/# )r/   r0   r   r$   )r2   s   "r,   r3   r©   L  s   € ÷ ñ ˜cñ r+   c                óÌ   € \        V RR4      pVf?   ^ RIHp \        ;_uu_ 4        \        V RR4      pVf   V! V 4      ;qn        RRR4       V# V#   + '       g   i     T# ; i)zóThis manager's plugin host (one process per profile home), created on first use. Creation
is atomic, so concurrent first callers share one host (which starts its process once); a
failed creation stores nothing, and the next caller tries again.Ú_plugin_host_instanceN)Ú
PluginHost)r.  Úhermes_cli.plugin_hostrŒ  Ú_PLUGIN_HOST_CREATE_LOCKr‹  )r³   ÚhostrŒ  s   &  r,   rX  ÚPluginLoaderMixin._plugin_hostL  se   € ô �tÐ4°dÓ;ˆØŠ<Ý9ß)Ö)Ü˜tÐ%<¸dÓC�Ø’<Ù8BÀ4Ó8HÐH�DÔ5÷ *ð ˆˆtˆ÷	 *Ö)ð ˆús   ¦ AÁA#	c               ó$   € V ^8„  d   QhRRRRRR/# )r/   rÅ   r   r}   rV   r0   rL   r$   )r2   s   "r,   r3   r©   Y  s(   € ÷ jñ j°Nð jÐQTð jÐY]ñ jr+   c                ó®  aaaa€ ^ RI Hp ^ RIHo V P                  o\
        P                  ! 4       ;_uu_ 4        SP                  SSR7      pSP                  SV! W4      P                  R4      SR7      o\
        P                  ! RSS3SVVVVV3R lR7      pV P                  VRSVP                  4       RRR4       R#   + '       g   i     R# ; i)	zTInstall the plugin's tool-override policy in tools.registry as a ledger-owned lease.©r   )Úregistryr   rÇ   Útool_override_policyc                ó.   <€ SP                  SSV SR 7      # )r   )Úrestore_plugin_override_policy)ÚreplacementÚ	_registryÚcurrent_policyr}   rf   s   &€€€€r,   r  Ú?PluginLoaderMixin._track_tool_override_policy.<locals>.<lambda>f  s   ø€ ¨I×,TÑ,TØ °ÀEð -Uô -r+   )r  r  ÚrestoreN)rÑ   r   Útools.registryr”  r  r   r‰   Úsnapshot_plugin_override_policyÚregister_plugin_override_policyÚ_tool_override_allowedÚacquireÚ_track_registrationÚdispose)	r³   rÅ   r}   r   Úprevious_policyÚpolicy_leaser™  rš  rf   s	   &&f   @@@r,   rf  Ú-PluginLoaderMixin._track_tool_override_policyY  s¹   û€ å4Ý8Ø—‘ˆÜ$×0Ò0×2Õ2Ø'×GÑGÈÐ[`ÐGÓaˆOØ&×FÑFØ™]¨8Ó:×QÑQÐRTÓUÐ]bð Gó ˆNô 3×:Ò:Ø'¨°Ð<ÀnØ(÷ôˆLð ×$Ñ$ XÐ/EÀ{ÐT`×ThÑThÔi÷ 3×2×2Ò2ús   ºA?CÃC	c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r/   r×   r   rU   rV   ro  Úintr0   rL   r$   )r2   s   "r,   r3   r©   l  s,   € ÷ 
ñ 
Ø"ð
Ø03ð
ØILð
à	ñ
r+   c                óì  aa	€ V P                   VR  Uu. uF,  pVP                  V8X  g   K  VP                  '       g   K*  VNK.  	  upo	R V	3R lloV P                  P	                  V. 4       Uu. uF  qUV P
                  9   g   K  VNK  	  ppTS! R4       Uu. uF  qwV9  g   K  VNK  	  up,           Vn        S! R4      Vn        S! R4      Vn        S! R4      Vn	        \        P                  R\        VP                  4      \        VP                  4      \        VP                  4      \        VP                  4      \        V3R	 lV P                   4       4      4       R# u upi u upi u upi )
zUFill ``loaded.*_registered`` from the ledger slice this plugin's register() produced.Nc               ó    € V ^8„  d   QhRRRR/# )r/   rå   rV   r0   r  r$   )r2   s   "r,   r3   Ú@PluginLoaderMixin._attribute_registrations.<locals>.__annotate__u  s   € ÷ 	Dñ 	D˜ð 	D 	ñ 	Dr+   c                ój   <€ S Uu. uF!  qP                   V 8X  g   K  VP                  NK#  	  up# u upi r]   )rå   r»   )rå   rp  Úregistrationss   & €r,   Ú_keysÚ9PluginLoaderMixin._attribute_registrations.<locals>._keysu  s)   ø€ Ù#0ÓC¡=˜a·F±F¸d±N”E�A—E”E¡=ÑCÐCùÒCs   †0�0ÚtoolÚhookÚ
middlewareÚcommandz[  registered: %d tool(s), %d hook(s), %d middleware, %d slash command(s), %d CLI command(s)c              3  óD   <"  € T F  qS! R 4      9   g   K  ^x € K  	  R# 5i)Úcli_commandNr$   )ræ   Úcr®  s   & €r,   rè   Ú=PluginLoaderMixin._attribute_registrations.<locals>.<genexpr>ƒ  s   øé € ÐKÑ-�a±e¸MÓ6JÑ1J—’Ó-ùs   ƒ –
 )rd  rU   Úactiver"  r„   r   r!  Úhooks_registeredÚmiddleware_registeredÚcommands_registeredrC   r  rP   ÚsumÚ_cli_commands)
r³   r×   rU   ro  rp  rR   ÚpredeclaredÚkr®  r­  s
   &&&&    @@r,   rh  Ú*PluginLoaderMixin._attribute_registrationsl  sE  ù€ ð
 ×/Ñ/Ð0BÐ0CÑDó
ÙD�!Ø�|‰|˜zÑ)ô Ø./¯h­h÷ ˆAÑDñ
ˆ÷
	Dð 	Dð
 #'×"9Ñ"9×"=Ñ"=¸jÈ"Ô"MÓnÑ"M˜QÐVZ×VmÑVmÑQm—q�qÑ"MˆÐnØ"-¹EÀ&¼MÓ0b¹M°qÐVaÑMa·°¹MÑ0bÕ"bˆÔÙ"'¨£-ˆÔÙ',¨\Ó':ˆÔ$Ù%*¨9Ó%5ˆÔ"Ü�‰ØiÜ�×'Ñ'Ó(¬#¨f×.EÑ.EÓ*FÜ�×,Ñ,Ó-¬s°6×3MÑ3MÓ/NÜÔK˜4×-Ò-ÓKÓKö		
ùò
ùò oùÚ0bs(   ”E'¬E'Á E'Á0E,ÂE,ÂE1Â'E1c               ó$   € V ^8„  d   QhRRRRRR/# r  r$   )r2   s   "r,   r3   r©   †  s"   € ÷ 4+ñ 4+¨nð 4+Àlð 4+ÐW[ñ 4+r+   c           
     ó\  a aa€ ^ RI Hp \        V4      p ^ RIHp V! \        VP                  4      \        4       R,          VP                  ,          4      pV! VS 4      pVP                   F.  p\        P                  RWHP                  VP                  4       K0  	  VP                   F@  p	 VP                  V	P                   V	P"                  V	P$                  V	P&                  4       KB  	  ^ RIHoHp ^ RIHo . p VP2                  P5                  4        FÚ  w  rÞ\7        WM4      pVS P8                  9   d4   \        P                  R	WOS P:                  P=                  VR
4      4       KT  \?        V4      S P8                  V&   VS P:                  V&   VP@                  P=                  V4      pVe0   SPC                  VVP0                  4       V! VVPD                  4       VPG                  V4       KÜ  	  V F%  pV3R VVV 3R lllpS PI                  VRVV4       K'  	  RVn%        TS PX                  T&   R#   \(         d.   p
\        P                  RYIP                   T
4        Rp
?
EKÃ  Rp
?
ii ; i  \L         d]    T FT  pS P8                  PO                  TR4       S P:                  PO                  TR4       SPQ                  T4       S! T4       KV  	  h i ; i  \(        \R        3 d;   p
\U        T
4      Tn+        \        P                  RYBPV                  4        Rp
?
LüRp
?
ii ; i)zALoad validated portable components without importing Python code.r“  )Úload_agent_pluginzplugin-datazAgent Plugin '%s' [%s]: %sz(Agent Plugin '%s' skill '%s' skipped: %sN)Ú_clear_livenessÚ_set_liveness)Údeclarationz_Agent Plugin '%s' MCP server '%s' skipped: name already taken by plugin '%s'; rename one serverÚ?c               ó    € V ^8„  d   QhRRRR/# )r/   rk   rV   r0   rL   r$   )r2   s   "r,   r3   Ú=PluginLoaderMixin._load_portable_plugin.<locals>.__annotate__¨  s   € ÷ .ñ . cð .¸dñ .r+   c                óª   <€ SP                   P                  V R 4       SP                  P                  V R 4       SP                  V 4       S! V 4       R # r]   )Ú_portable_mcp_serversr„   Ú_portable_mcp_server_pluginsÚ
unregister)rk   rÄ  rÆ  r³   s   &€€€r,   ÚreleaseÚ8PluginLoaderMixin._load_portable_plugin.<locals>.release¨  sE   ø€ Ø×2Ñ2×6Ñ6°t¸TÔBØ×9Ñ9×=Ñ=¸dÀDÔIØ#×.Ñ.¨tÔ4Ù'¨Ö-r+   Úportable_mcpTzAgent Plugin '%s' disabled: %s)-rÑ   r   r   Úhermes_cli.agent_pluginsrÃ  r   rÉ   r   Úskill_namespaceÚdiagnosticsrC   rD   rf   ÚmessageÚskillsÚregister_skillrk   Úskill_mdÚdescriptionÚfrontmatterrE   rÄ  rÅ  Úhermes_platformrÆ  Úmcp_serversÚitemsr   rË  rÌ  r5   r@   Úserver_declarationsrR  Úlivenessr_   r¢  rÏ   r`   r„   rÍ  r•   r—   rä   rÒ   )r³   rÅ   r×   r   rÖ   rÃ  ÚpackagerW   Ú
diagnosticÚskillrc   rÅ  r#  Úserver_namerA  Úinternal_nameÚserver_declrÎ  rÄ  rÆ  s   f&&               @@r,   rc  Ú'PluginLoaderMixin._load_portable_plugin†  s¼  ú€ å4Ü! (Ó+ˆ
ð/	WÝBÙ'Ü�X—]‘]Ó#¤_Ó%6¸Õ%FÈ×IaÑIaÕ%aócˆGá ¨$Ó/ˆCØ%×1Ô1�
Ü—‘Ð;¸Z×IYÑIYÐ[e×[mÑ[mÖnñ 2à Ÿœ�ðlØ×&Ñ& u§z¡z°5·>±>À5×CTÑCTÐV[×VgÑVgÖhñ (÷
 PÝ3Ø$&ˆJðØ+2×+>Ñ+>×+DÑ+DÖ+FÑ'�KÜ$<¸ZÓ$U�MØ$¨×(BÑ(BÔBÜŸ™ð  (IØ'1À$×BcÑBc×BgÑBgÐhuÐwzÓB{ô}á Ü@DÀVÃ�D×.Ñ.¨}Ñ=ØGQ�D×5Ñ5°mÑDØ")×"=Ñ"=×"AÑ"AÀ+Ó"N�KØ"Ò.Ø#×,Ñ,¨]¸K×<SÑ<SÔTÙ% m°[×5IÑ5IÔJØ×%Ñ% mÖ4ñ ,Gó &0�MØ,9÷ .ô .ð ×,Ñ,¨X°~À}ÐV]Ö^ñ &0ð "&�”ð %+ˆ�‰�jÓ!øôM !ô lÜ—N‘NÐ#MÈz×[eÑ[eÐgj×kÓkûðlûô8 !ô Û%/�MØ×.Ñ.×2Ñ2°=À$ÔGØ×5Ñ5×9Ñ9¸-ÈÔNØ×*Ñ*¨=Ô9Ù# MÖ2ñ	 &0ð
 ðûô œ:Ð&ô 	WÜ+¨CÓ0ˆFŒLÜ�N‰NÐ;¸ZÏÉ×VÑVûð	WúsV   –BK  Â/<H;Ã+K  Ä D*I6 È;I3É!I.É'K  É.I3É3K  É6A'KËK  Ë L+Ë10L&Ì&L+c               ó    € V ^8„  d   QhRRRR/# rÄ   r$   )r2   s   "r,   r3   r©   ¼  s   € ÷ 	1ñ 	1¨~ð 	1À#ñ 	1r+   c                óÒ  € \        V4      P                  RR4      P                  RR4      p\         RV 2p\        ;_uu_ 4        \        P                  W0P                  4      V P                  8X  d   VuuRRR4       # \        P                  ! V P                  P                  R4      4      P                  4       R,          pV R	V 2uuRRR4       #   + '       g   i     R# ; i)
z®Profile-safe import namespace for a directory plugin: the bare ``hermes_plugins.<slug>`` for the
first scope that claims it, a ``__home_<digest>`` suffix for any other scope.Ú/Ú__Ú-Ú_r   Nzutf-8:Né   NÚ__home_)r   ÚreplaceÚ
_NS_PARENTÚ_MODULE_NAMESPACE_LOCKr   Ú
setdefaultr  ÚhashlibÚsha256ÚencodeÚ	hexdigest)r³   rÅ   ÚslugÚ	bare_nameÚdigests   &&   r,   Ú_directory_module_nameÚ(PluginLoaderMixin._directory_module_name¼  s¯   € ô ˜HÓ%×-Ñ-¨c°4Ó8×@Ñ@ÀÀcÓJˆÜ!�l ! D 6Ð*ˆ	ß#Ö#Ü!×,Ñ,¨Y¿¹ÓGÈ4Ï>É>ÔYØ ÷ $Ò#ô —^’^ D§N¡N×$9Ñ$9¸'Ó$BÓC×MÑMÓOÐPSÕTˆFØ�[ ¨ xÐ0÷	 $×#×#Ó#ús   Á0CÂ A
CÃC&	c               ó    € V ^8„  d   QhRRRR/# rÄ   r$   )r2   s   "r,   r3   r©   Ç  s   € ÷ 5ñ 5¨Nð 5¸sñ 5r+   c                óð   € VP                   R8X  dV   VP                  '       dD   \        VP                  4      P                  R4      ^ ,          P	                  4       pV'       d   V# V P                  V4      # )z?Return the module prefix whose callbacks inherit plugin policy.rQ  Ú:)rY  rÉ   rV   Ú	partitionrž   rù  )r³   rÅ   r}   s   && r,   re  Ú%PluginLoaderMixin._policy_module_nameÇ  sW   € à�?‰?˜lÔ*¨x¯}¯}¨}Ü˜hŸm™mÓ,×6Ñ6°sÓ;¸AÕ>×DÑDÓFˆKßØ"Ð"Ø×*Ñ*¨8Ó4Ð4r+   r}   Nc               ó$   € V ^8„  d   QhRRRRRR/# )r/   rÅ   r   r}   zOptional[str]r0   ztypes.ModuleTyper$   )r2   s   "r,   r3   r©   Ï  s$   € ÷ #ñ #Ø&ð#Ø8Eð#à	ñ#r+   c               ó$  € \        VP                  4      pVR,          pVP                  4       '       g   \        RV 24      h\        \
        P                  9  dD   \        P                  ! \        4      p. Vn	        \        Vn
        V\
        P                  \        &   T;'       g    V P                  V4      p\        V4       \        P                  P                  W$\!        V4      .R7      pVe   VP"                  f   \%        RV 24      h\        P                  P'                  V4      pW'n
        \!        V4      .Vn	        V\
        P                  V&    VP"                  P)                  V4       V#   \*         d    \        T4       h i ; i)z�Import a directory plugin as ``hermes_plugins.<slug>`` (slug from ``manifest.key`` so
``image_gen/openai`` cannot collide with ``tts/openai``).rv  zNo __init__.py in )Úsubmodule_search_locationszCannot create module spec for )r   rÉ   ÚexistsÚFileNotFoundErrorrï  r�   r‚   r[  r\  Ú__path__Ú__package__rù  r†   rŸ   ÚutilÚspec_from_file_locationrV   ÚloaderÚImportErrorÚmodule_from_specÚexec_moduler`   )r³   rÅ   r}   r0  Ú	init_fileÚns_pkgÚspecr+  s   &&$     r,   r*  Ú(PluginLoaderMixin._load_directory_moduleÏ  sR  € ô
 ˜(Ÿ-™-Ó(ˆ
Ø Õ.ˆ	Ø×Ñ×!Ò!Ü#Ð&8¸¸Ð$EÓFÐFÜœSŸ[™[Ô(Ü×%Ò%¤jÓ1ˆFØ ˆFŒOÜ!+ˆFÔØ&,ŒC�K‰Kœ
Ñ#Ø!×JÐJ T×%@Ñ%@ÀÓ%Jˆô
 	�{Ô#Ü�~‰~×5Ñ5ØÄÀJÃÐ?Pð 6ó RˆàŠ<˜4Ÿ;™;Ò.ÜÐ >¸y¸kÐJÓKÐKÜ—‘×0Ñ0°Ó6ˆØ(ÔÜ˜z›?Ð+ˆŒØ#)Œ�‰�KÑ ð	Ø�K‰K×#Ñ# FÔ+ð ˆøô ô 	ô ˜;Ô'Øð		ús   ÅE7 Å7Fc               ó    € V ^8„  d   QhRRRR/# )r/   rÅ   r   r0   z%types.ModuleType | Callable[..., Any]r$   )r2   s   "r,   r3   r©   ô  s   € ÷ fñ f°ð fÐChñ fr+   c                ó  € \        \        P                  P                  4       \        4       F0  pVP
                  VP
                  8X  g   K   VP                  4       u # 	  \        RVP
                   R\         R24      h)z¶Load a pip-installed plugin via its entry-point reference: the module for a bare ``module`` target,
the referenced attribute (normally ``register``) for the ``module:function`` form.zEntry point 'z' not found in group 'Ú')r   rŸ   r    Úentry_pointsr   rk   rí   r
  )r³   rÅ   Úeps   && r,   rZ  Ú)PluginLoaderMixin._load_entrypoint_moduleô  sf   € ô ,¬I×,>Ñ,>×,KÑ,KÓ,MÔOaÖbˆBØ�w‰w˜(Ÿ-™-Ö'Ø—w‘w“yÒ ñ cô ˜M¨(¯-©-¨Ð8NÔOaÐNbÐbcÐdÓeÐer+   )r‹  )r%   r&   r'   r(   r´   rÁ   ÚstaticmethodrÊ   rØ   r÷   rŽ   rÓ   rÕ   r;  rF  rÔ   r  rW  rV  rg  rX  rf  rh  rc  rù  re  r*  rZ  r*   r$   r+   r,   r¦   r¦   Ö   s¾   † õõ4\ð ôCó ðCõAõ ð. ô!ó ð!õFVõp^õ(Gõ*/õ
W+ðr ôMó ðMõMõSõ
õjõ&
õ44+õl	1õ5ð#ØHL÷#÷Jfñ fr+   r¦   )MÚ__conditional_annotations__r)   Ú
__future__r   rq   rò  rŸ   Úimportlib.metadataÚimportlib.utilÚloggingrœ   r�   ro   r[  Ú
contextlibr   Ú	functoolsr   Úpathlibr   Útypingr   r   r	   r
   r   r   r   r   Úhermes_constantsr   r   r   Úregistration_lifecycler   rî   r   r   rï   r   r   r   r   Úhermes_cli.plugins_stater   rÑ   r   r   Ú	getLoggerrC   rï  ÚRLockrð  r   Ú__annotations__r=   rF   rQ   rt   r   ÚLockrN   rŽ  Ú
ContextVarr!   rE   r#   r6   rI   rS   r{   r†   rŽ   r’   r—   r¤   r¦   )r  s   @r,   Ú<module>r)     s@  øðôõ #ã Û Û Û Û Û Û 	Û 
Û Û Ý %Ý Ý ß U× UÓ Uç bÑ bÝ :ß Vß vÓ vÝ ;çß>à	×	Ò	Ð/Ó	0€à€
Ø"ŸšÓ*Ð Ø%'Ð �NÓ 'ð Ð ØÐ ØÐ Ø&Ð Ø-/Ð Ð*Ó /Ø#Ÿ.š.Ó*Ð à$Ÿ>š>Ó+Ð àIT×I_ÒI_Ø¨ôJ€ÐFó ô
e˜	ô eõ-õ
õ2õ/õd(ò"ð ô*ó ð*õõ÷dfó dfr+   