+
    Q(i-                    :   R t ^ RIHt ^ RIt^ RIt^ RIHtHtHtH	t	 ^ RI
t^ RIt^ RIHt ]'       d   ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ]! ]4      t]]P6                  P8                  ]P6                  P:                  ,          ,          t ! R
 R4      tR# )z*Prompt-related methods for FastMCP Client.)annotationsN)TYPE_CHECKINGAnyLiteraloverload)	RootModel)Client)
PromptTask)client_span)inject_trace_context)
get_loggerc                      ] tR t^tRtRR/R R lltR R ltRR R	 llt]RR
RRRRR/R R lll4       t	]RR
RRRRRRR/R R lll4       t	RR
RRRRRRRRR/R R lllt	RR R llt
RtR# )ClientPromptsMixinz2Mixin providing prompt-related methods for Client.cursorNc               $    V ^8  d   QhRRRRRR/# )   selfr   r   
str | Nonereturnzmcp.types.ListPromptsResult )formats   "c/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/client/mixins/prompts.py__annotate__ClientPromptsMixin.__annotate__"   s$      !+	$    c                  "   \         P                  RV P                   R24       V P                  V P                  P                  VR7      4      G Rj  xL
 pV#  L5i)a  Send a prompts/list request and return the complete MCP protocol result.

Args:
    cursor: Optional pagination cursor from a previous request's nextCursor.

Returns:
    mcp.types.ListPromptsResult: The complete response object from the protocol,
        containing the list of prompts and any additional metadata.

Raises:
    RuntimeError: If called while the client is not connected.
    McpError: If the request results in a TimeoutError | JSONRPCError
[z] called list_promptsr   N)loggerdebugname_await_with_session_monitoringsessionlist_prompts)r   r   results   &$ r   list_prompts_mcp#ClientPromptsMixin.list_prompts_mcp"   sW       	q#89:::LL%%V%4
 
 
s   AAAAc                    V ^8  d   QhRRRR/# )r   r   r   r   zlist[mcp.types.Prompt]r   )r   s   "r   r   r   9   s          ,B  r   c                  "   . pRp\        4       p V P                  VR7      G Rj  xL
 pVP                  VP                  4       VP                  '       g    V# VP                  V9   d5   \
        P                  RV P                   RVP                  : R24        V# VP                  VP                  4       VP                  pK   L5i)a  Retrieve all prompts available on the server.

This method automatically fetches all pages if the server paginates results,
returning the complete list. For manual pagination control (e.g., to handle
large result sets incrementally), use list_prompts_mcp() with the cursor parameter.

Returns:
    list[mcp.types.Prompt]: A list of all Prompt objects.

Raises:
    RuntimeError: If called while the client is not connected.
    McpError: If the request results in a TimeoutError | JSONRPCError
Nr   r   z.] Server returned duplicate pagination cursor z& for list_prompts; stopping pagination)	setr%   extendprompts
nextCursorr   warningr    add)r   all_promptsr   seen_cursorsr$   s   &    r   r#   ClientPromptsMixin.list_prompts9   s      /1!!$000??Fv~~.$$$    L0		{ #)),,RT   V../&&F @s   %CC
0CA2Cc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r   r    str	argumentsdict[str, Any] | Nonemetar   mcp.types.GetPromptResultr   )r   s   "r   r   r   \   sA     B BBB )B $	B
 
#Br   c                  "   \        RV 2RVV P                  P                  4       R7      ;_uu_ 4        \        P	                  RV P
                   RV 24       RpV'       d_   / pVP                  4        FH  w  rV\        V\        4      '       d   WdV&   K!  \        P                  ! V4      P                  R4      WE&   KJ  	  \        V4      pV'       d   VP                  R4      p\        P                  P!                  \        P                  P#                  TTV'       d!   \        P                  P$                  ! R/ VB MRVR	7      R
7      p	V P'                  V P(                  P+                  V	\        P                  P,                  R7      4      G Rj  xL
 p
M3V P'                  V P(                  P/                  WR7      4      G Rj  xL
 p
V
uuRRR4       #  LD L  + '       g   i     R# ; i5i)a}  Send a prompts/get request and return the complete MCP protocol result.

Args:
    name (str): The name of the prompt to retrieve.
    arguments (dict[str, Any] | None, optional): Arguments to pass to the prompt. Defaults to None.
    meta (dict[str, Any] | None, optional): Request metadata (e.g., for SEP-1686 tasks). Defaults to None.

Returns:
    mcp.types.GetPromptResult: The complete response object from the protocol,
        containing the prompt messages and any additional metadata.

Raises:
    RuntimeError: If called while the client is not connected.
    McpError: If the request results in a TimeoutError | JSONRPCError
zprompts/get zprompts/get)
session_idr   z] called get_prompt: Nutf-8zmodelcontextprotocol.io/taskr    r4   task_metaparamsrequestresult_type)r    r4   r   )r
   	transportget_session_idr   r   r    items
isinstancer3   pydantic_coreto_jsondecoder   getmcptypesGetPromptRequestGetPromptRequestParamsTaskMetadatar!   r"   send_requestGetPromptResult
get_prompt)r   r    r4   r6   serialized_argumentskeyvaluepropagated_meta	task_dictrA   r$   s   &&&&       r   get_prompt_mcp!ClientPromptsMixin.get_prompt_mcp\   s    * 4&!~~446	
 
 LL1TYYK'<TFCD ;? ')$"+//"3JC!%--49S1 5B4I4I%4P4W4W#5,1 #4 348O +//0NO	))4499;;!"6DMSYY33@i@SW-	 <  5   $BBLL-- '$'II$=$= .     $BBLL+++V   [
 
