+
    ÆÚjE&  ã                   óæ   € R t ^ RIHt ^ RIHtHtHt ^ RIHtH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt RR	.t ]!]"]3,          t# RR R llt$ ! R R4      t%R
# )a¿  Typed MCP request sugar over an `Outbound`.

`ClientPeer` wraps any `Outbound` (anything with `send_raw_request` and
`notify`) and exposes the server-to-client request methods (sampling,
elicitation, roots, ping) as typed methods.

`ClientPeer` does no capability gating: it builds the params, calls
`send_raw_request(method, params)`, and parses the result into the typed
model. Gating (and `NoBackChannelError`) is the wrapped `Outbound`'s job.
)ÚMapping)ÚAnyÚcastÚoverload)ÚCreateMessageRequestParamsÚCreateMessageResultÚCreateMessageResultWithToolsÚElicitRequestedSchemaÚElicitRequestFormParamsÚElicitRequestURLParamsÚElicitResultÚIncludeContextÚListRootsResultÚModelPreferencesÚRequestParamsÚRequestParamsMetaÚSamplingMessageÚToolÚ
ToolChoice)Ú	BaseModel)Ú
deprecated)ÚCallOptionsÚOutbound)ÚMCPDeprecationWarningÚ
ClientPeerÚMetaNc                óˆ   € V ^8„  d   QhR\         R,          R\        R,          R\        \        \        3,          R,          /# )é   ÚmodelNÚmetaÚreturn)r   r   ÚdictÚstrr   )Úformats   "Ú†/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/mcp/shared/peer.pyÚ__annotate__r%   ,   s9   € ÷ ñ ”y 4Õ'ð ¬t°d­{ð ÄdÌ3ÔPSÈ8ÅnÐW[ÕF[ñ ó    c                ó
  € V e   V P                  RRRR7      MRpV'       da   \        \        \        V4      R7      P                  RRR7      R,          p\	        T;'       g    / 4      p/ VP                  R/ 4      CVCVR&   V# )aR  Serialize a params model to a wire dict, merging `meta` into `_meta`.

Shared by `ClientPeer` and `Connection` so every typed convenience method
gets the same `_meta` handling. `meta` keys take precedence over any
`_meta` already present on the model.

`meta` is serialized through `RequestParams` so Python field names emit
their wire aliases: an inbound `ctx.meta` carries `progress_token` (the
key `_extract_meta` validation produces), and forwarding it outbound via
`meta=ctx.meta` must put `progressToken` back on the wire. Keys not
declared on `RequestParamsMeta` pass through unchanged.
NTÚjson)Úby_aliasÚmodeÚexclude_none)Ú_meta)r)   r*   r,   )Ú
model_dumpr   r   r   r!   Úget)r   r   ÚoutÚ	wire_metas   &&  r$   Údump_paramsr1   ,   s„   € ð NSÒM^ˆ%×
Ñ
 D¨vÀDÐ
Ô
IÐdh€CßÜ!¬Ô->ÀÓ(EÔF×QÑQÐ[_ÐflÐQÓmÐnuÕvˆ	Ü�3—9�9˜"‹oˆØ<˜#Ÿ'™' '¨2Ó.Ð<°)Ð<ˆˆG‰Ø€Jr&   c                   ój  a € ] tR t^At o RtV 3R lR ltR'V 3R lR lltR'V 3R lR llt]]	! R	]
R
7      RRRRRRRRRRRRRRRRRRRR/
V 3R lR ll4       4       t]]	! R	]
R
7      RRRRRRRRRRRRRRRRRR/	V 3R lR ll4       4       t]]	! R	]
R
7      RRRRRRRRRRRRRRRRRR/	V 3R lR ll4       4       t]	! R	]
R
7      RRRRRRRRRRRRRRRRRRRR/
V 3R lR ll4       tRRRR/V 3R lR lltRRRR/V 3R lR  llt]	! R!]
R
7      RRRR/V 3R" lR# ll4       tRRRR/V 3R$ lR% lltR&tV tR# )(r   zþTyped server-to-client request methods over a wrapped `Outbound`.

