+
    „WÝjÍ  ã                  óº   € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHtH	t	H
t
 ]P                  ! ]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# )a"  Make an installed plugin's MCP servers and skills usable in THIS process now (#87770 follow-up).

:func:`hermes_cli.plugins_activation.activate_plugin_now` loads the plugin; skills are live from that
point (``skill_view`` resolves ``<plugin>:<skill>``). MCP servers are not: nothing connects them until
``reload.mcp``. :func:`connect_plugin_mcp` connects the plugin's servers one by one (the connector
flow's ``register_mcp_servers({name: config})``), and :func:`live_notice` renders what became usable
as the note an open chat receives on its next tool result or turn (``agent/plugin_live_notes.py``).

MCP tools are deferred behind ``tool_search`` / ``tool_describe`` / ``tool_call``, so adding them to a
live session leaves the model-facing tool array (and the cached prompt prefix) byte-identical.
)ÚannotationsN)ÚPath)ÚAnyÚDictÚListÚOptionalc               ó$   € V ^8„  d   QhRRRRRR/# )é   Ú
activationúdict[str, Any]Úportablezdict[str, dict[str, Any]]Úreturnzlist[dict[str, Any]]© )Úformats   "ÚVC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\plugins_activation_live.pyÚ__annotate__r      s#   € ÷ "ñ " >ð "Ð=Vð "Ð[oñ "ó    c                óú  € \        V P                  R4      ;'       g    / P                  R4      ;'       g    R4      pV'       g   . #  ^ RIHpHp ^ RIHp V! 4       p. p	T Fý  p
TP                  T
4      ;'       g(    T! Y¡9   d   Y¡T
,          /M/ 4      P                  T
4      p\        T\        4      '       g   T	P                  RT
RRR	. R
R/4       Kt   T! Y«/4       ^ RIHp T! T
4       Uu. uF%  qÝP!                  \#        4       4      '       d   K#  TNK'  	  ppRT
R\%        T4      R	T/pT'       g   \'        T
4      ;'       g    RTR
&   T	P                  T4       Kÿ  	  T	#   \         dJ   p\        P                  RT4       T Uu. uF  pRTRRR	. R
\        T4      /NK  	  Mu upi upu Rp?# Rp?ii ; iu upi   \         d/   pT	P                  RT
RRR	. R
\        T4      /4        Rp?EK“  Rp?ii ; i)aB  Connect every portable MCP server ``activation`` defers, under the caller's profile scope.
``portable`` is the manager's portable server configs, read together with ``activation``.

Returns ``[{name, connected, tools, error?}]``, one row per server; a server that fails to
connect is reported, never retried. Never raises.ÚdeferredÚmcp_servers)Ú_filter_suspicious_mcp_serversÚ_load_mcp_config)Úregister_mcp_serversz6plugin MCP activation could not read server config: %sÚnameÚ	connectedFÚtoolsÚerrorNzno MCP configuration)Ú_registered_tool_nameszthe server did not connectr   )ÚlistÚgetÚtools.mcp_tool_configr   r   Útools.mcp_tool_discoveryr   Ú	ExceptionÚloggerÚwarningÚstrÚ
isinstanceÚdictÚappendÚtools.connectors.mcpr   ÚendswithÚ_utility_suffixesÚboolÚ_server_error)r
   r   Únamesr   r   r   Ú
