+
    lHàj`"  ã                  ó¨  € R t ^ RIHt ^ RIt^ RIHtHtHtHtH	t	 ^ RI
Ht R1tR2t]! 0 R3m4      t]! RR
04      t^
tRtRtRRRRRRRRRRRR]! ]4      /RRRR]! ]4      RR/RRRRR/RRRRRRRRRRRRR]! ]4      /R
RRRR//RRR
.RR//R	RRRR//RR.RR//tR  R! ltR"RR#RR$RR%RR&R/R' R( lltR&R/R) R* lltR&R/R+ R, lltR- R. ltR/ R0 ltR# )4a   ``manage_catalog``: a desktop chat's catalog search and install-through-the-card.

``search`` reads the plugin catalog (the Plugins tab's resolver) and the skills hub and says what is
already installed in this chat's profile. ``install`` opens the same connection operation
``manage_connections`` opens, with rows of kind ``plugin`` / ``skill``; the host installs each row
the user approves (``tools/connectors/catalog.py``). The model sends catalog ids and an action,
nothing else: the pin, scan, target profile and activation are the host's.
)ÚannotationsN)ÚAnyÚCallableÚDictÚListÚOptional)Ú
tool_errorÚactionÚkindÚqueryÚitemsÚreasonÚidzémanage_catalog is available only in the Hermes desktop app, where the approval card can be drawn. Tell the user to install from a terminal instead: `hermes plugins install <id>` for a plugin, `hermes skills install <id>` for a skill.a.  Settled once; do not re-offer a row the user skipped. Each installed row names target_profile: its tools and skills are live now in that profile's open chats and in every new chat of it; they are callable in this chat only when this chat runs in that profile. A failed row carries the reason in detail.ÚnameÚmanage_catalogÚdescriptiona¶  Find and install Hermes catalog plugins and hub skills for the user. 'search' lists matches (id, kind, display, tier, platforms, installed) and changes nothing. 'install' shows the user one approval card with a row per item and blocks until every row is installed, skipped or failed, or the card is closed; the host installs each approved row into this chat's profile at the catalog's reviewed version, and turns on a catalog plugin that is installed but not enabled. Pass only catalog ids exactly as 'search' returns them; the host decides the source, version, profile and settings, and the user can change them on the card. Offer an install only for something the user asked for or agreed to.Ú
parametersÚtypeÚobjectÚ
propertiesÚstringÚenumz0search only: limit results to plugins or skills.z1search only: words to match; empty lists plugins.Úarrayz<install only: the catalog items to offer, one card row each.z"Catalog id as 'search' returns it.ÚrequiredÚadditionalPropertiesFz0install only: one line on why these are offered.c               ó    € V ^8„  d   QhRRRR/# )é   Úargsúdict[str, Any]ÚreturnúOptional[str]© )Úformats   "ÚB/home/ubuntu/.hermes/hermes-agent/tools/connectors/catalog_tool.pyÚ__annotate__r$   L   s   € ÷ ñ �nð ¨ñ ó    c                ó>  € \        \        V 4      \        ,
          4      pV'       d   R RP                  V4       R2# V P	                  R4      \
        9  d   RRP                  \
        4       R2# V P	                  R4      R.\        O59  d   RRP                  \        4       R2# V R,          R	8X  d   R# V P	                  R
4      p\        V\        4      '       d	   V'       g   R# V F¯  p\        V\        4      '       g    R# \        \        V4      \        ,
          4      pV'       d   RRP                  V4       R2u # VP	                  R4      \        9  g;   \        VP	                  R4      ;'       g    R4      P                  4       '       d   K®   R# 	  R# )zunknown parameter(s) z, zu: manage_catalog takes action, kind, query, items and reason. The host decides source, version, profile and settings.r	   zaction must be one of Ú.r
   Nzkind must be one of Úsearchr   zGinstall needs 'items': [{"kind": "plugin", "id": "<catalog id>"}, ...].z#every item is an object {kind, id}.zunknown item field(s) zP: an item is {kind, id}. The host decides source, version, profile and settings.r   Ú z;every item needs kind (plugin or skill) and a non-empty id.)ÚsortedÚsetÚ	_TOP_KEYSÚjoinÚgetÚACTIONSÚ
ITEM_KINDSÚ
isinstanceÚlistÚdictÚ
_ITEM_KEYSÚstrÚstrip)r   Úunknownr   ÚitemÚextras   &    r#   Ú_check_argsr:   L   sR  € Ü”S˜“Y¤Õ*Ó+€GßØ'¨¯	©	°'Ó(:Ð';ð <\ð \ð 	]à‡x�x�Ó¤Ô(Ø'¨¯	©	´'Ó(:Ð';¸1Ð=Ð=Ø‡x�x�Ó Ð2¤zÑ2Ô2Ø% d§i¡i´
Ó&;Ð%<¸AÐ>Ð>ØˆH…~˜Ô!ÙØ�H‰H�WÓ€EÜ�eœT×"Ò"¯%Ù`ÛˆÜ˜$¤×%Ò%Ú8Ü”s˜4“y¤:Õ-Ó.ˆßØ,¨T¯Y©Y°uÓ-=Ð,>ð ?=ð =ò >à�8‰8�FÓ¤:Ô-´S¸¿¹À$»×9MÐ9MÈ2Ó5N×5TÑ5T×5VÔ5VÚPñ ñ r%   Ú
session_idÚtool_call_idÚconnection_callbackÚcard_surfaceÚ	installerc               ó4   € V ^8„  d   QhRRRRRRRRRR	R
RRR/# )r   r   r   r;   r    r<   r=   z3Optional[Callable[[dict[str, Any]], Optional[str]]]r>   Úboolr?   r   r   r5   r!   )r"   s   "r#   r$   r$   f   sZ   € ÷ Qñ QØ
ðQð ðQð  ð	Qð
 MðQð ðQð ðQð 	ñQr%   c          	     ód  € \        V 4      pV'       d   \        V4      # Ve	   V'       g   \        \        4      # V R,          R8X  dV   \        P                  ! \        \        V P                  R4      ;'       g    R4      V P                  R4      VR7      RR7      # \        V R	,          WW5R
