§
    ­eîi<  ã                   ó~   — d Z ddlZddlmZmZ ddlmZmZmZm	Z	m
Z
mZmZ ddlmZmZ  G d„ deej        ¦  «        ZdS )z2Base classes and interfaces for FastMCP resources.é    N)Ú	AnnotatedÚAny)ÚAnyUrlÚ	BaseModelÚ
ConfigDictÚFieldÚUrlConstraintsÚValidationInfoÚfield_validator)ÚAnnotationsÚIconc                   ó.  — e Zd ZU dZ ed¬¦  «        Z edd¬¦  «        Zee	 e
d¬¦  «        f         ed	<    ed
d¬¦  «        Zedz  ed<    edd¬¦  «        Zedz  ed<    edd¬¦  «        Zedz  ed<    eddd¬¦  «        Zeed<    edd¬¦  «        Zee         dz  ed<    edd¬¦  «        Zedz  ed<    edd¬¦  «        Zeeef         dz  ed<    edd¬¦  «        ededz  ded efd!„¦   «         ¦   «         Zej        d eez  fd"„¦   «         Z dS )#ÚResourcezBase class for all resources.T)Úvalidate_default.zURI of the resource)ÚdefaultÚdescriptionF)Úhost_requiredÚurizName of the resourceN)r   r   Únamez$Human-readable title of the resourceÚtitlezDescription of the resourcer   z
text/plainz!MIME type of the resource contentzG^[a-zA-Z0-9]+/[a-zA-Z0-9\-+.]+(;\s*[a-zA-Z0-9\-_.]+=[a-zA-Z0-9\-_.]+)*$)r   r   ÚpatternÚ	mime_typez(Optional list of icons for this resourceÚiconsz%Optional annotations for the resourceÚannotationsz#Optional metadata for this resourceÚmetaÚbefore)ÚmodeÚinfoÚreturnc                 ó~   — |r|S |j                              d¦  «        x}rt          |¦  «        S t          d¦  «        ‚)z*Set default name from URI if not provided.r   z#Either name or uri must be provided)ÚdataÚgetÚstrÚ
ValueError)Úclsr   r   r   s       úe/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/mcp/server/fastmcp/resources/base.pyÚset_default_namezResource.set_default_name%   sF   € ð ð 	ØˆKØ”)—-’- Ñ&Ô&Ð&ˆ3ð 	Ý�s‘8”8ˆOÝÐ>Ñ?Ô?Ð?ó    c              ƒ   ó
   K  — dS )zRead the resource content.N© )Úselfs    r&   ÚreadzResource.read/   s   è è € ð 	ˆr(   )!Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úmodel_configr   r   r   r   r	   Ú__annotations__r   r#   r   r   r   r   Úlistr   r   r   r   Údictr   r   Úclassmethodr
   r'   ÚabcÚabstractmethodÚbytesr,   r*   r(   r&   r   r      s  € € € € € € Ø'Ð'à�:¨tÐ4Ñ4Ô4€LàBGÀ%ÐPSÐavÐBwÑBwÔBw€Cˆ�6˜>˜>¸Ð>Ñ>Ô>Ð>Ô	?ÐwÐwÑwØ�uÐ)?ÈÐNÑNÔN€Dˆ#�‰*ÐNÐNÑNØ˜Ð*PÐZ^Ð_Ñ_Ô_€Eˆ3�‰:Ð_Ð_Ñ_Ø#˜eÐ0MÐW[Ð\Ñ\Ô\€K��t‘Ð\Ð\Ñ\Ø�UØØ7ØZðñ ô €Iˆsð ð ñ ð
  %˜u¨TÐ?iÐjÑjÔj€Eˆ4�Œ:˜ÑÐjÐjÑjØ&+ e°DÐFmÐ&nÑ&nÔ&n€K�˜tÑ#ÐnÐnÑnØ"' %°ÐBgÐ"hÑ"hÔ"h€Dˆ$ˆs�CˆxŒ.˜4Ñ
ÐhÐhÑhà€_�V (Ð+Ñ+Ô+Øð@ C¨$¡Jð @°nð @Èð @ð @ð @ñ „[ñ ,Ô+ð@ð 	Ôð˜C %™Kð ð ð ñ Ôðð ð r(   r   )r0   r6   Útypingr   r   Úpydanticr   r   r   r   r	   r
   r   Ú	mcp.typesr   r   ÚABCr   r*   r(   r&   ú<module>r=      sØ   ðØ 8Ð 8à 
€
€
€
Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð (Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ˆy˜#œ'ñ ô ð ð ð r(   