configuredÚexcÚnÚrowsr   Úconfigr   Útr   Úrows   &&              r   Úconnect_plugin_mcpr6      sÜ  € ô �*—.‘. Ó,×2Ð2°×7Ñ7¸ÓF×LÐLÈ"ÓM€EßØˆ	ð`ßZÝAÙ%Ó'ˆ
ð €DÛˆØ—‘ Ó%÷ Jð JÑ)GØ&*Ô&6ˆT˜D•>Ñ"¸Bó*@ß@CÁÀDÃ	ð 	ä˜&¤$×'Ò'Ø�K‰K˜  {°E¸7ÀBÈÐQgÐhÔiÙð	Ù  $ Ô0ÝCÙ 6°tÔ <ÓdÑ <˜1ÇJÁJÔO`ÓOb×Dc—Q�QÑ <ˆEÐdð  & t¨[¼$¸u»+ÀwÐPUÐVˆßÜ(¨Ó.×NÐNÐ2NˆC�‰LØ�‰�CÖñ! ð" €Køô+ ô `Ü�‰ÐOÐQTÔUÙY^Ó_ÑY^ÐTU�˜˜K¨°¸¸WÄcÈ#ÃhÓOÒY^ùÔ_Õ_ûð`üò eøÜô 	Ø�K‰K˜  {°E¸7ÀBÈÔQTÐUXÓQYÐZÔ[Þûð	úsZ   Á	E% ÃGÃ0 F<ÄF<ÄGÅ%F9Å0F4Æ
F'Æ&F4Æ.F9Æ4F9Æ<GÇG:Ç"G5Ç5G:c               ó   € V ^8„  d   QhRR/# )r	   r   Útupler   )r   s   "r   r   r   :   s   € ÷ Dñ D˜5ñ Dr   c                 óf   € ^ RI Hp  \        ;QJ d    . R V  4       F  NK  	  5# ! R V  4       4      # )z½The resource/prompt wrappers every MCP server gets (``mcp__x__list_resources``, ...): callable,
but they say nothing about what the plugin does, so they are left out of counts and listings.©Ú_UTILITY_HANDLER_FACTORIESc              3  ó,   "  € T F
  pR V 2x € K  	  R# 5i)Ú_Nr   )Ú.0Úkinds   & r   Ú	<genexpr>Ú$_utility_suffixes.<locals>.<genexpr>>   s   é € ÐCÑ(B �1�T�F•Ó(Bùs   ‚)Útools.mcp_tool_registrationr;   r8   r:   s    r   r+   r+   :   s,   € õ GßŒ5ÑCÑ(BÓC�5ÐCˆ5ÑCÑ(BÓCÓCÐCr   c               ó    € V ^8„  d   QhRRRR/# )r	   r   r%   r   úOptional[str]r   )r   s   "r   r   r   A   s   € ÷ ñ ˜ð  ñ r   c                ó¦   €  ^ RI Hp V! 4        F,  pVP                  R4      V 8X  g   K  VP                  R4      u # 	  R#   \         d     R# i ; i)é    )Úget_mcp_statusr   r   N)r!   rG   r   r"   )r   rG   Úentrys   &  r   r-   r-   A   sP   € ðÝ;Ù#Ö%ˆEØ�y‰y˜Ó  DÖ(Ø—y‘y Ó)Ò)ñ &ñ
 øô ô Úðús   ‚#A ªA ½A ÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r	   Ú
plugin_keyr%   r   zlist[dict[str, str]]r   )r   s   "r   r   r   L   s   € ÷ eñ e˜cð eÐ&:ñ er   c                ó:  €  ^ RI Hp V! 4       P                  p\	        TP                  4       4       UUu. uFE  w  r4TP                  R4      T 8X  g   K  RTR\        TP                  R4      ;'       g    R4      /NKG  	  upp#   \         d    . u # i ; iu uppi )z```[{name, description}]`` for the skills ``plugin_key`` registered (qualified ``<ns>:<skill>``).©Úget_plugin_managerrJ   r   ÚdescriptionÚ )Úhermes_cli.pluginsrM   Ú_plugin_skillsr"   ÚsortedÚitemsr   r%   )rJ   rM   ÚskillsÚ	qualifiedrH   s   &    r   Úplugin_skillsrV   L   s™   € ðÝ9Ù#Ó%×4Ñ4ˆô %+¨6¯<©<«>Ô$:ôeÙ$:Ñ �	¸e¿i¹iÈÓ>UÐYcÑ>cô TˆV�Y ¬s°5·9±9¸]Ó3K×3QÐ3QÈrÓ/RÓSÙ$:òeð eøô ô ØŠ	ðüóes"   ‚B µBÁBÁ4BÂBÂBc               ó    € V ^8„  d   QhRRRR/# )r	   Úwrittenr%   r   rD   r   )r   s   "r   r   r   W   s   € ÷ _ñ _ #ð _¨-ñ _r   c                ó  a	a
€ ^ RI Hp ^ RIHp V P	                  R4      w  r4o	V! V4      pVf   R# V! 4       pVP
                  P                  4        UUu0 uFg  w  rxVP                  P                  '       g   K#  \        VP                  P                  4      P                  4       VP                  4       8X  g   Ke  VkKi  	  uppo
