+
    Q(iDL                       a  R5 tF0 t R t^ RIHt ^ RIHt ^ RIHtHt ^ RI	t
^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHtHtHt ^ RIHtH t H!t! ^ RI"H#t#H$t$H%t% ^ RI&H't'H(t(H)t) ^ RI*H+t+H,t, ^ RI-H.t. ^ RI/H0t0 ].! ]1R7      t2] ^ k Rt3Rt4R6t5Rt6 ! R R]04      t7 ! R R]04      t8 ! R R]04      t9 ! R R]04      t: ! R R ]04      t; ! R! R"]4      t< ! R# R$]<4      t= ! R% R&]<4      t> ! R' R(]<4      t? ! R) R*]<4      t@ ! R+ R,]<4      tA ! R- R.]<4      tB ! R/ R0]04      tC ! R1 R2](4      tDR3 R4 ltER# )7z"A middleware for response caching.)Sequence)Logger)Any	TypedDictN)PydanticAdapter)AsyncKeyValue)MemoryStore)LimitSizeWrapper)StatisticsWrapperKVStoreCollectionStatistics)Field)NotRequiredSelfoverride)MessagePromptPromptResult)ResourceResourceContentResourceResult)CallNext
MiddlewareMiddlewareContext)Tool
ToolResult)
get_logger)FastMCPBaseModel)namei  i,  
__global__c                   8   a  ] tR t^&t o RtRtRtV 3R ltRtV t	R# )CachableResourceContentz1A wrapper for ResourceContent that can be cached.Nc                   < V ^8  d   Qh/ S[ S[,          ;R&   S[ R,          ;R&   S[S[ S[3,          R,          ;R&   # )   contentN	mime_typemeta)strbytesdictr   )format__classdict__s   "g/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/server/middleware/caching.py__annotate__$CachableResourceContent.__annotate__&   sA      5[  Tz 	 
 sCx.4
&      )
__name__
__module____qualname____firstlineno____doc__r%   r&   __annotate_func____static_attributes____classdictcell__r+   s   @r,   r!   r!   &   s     ; !I"&D  r/   r!   c                   t   a  ] tR t^.t o RtRtV 3R lR lt]V 3R lR l4       tV 3R lR lt	V 3R	 lt
R
tV tR# )CachableResourceResultz0A wrapper for ResourceResult that can be cached.Nc                    < V ^8  d   QhRS[ /# r#   returnint)r*   r+   s   "r,   r-   #CachableResourceResult.__annotate__4        + +# +r/   c                4    \        V P                  4       4      # Nlenmodel_dump_jsonselfs   &r,   get_sizeCachableResourceResult.get_size4       4'')**r/   c                &   < V ^8  d   QhRS[ RS[/# r#   valuer>   )r   r   )r*   r+   s   "r,   r-   rA   8   s     	
 	
 	
D 	
r/   c                    T ! VP                    Uu. uF/  p\        VP                  VP                  VP                  R 7      NK1  	  upVP                  R7      # u upi )r$   r%   r&   )contentsr&   )rR   r!   r$   r%   r&   )clsrO   items   && r,   wrapCachableResourceResult.wrap7   sZ    
 "NN	 +D ( LLDNN +	 
 	