FU
 
 
sH   3G4C-G #A4G G3G GG G4G G  G1	+	G4versionr6   r<   Fc               4    V ^8  d   QhRRRRRRRRR	RR
RRR/# )r   r   r   r    r3   r4   r5   rZ   r   r6   r<   zLiteral[False]r   r7   r   )r   s   "r   r   r      sN     ( ((( )(
 ( $( ( 
#(r   c               	   "   R # 5iNr   )r   r    r4   rZ   r6   r<   s   &&&$$$r   rR   ClientPromptsMixin.get_prompt   s
      %(   task_idttl`  c               <    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   r    r3   r4   r5   rZ   r   r6   r<   zLiteral[True]r`   ra   intr   r	   r   )r   s   "r   r   r      sb     
 


 )

 
 $
 
 
 
 

r   c               	   "   R # 5ir]   r   )r   r    r4   rZ   r6   r<   r`   ra   s   &&&$$$$$r   rR   r^      s
      r_   c               <    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   r    r3   r4   r5   rZ   r   r6   r<   boolr`   ra   rd   r   z&mcp.types.GetPromptResult | PromptTaskr   )r   s   "r   r   r      sb     . ... ).
 . $. . . . 
0.r   c               $  "   V'       d   \        V4      M/ pVe   / VP                  R/ 4      CRV/CVR&   V'       d'   T P                  YYgT;'       g    RR7      G Rj  xL
 # T P                  YT;'       g    RR7      G Rj  xL
 p	V	#  L+ L5i)a  Retrieve a rendered prompt message list from the server.

Args:
    name (str): The name of the prompt to retrieve.
    arguments (dict[str, Any] | None, optional): Arguments to pass to the prompt. Defaults to None.
    version (str | None, optional): Specific prompt version to get. If None, gets highest version.
    meta (dict[str, Any] | None): Optional request-level metadata.
    task (bool): If True, execute as background task (SEP-1686). Defaults to False.
    task_id (str | None): Optional client-provided task ID (auto-generated if not provided).
    ttl (int): Time to keep results available in milliseconds (default 60s).

Returns:
    mcp.types.GetPromptResult | PromptTask: The complete response object if task=False,
        or a PromptTask object if task=True.

Raises:
    RuntimeError: If called while the client is not connected.
    McpError: If the request results in a TimeoutError | JSONRPCError
NfastmcprZ   )r6   )r    r4   r6   )dictrJ   _get_prompt_as_taskrX   )
r   r    r4   rZ   r6   r<   r`   ra   request_metar$   s
   &&&$$$$$  r   rR   r^      s     > &*tDzr'""9b1'7'L#
 11L4H4HD 2    **1E1E + 
 
 
s4   <BBB B!B:BBBBc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r   r   r   r    r3   r4   r5   r`   r   ra   rd   r6   r   r	   r   )r   s   "r   r   r      sW     G GGG )G 	G
 G $G 
Gr   c           
       "   \        V4      pRpV'       d_   / pVP                  4        FH  w  r\        V	\        4      '       d   WV&   K!  \        P
                  ! V	4      P                  R4      Wx&   KJ  	  \        P                  P                  \        P                  P                  VV\        P                  P                  VR7      VR7      R7      p
V P                  V P                  P                  V
\        R7      4      G Rj  xL
 pVP                   p\        V\        P                  P"                  4      '       de   VP$                  P&                  pV P(                  P+                  V4       \-        WVRR7      p\.        P0                  ! V4      V P2                  V&   V# T;'       g    \        \4        P6                  ! 4       4      p\-        WWR7      #  L5i)a  Get a prompt for background execution (SEP-1686).

Returns a PromptTask object that handles both background and immediate execution.

Args:
    name: Prompt name to get
    arguments: Prompt arguments
    task_id: Optional client-provided task ID (ignored, for backward compatibility)
    ttl: Time to keep results available in milliseconds (default 60s)
    meta: Optional request metadata (e.g., version info)

Returns:
    PromptTask: Future-like object for accessing task status and results
Nr:   )ra   r;   r>   r@   )prompt_nameimmediate_result)r   rE   rF   r3   rG   rH   rI   rK   rL   rM   rN   rO   r!   r"   rP   PromptTaskResponseUnionrootCreateTaskResultr<   taskId_submitted_task_idsr.   r	   weakrefref_task_registryuuiduuid4)r   r    r4   r`   ra   r6   rV   rS   rT   rU   rA   wrapped_result
raw_resultserver_task_idtask_objsynthetic_task_ids   &&&&&&          r   rk   &ClientPromptsMixin._get_prompt_as_task   s    0 /t4 7;#% 'oo/
eS))05-0=0E0Ee0L0S0S1(-	 0 )),,9933.YY+++4%	 4  - 
  $BBLL%%3 &  
 
 $((
j#))"<"<=='__33N$$((8!$H 3:++h2GD/O !( < <3tzz|+<T +
s   DGG	B&G0-Gr   )NNr]   )NNrb   N)__name__
__module____qualname____firstlineno____doc__r%   r#   rX   r   rR   rk   __static_attributes__r   r   r   r   r      s    <.2. FBH (
 #( '+(  %( ( 

 #
 '+
 #
 
 
.
 #. '+. . #. . .`G Gr   r   ) r   
__future__r   ry   rv   typingr   r   r   r   	mcp.typesrK   rG   pydanticr   fastmcp.client.clientr   fastmcp.client.tasksr	   fastmcp.client.telemetryr
   fastmcp.telemetryr   fastmcp.utilities.loggingr   r   r   rL   rs   rQ   rq   r   r   r   r   <module>r      sq    0 "   8 8   , + 0 2 0	H	 $II!:!:: 
R Rr   