\        V	V
3R l\        VP                  P                  4       4       4       R4      # u uppi )a›  The registered name of a plugin skill written ``<catalog-name>:<skill>`` (``blender:blender``), or
None when that catalog plugin is not installed in this profile or registered no such skill. A
portable plugin's skills register under a collision-resistant namespace
(``agent-plugin-<slug>-<sha8>:<skill>``, ``hermes_cli/plugins_manifest.py``), so the readable form
is never itself a name ``skill_view`` resolves.rL   )Ú_catalog_installed_dirÚ:Nc              3  óŒ   <"  € T F9  w  rVP                  R 4      S9   g   K  VP                  R4      S8X  g   K5  Vx € K;  	  R# 5i)rJ   Ú	bare_nameN©r   )r>   rU   rH   ÚbareÚkeyss   &  €€r   r@   Ú'catalog_plugin_skill.<locals>.<genexpr>f   sF   øé € ð XÑ3YÑ/˜yØ—I‘I˜lÓ+¨tÑ3ô Ø8=¿	¹	À+Ó8NÐRVÑ8V÷ ’Ó3Yùs   ƒA¢Aº
A)rP   rM   Úhermes_cli.plugins_cmdrZ   Ú	partitionÚ_pluginsrS   ÚmanifestÚpathr   ÚresolveÚnextrR   rQ   )rX   rM   rZ   Úcatalog_namer=   ÚtargetÚmanagerÚkeyÚloadedr_   r`   s   &        @@r   Úcatalog_plugin_skillrn   W   sâ   ù€ õ 6Ý=Ø#×-Ñ-¨cÓ2Ñ€L�TÙ# LÓ1€FØ‚~ÙÙ Ó"€GØ#*×#3Ñ#3×#9Ñ#9Ô#;ô bÑ#;‘K�CØ�‰×#Õ#ô Ü(,¨V¯_©_×-AÑ-AÓ(B×(JÑ(JÓ(LÐPV×P^ÑP^ÓP`Ñ(`÷ ˆCÑ#;ò b€Däõ X´6¸'×:PÑ:P×:VÑ:VÓ:XÔ3Yó XØY]ó_ð _ùób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   j   s   € ÷ "ñ "˜Nð "¨sñ "r   c                óÐ  € V P                  R4      ;'       g    / pVP                  R4      ;'       g    . VP                  R4      ;'       g    . r2V'       g   V'       g   R# V P                  R4      ;'       g    V P                  R4      pRV R2.pVP                  R	 V 4       4       V F–  pVP                  R
4      '       dE   VP                  RVR,           R\        VR,          4       R\	        VR,          4       R24       K^  TP                  RVR,           RVP                  R4      ;'       g    R R24       K˜  	  \
        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   VP                  R4       V P                  R4      ;'       g    / pVP                  R4      '       d   \        VR,          4       R2MRVP                  R4      '       d   \        VR,          4       R2MR.p\        V4      '       d6   VP                  RRP                  R V 4       4      ,           R,           4       R P                  V4      R!,           # )"aw  The note an open chat gets on its next tool result or turn (``agent/plugin_live_notes.py``): the
plugin's skills and, per MCP server, its tool prefix and count or why it did not connect. Tools are
not listed one by one: the note stays in the chat's history and rides every later request, and
``tool_search`` lists them on demand. Empty when nothing of the plugin is live now.Úlive_nowr   rT   rO   r   rl   z[System note: plugin zM was installed and is live in this chat now (a Hermes note, not tool output).c              3  ó<   "  € T F  pR VR,           R2x € K  	  R# 5i)z- Skill r   z: load it with skill_view.Nr   )r>   Úskills   & r   r@   Úlive_notice.<locals>.<genexpr>v   s    é € ÐZÑSYÈ%�8˜E &�M˜?Ð*DÕEÓSYùs   ‚r   z- MCP server z: r   z tools, z*.z: not connected (r   zunknown errorz).c              3  óB   "  € T F  qP                  R 4      x € K  	  R# 5i)r   Nr^   )r>   Úservers   & r   r@   rt   }   s   é € Ð
9± v�:‰:�k×"Ð"³ùs   ‚TFzkIts MCP tools are deferred: find them with tool_search, read one with tool_describe, run it with tool_call.r   z Python toolsÚpromptz prompt sectionszNext session: z, c              3  ó8   "  € T F  q'       g   K  Vx € K  	  R # 5i)Nr   )r>   Úps   & r   r@   rt   „   s   é € Ð1H¹U¸Ãa·!²!»Uùs   ‚	�
Ú.Ú
Ú])r   Úextendr(   ÚlenÚ_tool_prefixÚanyÚjoin)	r
   ÚliveÚserversrT   r   Úlinesrv   r   Úlaters	   &        r   Úlive_noticer†   j   s  € ð
 �>‰>˜*Ó%×+Ð+¨€DØ—h‘h˜}Ó-×3Ð3°°T·X±X¸hÓ5G×5MÐ5MÈ2ˆVßŸ6ÙØ�>‰>˜&Ó!×:Ð: Z§^¡^°EÓ%:€DØ$ T Fð +!ð !ð "€Eà	‡L�LÑZÑSYÓZÔZÛˆØ�:‰:�k×"Ò"Ø�L‰L˜=¨°­Ð(8¸¼3¸vÀg½Ó;OÐ:PÐPXÜ(¨°­Ó8Ð9¸ð=ö >ð �L‰L˜=¨°­Ð(8Ð8IÈ&Ï*É*ÐU\ÓJ]×JpÐJpÐapÐIqÐqsÐtÖuñ ÷ ƒsÑ
9±Ó
9‡s‡s‚sÑ
9±Ó
9×9Ò9Ø�‰ð .ô 	/à�~‰~˜jÓ)×/Ð/¨R€HØ9A¿¹Àg×9NÒ9N”�H˜WÕ%Ó&Ð' }Ñ5ÐTVØ=E¿\¹\È(×=SÒ=S”�H˜XÕ&Ó'Ð(Ð(8Ñ9ÐY[ð]€Eä
ˆ5‡z‚zØ�‰Ð%¨¯	©	Ñ1H¹UÓ1HÓ(HÕHÈ3ÕNÔOØ�9‰9�UÓ˜cÕ!Ð!r   c               ó    € V ^8„  d   QhRRRR/# )r	   rv   r%   r   r   )r   s   "r   r   r   ˆ   s   € ÷ Lñ L˜ð L ñ Lr   c                ó,   € ^ RI HpHp V V! V 4       R2# )zK``mcp__<server>__``: the start of every registered tool name of ``server``.)ÚMCP_TOOL_NAME_PREFIXÚsanitize_mcp_name_componentÚ__)Útools.mcp_tool_schemar‰   rŠ   )rv   r‰   rŠ   s   &  r   r   r   ˆ   s   € çWØ"Ð#Ñ$?ÀÓ$GÐ#HÈÐKÐKr   )Ú__doc__Ú
__future__r   ÚloggingÚpathlibr   Útypingr   r   r   r   Ú	getLoggerÚ__name__r#   r6   r+   r-   rV   rn   r†   r   r   r   r   Ú<module>r”      sS   ðñ
õ #ã Ý ß ,Ó ,à	×	Ò	˜8Ó	$€õ"õJDõõeõ_õ&"÷<Lr   