7      # )zY``card_surface``: the session is a desktop chat, the one surface that draws catalog rows.r	   r(   r   r)   r
   )r?   F)Úensure_asciir   )r;   r<   r=   r?   )	r:   r   ÚNOT_HEREÚjsonÚdumpsr(   r5   r.   Úinstall)r   r;   r<   r=   r>   r?   Úerrors   &$$$$$ r#   r   r   f   s”   € ô ˜Ó€EßÜ˜%Ó Ð ØÒ"¯,Üœ(Ó#Ð#ØˆH…~˜Ô!Ü�zŠzœ&¤ T§X¡X¨gÓ%6×%<Ð%<¸"Ó!=¸t¿x¹xÈÓ?OÐ[dÔeØ',ô.ð 	.ä�4˜•=¨ZØ':ôQð Qr%   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r   r   zlist[dict[str, str]]r;   r    r<   r=   z)Callable[[dict[str, Any]], Optional[str]]r?   r   r   r5   r!   )r"   s   "r#   r$   r$   |   s;   € ÷ ñ Ð'ð ¸ð ÐUbð Ø!JðØWZðØfiñr%   c          	     óö  € ^ RI Hp ^ RIHp ^ RIHp ^ RIHpHp	 \        4       . rºV  Fm  pVR,          \        VR,          4      P                  4       3pWÚ9  g   K4  V
P                  V4       VP                  V! V^,          V^ ,          RR7      4       Ko  	  V! V4      p V	! W¸! VP                  VP                  \         R	7      V! V4      VVR
R7      VP#                  4        #   TP#                  4        i ; i)é    )Úopen_runner)Úoperation_session_key)ÚTarget)ÚKindÚrun_operationr
   r   rG   )r   r
   r	   )ÚprepareÚobserveÚnoteF)Úsession_keyr<   r=   Úwith_urls_in_result)Útools.connectors.catalogrL   Útools.connectors.gateway.configrM   Útools.connectors.operationrN   Útools.connectors.runrO   rP   r+   r5   r6   ÚaddÚappendrQ   rR   ÚNOTEÚclose)r   r;   r<   r=   r?   rL   rM   rN   rO   rP   ÚseenÚtargetsr8   ÚkeyÚrunners   &$$$$          r#   rG   rG   |   sÀ   € å4ÝEÝ1ß8ä“E˜2ˆ'ÛˆØ�F�|œS  d¥›_×2Ñ2Ó4Ð5ˆØŽ?Ø�H‰H�SŒMØ�N‰N™6 s¨1¥v°C¸µFÀ9ÔMÖNñ	 ñ
 ˜Ó#€FðÙØ�T &§.¡.¸&¿.¹.ÌtÔTÙ-¨jÓ9ÈØ 3Èô
ð 	�‰�øˆ�‰�ús   Â"3C& Ã&C8c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r   r5   r
   r    r?   r   r   r   r!   )r"   s   "r#   r$   r$   ”   s.   € ÷ 
Wñ 
W�#ð 
W˜]ð 
W¸#ð 
WÈñ 
Wr%   c               óÈ   € ^ RI HpHp . pVR9   d   V\        V 4      ,          pVR9   d)   V P	                  4       '       d   V\        V 4      ,          pRVRV! V! 4       4      /# )zhRuns on the tool call's thread, in this chat's profile scope, so ``installed`` is this
chat's profile's.)Úget_hermes_homeÚprofile_name_for_homeÚresultsÚinstalled_in)NÚplugin)NÚskill)Úhermes_constantsrd   re   Ú_plugin_rowsr6   Ú_skill_rows)r   r
   r?   rd   re   Úrowss   &&$   r#   r(   r(   ”   s^   € ÷ Hà!#€DØÐÔØ”˜UÓ#Õ#ˆØˆÔ 5§;¡;§=¢=Ø”˜EÓ"Õ"ˆØ�t˜^Ñ-BÁ?ÓCTÓ-UÐVÐVr%   c               ó    € V ^8„  d   QhRRRR/# ©r   r   r5   r   zlist[dict[str, Any]]r!   )r"   s   "r#   r$   r$   ¡   s   € ÷ Pñ P˜ð PÐ 4ñ Pr%   c                ó�  € ^ RI HpHp ^ RIHpHp ^ RIHp  V! 4       P                  4        Uu0 uF{  p\        V\        4      '       g   K  \        VP                  R4      \        4      '       g   KB  VR,          P                  R4      '       g   Kb  \        VR,          R,          4      kK}  	  ppV! V! 4       V 4      R\          Uu. uFU  pRVP                  RR	R
