+
    Q(i#                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
HtHtHtHtHtHtHt ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RI H!t! ^ RI"H#t#H$t$H%t%H&t&H't'H(t(  ^ RI)H*t+ ^ RI,H-t. ]+].3t/R]0R&   R R lt2]! R]R7      t3]!! ]44      t5]	 ! R R]]3,          4      4       t6 ! R R4      t7R R lt8]	 ! R R4      4       t9R#   ]1 d    Rt/ L[i ; i)z?Function introspection and schema generation for FastMCP tools.)annotationsN)Callable)	dataclass)	AnnotatedAnyGenericUnionget_args
get_originget_type_hints)PydanticSchemaGenerationError)TypeVar)transform_context_annotationswithout_injected_parameters)
ToolResult)compress_schema)
get_logger)AudioFileImagecreate_function_without_paramsget_cached_typeadapterreplace_type)	PrefabApp)	Componentztuple[type, ...]_PREFAB_TYPESc                    V ^8  d   QhRRRR/# )   tpr   returnbool )formats   "d/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/tools/function_parsing.py__annotate__r$   (   s      c d     c                T   \        V \        4      '       d   \        V \        4      '       d   R# \	        V 4      pV\
        J g   V\        P                  J g   V\        J dG   \        ;QJ d%    R \        V 4       4       F  '       g   K   R# 	  R# ! R \        V 4       4       4      # R# )zSCheck if *tp* is or contains a prefab type, recursing through unions and Annotated.Tc              3  8   "   T F  p\        V4      x  K  	  R # 5i)N)_contains_prefab_type).0as   & r#   	<genexpr>(_contains_prefab_type.<locals>.<genexpr>.   s     B\(++\s   F)
isinstancetype
issubclassr   r
   r   types	UnionTyper   anyr	   )r   origins   & r#   r(   r(   (   st    "d
2} = =^F&EOO3v7JsBXb\BssBsBsBXb\BBBr%   T)defaultc                  &    ] tR t^7t$ RtR]R&   RtR# )_WrappedResultz,Generic wrapper for non-object return types.r4   resultr!   N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r!   r%   r#   r7   r7   7   s
    6Ir%   r7   c                      ] tR t^>tRtR# )_UnserializableTyper!   N)r9   r:   r;   r<   r?   r!   r%   r#   rA   rA   >   s    r%   rA   c                    V ^8  d   QhRRRR/# )r   schemadict[str, Any]r   r    r!   )r"   s   "r#   r$   r$   B   s     2 2n 2 2r%   c                h    V P                  R4      R8X  d   R# RV 9   d   R# RV 9   ;'       d    RV 9   # )z1Check if a JSON schema represents an object type.r.   objectT
propertiesz$refz$defs)get)rC   s   &r#   _is_object_schemarI   B   s?     zz&X% v V116 11r%   c                  r    ] tR t^Qt$ R]R&   R]R&   R]R&   R]R&   R	]R
&   RtR]R&   ]RR R ll4       tRtR# )ParsedFunctionCallable[..., Any]fnstrnamez
str | NonedescriptionrD   input_schemazdict[str, Any] | Noneoutput_schemaNr   return_typec          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   rM   rL   exclude_argszlist[str] | Nonevalidater    wrap_non_object_output_schemar   rK   r!   )r"   s   "r#   r$   ParsedFunction.__annotate__[   sC     P
 P
