§
    öŽ’jÝ\  ã                   ó  — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZ ddlmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0  G d„ d¦  «        Z1dS )zô
ServerTaskContext - Server-integrated task context with elicitation and sampling.

This wraps the pure TaskContext and adds server-specific functionality:
- Elicitation (task.elicit())
- Sampling (task.create_message())
- Status notifications
é    )ÚAnyN)ÚTaskResultHandler)ÚServerSession)Úvalidate_sampling_toolsÚ!validate_tool_use_result_messages)ÚMcpError)Ú"require_task_augmented_elicitationÚrequire_task_augmented_sampling)ÚTaskContext)ÚQueuedMessageÚTaskMessageQueue)ÚResolver)Ú	TaskStore)ÚINVALID_REQUESTÚTASK_STATUS_INPUT_REQUIREDÚTASK_STATUS_WORKINGÚClientCapabilitiesÚCreateMessageResultÚCreateTaskResultÚElicitationCapabilityÚElicitRequestedSchemaÚElicitResultÚ	ErrorDataÚIncludeContextÚModelPreferencesÚ	RequestIdÚResultÚSamplingCapabilityÚSamplingMessageÚServerNotificationÚTaskÚTaskMetadataÚTaskStatusNotificationÚTaskStatusNotificationParamsÚToolÚ
ToolChoicec                   ó¤  — e Zd ZdZddœdedededededz  f
d	„Z	e
d
efd„¦   «         Ze
d
efd„¦   «         Ze
d
efd„¦   «         Zd2d„Zddœdeded
dfd„Zddœdeded
dfd„Zddœdeded
dfd„Zd2d„Zd2d„Zd2d„Zdeded
efd„Zdededed
efd„Zddddddddd œd!ee         d"ed#edz  d$edz  d%e dz  d&ee         dz  d'e!ee"f         dz  d(e#dz  d)ee$         dz  d*e%dz  d
e&fd+„Z'd,d-œdeded.ed
efd/„Z(d,ddddddddd0œ	d!ee         d"ed.ed#edz  d$edz  d%e dz  d&ee         dz  d'e!ee"f         dz  d(e#dz  d)ee$         dz  d*e%dz  d
e&fd1„Z)dS )3ÚServerTaskContextaE  
    Server-integrated task context with elicitation and sampling.

    This wraps a pure TaskContext and adds server-specific functionality:
    - elicit() for sending elicitation requests to the client
    - create_message() for sampling requests
    - Status notifications via the session

    Example:
        async def my_task_work(task: ServerTaskContext) -> CallToolResult:
            await task.update_status("Starting...")

            result = await task.elicit(
                message="Continue?",
                requestedSchema={"type": "object", "properties": {"ok": {"type": "boolean"}}}
            )

            if result.content.get("ok"):
                return CallToolResult(content=[TextContent(text="Done!")])
            else:
                return CallToolResult(content=[TextContent(text="Cancelled")])
    N)ÚhandlerÚtaskÚstoreÚsessionÚqueuer)   c                ój   — t          ||¬¦  «        | _        || _        || _        || _        || _        dS )aH  
        Create a ServerTaskContext.

        Args:
            task: The Task object
            store: The task store
            session: The server session
            queue: The message queue for elicitation/sampling
            handler: The result handler for response routing (required for elicit/create_message)
        )r*   r+   N)r   Ú_ctxÚ_sessionÚ_queueÚ_handlerÚ_store)Úselfr*   r+   r,   r-   r)   s         úRC:\Projects\DSCons\.venv\Lib\site-packages\mcp\server\experimental\task_context.pyÚ__init__zServerTaskContext.__init__M   s8   € õ&   T°Ð7Ñ7Ô7ˆŒ	ØˆŒØˆŒØˆŒØˆŒˆˆó    Úreturnc                 ó   — | j         j        S )zThe task identifier.)r/   Útask_id©r4   s    r5   r:   zServerTaskContext.task_idh   s   € ð ŒyÔ Ð r7   c                 ó   — | j         j        S )zThe current task state.)r/   r*   r;   s    r5   r*   zServerTaskContext.taskm   s   € ð ŒyŒ~Ðr7   c                 ó   — | j         j        S )z(Whether cancellation has been requested.)r/   Úis_cancelledr;   s    r5   r>   zServerTaskContext.is_cancelledr   s   € ð ŒyÔ%Ð%r7   c                 ó8   — | j                              ¦   «          dS )z"Request cancellation of this task.N)r/   Úrequest_cancellationr;   s    r5   r@   z&ServerTaskContext.request_cancellationw   s   € àŒ	×&Ò&Ñ(Ô(Ð(Ð(Ð(r7   T)ÚnotifyÚmessagerA   c             ƒ   ó†   K  — | j                              |¦  «        ƒ d{V —† |r|                      ¦   «         ƒ d{V —† dS dS )z¯
        Update the task's status message.

        Args:
            message: The new status message
            notify: Whether to send a notification to the client
        N)r/   Úupdate_statusÚ_send_notification)r4   rB   rA   s      r5   rD   zServerTaskContext.update_status}   sl   è è € ð Œi×%Ò% gÑ.Ô.Ð.Ð.Ð.Ð.Ð.Ð.Ð.Øð 	,Ø×)Ò)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+ð	,ð 	,r7   Úresultc             ƒ   ó†   K  — | j                              |¦  «        ƒ d{V —† |r|                      ¦   «         ƒ d{V —† dS dS )z·
        Mark the task as completed with the given result.

        Args:
            result: The task result
            notify: Whether to send a notification to the client
        N)r/   ÚcompleterE   )r4   rF   rA   s      r5   rH   zServerTaskContext.complete‰   sl   è è € ð Œi× Ò  Ñ(Ô(Ð(Ð(Ð(Ð(Ð(Ð(Ð(Øð 	,Ø×)Ò)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+ð	,ð 	,r7   Úerrorc             ƒ   ó†   K  — | j                              |¦  «        ƒ d{V —† |r|                      ¦   «         ƒ d{V —† dS dS )zµ
        Mark the task as failed with an error message.

        Args:
            error: The error message
            notify: Whether to send a notification to the client
        N)r/   ÚfailrE   )r4   rI   rA   s      r5   rK   zServerTaskContext.fail•   sj   è è € ð Œi�nŠn˜UÑ#Ô#Ð#Ð#Ð#Ð#Ð#Ð#Ð#Øð 	,Ø×)Ò)Ñ+Ô+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+Ð+ð	,ð 	,r7   c              ƒ   ó  K  — | j         j        }| j                             t	          t          t          |j        |j        |j	        |j
        |j        |j        |j        ¬¦  «        ¬¦  «        ¦  «        ¦  «        ƒ d{V —† dS )z.Send a task status notification to the client.)ÚtaskIdÚstatusÚstatusMessageÚ	createdAtÚlastUpdatedAtÚttlÚpollInterval)ÚparamsN)r/   r*   r0   Úsend_notificationr    r#   r$   rM   rN   rO   rP   rQ   rR   rS   )r4   r*   s     r5   rE   z$ServerTaskContext._send_notification¡   s¨   è è € àŒyŒ~ˆØŒm×-Ò-ÝÝ&Ý7Ø#œ{Ø#œ{Ø&*Ô&8Ø"&¤.Ø&*Ô&8Ø œHØ%)Ô%6ðñ ô ð
ñ 
ô 
ñô ñ
ô 
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
r7   c                 ó´   — | j                              t          t          ¦   «         ¬¦  «        ¦  «        s#t	          t          t          d¬¦  «        ¦  «        ‚dS )z)Check if the client supports elicitation.)Úelicitationz.Client does not support elicitation capability©ÚcoderB   N)r0   Úcheck_client_capabilityr   r   r   r   r   r;   s    r5   Ú_check_elicitation_capabilityz/ServerTaskContext._check_elicitation_capability¶   sa   € àŒ}×4Ò4Õ5GÕTiÑTkÔTkÐ5lÑ5lÔ5lÑmÔmð 	ÝÝÝ(ØLðñ ô ñô ð ð	ð 	r7   c                 ó´   — | j                              t          t          ¦   «         ¬¦  «        ¦  «        s#t	          t          t          d¬¦  «        ¦  «        ‚dS )z&Check if the client supports sampling.)Úsamplingz+Client does not support sampling capabilityrX   N)r0   rZ   r   r   r   r   r   r;   s    r5   Ú_check_sampling_capabilityz,ServerTaskContext._check_sampling_capabilityÀ   sa   € àŒ}×4Ò4Õ5GÕQcÑQeÔQeÐ5fÑ5fÔ5fÑgÔgð 	ÝÝÝ(ØIðñ ô ñô ð ð	ð 	r7   ÚrequestedSchemac              ƒ   óô  K  — |                       ¦   «          | j        €t          d¦  «        ‚| j                             | j        t          ¬¦  «        ƒ d{V —† | j                             ||| j        ¬¦  «        }|j	        }t          ¦   «         }|| j        j        |<   t          d|||¬¦  «        }| j                             | j        |¦  «        ƒ d{V —† 	 |                     ¦   «         ƒ d{V —†}| j                             | j        t           ¬¦  «        ƒ d{V —† t#          j        |¦  «        S # t'          j        ¦   «         $ r. | j                             | j        t           ¬¦  «        ƒ d{V —† ‚ w xY w)a™  
        Send an elicitation request via the task message queue.

        This method:
        1. Checks client capability
        2. Updates task status to "input_required"
        3. Queues the elicitation request
        4. Waits for the response (delivered via tasks/result round-trip)
        5. Updates task status back to "working"
        6. Returns the result

        Args:
            message: The message to present to the user
            requestedSchema: Schema defining the expected response structure

        Returns:
            The client's response

        Raises:
            McpError: If client doesn't support elicitation capability
        NzEhandler is required for elicit(). Pass handler= to ServerTaskContext.©rN   )rB   r_   Úrelated_task_idÚrequest©ÚtyperB   ÚresolverÚoriginal_request_id)r[   r2   ÚRuntimeErrorr3   Úupdate_taskr:   r   r0   Ú_build_elicit_form_requestÚidr   Ú_pending_requestsr   r1   ÚenqueueÚwaitr   r   Úmodel_validateÚanyioÚget_cancelled_exc_class)r4   rB   r_   rc   Ú
request_idrf   ÚqueuedÚresponse_datas           r5   ÚelicitzServerTaskContext.elicitÊ   s¹  è è € ð4 	×*Ò*Ñ,Ô,Ð,àŒ=Ð ÝÐfÑgÔgÐgð Œk×%Ò% d¤lÕ;UÐ%ÑVÔVÐVÐVÐVÐVÐVÐVÐVð ”-×:Ò:ØØ+Ø œLð ;ñ 
ô 
ˆð
 !(¤
ˆ
å-5©Z¬ZˆØ6>ˆŒÔ'¨
Ñ3åØØØØ *ð	
ñ 
ô 
ˆð Œk×!Ò! $¤,°Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð
	à"*§-¢-¡/¤/Ð1Ð1Ð1Ð1Ð1Ð1ˆMØ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSÝÔ.¨}Ñ=Ô=Ð=øÝÔ,Ñ.Ô.ð 	ð 	ð 	ð ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØð	øøøs   ÃAD3 Ä3AE7ÚurlÚelicitation_idc              ƒ   óö  K  — |                       ¦   «          | j        €t          d¦  «        ‚| j                             | j        t          ¬¦  «        ƒ d{V —† | j                             |||| j        ¬¦  «        }|j	        }t          ¦   «         }|| j        j        |<   t          d|||¬¦  «        }| j                             | j        |¦  «        ƒ d{V —† 	 |                     ¦   «         ƒ d{V —†}| j                             | j        t           ¬¦  «        ƒ d{V —† t#          j        |¦  «        S # t'          j        ¦   «         $ r. | j                             | j        t           ¬¦  «        ƒ d{V —† ‚ w xY w)aì  
        Send a URL mode elicitation request via the task message queue.

        This directs the user to an external URL for out-of-band interactions
        like OAuth flows, credential collection, or payment processing.

        This method:
        1. Checks client capability
        2. Updates task status to "input_required"
        3. Queues the elicitation request
        4. Waits for the response (delivered via tasks/result round-trip)
        5. Updates task status back to "working"
        6. Returns the result

        Args:
            message: Human-readable explanation of why the interaction is needed
            url: The URL the user should navigate to
            elicitation_id: Unique identifier for tracking this elicitation

        Returns:
            The client's response indicating acceptance, decline, or cancellation

        Raises:
            McpError: If client doesn't support elicitation capability
            RuntimeError: If handler is not configured
        NzIhandler is required for elicit_url(). Pass handler= to ServerTaskContext.ra   )rB   rv   rw   rb   rc   rd   )r[   r2   rh   r3   ri   r:   r   r0   Ú_build_elicit_url_requestrk   r   rl   r   r1   rm   rn   r   r   ro   rp   rq   )	r4   rB   rv   rw   rc   rr   rf   rs   rt   s	            r5   Ú