V! VP                  4      RVP                   R\#        VP$                  4      RVP                  V9   /NKW  	  up# u upi   T d    \        4       p L�i ; iu upi )rK   )Úfilter_entriesÚload_catalog_live)ÚPluginOperationErrorÚ_read_install_metadata)Ú_displayÚcatalogr   Nr   r
   rh   ÚdisplayÚtierÚ	platformsÚ	installed)Úhermes_cli.plugin_catalogrq   rr   Úhermes_cli.plugins_cmdrs   rt   rV   ru   Úvaluesr1   r3   r.   r5   r+   ÚSEARCH_LIMITr   rx   r2   ry   )	r   rq   rr   rs   rt   ru   Úrecrz   Úes	   &        r#   rk   rk   ¡   s#  € ßKßSÝ1ðÙ<RÓ<T×<[Ñ<[Ô<]ó wÑ<]°SÜ" 3¬×-ô 1Ü2<¸S¿W¹WÀYÓ=OÔQU×2Vô 1Ø[^Ð_hÕ[i×[mÑ[mÐnt×[uô 1”S˜˜Y�¨Õ/Ö0Ñ<]ˆ	ð wñ $Ñ$5Ó$7¸Ó?ÀÄÑNóPáN�ð �1—6‘6˜6 8¨Y¹ÀÇÁÓ8HÈ&ÐRS×RXÑRXØœ$˜qŸ{™{Ó+¨[¸!¿&¹&ÀIÑ:MóOáNñPð Pùò	wøàô Ü“EŠ	ðüòPs;   ˜D, ¯D'Á"D'Á3D'ÂD'Â0D, Ã	AEÄ'D, Ä,E Ä?E c               ó    € V ^8„  d   QhRRRR/# ro   r!   )r"   s   "r#   r$   r$   °   s   € ÷ 	dñ 	d�sð 	dÐ3ñ 	dr%   c                óˆ  € ^ RI Hp ^ RIHp ^ RIHpHp V! 4       P                  4        Uu0 uF  p\        VP                  R4      4      kK  	  ppV! W! V! 4       4      \        R7       Uu. uFE  pRVP                  RRR	VP                  R
VP                  R8X  d   RMRR. RVP                  V9   /NKG  	  up# u upi u upi )rK   )ÚHubLockFile)Ú
GitHubAuth)Úcreate_source_routerÚunified_searchÚ
identifier)Úlimitr   r
   ri   rw   rx   ÚofficialÚ	communityry   rz   )Útools.skills_hubrƒ   Útools.skills_hub_githubr„   Útools.skills_hub_searchr…   r†   Úlist_installedr5   r.   r~   r‡   r   Úsource)r   rƒ   r„   r…   r†   r€   rz   Úrs   &       r#   rl   rl   °   s¿   € Ý,Ý2ßLá3>³=×3OÑ3OÔ3QÓRÑ3Q¨a”�Q—U‘U˜<Ó(Ö)Ñ3Q€IÐRñ $ EÐ+?Á
ÃÓ+MÔUaÕbódñ c�ð �1—<‘< ¨°)¸Q¿V¹VØ 1§8¡8¨zÔ#9‘Z¸{ÈKÐY[Ø˜!Ÿ,™,¨)Ñ3ó5ñ cñdð dùò Sùòds   ¬#B:Á,AB?)r(   rG   )rh   ri   >   r
   r   r   r	   r   )Ú__doc__Ú
__future__r   rE   Útypingr   r   r   r   r   Útools.registryr   r/   r0   Ú	frozensetr,   r4   r~   rD   r\   r2   ÚMANAGE_CATALOG_SCHEMAr:   r   rG   r(   rk   rl   r!   r%   r#   Ú<module>r—      s©  ðñõ #ã ß 6Õ 6å %à
€Ø €
ÙÒDÓE€	Ù˜ �~Ó&€
Ø€ð0ð 	ðð ð ÐØð	Uð Ø�ØØ�v˜x¨±°g³Ð?Ø�V˜X v©t°JÓ/?Ø"Ð$VðXà�f˜h¨Ð7jÐkØØ˜ØÐ]ØØ˜HØ Ø ¨°6¹4À
Ó;KÐ LØ˜v x°Ð@dÐeð#ð  ¨ Ø*¨Eððð �v˜x¨Ð8jÐkð%
ð( 	�X�JØ ð/ð%Ð õPð4Qð !%ðQð #'ð	Qð
 PTðQð ðQð ÷Qð,Ø]a÷ð0
WÀ÷ 
WõP÷	dr%   