Use this when you have a bare dispatcher (or any `Outbound`) and want the
typed methods (`sample`, `elicit_form`, `elicit_url`, `list_roots`,
`ping`) without writing your own host class.
c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úoutboundr    N)r   )r#   Ú__classdict__s   "€r$   r%   ÚClientPeer.__annotate__I   s   ø€ ÷ "ñ "¡ð "¨dñ "r&   c                ó   € Wn         R # ©N©Ú	_outbound)Úselfr4   s   &&r$   Ú__init__ÚClientPeer.__init__I   s   € Ø!Žr&   Nc          
      óz   <€ V ^8„  d   QhRS[ RS[S[ S[3,          R,          RS[R,          RS[S[ S[3,          /# ©r   ÚmethodÚparamsNÚoptsr    )r"   r   r   r   r!   )r#   r5   s   "€r$   r%   r6   L   sT   ø€ ÷ Kñ KáðKñ ™™S˜Õ! DÕ(ðKñ ˜DÕ ð	Kñ
 
‰c‘3ˆh�ñKr&   c              ƒ  óV   "  € V P                   P                  WV4      G R j  x€L
 #  L5ir8   )r:   Úsend_raw_request©r;   r@   rA   rB   s   &&&&r$   rD   ÚClientPeer.send_raw_requestL   s$   é € ð —^‘^×4Ñ4°VÀTÓJ×JÐJÑJùs   ‚ )¢'£)c                ób   <€ V ^8„  d   QhRS[ RS[S[ S[3,          R,          RS[R,          RR/# r?   )r"   r   r   r   )r#   r5   s   "€r$   r%   r6   T   s?   ø€ ÷ :ñ :¡3ð :±¹¹S¸Õ0AÀDÕ0Hð :ÑP[Ð^bÕPbð :Ðnrñ :r&   c              ƒ  óZ   "  € V P                   P                  WV4      G R j  x€L
  R #  L5ir8   )r:   ÚnotifyrE   s   &&&&r$   rI   ÚClientPeer.notifyT   s   é € Ø�n‰n×#Ñ# F°DÓ9×9Ô9ùs   ‚ +¢)£+zBThe sampling capability is deprecated as of 2026-07-28 (SEP-2577).)ÚcategoryÚsystem_promptÚinclude_contextÚtemperatureÚstop_sequencesÚmetadataÚmodel_preferencesÚtoolsÚtool_choicer   rB   c                ó
  <€ V ^8„  d   QhRS[ S[,          RS[RS[R,          RS[R,          RS[R,          RS[ S[,          R,          RS[S[S[3,          R,          R	S[R,          R
RRRRS[	R,          RS[
R,          RS[/# ©r   ÚmessagesÚ
max_tokensrL   NrM   rN   rO   rP   rQ   rR   rS   r   rB   r    )Úlistr   Úintr"   r   Úfloatr!   r   r   r   r   r   )r#   r5   s   "€r$   r%   r6   Y   sÃ   ø€ ÷ "ñ "á‘Õ'ð"ñ ð	"ñ
 ˜T•zð"ñ (¨$Õ.ð"ñ ˜T•\ð"ñ ™S�	 DÕ(ð"ñ ‘s™C�x•. 4Õ'ð"ñ ,¨dÕ2ð"ð ð"ð ð"ñ �T�kð"ñ ˜DÕ ð"ñ 
ñ"r&   c             ƒ  ó   "  € R # 5ir8   © ©r;   rV   rW   rL   rM   rN   rO   rP   rQ   rR   rS   r   rB   s   &&$$$$$$$$$$$r$   ÚsampleÚClientPeer.sampleW   s
   é € ñ" "ùó   ‚c                ó,  <€ V ^8„  d   QhRS[ S[,          RS[RS[R,          RS[R,          RS[R,          RS[ S[,          R,          RS[S[S[3,          R,          R	S[R,          R
S[ S[	,          RS[
R,          RS[R,          RS[R,          RS[/# rU   ©rX   r   rY   r"   r   rZ   r!   r   r   r   r   r   r   r   )r#   r5   s   "€r$   r%   r6   k   sÌ   ø€ ÷ +ñ +á‘Õ'ð+ñ ð	+ñ
 ˜T•zð+ñ (¨$Õ.ð+ñ ˜T•\ð+ñ ™S�	 DÕ(ð+ñ ‘s™C�x•. 4Õ'ð+ñ ,¨dÕ2ð+ñ ‘D�zð+ñ   $Õ&ð+ñ �T�kð+ñ ˜DÕ ð+ñ 
&ñ+r&   c             ƒ  ó   "  € R # 5ir8   r\   r]   s   &&$$$$$$$$$$$r$   r^   r_   i   ó
   é € ñ" (+ùr`   c                ó,  <€ V ^8„  d   QhRS[ S[,          RS[RS[R,          RS[R,          RS[R,          RS[ S[,          R,          RS[S[S[3,          R,          R	S[R,          R
S[ S[	,          R,          RS[
RS[R,          RS[R,          RS[/# rU   rb   )r#   r5   s   "€r$   r%   r6   }   sÌ   ø€ ÷ +ñ +á‘Õ'ð+ñ ð	+ñ
 ˜T•zð+ñ (¨$Õ.ð+ñ ˜T•\ð+ñ ™S�	 DÕ(ð+ñ ‘s™C�x•. 4Õ'ð+ñ ,¨dÕ2ð+ñ ‘D�z˜DÕ ð+ñ  ð+ñ �T�kð+ñ ˜DÕ ð+ñ 
&ñ+r&   c             ƒ  ó   "  € R # 5ir8   r\   r]   s   &&$$$$$$$$$$$r$   r^   r_   {   rd   r`   c                óJ  <€ V ^8„  d   QhRS[ S[,          RS[RS[R,          RS[R,          RS[R,          RS[ S[,          R,          RS[S[S[3,          R,          R	S[R,          R
S[ S[	,          R,          RS[
R,          RS[R,          RS[R,          RS[S[,          /# rU   )rX   r   rY   r"   r   rZ   r!   r   r   r   r   r   r   r   r   )r#   r5   s   "€r$   r%   r6   Ž   sæ   ø€ ÷ &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ñ �T�kð&Iñ ˜DÕ ð&Iñ 
Ñ;Õ	;ñ&Ir&   c             ƒ  óð   "  € \        VVVVVVVVV	V
R7
      pV P                  R\        WÛ4      V4      G Rj  x€L
 pV	f   V
e   \        P                  ! VRR7      # \
        P                  ! VRR7      #  L<5i)a  Send a `sampling/createMessage` request to the peer.

Raises:
    MCPError: The peer responded with an error.
    NoBackChannelError: No back-channel for server-initiated requests.
    pydantic.ValidationError: The peer's result does not match the expected result type.
)
rV   rL   rM   rN   rW   rO   rP   rQ   rR   rS   zsampling/createMessageNF©Úby_name)r   rD   r1   r   Úmodel_validater   )r;   rV   rW   rL   rM   rN   rO   rP   rQ   rR   rS   r   rB   rA   Úresults   &&$$$$$$$$$$$  r$   r^   r_   �   s‡   é € ô0 ,ØØ'Ø+Ø#Ø!Ø)ØØ/ØØ#ô
ˆð ×,Ñ,Ð-EÄ{ÐSYÓG`ÐbfÓg×gˆØÒ Ò 7Ü/×>Ò>¸vÈuÔUÐUÜ"×1Ò1°&À%ÔHÐHñ hùs   ‚5A6·A4¸=A6c          
      óT   <€ V ^8„  d   QhRS[ RS[RS[R,          RS[R,          RS[/# )r   ÚmessageÚrequested_schemar   NrB   r    )r"   r	   r   r   r   )r#   r5   s   "€r$   r%   r6   ¶   sM   ø€ ÷ Bñ BáðBñ 0ðBñ
 �T�kðBñ ˜DÕ ðBñ 
ñBr&   c             ƒ  óž   "  € \        WR7      pV P                  R\        WS4      V4      G Rj  x€L
 p\        P                  ! VRR7      #  L5i)a  Send a form-mode `elicitation/create` request.

Raises:
    MCPError: The peer responded with an error.
    NoBackChannelError: No back-channel for server-initiated requests.
    pydantic.ValidationError: The peer's result does not match the expected result type.
)rn   ro   úelicitation/createNFri   )r
   rD   r1   r   rk   )r;   rn   ro   r   rB   rA   rl   s   &&&$$  r$   Úelicit_formÚClientPeer.elicit_form¶   sH   é € ô )°Ô\ˆØ×,Ñ,Ð-AÄ;ÈvÓC\Ð^bÓc×cˆÜ×*Ò*¨6¸5ÔAÐAñ dùs   ‚,A®A¯Ac                óZ   <€ V ^8„  d   QhRS[ RS[ RS[ RS[R,          RS[R,          RS[/# )r   rn   ÚurlÚelicitation_idr   NrB   r    )r"   r   r   r   )r#   r5   s   "€r$   r%   r6   É   sX   ø€ ÷ Bñ BáðBñ ðBñ ð	Bñ �T�kðBñ ˜DÕ ðBñ 
ñBr&   c             ƒ  ó    "  € \        WVR7      pV P                  R\        Wd4      V4      G Rj  x€L
 p\        P                  ! VRR7      #  L5i)a  Send a URL-mode `elicitation/create` request.

Raises:
    MCPError: The peer responded with an error.
    NoBackChannelError: No back-channel for server-initiated requests.
    pydantic.ValidationError: The peer's result does not match the expected result type.
)rn   ru   rv   rq   NFri   )r   rD   r1   r   rk   )r;   rn   ru   rv   r   rB   rA   rl   s   &&&&$$  r$   Ú
elicit_urlÚClientPeer.elicit_urlÉ   sK   é € ô  (°ÐQ_Ô`ˆØ×,Ñ,Ð-AÄ;ÈvÓC\Ð^bÓc×cˆÜ×*Ò*¨6¸5ÔAÐAñ dùs   ‚-A¯A°Az?The roots capability is deprecated as of 2026-07-28 (SEP-2577).c                óH   <€ V ^8„  d   QhRS[ R,          RS[R,          RS[/# ©r   r   NrB   r    )r   r   r   )r#   r5   s   "€r$   r%   r6   Þ   s2   ø€ ÷ 	Eñ 	E©¨t­ð 	EÁ+ÐPTÕBTð 	EÑ`oñ 	Er&   c             ƒ  óˆ   "  € V P                  R\        RV4      V4      G Rj  x€L
 p\        P                  ! VRR7      #  L5i)zöSend a `roots/list` request.

Raises:
    MCPError: The peer responded with an error.
    NoBackChannelError: No back-channel for server-initiated requests.
    pydantic.ValidationError: The peer's result does not match the expected result type.
z
roots/listNFri   )rD   r1   r   rk   )r;   r   rB   rl   s   &$$ r$   Ú
list_rootsÚClientPeer.list_rootsÝ   s?   é € ð ×,Ñ,¨\¼;ÀtÈTÓ;RÐTXÓY×YˆÜ×-Ò-¨f¸eÔDÐDñ Zùs   ‚!A£A ¤Ac                óF   <€ V ^8„  d   QhRS[ R,          RS[R,          RR/# r{   )r   r   )r#   r5   s   "€r$   r%   r6   é   s1   ø€ ÷ Kñ K¡$¨¥+ð K¹KÈ$Õ<Nð KÐZ^ñ Kr&   c             ƒ  ó\   "  € V P                  R\        RV4      V4      G Rj  x€L
  R#  L5i)z­Send a `ping` request and ignore the result.

Raises:
    MCPError: The peer responded with an error.
    NoBackChannelError: No back-channel for server-initiated requests.
ÚpingN)rD   r1   )r;   r   rB   s   &$$r$   r�   ÚClientPeer.pingé   s&   é € ð ×#Ñ# F¬K¸¸dÓ,CÀTÓJ×JÔJùs   ‚!,£*¤,r9   r8   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r<   rD   rI   r   r   r   r^   rr   rx   r}   r�   Ú__static_attributes__Ú__classdictcell__)r5   s   @r$   r   r   A   sö  ø‡ € ñ÷"ð "÷Kò K÷:ò :ð ÙÐTÐ_tÔuð"ð
 %)ð"ð 26ð"ð %)ð"ð ,0ð"ð +/ð"ð 6:ð"ð ð"ð !ð"ð !ð"ð $(÷"ñ "ó vó ð"ð  ÙÐTÐ_tÔuð+ð
 %)ð+ð 26ð+ð %)ð+ð ,0ð+ð +/ð+ð 6:ð+ð *.ð+ð !ð+ð $(÷+ñ +ó vó ð+ð  ÙÐTÐ_tÔuð+ð
 %)ð+ð 26ð+ð %)ð+ð ,0ð+ð +/ð+ð 6:ð+ð $(ð+ð !ð+ð $(÷+ñ +ó vó ð+ñ  ÐTÐ_tÔuð&Ið
 %)ð&Ið 26ð&Ið %)ð&Ið ,0ð&Ið +/ð&Ið 6:ð&Ið $(ð&Ið *.ð&Ið !ð&Ið $(÷&Iñ &Ió vð&IðPBð
 !ðBð $(÷Bò Bð&Bð !ðBð $(÷Bò Bñ( ÐQÐ\qÔrð	E°dð 	EÐW[÷ 	Eñ 	Eó sð	EðK°ð KÐQU÷ K÷ Kð Kr&   r8   )&r‡   Úcollections.abcr   Útypingr   r   r   Ú	mcp_typesr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Úpydanticr   Útyping_extensionsr   Úmcp.shared.dispatcherr   r   Úmcp.shared.exceptionsr   Ú__all__r!   r"   r   r1   r   r\   r&   r$   Ú<module>r’      si   ðñ	õ $ß &Ñ &÷÷ ÷ ÷ ñ õ" Ý (ç 7Ý 7à˜Ð
 €àˆC�ˆH…~€Ø N÷÷*oKó oKr&   