elicit_urlzServerTaskContext.elicit_url  s»  è è € ð@ 	×*Ò*Ñ,Ô,Ð,àŒ=Ð ÝÐjÑkÔkÐkð Œk×%Ò% d¤lÕ;UÐ%ÑVÔVÐVÐVÐVÐVÐVÐVÐVð ”-×9Ò9ØØØ)Ø œLð	 :ñ 
ô 
ˆð !(¤
ˆ
å-5©Z¬ZˆØ6>ˆŒÔ'¨
Ñ3åØØØØ *ð	
ñ 
ô 
ˆð Œk×!Ò! $¤,°Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð	à"*§-¢-¡/¤/Ð1Ð1Ð1Ð1Ð1Ð1ˆMØ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSÝÔ.¨}Ñ=Ô=Ð=øÝÔ,Ñ.Ô.ð 	ð 	ð 	Ø”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØð	øøøs   ÃAD4 Ä4AE8)Úsystem_promptÚinclude_contextÚtemperatureÚstop_sequencesÚmetadataÚmodel_preferencesÚtoolsÚtool_choiceÚmessagesÚ
max_tokensr{   r|   r}   r~   r   r€   r�   r‚   c       	      ƒ   ó‚  K  — |                       ¦   «          | j        j        r| j        j        j        nd}t	          ||	|
¦  «         t          |¦  «         | j        €t          d¦  «        ‚| j         	                    | j
        t          ¬¦  «        ƒ d{V —† | j                             |||||||||	|
| j
        ¬¦  «        }|j        }t          ¦   «         }|| j        j        |<   t!          d|||¬¦  «        }| j                             | j
        |¦  «        ƒ d{V —† 	 |                     ¦   «         ƒ d{V —†}| j         	                    | j
        t(          ¬¦  «        ƒ d{V —† t+          j        |¦  «        S # t/          j        ¦   «         $ r. | j         	                    | j
        t(          ¬¦  «        ƒ d{V —† ‚ w xY w)aš  
        Send a sampling request via the task message queue.

        This method:
        1. Checks client capability
        2. Updates task status to "input_required"
        3. Queues the sampling request
        4. Waits for the response (delivered via tasks/result round-trip)
        5. Updates task status back to "working"
        6. Returns the result

        Args:
            messages: The conversation messages for sampling
            max_tokens: Maximum tokens in the response
            system_prompt: Optional system prompt
            include_context: Context inclusion strategy
            temperature: Sampling temperature
            stop_sequences: Stop sequences
            metadata: Additional metadata
            model_preferences: Model selection preferences
            tools: Optional list of tools the LLM can use during sampling
            tool_choice: Optional control over tool usage behavior

        Returns:
            The sampling result from the client

        Raises:
            McpError: If client doesn't support sampling capability or tools
            ValueError: If tool_use or tool_result message structure is invalid
        NzMhandler is required for create_message(). Pass handler= to ServerTaskContext.ra   )rƒ   r„   r{   r|   r}   r~   r   r€   r�   r‚   rb   rc   rd   )r^   r0   Úclient_paramsÚcapabilitiesr   r   r2   rh   r3   ri   r:   r   Ú_build_create_message_requestrk   r   rl   r   r1   rm   rn   r   r   ro   rp   rq   )r4   rƒ   r„   r{   r|   r}   r~   r   r€   r�   r‚   Úclient_capsrc   rr   rf   rs   rt   s                    r5   Úcreate_messagez ServerTaskContext.create_messageP  s  è è € ðX 	×'Ò'Ñ)Ô)Ð)ØBFÄ-ÔB]Ðg�d”mÔ1Ô>Ð>ÐcgˆÝ ¨U°KÑ@Ô@Ð@Ý)¨(Ñ3Ô3Ð3àŒ=Ð ÝÐnÑoÔoÐoð Œk×%Ò% d¤lÕ;UÐ%ÑVÔVÐVÐVÐVÐVÐVÐVÐVð ”-×=Ò=ØØ!Ø'Ø+Ø#Ø)ØØ/ØØ#Ø œLð >ñ 
ô 
ˆð !(¤
ˆ
å-5©Z¬ZˆØ6>ˆŒÔ'¨
Ñ3åØØØØ *ð	
ñ 
ô 
ˆð Œk×!Ò! $¤,°Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð
	à"*§-¢-¡/¤/Ð1Ð1Ð1Ð1Ð1Ð1ˆMØ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSÝ&Ô5°mÑDÔDÐDøÝÔ,Ñ.Ô.ð 	ð 	ð 	ð ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØð	øøøs   Ä AE: Å:AF>i`ê  ©rR   rR   c             ƒ   óø  K  — | j         j        r| j         j        j        nd}t          |¦  «         | j        €t          d¦  «        ‚| j                             | j        t          ¬¦  «        ƒ d{V —† | j          
                    ||| j        t          |¬¦  «        ¬¦  «        }|j        }t          ¦   «         }|| j        j        |<   t          d|||¬¦  «        }| j                             | j        |¦  «        ƒ d{V —† 	 |                     ¦   «         ƒ d{V —†}	t'          j        |	¦  «        }
|
j        j        }| j         j        }|                     |¦  «        2 3 d{V —†}Œ6 |                     |t4          ¦  «        ƒ d{V —†}| j                             | j        t6          ¬¦  «        ƒ d{V —† |S # t9          j        ¦   «         $ r. | j                             | j        t6          ¬¦  «        ƒ d{V —† ‚ w xY w)aJ  
        Send a task-augmented elicitation via the queue, then poll client.

        This is for use inside a task-augmented tool call when you want the client
        to handle the elicitation as its own task. The elicitation request is queued
        and delivered when the client calls tasks/result. After the client responds
        with CreateTaskResult, we poll the client's task until complete.

        Args:
            message: The message to present to the user
            requestedSchema: Schema defining the expected response structure
            ttl: Task time-to-live in milliseconds for the client's task

        Returns:
            The client's elicitation response

        Raises:
            McpError: If client doesn't support task-augmented elicitation
            RuntimeError: If handler is not configured
        Nz(handler is required for elicit_as_task()ra   r‹   )rB   r_   rb   r*   rc   rd   )r0   r†   r‡   r	   r2   rh   r3   ri   r:   r   rj   r"   rk   r   rl   r   r1   rm   rn   r   ro   r*   rM   Ú_experimentalÚ	poll_taskÚget_task_resultr   r   rp   rq   )r4   rB   r_   rR   r‰   rc   rr   rf   rs   rt   Úcreate_resultÚclient_task_idÚfeaturesÚ_rF   s                  r5   Úelicit_as_taskz ServerTaskContext.elicit_as_task®  st  è è € ð6 CGÄ-ÔB]Ðg�d”mÔ1Ô>Ð>ÐcgˆÝ*¨;Ñ7Ô7Ð7àŒ=Ð ÝÐIÑJÔJÐJð Œk×%Ò% d¤lÕ;UÐ%ÑVÔVÐVÐVÐVÐVÐVÐVÐVà”-×:Ò:ØØ+Ø œLÝ #Ð&Ñ&Ô&ð	 ;ñ 
