
    Ch<	                     ~    S SK r S SKJr  S SKJrJrJr  \" S5      r\" S5      rS\S\4   S\	\   S	\\/\4   4S
 jr
g)    N)Callable)AnyTypeVarget_type_hintsTRfunc.request_typereturnc                 z  ^   [         R                  " T 5      n[        T 5      nUR                  R                  5        H|  u  pEUR                  [         R                  R                  :X  d  M/  UR                  U5      nXa:X  d  MG  UR                  [         R                  R                  La  U 4S js  $ U 4S js  $    UR                  R                  5        H  u  pEUR                  [         R                  R                  [         R                  R                  4;   d  MI  UR                  U5      nXa:X  d  Ma  UR                  [         R                  R                  La  U 4S js  $ S[         S["        [$        /[$        4   4U 4S jjnU" U5      s  $    U 4S j$ ! [        [        [
        4 a	    U 4S js $ f = f)	a  
Create a wrapper function that knows how to call func with the request object.

Returns a wrapper function that takes the request and calls func appropriately.

The wrapper handles three calling patterns:
1. Positional-only parameter typed as request_type (no default): func(req)
2. Positional/keyword parameter typed as request_type (no default): func(**{param_name: req})
3. No request parameter or parameter with default: func()
c                    > T" 5       $ N _r	   s    ]/home/james-whalen/.local/lib/python3.13/site-packages/mcp/server/lowlevel/func_inspection.py<lambda>%create_call_wrapper.<locals>.<lambda>   s        c                    > T" 5       $ r   r   r   s    r   r   r   !       TVr   c                    > T" U 5      $ r   r   )reqr	   s    r   r   r   #   s	    49r   c                    > T" 5       $ r   r   r   s    r   r   r   ,   r   r   namer   c                    >^  UU 4S j$ )Nc                    > T" S0 TU 0D6$ )Nr   r   )r   r	   r   s    r   r   Ccreate_call_wrapper.<locals>.make_keyword_wrapper.<locals>.<lambda>1   s    t':tSk':r   r   )r   r	   s   `r   make_keyword_wrapper1create_call_wrapper.<locals>.make_keyword_wrapper0   s	    ::r   c                    > T" 5       $ r   r   r   s    r   r   r   6   s    TVr   )inspect	signaturer   
ValueError	TypeError	NameError
parametersitemskind	ParameterPOSITIONAL_ONLYgetdefaultemptyPOSITIONAL_OR_KEYWORDKEYWORD_ONLYstrr   r   )r	   r
   sig
type_hints
param_nameparam
param_typer   s   `       r   create_call_wrapperr7   	   sV    %#D)

 !^^113
::**:::#
3J)==(9(9(?(??++,, 4 !^^113
::'++AA7CTCTCaCabb#
3J)==(9(9(?(??++;s ;xs
7K ; ,J77 4  ? 	9-   s   !F F:9F:)r"   collections.abcr   typingr   r   r   r   r   typer7   r   r   r   <module>r;      sY     $ / /CLCL-hsAv. -d1g -(TUSVXYSYJZ -r   