s   5Ac                    < V ^8  d   QhRS[ /# r=   )r   )r*   r+   s   "r,   r-   rA   C   s     	
 	
 	
r/   c                    \        V P                   Uu. uF/  p\        VP                  VP                  VP
                  R 7      NK1  	  upV P
                  R7      # u upi rQ   )r   rR   r   r$   r%   r&   )rI   rT   s   & r,   unwrapCachableResourceResult.unwrapC   sZ    
 !MM	 *D   LLDNN *	 
 	
s   5Ac                f   < V ^8  d   Qh/ S[ S[,          ;R&   S[S[S[3,          R,          ;R&   # )r#   rR   Nr&   )listr!   r)   r'   r   )r*   r+   s   "r,   r-   rA   .   s2      *++  sCx.4
&	 r/   r0   )r1   r2   r3   r4   r5   r&   rJ   classmethodrU   rY   r6   r7   r8   r9   s   @r,   r;   r;   .   s>     : #'D+ + 	
 	
	
 	
+  r/   r;   c                   Z   a  ] tR t^Ot o ]V 3R lR l4       tV 3R lR ltV 3R ltRtV t	R# )CachableToolResultc                &   < V ^8  d   QhRS[ RS[/# rN   )r   r   )r*   r+   s   "r,   r-   CachableToolResult.__annotate__U   s     
 
 
 
r/   c                T    V ! VP                   VP                  VP                  R 7      # r$   structured_contentr&   rd   )rS   rO   s   &&r,   rU   CachableToolResult.wrapT   s&    MM$77
 	
r/   c                    < V ^8  d   QhRS[ /# r=   )r   )r*   r+   s   "r,   r-   ra   \   s     
 

 
r/   c                Z    \        V P                  V P                  V P                  R 7      # rc   )r   r$   re   r&   rH   s   &r,   rY   CachableToolResult.unwrap\   s&    LL#66
 	
r/   c                   < V ^8  d   Qh/ S[ S[P                  P                  ,          ;R&   S[S[S[3,          R,          ;R&   S[S[S[3,          R,          ;R&   # )r#   r$   Nre   r&   )r\   mcptypesContentBlockr)   r'   r   )r*   r+   s   "r,   r-   ra   O   sQ     #))(()) S#X--  sCx.4
 r/   r0   N)
r1   r2   r3   r4   r]   rU   rY   r6   r7   r8   r9   s   @r,   r_   r_   O   s*     
 
 

 
  r/   r_   c                   0   a  ] tR t^dt o RtV 3R ltRtV tR# )CachableMessagez)A wrapper for Message that can be cached.c                   < V ^8  d   Qh/ S[ ;R&   S[P                  P                  S[P                  P                  ,          ;R&   # )r#   roler$   )r'   rk   rl   TextContentEmbeddedResource)r*   r+   s   "r,   r-   CachableMessage.__annotate__d   s7      I  YY""SYY%?%???	 r/   r0   Nr1   r2   r3   r4   r5   r6   r7   r8   r9   s   @r,   ro   ro   d   s     3  r/   ro   c                   x   a  ] tR t^kt o RtRtRtV 3R lR lt]V 3R lR l4       t	V 3R lR lt
V 3R	 ltR
tV tR# )CachablePromptResultz.A wrapper for PromptResult that can be cached.Nc                    < V ^8  d   QhRS[ /# r=   r?   )r*   r+   s   "r,   r-   !CachablePromptResult.__annotate__r   rB   r/   c                4    \        V P                  4       4      # rD   rE   rH   s   &r,   rJ   CachablePromptResult.get_sizer   rL   r/   c                &   < V ^8  d   QhRS[ RS[/# rN   )r   r   )r*   r+   s   "r,   r-   ry   v   s     
 
 
$ 
r/   c           
         T ! VP                    Uu. uF$  p\        VP                  VP                  R 7      NK&  	  upVP                  VP
                  R7      # u upi ))rq   r$   messagesdescriptionr&   )r   ro   rq   r$   r   r&   )rS   rO   ms   && r,   rU   CachablePromptResult.wrapu   sP    INIWAQVVQYY? ))
 	
s   *Ac                    < V ^8  d   QhRS[ /# r=   )r   )r*   r+   s   "r,   r-   ry      s     
 
 
r/   c           
         \        V P                   Uu. uF$  p\        VP                  VP                  R 7      NK&  	  upV P
                  V P                  R7      # u upi ))r$   rq   r~   )r   r   r   r$   rq   r   r&   )rI   r   s   & r,   rY   CachablePromptResult.unwrap   sV     &A 		7& ((
 	
s   *Ac                   < V ^8  d   Qh/ S[ S[,          ;R&   S[R,          ;R&   S[S[S[3,          R,          ;R&   # )r#   r   Nr   r&   )r\   ro   r'   r)   r   )r*   r+   s   "r,   r-   ry   k   sB      ?##  t"	 
 sCx.4
& r/   r0   )r1   r2   r3   r4   r5   r   r&   rJ   r]   rU   rY   r6   r7   r8   r9   s   @r,   rw   rw   k   sC     8 #K"&D+ + 
 

 
)  r/   rw   c                   0   a  ] tR t^t o RtV 3R ltRtV tR# )SharedMethodSettingsz!Shared config for a cache method.c                R   < V ^8  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   # )r#   ttlenabled)r   r@   bool)r*   r+   s   "r,   r-   !SharedMethodSettings.__annotate__   s)      
S	  	 r/   r0   Nru   r9   s   @r,   r   r      s     +  r/   r   c                       ] tR t^tRtRtR# )ListToolsSettings/Configuration options for Tool-related caching.r0   Nr1   r2   r3   r4   r5   r7   r0   r/   r,   r   r      s    9r/   r   c                       ] tR t^tRtRtR# )ListResourcesSettings3Configuration options for Resource-related caching.r0   Nr   r0   r/   r,   r   r          =r/   r   c                       ] tR t^tRtRtR# )ListPromptsSettings1Configuration options for Prompt-related caching.r0   Nr   r0   r/   r,   r   r          ;r/   r   c                   0   a  ] tR t^t o RtV 3R ltRtV tR# )CallToolSettingsr   c                r   < V ^8  d   Qh/ S[ S[S[,          ,          ;R&   S[ S[S[,          ,          ;R&   # )r#   included_toolsexcluded_tools)r   r\   r'   )r*   r+   s   "r,   r-   CallToolSettings.__annotate__   s1       S	**   S	**	 r/   r0   Nru   r9   s   @r,   r   r      s     9  r/   r   c                       ] tR t^tRtRtR# )ReadResourceSettingsr   r0   Nr   r0   r/   r,   r   r      r   r/   r   c                       ] tR t^tRtRtR# )GetPromptSettingsr   r0   Nr   r0   r/   r,   r   r      r   r/   r   c                      a  ] tR t^t o ]! RR7      t]! RR7      t]! RR7      t]! RR7      t]! RR7      t	]! RR7      t
V 3R ltRtV tR# )ResponseCachingStatisticsN)defaultc                   < V ^8  d   Qh/ S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   # )r#   N
list_toolslist_resourceslist_promptsread_resource
get_prompt	call_toolr   )r*   r+   s   "r,   r-   &ResponseCachingStatistics.__annotate__   sm     +d2H /$6L  .4J  /5K	 
 ,d2H  +T1G r/   r0   )r1   r2   r3   r4   r   r   r   r   r   r   r   r6   r7   r8   r9   s   @r,   r   r      sH     5:45HJ9>t9LN7<T7JL8=d8KM5:45HJ49$4GI  r/   r   c                     a  ] tR t^t o RtRRRRRRR]3V 3R lR llt]V 3R lR l4       t]V 3R lR l4       t	]V 3R	 lR
 l4       t
]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR ltRtV tR# )ResponseCachingMiddlewarea  The response caching middleware offers a simple way to cache responses to mcp methods. The Middleware
supports cache invalidation via notifications from the server. The Middleware implements TTL-based caching
but cache implementations may offer additional features like LRU eviction, size limits, and more.

When items are retrieved from the cache they will no longer be the original objects, but rather no-op objects
this means that response caching may not be compatible with other middleware that expects original subclasses.

Notes:
- Caches `tools/call`, `resources/read`, `prompts/get`, `tools/list`, `resources/list`, and `prompts/list` requests.
- Cache keys are derived from method name and arguments.
Nc                   < V ^8  d   QhRS[ R,          RS[R,          RS[R,          RS[R,          RS[R,          RS[R,          RS[R,          R	S[/# )
r#   cache_storageNlist_tools_settingslist_resources_settingslist_prompts_settingsread_resource_settingsget_prompt_settingscall_tool_settingsmax_item_size)r   r   r   r   r   r   r   r@   )r*   r+   s   "r,   r-   &ResponseCachingMiddleware.__annotate__   s     X
 X
$t+X
 /5X
 "7!=	X

  3T9X
 !5t ;X
 /5X
 -t3X
 X
r/   c	                   T;'       g    \        4       V n        \        V P                  VRR7      V n        \	        V P                  R7      V n        T;'       g    \        4       V n        T;'       g    \        4       V n	        T;'       g    \        4       V n        T;'       g    \        4       V n        T;'       g    \        4       V n        T;'       g    \!        4       V n        \%        V P
                  \&        \(        ,          RR7      V n        \%        V P
                  \&        \,        ,          RR7      V n        \%        V P
                  \&        \0        ,          RR7      V n        \%        V P
                  \4        RR7      V n        \%        V P
                  \8        R	R7      V n        \%        V P
                  \<        R
R7      V n        R# )a  Initialize the response caching middleware.

Args:
    cache_storage: The cache backend to use. If None, an in-memory cache is used.
    list_tools_settings: The settings for the list tools method. If None, the default settings are used (5 minute TTL).
    list_resources_settings: The settings for the list resources method. If None, the default settings are used (5 minute TTL).
    list_prompts_settings: The settings for the list prompts method. If None, the default settings are used (5 minute TTL).
    read_resource_settings: The settings for the read resource method. If None, the default settings are used (1 hour TTL).
    get_prompt_settings: The settings for the get prompt method. If None, the default settings are used (1 hour TTL).
    call_tool_settings: The settings for the call tool method. If None, the default settings are used (1 hour TTL).
    max_item_size: The maximum size of items eligible for caching. Defaults to 1MB.
F)	key_valuemax_sizeraise_on_too_large)r   
tools/list)r   pydantic_modeldefault_collectionresources/listprompts/listresources/readprompts/get
tools/callN) r   _backendr	   _size_limiterr
   _statsr   _list_tools_settingsr   _list_resources_settingsr   _list_prompts_settingsr   _read_resource_settingsr   _get_prompt_settingsr   _call_tool_settingsr   r\   r   _list_tools_cacher   _list_resources_cacher   _list_prompts_cacher;   _read_resource_cacherw   _get_prompt_cacher_   _call_tool_cache)	rI   r   r   r   r   r   r   r   r   s	   &&&&&&&&&r,   __init__"ResponseCachingMiddleware.__init__   s   0 (5'E'E 0@mmmPU0
 *;TEWEW)X  66#4#6 	! $>>'<'> 	% "::%8%: 	#
 #<<&:&< 	$  66#4#6 	! 44"2"4 	  ?Nkk:+?
 GVkk>/G
" CRkk<-C
  ++5#3 	! IXkk/,I
 FUkk-+F
r/   c                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[S[,          3,          RS[S[,          /# r#   context	call_nextr>   )r   rk   rl   ListToolsRequestr   r   r   )r*   r+   s   "r,   r-   r     sT     $ $"399#=#=>$ CII66FG$ 
$	$r/   c                  "   V P                   P                  R4      RJ d   V! V4      G Rj  xL
 # V P                  P                  \        R7      G Rj  xL
 ;p'       d   V# V! VR7      G Rj  xL
 pV Uu. uFf  p\	        VP
                  VP                  VP                  VP                  VP                  VP                  VP                  VP                  R7      NKh  	  ppV P                  P                  \        VV P                   P                  R\        4      R7      G Rj  xL
  V#  EL L Lu upi  L5i)	zList tools from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   FNkeyr   )r   titler   
parametersoutput_schemaannotationsr&   tagsr   r   rO   r   )r   getr   
GLOBAL_KEYr   r   r   r   r   r   r   r&   r   putFIVE_MINUTES_IN_SECONDS)rI   r   r   cached_valuetoolstoolcachable_toolss   &&&    r,   on_list_tools'ResponseCachingMiddleware.on_list_tools  s.     $$((3u<"7+++!%!7!7!;!;
!;!KKK<K&/&@ @ &
  YYjj ,,??"00 ,,YYYY	  	 &
 $$(( ))--e5LM ) 
 	
 	
 9 ,K !A&
	
Y   +D?D1'D?D4D?"D?0D61D?9A,D8%AD?*D=+D?4D?6D?8D?c                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[S[,          3,          RS[S[,          /# r   )r   rk   rl   ListResourcesRequestr   r   r   )r*   r+   s   "r,   r-   r   D  sV     $" $""399#A#AB$" CII::HX<NNO$" 
(		$"r/   c                  "   V P                   P                  R4      RJ d   V! V4      G Rj  xL
 # V P                  P                  \        R7      G Rj  xL
 ;p'       d   V# V! VR7      G Rj  xL
 pV Uu. uFf  p\	        VP
                  VP                  VP                  VP                  VP                  VP                  VP                  VP                  R7      NKh  	  ppV P                  P                  \        VV P                   P                  R\        4      R7      G Rj  xL
  V#  EL L Lu upi  L5i)	zList resources from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   FNr   r   )r   r   r   r   r&   r%   r   urir   r   )r   r   r   r   r   r   r   r   r   r&   r%   r   r   r   r   )rI   r   r   r   	resourcesresourcecachable_resourcess   &&&    r,   on_list_resources+ResponseCachingMiddleware.on_list_resourcesC  s.     ((,,Y75@"7+++!%!;!;!?!?J!?!OOO<O.7.H(H	 &.
 & ]]nn$00]]]]",,$00LL	 & 	 .
 ((,,$--11%9PQ - 
 	
 	
 "!9 ,O )I.
	
r   c                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[S[,          3,          RS[S[,          /# r   )r   rk   rl   ListPromptsRequestr   r   r   )r*   r+   s   "r,   r-   r   k  sV     "  " "399#?#?@"  CII88(6:JJK"  
&		" r/   c                T  "   V P                   P                  R4      RJ d   V! V4      G Rj  xL
 # V P                  P                  \        R7      G Rj  xL
 ;p'       d   V# V! VR7      G Rj  xL
 pV Uu. uFP  p\	        VP
                  VP                  VP                  VP                  VP                  VP                  R7      NKR  	  ppV P                  P                  \        VV P                   P                  R\        4      R7      G Rj  xL
  V#  L L Lu upi  L5i)	zList prompts from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   FNr   r   )r   r   r   r   r&   	argumentsr   r   )r   r   r   r   r   r   r   r   r   r&   r   r   r   )rI   r   r   r   promptspromptcachable_promptss   &&&    r,   on_list_prompts)ResponseCachingMiddleware.on_list_promptsj  s     &&**95>"7+++!%!9!9!=!=*!=!MMM<M*3G*D$D "
*
 " [[ll"..[[[[ ** " 	 
*
 &&**"++//7NO + 
 	
 	
  5 ,M %E
*
	
sY   +D(D'D(DD("D(0D1D(9AD!AD(D&D(D(D(!D(c                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[3,          RS[/# r   )r   rk   rl   CallToolRequestParamsr   r   )r*   r+   s   "r,   r-   r     sL     - -"399#B#BC- CII;;ZGH- 
	-r/   c                  "   VP                   P                  pV P                  P                  R4      RJ g   V P	                  VR7      '       g   V! VR7      G Rj  xL
 # V R\        VP                   P                  4       2pV P                  P                  VR7      G Rj  xL
 ;p'       d   VP                  4       # V! VR7      G Rj  xL
 p\        P                  VR7      pV P                  P                  VVV P                  P                  R	\        4      R
7      G Rj  xL
  VP                  4       #  L L Lr L5i)zCall a tool from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   F)	tool_namer   N:r   )rO   r   r   )messager   r   r   _matches_tool_cache_settings_get_arguments_strr   r   rY   r_   rU   r   ONE_HOUR_IN_SECONDS)rI   r   r   r  	cache_keyr   tool_resultcachable_tool_results   &&&     r,   on_call_tool&ResponseCachingMiddleware.on_call_tool  s9     OO((	##''
;;i;PP"7333%;a(:7??;T;T(U'VW	!%!6!6!:!:y!:!III<I&&(((1'(B"B3E3J3J 4K 4
 ##''&((,,U4GH ( 
 	
 	
 $**,,% 4 J #C
	
sV   AEED<AE$D>%E1EE AE'E(E>E EEc                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[3,          RS[/# r   )r   rk   rl   ReadResourceRequestParamsr   r   )r*   r+   s   "r,   r-   r     sL     % %"399#F#FG% CII??OP% 
	%r/   c                $  "   V P                   P                  R4      RJ d   V! VR7      G Rj  xL
 # \        VP                  P                  4      pV P
                  P                  VR7      G Rj  xL
 ;p'       d   VP                  4       # V! VR7      G Rj  xL
 p\        P                  V4      pV P
                  P                  VVV P                   P                  R\        4      R7      G Rj  xL
  VP                  4       #  L L Lq L5i)zRead a resource from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   Fr   Nr   r   r   )r   r   r'   r	  r   r   rY   r;   rU   r   r  rI   r   r   r  r   rO   s   &&&   r,   on_read_resource*ResponseCachingMiddleware.on_read_resource  s      ''++I6%?"7333W__001	 "&!:!:!>!>9!>!MMM<M&&((&/&@ @-2259''++,,008KL , 
 	
 	
 ""$$# 4
 N !A	
sM   ,DDAD1D
2D>DDAD3D4D
DDDc                   < V ^8  d   QhRS[ S[P                  P                  ,          RS[S[P                  P                  S[3,          RS[/# r   )r   rk   rl   GetPromptRequestParamsr   r   )r*   r+   s   "r,   r-   r     sL      "399#C#CD CII<<lJK 
	r/   c                8  "   V P                   P                  R4      RJ d   V! VR7      G Rj  xL
 # VP                  P                   R\	        VP                  P
                  R7       2pV P                  P                  VR7      G Rj  xL
 ;p'       d   VP                  4       # V! VR7      G Rj  xL
 pV P                  P                  V\        P                  V4      V P                   P                  R\        4      R	7      G Rj  xL
  V#  L L La L5i)
zGet a prompt from the cache, if caching is enabled, and the result is in the cache. Otherwise,
otherwise call the next middleware and store the result in the cache if caching is enabled.r   Fr   Nr  r   r   r   r   )r   r   r	  r   r  r   r   rY   r   rw   rU   r  r  s   &&&   r,   on_get_prompt'ResponseCachingMiddleware.on_get_prompt  s     $$((3u<"7333#OO0013EPWP_P_PiPi3j2kl	!%!7!7!;!;	!;!JJJ<J&&(($-g$>>$$((&++E2))--e5HI ) 
 	
 	
  4 K ?	
sM   ,DDADDDD4D5ADDDDDDc                &   < V ^8  d   QhRS[ RS[/# )r#   r  r>   )r'   r   )r*   r+   s   "r,   r-   r     s      c d r/   c                    V P                   P                  R4      ;p'       d	   W9  d   R# V P                   P                  R4      ;p'       d	   W9   d   R# R# )z<Check if the tool matches the cache settings for tool calls.r   Fr   T)r   r   )rI   r  r   r   s   &&  r,   r
  6ResponseCachingMiddleware._matches_tool_cache_settings  sS     "5599:JKK>K.!5599:JKK>K*r/   c                    < V ^8  d   QhRS[ /# r=   )r   )r*   r+   s   "r,   r-   r     s     	
 	
5 	
r/   c           
     @   \        V P                  P                  P                  P	                  R4      V P                  P                  P                  P	                  R4      V P                  P                  P                  P	                  R4      V P                  P                  P                  P	                  R4      V P                  P                  P                  P	                  R4      V P                  P                  P                  P	                  R4      R7      # )z!Get the statistics for the cache.r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   
statisticscollectionsr   rH   s   &r,   r#  $ResponseCachingMiddleware.statistics  s    ({{--99==lK;;11==AABRS//;;??O++00<<@@AQR{{--99==mLkk,,88<<\J
 	
r/   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r1   r2   r3   r4   r5   ONE_MB_IN_BYTESr   r   r   r   r  r  r  r  r
  r#  r7   r8   r9   s   @r,   r   r      s     
 /38<@D<@>B8<6:,X
 X
t $ $L $" $"L "  " H - -@ % %6  2 	
 	
r/   r   c                `    V ^8  d   QhR\         \        \        3,          R,          R\        /# )r#   r   Nr>   )r)   r'   r   )r*   s   "r,   r-   r-     s'     
 
$sCx.4"7 
C 
r/   c                    V f   R#  \         P                  ! V \        R7      P                  4       #   \         d    \        T 4      u # i ; i)z-Get a string representation of the arguments.null)rO   fallback)pydantic_coreto_jsonr'   decode	TypeErrorreprr  s   &r,   r  r    sG     $$9sCJJLL Is   )2 A
Ac                @    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   # )r#   logger)__conditional_annotations__r   )r*   s   "r,   r-   r-      s     ( (4 + * *5 )r/   i   )Gr2  r5   collections.abcr   loggingr   typingr   r   	mcp.typesrk   r+  key_value.aio.adapters.pydanticr   !key_value.aio.protocols.key_valuer   key_value.aio.stores.memoryr   !key_value.aio.wrappers.limit_sizer	   !key_value.aio.wrappers.statisticsr
   )key_value.aio.wrappers.statistics.wrapperr   pydanticr   typing_extensionsr   r   r   fastmcp.prompts.promptr   r   r   fastmcp.resources.resourcer   r   r   $fastmcp.server.middleware.middlewarer   r   r   fastmcp.tools.toolr   r   fastmcp.utilities.loggingr   fastmcp.utilities.typesr   r1   r1  r  r   r&  r   r!   r;   r_   ro   rw   r   r   r   r   r   r   r   r   r   r  r-   )r2  s   @r,   <module>rE     s8   ( $  !   ; ; 3 > ?  9 9 @ @ P P X X / 0 4* *   
'. '
- 
B
) 
*@& @
+ 
>9 :, :>0 ><. <++ +>/ ><, <H 0 HG

 G
T

r/   