ô 
ˆð !(¤
ˆ
å-5©Z¬ZˆØ6>ˆŒÔ'¨
Ñ3åØØØØ *ð	
ñ 
ô 
ˆð Œk×!Ò! $¤,°Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð	à"*§-¢-¡/¤/Ð1Ð1Ð1Ð1Ð1Ð1ˆMÝ,Ô;¸MÑJÔJˆMØ*Ô/Ô6ˆNð ”}Ô2ˆHØ#×-Ò-¨nÑ=Ô=ð ð ð ð ð ð ð �aØð >ð $×3Ò3ØÝñô ð ð ð ð ð ð ˆFð
 ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØˆMøåÔ,Ñ.Ô.ð 	ð 	ð 	Ø”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØð	øøøs   ÄAF5 ÅE%Å#AF5 Æ5AG9)	rR   r{   r|   r}   r~   r   r€   r�   r‚   c       
      ƒ   óH  K  — | j         j        r| j         j        j        nd}t          |¦  «         t	          ||
|¦  «         t          |¦  «         | j        €t          d¦  «        ‚| j         	                    | j
        t          ¬¦  «        ƒ d{V —† | j                              ||||||||	|
|| j
        t          |¬¦  «        ¬¦  «        }|j        }t          ¦   «         }|| j        j        |<   t#          d|||¬¦  «        }| j                             | j
        |¦  «        ƒ d{V —† 	 |                     ¦   «         ƒ d{V —†}t+          j        |¦  «        }|j        j        }| j         j        }|                     |¦  «        2 3 d{V —†}Œ6 |                     |t8          ¦  «        ƒ d{V —†}| j         	                    | j
        t:          ¬¦  «        ƒ d{V —† |S # t=          j        ¦   «         $ r. | j         	                    | j
        t:          ¬¦  «        ƒ d{V —† ‚ w xY w)a<  
        Send a task-augmented sampling request via the queue, then poll client.

        This is for use inside a task-augmented tool call when you want the client
        to handle the sampling as its own task. The request is queued and delivered
        when the client calls tasks/result. After the client responds with
        CreateTaskResult, we poll the client's task until complete.

        Args:
            messages: The conversation messages for sampling
            max_tokens: Maximum tokens in the response
            ttl: Task time-to-live in milliseconds for the client's task
            system_prompt: Optional system prompt
            include_context: Context inclusion strategy
            temperature: Sampling temperature
            stop_sequences: Stop sequences
            metadata: Additional metadata
            model_preferences: Model selection preferences
            tools: Optional list of tools the LLM can use during sampling
            tool_choice: Optional control over tool usage behavior

        Returns:
            The sampling result from the client

        Raises:
            McpError: If client doesn't support task-augmented sampling or tools
            ValueError: If tool_use or tool_result message structure is invalid
            RuntimeError: If handler is not configured
        Nz0handler is required for create_message_as_task()ra   r‹   )rƒ   r„   r{   r|   r}   r~   r   r€   r�   r‚   rb   r*   rc   rd   ) r0   r†   r‡   r
   r   r   r2   rh   r3   ri   r:   r   rˆ   r"   rk   r   rl   r   r1   rm   rn   r   ro   r*   rM   r�   rŽ   r�   r   r   rp   rq   )r4   rƒ   r„   rR   r{   r|   r}   r~   r   r€   r�   r‚   r‰   rc   rr   rf   rs   rt   r�   r‘   r’   r“   rF   s                          r5   Úcreate_message_as_taskz(ServerTaskContext.create_message_as_taský  s¯  è è € ðX CGÄ-ÔB]Ðg�d”mÔ1Ô>Ð>ÐcgˆÝ'¨Ñ4Ô4Ð4Ý ¨U°KÑ@Ô@Ð@Ý)¨(Ñ3Ô3Ð3àŒ=Ð ÝÐQÑRÔRÐRð Œk×%Ò% d¤lÕ;UÐ%ÑVÔVÐVÐVÐVÐVÐVÐVÐVð ”-×=Ò=ØØ!Ø'Ø+Ø#Ø)ØØ/ØØ#Ø œLÝ #Ð&Ñ&Ô&ð >ñ 
