§
    öŽ’j±  ã            	       ó®   — d Z ddlmZmZ ddlZg d¢ZdZdZ G d„ de¦  «        Z	 	 	 dd	e	e
e
f         dz  d
ej        dz  dej        dz  dej        fd„ZdS )z@Utilities for creating standardized httpx AsyncClient instances.é    )ÚAnyÚProtocolN)Úcreate_mcp_http_clientÚMCP_DEFAULT_TIMEOUTÚMCP_DEFAULT_SSE_READ_TIMEOUTg      >@g     Àr@c            	       ón   — e Zd Z	 	 	 ddeeef         dz  dej        dz  dej        dz  dej        fd„Z	dS )ÚMcpHttpClientFactoryNÚheadersÚtimeoutÚauthÚreturnc                 ó   — d S )N© )Úselfr
   r   r   s       úEC:\Projects\DSCons\.venv\Lib\site-packages\mcp\shared\_httpx_utils.pyÚ__call__zMcpHttpClientFactory.__call__   s	   € ð
  ˜Có    ©NNN)
Ú__name__Ú
__module__Ú__qualname__ÚdictÚstrÚhttpxÚTimeoutÚAuthÚAsyncClientr   r   r   r   r	   r	      s|   € € € € € ð *.Ø(,Ø"&ð	 ð  à�c˜3�h” $Ñ&ð ð ” Ñ%ð ð Œj˜4Ñð	 ð
 
Ô	ð ð  ð  ð  ð  ð  r   r	   r
   r   r   r   c                 óž   — ddi}|€$t          j        t          t          ¬¦  «        |d<   n||d<   | �| |d<   |�||d<   t          j        di |¤ŽS )	a	  Create a standardized httpx AsyncClient with MCP defaults.

    This function provides common defaults used throughout the MCP codebase:
    - follow_redirects=True (always enabled)
    - Default timeout of 30 seconds if not specified

    Args:
        headers: Optional headers to include with all requests.
        timeout: Request timeout as httpx.Timeout object.
            Defaults to 30 seconds if not specified.
        auth: Optional authentication handler.

    Returns:
        Configured httpx.AsyncClient instance with MCP defaults.

    Note:
        The returned AsyncClient must be used as a context manager to ensure
        proper cleanup of connections.

    Examples:
        # Basic usage with MCP defaults
        async with create_mcp_http_client() as client:
            response = await client.get("https://api.example.com")

        # With custom headers
        headers = {"Authorization": "Bearer token"}
        async with create_mcp_http_client(headers) as client:
            response = await client.get("/endpoint")

        # With both custom headers and timeout
        timeout = httpx.Timeout(60.0, read=300.0)
        async with create_mcp_http_client(headers, timeout) as client:
            response = await client.get("/long-request")

        # With authentication
        from httpx import BasicAuth
        auth = BasicAuth(username="user", password="pass")
        async with create_mcp_http_client(headers, timeout, auth) as client:
            response = await client.get("/protected-endpoint")
    Úfollow_redirectsTN)Úreadr   r
   r   r   )r   r   r   r   r   )r
   r   r   Úkwargss       r   r   r      sz   € ð^ 	˜Dð€Fð
 €Ý!œMÕ*=ÕD`ÐaÑaÔaˆˆyÑÐà#ˆˆyÑð ÐØ#ˆˆyÑð ÐØˆˆv‰åÔÐ&Ð&˜vÐ&Ð&Ð&r   r   )Ú__doc__Útypingr   r   r   Ú__all__r   r   r	   r   r   r   r   r   r   r   r   r   ú<module>r%      sê   ðØ FÐ Fà  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à €€€à
[Ð
[Ð
[€ð Ð Ø$Ð ð ð  ð  ð  ð  ˜8ñ  ô  ð  ð &*Ø$(Ø"ð@'ð @'Ø�#�s�(Œ^˜dÑ"ð@'àŒ]˜TÑ!ð@'ð Œ*�tÑ
ð@'ð Ôð	@'ð @'ð @'ð @'ð @'ð @'r   