P
 'P
 	P

 (,P
 
P
r%   c                	   V'       Ed   \         P                  ! V4      pVP                  P                  4        Fk  pVP                  \         P
                  P                  8X  d   \        R 4      hVP                  \         P
                  P                  8X  g   Kb  \        R4      h	  V'       dt   V Fm  pWuP                  9  d   \        RV R24      hVP                  V,          pVP                  \         P
                  P                  8X  g   K`  \        RV R24      h	  \        VRR4      ;'       g    VP                  P                  p\         P                  ! V4      p	\         P                  ! V4      '       g   VP                   p\#        V\$        4      '       d   VP&                  p\)        V4      p\+        V4      p
V'       d   \-        V
\/        V4      4      p
\1        V
4      pVP3                  4       pV'       d   \/        V4      MRp\5        WRR7      pRp\         P                  ! V4      pVP6                  p\#        V\8        4      '       d!    \;        VRR	7      pVP=                  R
V4      pTpV\         PD                  R\F        R39  EdV   \H        '       d   \K        V4      '       d   \L        p\O        V\P        PS                  \T        \V        \X        \Z        \\        P^                  P`                  \\        P^                  Pb                  \\        P^                  Pd                  \\        P^                  Pf                  \\        P^                  Ph                  .	\H        O5\L        4      4      p \1        V4      pVP3                  RR7      pV'       dB   \k        V4      '       g1   \l        V,          p\1        V4      pVP3                  RR7      pRVR&   MTp\5        VRR7      pT ! TTT	TT;'       g    RVR7      #   \>         d"   p\@        PC                  RT4        Rp?ELRp?ii ; i  \n         d4   pR\9        T4      9  d   \@        PC                  RT: 24        Rp?LRp?ii ; i)z/Functions with *args are not supported as toolsz2Functions with **kwargs are not supported as toolszParameter 'z-' in exclude_args does not exist in function.z,' in exclude_args must have a default value.r9   NT)prune_paramsprune_titles)include_extrasr   z5Failed to resolve type hint for return annotation: %s.serialization)modezx-fastmcp-wrap-result)r[   rA   z#Unable to generate schema for type )rM   rO   rP   rQ   rR   rS   )8inspect	signature
parametersvalueskind	ParameterVAR_POSITIONAL
ValueErrorVAR_KEYWORDr5   emptygetattr	__class__r9   getdoc	isroutine__call__r-   staticmethod__func__r   r   r   listr   json_schemar   return_annotationrN   r   rH   	Exceptionloggerdebug_emptyr   r   r(   rA   r   dictfromkeysr   r   r   r   mcpr0   TextContentImageContentAudioContentResourceLinkEmbeddedResourcerI   r7   r   )clsrM   rU   rV   rW   sigparamarg_namefn_namefn_doc
wrapper_fninput_type_adapterrQ   rZ   rR   output_type
type_hintseoriginal_output_typeclean_output_typetype_adapterbase_schemawrapped_typewrapped_adapters   &&&&&                   r#   from_functionParsedFunction.from_functionZ   s    8##B'C..0::!2!2!A!AA$%VWW::!2!2!>!>>$L 	 1  ,H~~5()(3`a   NN84E}}(9(9(?(??()(3_`  !- "j$/HH2<<3H3H#   $$Bb,''B +2. 14
 7
DDVWJ3J?)557 .:tL)t&$
 #++ k3''Y ,BtD
(nnX{C  +w~~tS#>> }!6{!C!C1 !-"		--		..		..		..		22 ' (!&X56GH*66O6L 19J;9W9W#12C#DL&<\&JO$3$?$?_$?$UM=AM"9:$/M /D Q %'//4,
 	
  YTVWXXYv 1 X(A6LL#F{o!VWXs1   P 9A5P5 P2P--P25Q3 )Q..Q3r!   )NTT)	r9   r:   r;   r<   r>   rS   classmethodr   r?   r!   r%   r#   rK   rK   Q   s=    
I  ((KP
 P
r%   rK   r!   ):__conditional_annotations__r=   
__future__r   r_   r0   collections.abcr   dataclassesr   typingr   r   r   r   r	   r
   r   	mcp.typesry   pydanticr   typing_extensionsr   
TypeVarExtfastmcp.server.dependenciesr   r   fastmcp.tools.toolr   fastmcp.utilities.json_schemar   fastmcp.utilities.loggingr   fastmcp.utilities.typesr   r   r   r   r   r   prefab_ui.appr   
_PrefabAppprefab_ui.components.baser   _PrefabComponentr   r>   ImportErrorr(   r4   r9   rt   r7   rA   rI   rK   )r   s   @r#   <module>r      s    E "   $ ! W W W  2 3 * 9 0 5G'13C&DM#D
 sC 	H	 WQZ  	 	2 Y
 Y
 Y
]  Ms   .C 	CC