ô 
ˆð !(¤
ˆ
å-5©Z¬ZˆØ6>ˆŒÔ'¨
Ñ3åØØØØ *ð	
ñ 
ô 
ˆð Œk×!Ò! $¤,°Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7Ð7ð	à"*§-¢-¡/¤/Ð1Ð1Ð1Ð1Ð1Ð1ˆMÝ,Ô;¸MÑJÔJˆMØ*Ô/Ô6ˆNð ”}Ô2ˆHØ#×-Ò-¨nÑ=Ô=ð ð ð ð ð ð ð �aØð >ð $×3Ò3ØÝ#ñô ð ð ð ð ð ð ˆFð
 ”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØˆMøåÔ,Ñ.Ô.ð 	ð 	ð 	Ø”+×)Ò)¨$¬,Õ?RÐ)ÑSÔSÐSÐSÐSÐSÐSÐSÐSØð	øøøs   Ä*AG ÆFÆAG ÇAH!)r8   N)*Ú__name__Ú
__module__Ú__qualname__Ú__doc__r!   r   r   r   r   r6   ÚpropertyÚstrr:   r*   Úboolr>   r@   rD   r   rH   rK   rE   r[   r^   r   r   ru   rz   Úlistr   Úintr   ÚfloatÚdictr   r   r%   r&   r   rŠ   r”   r–   © r7   r5   r(   r(   5   s¢  € € € € € ðð ð< -1ðð ð ð ðð ð	ð
 ðð  ðð # TÑ)ðð ð ð ð6 ð!˜ð !ð !ð !ñ „Xð!ð ð�dð ð ð ñ „Xðð ð&˜dð &ð &ð &ñ „Xð&ð)ð )ð )ð )ð CGð 
,ð 
,ð 
,¨3ð 
,¸4ð 
,È4ð 
,ð 
,ð 
,ð 
,ð @Dð 
,ð 
,ð 
, Vð 
,¸ð 
,Èð 
,ð 
,ð 
,ð 
,ð 8<ð 
,ð 
,ð 
, ð 
,°ð 
,Àð 
,ð 
,ð 
,ð 
,ð
ð 
ð 
ð 
ð*ð ð ð ðð ð ð ð?àð?ð /ð?ð 
ð	?ð ?ð ?ð ?ðBCàðCð ðCð ð	Cð
 
ðCð Cð Cð CðT %)Ø15Ø$(Ø+/Ø*.Ø59Ø#'Ø)-ð\ð \ð \à�Ô'ð\ð ð	\ð
 ˜T‘zð\ð (¨$Ñ.ð\ð ˜T‘\ð\ð ˜Sœ	 DÑ(ð\ð �s˜C�x”. 4Ñ'ð\ð ,¨dÑ2ð\ð �DŒz˜DÑ ð\ð   $Ñ&ð\ð 
ð\ð \ð \ð \ðF ðMð Mð MàðMð /ðMð
 ðMð 
ðMð Mð Mð Mðh Ø$(Ø15Ø$(Ø+/Ø*.Ø59Ø#'Ø)-ðið ið ià�Ô'ðið ð	ið
 ðið ˜T‘zðið (¨$Ñ.ðið ˜T‘\ðið ˜Sœ	 DÑ(ðið �s˜C�x”. 4Ñ'ðið ,¨dÑ2ðið �DŒz˜DÑ ðið   $Ñ&ðið 
ðið ið ið ið ið ir7   r(   )2rš   Útypingr   rp   Ú+mcp.server.experimental.task_result_handlerr   Úmcp.server.sessionr   Úmcp.server.validationr   r   Úmcp.shared.exceptionsr   Ú*mcp.shared.experimental.tasks.capabilitiesr	   r
   Ú%mcp.shared.experimental.tasks.contextr   Ú+mcp.shared.experimental.tasks.message_queuer   r   Ú&mcp.shared.experimental.tasks.resolverr   Ú#mcp.shared.experimental.tasks.storer   Ú	mcp.typesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r(   r¢   r7   r5   ú<module>r®      s(  ððð ð Ð Ð Ð Ð Ð à €€€à IÐ IÐ IÐ IÐ IÐ IØ ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø \Ð \Ð \Ð \Ð \Ð \Ð \Ð \Ø *Ð *Ð *Ð *Ð *Ð *ðð ð ð ð ð ð ð ð >Ð =Ð =Ð =Ð =Ð =Ø WÐ WÐ WÐ WÐ WÐ WÐ WÐ WØ ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð6qð qð qð qð qñ qô qð qð qð qr7   