Ë
    ñÏj°ö  ã                  ó$  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZ ddlmZmZmZmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z' ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD erddlEmFZF ddlGmHZH d!d„ZId"d„ZJeeeKeKf      ZLd#d„ZMd#d„ZNd$d„ZOd%d„ZP	 	 	 	 	 	 d&d„ZQ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d'd„ZR G d„ d «      ZSy)(zEMain SandboxClient class for interacting with the sandbox server API.é    )ÚannotationsN)ÚCallableÚMapping)ÚPath)ÚTYPE_CHECKINGÚAnyÚOptionalÚUnionÚoverload)Úquote)Úutils)Ú	Langsmith)Úhttpx)Ú_get_openapi_base_url)ÚAccessDelegationÚ_validate_access_delegation)ÚResourceCreationErrorÚResourceNameConflictErrorÚResourceNotFoundErrorÚResourceTimeoutErrorÚSandboxAPIError)Úhandle_client_http_errorÚhandle_sandbox_creation_errorÚmerge_headersÚraise_if_not_readyÚvalidate_service_paramsÚvalidate_ttl)
ÚDownloadContentDispositionÚDownloadURLÚResourceStatusÚ	RunConfigÚServiceAccessÚServiceLoginURLÚ
ServiceURLÚSnapshotÚSnapshotTagÚ_run_config_payload)ÚSandboxMountConfigÚ"validate_mount_config_proxy_config)ÚSandboxProxyConfig)ÚSandbox)Úadd_sandbox_metadata)ÚRetryTransport)ÚRegistriesResource©ÚAsyncSandboxClientc                 óL   — t        j                  dd¬«      } t        | «      › d�S )z†Get the default sandbox API endpoint from environment.

    Derives the endpoint from LANGSMITH_ENDPOINT (or LANGCHAIN_ENDPOINT).
    ÚENDPOINTzhttps://api.smith.langchain.com)Údefaultz/api/v2/sandboxes)Úls_utilsÚget_env_varr   )Úbases    úV/var/www/html/gaurav-v2/venv/lib/python3.12/site-packages/langsmith/sandbox/_client.pyÚ_get_default_api_endpointr8   C   s+   € ô
 ×Ñ 
Ð4UÔV€DÜ# DÓ)Ð*Ð*;Ð<Ð<ó    c                 ó,   — t        j                  d«      S )z)Get the default API key from environment.ÚAPI_KEY)r4   r5   © r9   r7   Ú_get_default_api_keyr=   L   s   € ä×Ñ 	Ó*Ð*r9   c                ó6   — | st        d«      ‚t        | d¬«      S )zCQuote a user-controlled value for use as a single URL path segment.ú+URL path segment must be a non-empty stringÚ ©Úsafe©Ú
ValueErrorr   ©Úvalues    r7   Ú_quote_path_segmentrG   T   s   € áÜÐFÓGÐGÜ�˜RÔ Ð r9   c                ó6   — | st        d«      ‚t        | d¬«      S )zßQuote a Docker-style ``name[:tag]`` reference as one URL path segment.

    The colon is left literal: it is a legal path character and the server splits
    the reference on it, so percent-encoding would hide the tag.
    r?   Ú:rA   rC   rE   s    r7   Ú_quote_reference_segmentrJ   [   s    € ñ ÜÐFÓGÐGÜ�˜SÔ!Ð!r9   c                óV   — |rddj                  |«      z   nd}| › dt        |«      › |› �S )zDBuild the URL for a sandbox, optionally with trailing path segments.Ú/r@   z/boxes/)ÚjoinrG   )Úbase_urlÚnameÚsegmentsÚsuffixs       r7   Ú_box_urlrR   f   s5   € á)1ˆS�3—8‘8˜HÓ%Ò%°r€FØˆZ�wÔ2°4Ó8Ð9¸&¸ÐBÐBr9   c                ó¤  — t        j                  «       }t        j                  |d¬«      5 }t	        | j                  d«      «      D ]T  }|j                  | «      }|j                  r|j                  d   dk(  rŒ3|j                  ||j                  «       d¬«       ŒV 	 d d d «       |j                  «       S # 1 sw Y   |j                  «       S xY w)NÚw)ÚfileobjÚmodeÚ*r   z.gitF)ÚarcnameÚ	recursive)ÚioÚBytesIOÚtarfileÚopenÚsortedÚrglobÚrelative_toÚpartsÚaddÚas_posixÚgetvalue)Úcontext_pathÚbufÚtarÚpathÚrels        r7   Ú_make_docker_context_tarrj   l   sŸ   € Ü
�*‰*‹,€CÜ	�‰˜c¨Õ	,°Ü˜<×-Ñ-¨cÓ2Ö3ˆDØ×"Ñ" <Ó0ˆCØ�yŠy˜SŸY™Y q™\¨VÒ3ØØ�G‰G�D #§,¡,£.¸EˆGÕBñ	 4÷ 
-ð �<‰<‹>Ð÷ 
-ð �<‰<‹>Ðús   ¬A2B7Â7Cc                óÆ  — t        |«      j                  «       j                  «       }t        | «      j                  «       }|j                  «       s||z  }|j                  «       }|j	                  «       st        d|› �«      ‚|j                  «       st        d|› �«      ‚	 |j                  |«      }||j                  «       fS # t
        $ r}t        d«      |‚d }~ww xY w)Nzcontext must be a directory: zdockerfile must be a file: z!dockerfile must be inside context)	r   Ú
expanduserÚresolveÚis_absoluteÚis_dirrD   Úis_filer`   rc   )Ú
dockerfileÚcontextre   Údockerfile_pathÚdockerfile_relÚexcs         r7   Ú_resolve_dockerfile_contextrv   w   sã   € ô ˜“=×+Ñ+Ó-×5Ñ5Ó7€LÜ˜:Ó&×1Ñ1Ó3€OØ×&Ñ&Ô(Ø&¨Ñ8ˆØ%×-Ñ-Ó/€OØ×ÑÔ ÜÐ8¸¸ÐGÓHÐHØ×"Ñ"Ô$ÜÐ6°Ð6GÐHÓIÐIðGØ(×4Ñ4°\ÓBˆð ˜×0Ñ0Ó2Ð2Ð2øô ò GÜÐ<Ó=À3ÐFûðGús   Â#C Ã	C ÃCÃC c                óv  — t        j                  | |«      }t        j                  |«      }t        j                  |«      }	t        j                  |d«      }
ddd|
z   ddddd	d
| z   d	d|z   dd|	z   dd|z   g}|�|j	                  dd|z   g«       t        |xs i j                  «       «      D ]  \  }}|j	                  dd|› d|› �g«       Œ  dt        j                  |«      › dt        j                  |«      › dt        j                  d|
z   «      › dt        j                  |«      › dt        j                  |dz   «      › dt        j                  d|
z   «      › dt        j                  |dz   «      › dt        j                  |dz   «      › dt        j                  |«      › dt        j                  |«      › d�S )Nzbuildkitd.sockÚbuildctlz--addrzunix://Úbuildz--progress=plainz
--frontendzdockerfile.v0z--localzcontext=zdockerfile=z--optz	filename=z--outputztype=docker,name=ztarget=z
build-arg:Ú=zset -euo pipefail
mkdir -p Ú z
buildkitd --addr z --root zq --oci-worker=true --containerd-worker=false --oci-worker-snapshotter=native --oci-worker-binary buildkit-runc > z/buildkitd.logz— 2>&1 &
buildkitd_pid=$!
cleanup() { kill "$buildkitd_pid" >/dev/null 2>&1 || true; }
trap cleanup EXIT
for i in $(seq 1 300); do
  if buildctl --addr zi debug workers >/dev/null 2>&1; then break; fi
  if ! kill -0 "$buildkitd_pid" >/dev/null 2>&1; then cat z+; exit 1; fi
  if [ "$i" = 300 ]; then cat z¬; exit 1; fi
  sleep 0.1
done
for i in $(seq 1 300); do
  if docker info >/dev/null 2>&1; then break; fi
  if [ "$i" = 300 ]; then docker info; exit 1; fi
  sleep 0.1
done
z | docker load
rm -rf z	 || true
)	Ú	posixpathrM   ÚdirnameÚbasenameÚextendr^   ÚitemsÚshlexr   )Úremote_contextrt   Ú	image_refÚbuildkit_rootÚbuildkit_runÚ
build_argsÚtargetÚdockerfile_remoteÚdockerfile_dirÚdockerfile_nameÚsocket_pathrx   ÚkeyrF   s                 r7   Ú_make_dockerfile_build_commandr�   ‹   sé  € ô "Ÿ™ ~°~ÓFÐÜ×&Ñ&Ð'8Ó9€NÜ×(Ñ(Ð):Ó;€OÜ—.‘. Ð/?Ó@€KàØØ�KÑØØØØØØ�^Ñ#ØØ˜Ñ&ØØ�oÑ%ØØ˜iÑ'ð€Hð" ÐØ�‰˜ )¨fÑ"4Ð5Ô6Ü˜jÒ.¨B×5Ñ5Ó7Ö8‰
ˆˆUØ�‰˜ J¨s¨e°1°U°GÐ"<Ð=Õ>ð 9ð	Ü—K‘K Ó.Ð/¨q´·±¸\Ó1JÐ0Kð LÜ!ŸK™K¨	°KÑ(?Ó@ÐAð BÜ—+‘+˜mÓ,Ð-ð .ô �[‰[˜Ð(8Ñ8Ó9Ð:ð ; ô
 !&§¡¨I¸Ñ,CÓ DÐEð Fô �{‰{˜<Ð*:Ñ:Ó;Ð<ð =ä�{‰{˜<Ð*:Ñ:Ó;Ð<ð =ô �:‰:�hÓÐ
 ð !Ü—+‘+˜mÓ,Ð-¨Zð5	9ðr9   c                  óX  — e Zd ZdZddddddœ	 	 	 	 	 	 	 	 	 d?d„Zd@d„ZdAd„ZdBd	„ZedCd
„«       Z	dDd„Z
dDd„ZdEd„ZdFd„ZdFd„ZdGd„Z	 	 	 	 	 	 	 	 dHd„ZdBd„Z	 dIddddddddddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dJd„Z	 dIddddddddddddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dKd„ZddœdLd„ZddœdMd„Zdddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dNd„ZddœdOd„Zddœ	 	 	 	 	 dPd„Zed ddd!œ	 	 	 	 	 	 	 	 	 	 	 dQd"„«       Zed dd#œ	 	 	 	 	 	 	 	 	 	 	 dRd$„«       Zd ddd!œ	 	 	 	 	 	 	 	 	 	 	 dSd%„Zddddd&œ	 	 	 	 	 	 	 	 	 	 	 	 	 dTd'„Zd(d)dd*œ	 	 	 	 	 	 	 	 	 dUd+„Zd(dd,œ	 	 	 	 	 	 	 dVd-„ZddœdOd.„Zdddd/dd0œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dWd1„Z	 dId2dddddd/dd3œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dXd4„Z ddddd/dd5œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dYd6„Z!ddœ	 	 	 	 	 dZd7„Z"ddœ	 	 	 	 	 d[d8„Z#ddddd9œ	 	 	 	 	 	 	 	 	 d\d:„Z$ddœ	 	 	 	 	 d]d;„Z%d<d=dd*œ	 	 	 	 	 	 	 	 	 d^d>„Z&y)_ÚSandboxClientaŠ  Client for interacting with the Sandbox Server API.

    This client provides a simple interface for managing sandboxes and snapshots.

    Example:
        # Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment
        client = SandboxClient()

        # Or with explicit configuration
        client = SandboxClient(
            api_endpoint="https://api.smith.langchain.com/v2/sandboxes",
            api_key="your-api-key",
        )

        # Create a sandbox with the default runtime and run commands
        with client.sandbox() as sandbox:
            result = sandbox.run("python --version")
            print(result.stdout)
    Ng      $@é   ©Úapi_endpointÚtimeoutÚapi_keyÚmax_retriesÚheadersc               óz  — |xs
 t        «       j                  d«      | _        |xs
 t        «       }|| _        || _        || _        i | _        |rt        |«      ni | _	        i }|r||d<   | j                  rt        || j                  «      }t        |¬«      }t        j                  |||¬«      | _        d| _        y)a©  Initialize the SandboxClient.

        Args:
            api_endpoint: Full URL of the sandbox API endpoint. If not provided,
                          derived from LANGSMITH_ENDPOINT environment variable.
            timeout: Default HTTP timeout in seconds.
            api_key: API key for authentication. If not provided, uses
                     LANGSMITH_API_KEY environment variable.
            max_retries: Maximum number of retries for transient errors (502, 503,
                         504), rate limits (429), and connection failures. Set to 0
                         to disable retries. Default: 3.
            headers: Optional default headers attached to every request on this
                     client, including the data-plane ``/execute`` HTTP endpoint
                     and the ``/execute/ws`` WebSocket upgrade. Use this to pass
                     additional auth headers (e.g. ``X-Service-Key``).
        rL   z	X-Api-Key)r•   )Ú	transportr“   r–   N)r8   ÚrstripÚ	_base_urlr=   Ú_api_keyÚ_timeoutÚ_max_retriesÚ_sandbox_idsÚdictÚ_default_headersr   r-   r   ÚClientÚ_httpÚ_registries_client)	Úselfr’   r“   r”   r•   r–   Úresolved_api_keyÚclient_headersr˜   s	            r7   Ú__init__zSandboxClient.__init__â   s´   € ð2 'ÒEÔ*CÓ*E×MÑMÈcÓRˆŒØ"Ò<Ô&:Ó&<ÐØ(ˆŒØˆŒØ'ˆÔØ,.ˆÔÙAH´°W´ÈbˆÔØ)+ˆÙØ*:ˆN˜;Ñ'Ø× Ò Ü*¨>¸4×;PÑ;PÓQˆNÜ"¨{Ô;ˆ	Ü—\‘\Ø¨¸.ô
ˆŒ
ð 8<ˆÕr9   c                ó²   — | j                   j                  |«      }|€	 t        t        j                  |«      «      }t        |«       |S # t
        $ r Y Œw xY w)z5Attach metadata when the sandbox ID is already known.)rž   ÚgetÚstrÚuuidÚUUIDrD   r,   )r¤   rO   Ú
sandbox_ids      r7   Ú_trace_sandboxzSandboxClient._trace_sandbox  sY   € à×&Ñ&×*Ñ*¨4Ó0ˆ
ØÐðÜ ¤§¡¨4£Ó1�
ô 	˜ZÔ(ØÐøô ò Ùðús   ŸA
 Á
	AÁAc                óÂ   — | j                   j                  ||«      }| j                   j                  «       D ��ci c]  \  }}||k7  r||k7  r||“Œ c}}| _         y c c}}w ©N)rž   r©   r€   )r¤   rO   r­   Úcached_nameÚ	cached_ids        r7   Ú_forget_sandboxzSandboxClient._forget_sandbox  si   € Ø×&Ñ&×*Ñ*¨4°Ó6ˆ
ð +/×*;Ñ*;×*AÑ*AÔ*Cô
á*CÑ&�˜YØ˜dÒ" y°JÒ'>ð ˜Ñ"Ø*Cò
ˆÕùó 
s   ºAc                ó˜   — d}| j                   j                  |«      r"t        | j                   dt        |«        «      S | j                   S )z>Return the API root URL, without the ``/v2/sandboxes`` suffix.z/v2/sandboxesN)rš   Úendswithr   Úlen)r¤   rQ   s     r7   Ú	_api_rootzSandboxClient._api_root   s?   € à ˆØ�>‰>×"Ñ" 6Ô*Ü(¨¯©¸¼3¸v»;¸,Ð)GÓHÐHØ�~‰~Ðr9   c                óÌ   — | j                   €9t        | j                  | j                  «       | j                  xs d¬«      | _         | j                   j
                  j                  S )aæ  Manage sandbox image registries: create, list, retrieve, update, delete.

        A registry stores credentials for pulling private images. Create one,
        then pass its ``id`` as ``registry_id`` when building a snapshot.

        Example:
            registry = client.registries.create(
                name="internal",
                url="registry.example.com",
                username="robot",
                password=os.environ["REGISTRY_PASSWORD"],
            )
            snapshot = client.create_snapshot(
                "internal-python",
                docker_image="registry.example.com/internal/python:3.12",
                fs_capacity_bytes=2 * 1024**3,
                registry_id=registry.id,
            )
        N)r”   rN   Údefault_headers)r£   r   r›   r·   r    Ú	sandboxesÚ
registries©r¤   s    r7   r»   zSandboxClient.registries'  sV   € ð* ×"Ñ"Ð*Ü&/ØŸ™ØŸ™Ó)Ø $× 5Ñ 5Ò =¸ô'ˆDÔ#ð
 ×&Ñ&×0Ñ0×;Ñ;Ð;r9   c                óH   — |€yt        | j                  j                  |«      S )z8Merge default client headers with per-request overrides.N)r   r¢   r–   ©r¤   r–   s     r7   Ú_request_headerszSandboxClient._request_headersD  s!   € àˆ?ØÜ˜TŸZ™Z×/Ñ/°Ó9Ð9r9   c                óL   — | j                   s|€yt        | j                   |«      S )zÜMerge constructor-supplied default headers with per-request overrides.

        Used by the WebSocket exec path so headers like ``X-Service-Key``
        set on the client are attached to the WS upgrade request.
        N)r    r   r¾   s     r7   Ú_ws_default_headersz!SandboxClient._ws_default_headersJ  s'   € ð ×$Ò$¨¨ØÜ˜T×2Ñ2°GÓ<Ð<r9   c                ó”   — ddl m}  || j                  | j                  | j                  | j
                  | j                  xs d¬«      S )a[  Create an AsyncSandboxClient with the same configuration.

        The returned client has its own HTTP connection pool; close it
        independently (``await client.aclose()`` or ``async with``).

        Returns:
            AsyncSandboxClient with the same endpoint, credentials, timeout,
            retry, and header configuration.
        r   r/   Nr‘   )Úlangsmith.sandbox._async_clientr0   rš   rœ   r›   r�   r    )r¤   r0   s     r7   Úto_asynczSandboxClient.to_asyncT  sA   € õ 	Gá!ØŸ™Ø—M‘MØ—M‘MØ×)Ñ)Ø×)Ñ)Ò1¨Tô
ð 	
r9   c                ó†   — | j                   j                  «        | j                  �| j                  j                  «        yy)zClose the HTTP client.N)r¢   Úcloser£   r¼   s    r7   rÆ   zSandboxClient.closeh  s5   € à�
‰
×ÑÔØ×"Ñ"Ð.Ø×#Ñ#×)Ñ)Õ+ð /r9   c                óÒ   — 	 | j                   j                  s| j                   j                  «        | j                  �| j                  j                  «        yy# t        $ r Y yw xY w)z,Close the HTTP client on garbage collection.N)r¢   Ú	is_closedrÆ   r£   Ú	Exceptionr¼   s    r7   Ú__del__zSandboxClient.__del__n  sY   € ð	Ø—:‘:×'Ò'Ø—
‘
× Ñ Ô"Ø×&Ñ&Ð2Ø×'Ñ'×-Ñ-Õ/ð 3øäò 	Ùð	ús   ‚AA Á	A&Á%A&c                ó   — | S )zEnter context manager.r<   r¼   s    r7   Ú	__enter__zSandboxClient.__enter__x  s   € àˆr9   c                ó$   — | j                  «        y)zExit context manager.N)rÆ   )r¤   Úexc_typeÚexc_valÚexc_tbs       r7   Ú__exit__zSandboxClient.__exit__|  s   € ð 	�
‰
�r9   c                ó"   — d| j                   › d�S )z�Return a string representation of the instance.

        Returns:
            The string representation of the instance.
        zSandboxClient (API URL: Ú))rš   r¼   s    r7   Ú__repr__zSandboxClient.__repr__…  s   € ð *¨$¯.©.Ð)9¸Ð;Ð;r9   é   ©ÚsnapshotÚsnapshot_namerO   r“   Úidle_ttl_secondsÚdelete_after_stop_secondsÚvcpusÚ	mem_bytesÚfs_capacity_bytesÚmount_configÚproxy_configÚ
run_configr–   c               óR   — | j                  |||||||||	|
||||¬«      }d|_        |S )aë  Create a sandbox and return a Sandbox instance.

        This is the primary method for creating sandboxes. Use it as a
        context manager for automatic cleanup:

            with client.sandbox(snapshot_id="<uuid>") as sandbox:
                result = sandbox.run("echo hello")

            # Resolve by snapshot name instead of ID:
            with client.sandbox(snapshot_name="my-snap") as sandbox:
                result = sandbox.run("echo hello")

        The sandbox is automatically deleted when exiting the context manager.
        For sandboxes with manual lifecycle management, use create_sandbox().

        Args:
            snapshot_id: Optional snapshot ID to boot from. Mutually exclusive
                with ``snapshot`` and ``snapshot_name``.
            snapshot: Snapshot to boot from, as a UUID, ``name:tag``, or a bare
                ``name`` (which means ``name:latest``). Prefer this over
                ``snapshot_id`` and ``snapshot_name``: it covers all three forms.
            snapshot_name: Deprecated synonym for ``snapshot``, kept for callers
                that predate it.
            name: Optional sandbox name (auto-generated if not provided).
            timeout: Timeout in seconds when waiting for ready.
            idle_ttl_seconds: Idle timeout in seconds. The launcher
                automatically stops the sandbox after this duration of
                inactivity. Must be a multiple of 60. ``0`` explicitly
                disables the idle stop. When omitted (``None``), the server
                applies a default of ``600`` seconds (10 minutes).
            delete_after_stop_seconds: Seconds after the sandbox enters the
                ``stopped`` state before it (and its filesystem clone) are
                permanently deleted. Must be a multiple of 60. ``0`` disables
                stop-anchored deletion (manual cleanup required). When
                omitted (``None``), the server applies its configured default.
            vcpus: Number of vCPUs.
            mem_bytes: Memory in bytes.
            fs_capacity_bytes: Root filesystem capacity in bytes.
            run_config: User, working directory and environment the sandbox
                boots with, overriding the snapshot's: ``user`` and
                ``work_dir`` replace, ``env_vars`` merge. The sandbox's own
                ``env_vars`` remain a layer above this one.
            mount_config: Mount configuration forwarded to the server as
                ``mount_config``. The backend expands mount auth into runtime
                proxy rules. Explicit AWS/GCP proxy rules in ``proxy_config``
                conflict with mount auth for the same provider.
            proxy_config: Per-sandbox proxy configuration forwarded to the
                server as-is. Shape matches the backend `proxy_config` field:
                ``{"rules": [...], "access_control":
                {"allow_list": [...]}}`` or ``{"access_control":
                {"deny_list": [...]}}``. Use ``access_control.allow_list`` to
                restrict outbound HTTPS to a set of host patterns (exact
                domains, globs like ``*.example.com``, IPs, CIDRs, or
                ``~regex``). Use ``proxy_config`` with provider rule helpers
                such as ``aws_auth`` to let the proxy sign supported
                AWS HTTPS requests on the sandbox's behalf.

        Returns:
            Sandbox instance.

        Raises:
            ResourceTimeoutError: If timeout waiting for sandbox to be ready.
            ResourceCreationError: If sandbox creation fails.
            SandboxClientError: For other errors.
            ValueError: If TTL values are invalid, or if more than one of
                ``snapshot_id``, ``snapshot`` and ``snapshot_name`` is provided.
        rÖ   T)Úcreate_sandboxÚ_auto_delete)r¤   Úsnapshot_idr×   rØ   rO   r“   rÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   r–   Úsbs                   r7   ÚsandboxzSandboxClient.sandbox‘  sR   € ðj × Ñ ØØØ'ØØØ-Ø&?ØØØ/Ø%Ø%Ø!Øð !ó 
ˆð  ˆŒØˆ	r9   T)r×   rØ   rO   r“   Úwait_for_readyrÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   Úaccess_delegationr–   c               ób  — |xs |}|r|r||k7  rt        d«      ‚|r|rt        d«      ‚t        |d«       t        |d«       | j                  › d�}d|i}|r||d<   |r||d<   n|r||d	<   |r||d
<   |r||d<   |�||d<   |�||d<   |	�|	|d<   |
�|
|d<   |�||d<   |�t        ||«       ||d<   |�||d<   |�t	        |«      |d<   |�t        |«      |d<   |r|dz   nd}	 | j                  j                  |||| j                  |«      ¬«      }|j                  «        t        j                  |j                  «       | d¬«      }|j                  r#|j                  | j                  |j                  <   t!        |j                  «       |S # t"        j$                  $ r}t'        |«       ‚ d}~ww xY w)aÛ  Create a new Sandbox.

        The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup,
        or use sandbox() for automatic cleanup with a context manager.

        Args:
            snapshot_id: Optional snapshot ID to boot from. Mutually exclusive
                with ``snapshot`` and ``snapshot_name``.
            snapshot: Snapshot to boot from, as a UUID, ``name:tag``, or a bare
                ``name`` (which means ``name:latest``). Prefer this over
                ``snapshot_id`` and ``snapshot_name``: it covers all three forms.
            snapshot_name: Deprecated synonym for ``snapshot``, kept for callers
                that predate it.
            name: Optional sandbox name (auto-generated if not provided).
            timeout: Timeout in seconds when waiting for ready (only used when
                wait_for_ready=True).
            wait_for_ready: If True (default), block until sandbox is ready.
                If False, return immediately with status "provisioning". Use
                get_sandbox_status() or wait_for_sandbox() to poll for readiness.
            idle_ttl_seconds: Idle timeout in seconds. The launcher
                automatically stops the sandbox after this duration of
                inactivity. Must be a multiple of 60. ``0`` explicitly
                disables the idle stop. When omitted (``None``), the server
                applies a default of ``600`` seconds (10 minutes).
            delete_after_stop_seconds: Seconds after the sandbox enters the
                ``stopped`` state before it (and its filesystem clone) are
                permanently deleted. Must be a multiple of 60. ``0`` disables
                stop-anchored deletion (manual cleanup required). When
                omitted (``None``), the server applies its configured default.
            vcpus: Number of vCPUs.
            mem_bytes: Memory in bytes.
            fs_capacity_bytes: Root filesystem capacity in bytes.
            run_config: User, working directory and environment the sandbox
                boots with, overriding the snapshot's: ``user`` and
                ``work_dir`` replace, ``env_vars`` merge. The sandbox's own
                ``env_vars`` remain a layer above this one.
            mount_config: Mount configuration forwarded to the server as
                ``mount_config``. The backend expands mount auth into runtime
                proxy rules. Explicit AWS/GCP proxy rules in ``proxy_config``
                conflict with mount auth for the same provider.
            proxy_config: Per-sandbox proxy configuration forwarded to the
                server as-is. Shape matches the backend `proxy_config` field:
                ``{"rules": [...], "access_control":
                {"allow_list": [...]}}`` or ``{"access_control":
                {"deny_list": [...]}}``. Use ``access_control.allow_list`` to
                restrict outbound HTTPS to a set of host patterns (exact
                domains, globs like ``*.example.com``, IPs, CIDRs, or
                ``~regex``). Use ``proxy_config`` with provider rule helpers
                such as ``aws_auth`` to let the proxy sign supported
                AWS HTTPS requests on the sandbox's behalf.

            access_delegation: Optional grant letting code inside the sandbox
                call the LangSmith API as you, with no API key of its own.
                ``{"mode": "INHERIT"}`` grants everything you can do;
                ``{"mode": "EXPLICIT", "permissions": [...]}`` grants only the
                permissions listed, each of which you must already hold. The
                grant belongs to the sandbox, so anyone who can exec into it
                can make calls under it. Omit for no access.

        Returns:
            Created Sandbox. When wait_for_ready=False, the sandbox will have
            status="provisioning" and cannot be used for operations until ready.

        Raises:
            ResourceTimeoutError: If timeout waiting for sandbox to be ready.
            ResourceCreationError: If sandbox creation fails.
            SandboxClientError: For other errors.
            ValueError: If TTL values are invalid, or if more than one of
                ``snapshot_id``, ``snapshot`` and ``snapshot_name`` is provided.
        z,snapshot and snapshot_name must not disagreez@At most one of snapshot_id, snapshot or snapshot_name may be setrÙ   rÚ   ú/boxesrç   rä   r×   rØ   r“   rO   NrÛ   rÜ   rÝ   rÞ   rß   rà   rè   rÕ   )Újsonr“   r–   F©ÚclientÚauto_delete)rD   r   rš   r)   r'   r   r¢   Úpostr¿   Úraise_for_statusr+   Ú	from_dictrë   Úidrž   rO   r,   r   ÚHTTPStatusErrorr   )r¤   rä   r×   rØ   rO   r“   rç   rÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   rè   r–   Ú	referenceÚurlÚpayloadÚhttp_timeoutÚresponseræ   Úes                           r7   râ   zSandboxClient.create_sandboxù  s  € ðt Ò- ˆ	Ù™¨(°mÒ*CÜÐKÓLÐLÙ™9ÜØRóð ô 	Ð%Ð'9Ô:ÜÐ.Ð0KÔLà—‘Ð  Ð'ˆð ˜nð#
ˆñ Ø%0ˆG�MÑ"ÙØ"*ˆG�JÒÙØ'4ˆG�OÑ$ÙØ!(ˆG�IÑÙØ"ˆG�F‰OØÐ'Ø*:ˆGÐ&Ñ'Ø$Ð0Ø3LˆGÐ/Ñ0ØÐØ$ˆG�GÑØÐ Ø#,ˆG�KÑ ØÐ(Ø+<ˆGÐ'Ñ(ØÐ#Ü.¨|¸\ÔJØ&2ˆG�NÑ#ØÐ#Ø&2ˆG�NÑ#ØÐ!Ü$7¸
Ó$CˆG�LÑ!ØÐ(Ü+FØ!ó,ˆGÐ'Ñ(ñ *8˜ "š¸Rˆð	Ø—z‘z—‘ØØØ$Ø×-Ñ-¨gÓ6ð	 'ó ˆHð ×%Ñ%Ô'Ü×'Ñ'¨¯©«ÀÐRWÔXˆGØ�zŠzØ29·*±*�×!Ñ! '§,¡,Ñ/Ü  §¡Ô,ØˆNøÜ×$Ñ$ò 	Ü)¨!Ô,Øûð	ús   Ã B)F
 Æ
F.ÆF)Æ)F.©r–   c               óF  — | j                  |«       t        | j                  |«      }	 | j                  j	                  || j                  |«      ¬«      }|j                  «        t        j                  |j                  «       | d¬«      }|j                  r#|j                  | j                  |j                  <   t        |j                  «       |S # t        j                  $ r<}|j                   j"                  dk(  rt%        d|› d�d¬«      |‚t'        |«       ‚ d	}~ww xY w)
aF  Get a Sandbox by name.

        The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup.

        Args:
            name: Sandbox name.

        Returns:
            Sandbox.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        rú   Frì   é”  ú	Sandbox 'ú' not foundræ   ©Úresource_typeN)r®   rR   rš   r¢   r©   r¿   rð   r+   rñ   rë   rò   rž   rO   r,   r   ró   rø   Ústatus_coder   r   )r¤   rO   r–   rõ   rø   ræ   rù   s          r7   Úget_sandboxzSandboxClient.get_sandbox•  sò   € ð 	×Ñ˜DÔ!Ü�t—~‘~ tÓ,ˆð	Ø—z‘z—~‘~ c°4×3HÑ3HÈÓ3Q�~ÓRˆHØ×%Ñ%Ô'Ü×'Ñ'¨¯©«ÀÐRWÔXˆGØ�zŠzØ29·*±*�×!Ñ! '§,¡,Ñ/Ü  §¡Ô,ØˆNøÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % QÔ'Øûð	ús   ©B'C ÃD Ã$7DÄD c               óÐ  — | j                   › d�}	 | j                  j                  || j                  |«      ¬«      }|j	                  «        |j                  «       }|j                  dg «      D �cg c]  }t        j                  || d¬«      ‘Œ c}S c c}w # t        j                  $ r:}|j                  j                  dk(  rt        d|› d�«      |‚t        |«       ‚ d	}~ww xY w)
zMList all Sandboxes.

        Returns:
            List of Sandboxes.
        rê   rú   rº   Frì   rü   úAPI endpoint not found: ú%. Check that api_endpoint is correct.N)rš   r¢   r©   r¿   rð   rë   r+   rñ   r   ró   rø   r  r   r   )r¤   r–   rõ   rø   ÚdataÚcrù   s          r7   Úlist_sandboxeszSandboxClient.list_sandboxes·  sí   € ð —‘Ð  Ð'ˆð	Ø—z‘z—~‘~ c°4×3HÑ3HÈÓ3Q�~ÓRˆHØ×%Ñ%Ô'Ø—=‘=“?ˆDð Ÿ™ +¨rÔ2óá2�Aô ×!Ñ! !¨D¸eÖDØ2ñð ùò øô ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü%Ø.¨s¨eð 4:ð ;óð ðô % QÔ'Øûð	ús*   ‘A B Á1BÂB ÂB ÂC%Â+5C Ã C%)Únew_namerÙ   rÚ   rß   rà   r–   c               óh  — t        |d«       t        |d«       | j                  |«       t        | j                  |«      }i }	|�||	d<   |�||	d<   |�||	d<   |�||	d<   |�t	        |«      |	d<   	 | j
                  j                  ||	| j                  |«      ¬«      }
|
j                  «        | j                  |«       t        j                  |
j                  «       | d¬	«      }|j                  r#|j                  | j                  |j                  <   t!        |j                  «       |S # t"        j$                  $ ru}|j&                  j(                  d
k(  rt+        d|› d�d¬«      |‚|j&                  j(                  dk(  rt-        d|› d�d¬«      |‚|�t/        ||«       t1        |«       ‚ d}~ww xY w)aY  Update a sandbox's properties.

        Args:
            name: Current sandbox name.
            new_name: New display name.
            idle_ttl_seconds: Idle timeout in seconds. Must be a multiple of
                60. ``0`` disables idle-stop. ``None`` leaves the existing
                value unchanged.
            delete_after_stop_seconds: Seconds after entering ``stopped``
                before deletion. Must be a multiple of 60. ``0`` disables
                stop-anchored deletion. ``None`` leaves the existing value
                unchanged.
            proxy_config: Replacement proxy configuration, forwarded to the
                server as-is (same shape as ``create_sandbox``). Rules replace
                the existing set rather than merging into it, so include every
                rule the sandbox should keep. Opaque header values carry over
                from the current config, so rotating one credential does not
                mean re-supplying secrets that can no longer be read. The
                sandbox must be ``ready``; start a stopped one first.
            run_config: Merge into the sandbox's stored run configuration:
                ``user`` and ``work_dir`` replace, ``env_vars`` merge. Takes
                effect for subsequent commands; commands already running are
                unaffected, and a stopped sandbox picks it up on its next
                start. Omitting it leaves the stored value untouched.

        Returns:
            Updated Sandbox.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            ResourceNameConflictError: If new_name is already in use.
            SandboxNotReadyError: If ``proxy_config`` was given and the sandbox
                is not ``ready``.
            SandboxClientError: For other errors.
            ValueError: If TTL values are invalid.
        rÙ   rÚ   NrO   rß   rà   ©rë   r–   Frì   rü   rý   rþ   ræ   rÿ   i™  zSandbox name 'z' already in use)r   r®   rR   rš   r'   r¢   Úpatchr¿   rð   r³   r+   rñ   rë   rò   rž   rO   r,   r   ró   rø   r  r   r   r   r   )r¤   rO   r	  rÙ   rÚ   rß   rà   r–   rõ   rö   rø   ræ   rù   s                r7   Úupdate_sandboxzSandboxClient.update_sandboxÐ  sÆ  € ô^ 	Ð%Ð'9Ô:ÜÐ.Ð0KÔLà×Ñ˜DÔ!Ü�t—~‘~ tÓ,ˆØ"$ˆØÐØ&ˆG�F‰OØÐ'Ø*:ˆGÐ&Ñ'Ø$Ð0Ø3LˆGÐ/Ñ0ØÐ#Ø&2ˆG�NÑ#ØÐ!Ü$7¸
Ó$CˆG�LÑ!ð	Ø—z‘z×'Ñ'Ø˜'¨4×+@Ñ+@ÀÓ+Ið (ó ˆHð ×%Ñ%Ô'Ø× Ñ  Ô&Ü×'Ñ'¨¯©«ÀÐRWÔXˆGØ�zŠzØ29·*±*�×!Ñ! '§,¡,Ñ/Ü  §¡Ô,ØˆNøÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðð �z‰z×%Ñ%¨Ò,Ü/Ø$ X JÐ.>Ð?Ø"+ôð ðð Ð'Ü" 1 dÔ+Ü$ QÔ'Øûð	ús   Á/B9D) Ä)F1Ä<A0F,Æ,F1c               óš  — | j                  |«       t        | j                  |«      }	 | j                  j	                  || j                  |«      ¬«      }|j                  «        | j                  |«       y# t        j                  $ r@}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       Y d}~yd}~ww xY w)zÅDelete a Sandbox.

        Args:
            name: Sandbox name.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        rú   rü   rý   rþ   ræ   rÿ   N)r®   rR   rš   r¢   Údeleter¿   rð   r³   r   ró   rø   r  r   r   ©r¤   rO   r–   rõ   rø   rù   s         r7   Údelete_sandboxzSandboxClient.delete_sandbox*  s¸   € ð 	×Ñ˜DÔ!Ü�t—~‘~ tÓ,ˆð		(Ø—z‘z×(Ñ(¨°d×6KÑ6KÈGÓ6TÐ(ÓUˆHØ×%Ñ%Ô'Ø× Ñ  Õ&øÜ×$Ñ$ò 	(Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % Q×'Ñ'ûð	(ús   ©AA7 Á7C
Â
6CÃC
c               ó¶  — | j                  |«       t        | j                  |d«      }	 | j                  j	                  || j                  |«      ¬«      }|j                  «        t        j                  |j                  «       «      S # t        j                  $ r<}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       ‚ d}~ww xY w)	aà  Get the provisioning status of a sandbox.

        This is a lightweight endpoint designed for high-frequency polling
        during sandbox provisioning. It returns only the status fields
        without full sandbox data.

        Args:
            name: Sandbox name.

        Returns:
            ResourceStatus with status and status_message.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        Ústatusrú   rü   rý   rþ   ræ   rÿ   N)r®   rR   rš   r¢   r©   r¿   rð   r    rñ   rë   r   ró   rø   r  r   r   r  s         r7   Úget_sandbox_statusz SandboxClient.get_sandbox_statusB  sÀ   € ð& 	×Ñ˜DÔ!Ü�t—~‘~ t¨XÓ6ˆð
	Ø—z‘z—~‘~ c°4×3HÑ3HÈÓ3Q�~ÓRˆHØ×%Ñ%Ô'Ü!×+Ñ+¨H¯M©M«OÓ<Ð<øÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % QÔ'Øûð	ús   ªAB	 Â	CÂ7CÃCiX  )Úexpires_in_secondsÚaccessr–   c                ó   — y r°   r<   ©r¤   rO   Úportr  r  r–   s         r7   ÚservicezSandboxClient.serviced  s   € ð r9   ©r  r–   c                ó   — y r°   r<   r  s         r7   r  zSandboxClient.serviceo  s   € ð r9   c               óÀ  ‡ ‡‡‡‡— t        ‰‰«       |�|dvrt        d|›�«      ‚|du}‰ j                  ‰«       t        ‰ j                  ‰d«      }d‰i}|s‰|d<   |�||d<   dˆˆˆˆˆ fd„}		 ‰ j
                  j                  ||‰ j                  ‰«      ¬	«      }
|
j                  «        |r#t        j                  |
j                  «       «      S t        j                  |
j                  «       |	¬
«      }‰ j                  ‰«      |_        |S # t        j                  $ r<}|j                   j"                  dk(  rt%        d‰› d�d¬«      |‚t'        |«       ‚ d}~ww xY w)al  Get an authenticated URL for a service running inside a sandbox.

        Returns a :class:`ServiceURL` whose properties auto-refresh the
        token transparently before it expires.  The object also provides
        HTTP helper methods (``.get``, ``.post``, etc.) that inject the
        authentication header automatically.

        Args:
            name: Sandbox name.
            port: Port the service is listening on inside the sandbox.
            expires_in_seconds: Token TTL in seconds (1--86400, default 600).
            access: Gate the URL behind LangSmith login instead of a token,
                returning a :class:`ServiceLoginURL`. ``"restricted"`` admits
                anyone with ``sandboxes:read`` on the sandbox, ``"workspace"``
                any member of the owning workspace. Neither carries a token or
                expires, so ``expires_in_seconds`` does not apply. Omit for
                token mode; a login grant is durable, so token mode is refused
                with 409 while one is in place.
            headers: Optional per-request header overrides.

        Returns:
            ServiceURL with auto-refreshing token and HTTP helpers.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            ValueError: If port or expires_in_seconds is out of range.
            SandboxClientError: For other errors.
        N)Ú
restrictedÚ	workspacez0access must be "restricted" or "workspace", got zservice-urlr  r  r  c                 ó.   •— ‰j                  ‰‰‰ ‰¬«      S )Nr  )r  )r  r–   rO   r  r¤   s   €€€€€r7   Ú
_refresherz)SandboxClient.service.<locals>._refresher­  s%   ø€ Ø—<‘<ØØØ#5Øð	  ó ð r9   r  )r!  rü   rý   rþ   ræ   rÿ   )Úreturnr$   )r   rD   r®   rR   rš   r¢   rï   r¿   rð   r#   rñ   rë   r$   Ú_sandbox_idr   ró   rø   r  r   r   )r¤   rO   r  r  r  r–   Ú
login_moderõ   rö   r!  rø   r  rù   s   ```` `       r7   r  zSandboxClient.servicez  sl  ü€ ôJ 	  Ð&8Ô9ØÐ &Ð0KÑ"KÜØBÀ6À*ÐMóð ð  4Ð'ˆ
Ø×Ñ˜DÔ!Ü�t—~‘~ t¨]Ó;ˆØ#)¨4 .ˆÙØ,>ˆGÐ(Ñ)ØÐØ &ˆG�HÑ÷	ñ 	ð	Ø—z‘z—‘Ø˜'¨4×+@Ñ+@ÀÓ+Ið 'ó ˆHð ×%Ñ%Ô'ÙÜ&×0Ñ0°·±³ÓAÐAÜ ×*Ñ*¨8¯=©=«?ÀzÔRˆGØ"&×"5Ñ"5°dÓ";ˆGÔØˆNøÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % QÔ'Øûð	ús   Á/A!D Ã<D ÄEÄ!7EÅE)r  Úcontent_typeÚcontent_dispositionr–   c               ó  — |�|dk  rt        d|› d�«      ‚| j                  |«       t        | j                  |d«      }d|i}|�||d<   |�||d<   |�||d	<   	 | j                  j                  ||| j                  |«      ¬
«      }	|	j                  «        t        j                  |	j                  «       «      S # t        j                  $ r<}
|
j                  j                  dk(  rt        d|› d�d¬«      |
‚t!        |
«       ‚ d}
~
ww xY w)aM  Create a link that downloads one file from a sandbox.

        The link carries its own token, so anyone holding the URL can fetch
        that one file without a LangSmith credential. It is pinned to the
        sandbox and the exact path and cannot be repointed at another file.
        Fetching wakes a stopped sandbox.

        Do not modify the file after minting a link for it. The link is
        pinned to a path, not to a snapshot of the contents, so a later
        write to that path may or may not be reflected in what the link
        serves. Write a new file and mint a new link when the contents
        change.

        Args:
            name: Sandbox name.
            path: File path inside the sandbox.
            expires_in_seconds: Link TTL in seconds. Omit for a link that
                never expires.
            content_type: Content-Type to serve the file as.
            content_disposition: Content-Disposition to serve the file with,
                either ``"attachment"`` or ``"inline"``.
            headers: Optional per-request header overrides.

        Returns:
            DownloadURL with the link and its expiry, if any.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            ValueError: If expires_in_seconds is not positive.
            SandboxClientError: For other errors.
        Né   z/expires_in_seconds must be greater than 0 (got z(); omit it for a link that never expireszdownload-urlrh   r  r%  r&  r  rü   rý   rþ   ræ   rÿ   )rD   r®   rR   rš   r¢   rï   r¿   rð   r   rñ   rë   r   ró   rø   r  r   r   )r¤   rO   rh   r  r%  r&  r–   rõ   rö   rø   rù   s              r7   Úgenerate_download_urlz#SandboxClient.generate_download_urlÇ  s7  € ðR Ð)Ð.@À1Ò.DÜðØ*Ð+Ð+SðUóð ð 	×Ñ˜DÔ!Ü�t—~‘~ t¨^Ó<ˆØ#)¨4 .ˆØÐ)Ø,>ˆGÐ(Ñ)ØÐ#Ø&2ˆG�NÑ#ØÐ*Ø-@ˆGÐ)Ñ*ð	Ø—z‘z—‘Ø˜'¨4×+@Ñ+@ÀÓ+Ið 'ó ˆHð ×%Ñ%Ô'Ü×(Ñ(¨¯©«Ó9Ð9øÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % QÔ'Øûð	ús   ÁAB9 Â9DÃ7DÄDéx   g      ð?)r“   Úpoll_intervalr–   c               ó–  — ddl }|j                  «       |z   }	 | j                  ||¬«      }|j                  dk(  r| j	                  ||¬«      S |j                  dk(  rt        |j                  xs dd¬«      ‚||j                  «       z
  }|dk  rt        d	|› d
|› d�d|j                  ¬«      ‚|j                  t        ||«      «       Œ²)a§  Poll until a sandbox reaches "ready" or "failed" status.

        Uses the lightweight status endpoint for polling, then fetches the
        full sandbox data once ready.

        Args:
            name: Sandbox name.
            timeout: Maximum time to wait in seconds.
            poll_interval: Time between status checks in seconds.

        Returns:
            Sandbox in "ready" status.

        Raises:
            ResourceCreationError: If sandbox status becomes "failed".
            ResourceTimeoutError: If timeout expires while still "provisioning".
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        r   Nrú   ÚreadyÚfailedzSandbox provisioning failedræ   rÿ   rý   ú' not ready after Ús©r   Úlast_status)
ÚtimeÚ	monotonicr  r  r  r   Ústatus_messager   ÚsleepÚmin)	r¤   rO   r“   r+  r–   r3  Údeadliner  Ú	remainings	            r7   Úwait_for_sandboxzSandboxClient.wait_for_sandbox  sÛ   € ó6 	à—>‘>Ó# gÑ-ˆØØ×,Ñ,¨T¸7Ð,ÓCˆFØ�}‰} Ò'Ø×'Ñ'¨°gÐ'Ó>Ð>Ø�}‰} Ò(Ü+Ø×)Ñ)ÒJÐ-JØ"+ôð ð ! 4§>¡>Ó#3Ñ3ˆIØ˜AŠ~Ü*Ø ˜vÐ%7¸°yÀÐBØ"+Ø &§¡ôð ð
 �J‰J”s˜=¨)Ó4Ô5ð! r9   ©r“   r–   c               ó¢  — | j                  |«       t        | j                  |d«      }	 | j                  j	                  |i | j                  |«      ¬«      }|j                  «        | j                  |||¬	«      S # t        j                  $ r@}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       Y d}~Œbd}~ww xY w)
að  Start a stopped sandbox and wait until ready.

        Args:
            name: Sandbox name.
            timeout: Timeout in seconds when waiting for ready.

        Returns:
            Sandbox in "ready" status.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            ResourceCreationError: If sandbox fails during startup.
            ResourceTimeoutError: If sandbox doesn't become ready within timeout.
            SandboxClientError: For other errors.
        Ústartr  rü   rý   rþ   ræ   rÿ   Nr;  )r®   rR   rš   r¢   rï   r¿   rð   r   ró   rø   r  r   r   r:  )r¤   rO   r“   r–   rõ   rø   rù   s          r7   Ústart_sandboxzSandboxClient.start_sandbox=  sÏ   € ð, 	×Ñ˜DÔ!Ü�t—~‘~ t¨WÓ5ˆð
	(Ø—z‘z—‘Ø˜" d×&;Ñ&;¸GÓ&Dð 'ó ˆHð ×%Ñ%Ô'ð ×$Ñ$ T°7ÀGÐ$ÓLÐLøô ×$Ñ$ò 	(Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % Q×'Ñ'ûð	(ús   ª=A; Á;CÂ6C	Ã	Cc               ó|  — | j                  |«       t        | j                  |d«      }	 | j                  j	                  |i | j                  |«      ¬«      }|j                  «        y# t        j                  $ r@}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       Y d}~yd}~ww xY w)	z÷Stop a running sandbox (preserves sandbox files for later restart).

        Args:
            name: Sandbox name.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        Ústopr  rü   rý   rþ   ræ   rÿ   N)r®   rR   rš   r¢   rï   r¿   rð   r   ró   rø   r  r   r   r  s         r7   Ústop_sandboxzSandboxClient.stop_sandboxd  s³   € ð 	×Ñ˜DÔ!Ü�t—~‘~ t¨VÓ4ˆð
	(Ø—z‘z—‘Ø˜" d×&;Ñ&;¸GÓ&Dð 'ó ˆHð ×%Ñ%Õ'øÜ×$Ñ$ò 	(Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜v [Ð1Àôàðô % Q×'Ñ'ûð	(ús   ª=A( Á(B;Á;6B6Â6B;é<   )ÚtagÚregistry_idrà   r“   r–   c               ó´  — | j                   › d�}	|||dœ}
|�||
d<   |�||
d<   |�t        |«      |
d<   	 | j                  j                  |	|
| j	                  |«      ¬«      }|j                  «        t        j                  |j                  «       «      }| j                  |j                  ||¬«      S # t        j                  $ r}t        |«       ‚ d}~ww xY w)	ai  Build a snapshot from a Docker image.

        Blocks until the snapshot is ready (polls with 2s interval).

        Args:
            name: Snapshot name.
            docker_image: Docker image to build from (e.g., "python:3.12-slim").
            fs_capacity_bytes: Filesystem capacity in bytes.
            tag: Tag to publish the snapshot under, within ``name``. Re-using a
                tag moves it to the new snapshot, leaving the previous one
                addressable by id. Defaults server-side to the Docker image's
                own tag, else ``latest``.
            registry_id: Private registry ID.
            run_config: Override the Docker image's ``USER``, ``WORKDIR`` and
                ``ENV`` for sandboxes built from this snapshot: ``user`` and
                ``work_dir`` replace the image's, ``env_vars`` merge over it
                key by key. Omitting it adopts the image's own configuration.
                Pass ``{"user": "0"}`` to keep the pre-``run_config``
                behaviour of running as root.
            timeout: Timeout in seconds when waiting for ready.

        Returns:
            Snapshot in "ready" status.

        Raises:
            ResourceTimeoutError: If snapshot doesn't become ready within timeout.
            ResourceCreationError: If snapshot build fails.
            SandboxClientError: For other errors.
        ú
/snapshots)rO   Údocker_imagerÝ   NrC  rD  rà   r  r;  )rš   r'   r¢   rï   r¿   rð   r%   rñ   rë   r   ró   r   Úwait_for_snapshotrò   )r¤   rO   rG  rÝ   rC  rD  rà   r“   r–   rõ   rö   rø   r×   rù   s                 r7   Úcreate_snapshotzSandboxClient.create_snapshot�  sð   € ðR —‘Ð  
Ð+ˆð Ø(Ø!2ñ#
ˆð
 ˆ?Ø ˆG�E‰NØÐ"Ø%0ˆG�MÑ"ØÐ!Ü$7¸
Ó$CˆG�LÑ!ð	Ø—z‘z—‘Ø˜'¨4×+@Ñ+@ÀÓ+Ið 'ó ˆHð ×%Ñ%Ô'Ü×)Ñ)¨(¯-©-«/Ó:ˆHð
 ×%Ñ% h§k¡k¸7ÈGÐ%ÓTÐTøô	 ×$Ñ$ò 	Ü$ QÔ'Øûð	ús   µA B3 Â3CÃCÃCÚ.)rr   r†   r‡   Úon_build_logrÛ   rÜ   r“   r–   c               óè  — t        ||«      \  }}dt        j                  «       j                  dd › �}dt        j                  «       j                  dd › �}t	        j
                  |d«      }t	        j
                  |d«      }dt        j                  «       j                  › �}t	        j
                  |d«      }t	        j
                  |d	«      }| j                  ||
||	||¬
«      5 }|j                  |t        |«      |
|¬«       |j                  dt        j                  |«      z   dz   t        j                  |«      z   dz   t        j                  |«      z   dz   t        j                  |«      z   |
|¬«       |j                  t        |||||||¬«      |
|||¬«      }|j                  dk7  rt        dd¬«      ‚| j                  |j                   ||||
|¬«      cddd«       S # 1 sw Y   yxY w)a¸  Build a snapshot from a local Dockerfile context.

        When ``fs_capacity_bytes`` is omitted, the server applies its default.
        ``vcpus`` and ``mem_bytes`` size the temporary builder sandbox. The
        build runs BuildKit plus the native snapshotter's layer copies inside
        it, which contend for a single core by default, so giving the builder
        an extra vCPU can cut a cold build's wall time substantially.
        zsnapshot-builder-Né   z/var/lib/langsmith-build/rr   zcontext.tarzlangsmith-snapshot-build:zbuildkit-rootzbuildkit-run)rO   r“   rÛ   rÜ   rÝ   r–   r;  zrm -rf z && mkdir -p z && tar -xf z -C )r‚   rt   rƒ   r„   r…   r†   r‡   )r“   Ú	on_stdoutÚ	on_stderrr–   r   z Dockerfile snapshot build failedr×   rÿ   )rG  rÝ   r“   r–   )rv   r«   Úuuid4Úhexr|   rM   ræ   Úwriterj   Úrunr�   r   r�   Ú	exit_coder   Úcapture_snapshotrO   )r¤   rO   rq   rÝ   rr   r†   r‡   rK  rÛ   rÜ   r“   r–   re   rt   Úbuilder_nameÚ
build_rootr‚   Ú
remote_tarrƒ   r„   r…   ræ   Úresults                          r7   Úcreate_snapshot_from_dockerfilez-SandboxClient.create_snapshot_from_dockerfileÄ  s  € ô. (CÀ:ÈwÓ'WÑ$ˆ�nà*¬4¯:©:«<×+;Ñ+;¸C¸RÐ+@Ð*AÐBˆð 1´·±³×1AÑ1AÀ#À2Ð1FÐ0GÐHˆ
Ü"Ÿ™¨
°IÓ>ˆÜ—^‘^ J°Ó>ˆ
Ø/´·
±
³×0@Ñ0@Ð/AÐBˆ	Ü!Ÿ™ z°?ÓCˆÜ —~‘~ j°.ÓAˆà�\‰\ØØØØØ/Øð ô 
ð Ø�M‰MØÜ(¨Ó6ØØð	 ô ð �K‰KØÜ—+‘+˜nÓ-ñ.à!ñ"ô —+‘+˜nÓ-ñ.ð !ñ	!ô
 —+‘+˜jÓ)ñ*ð ñô —+‘+˜nÓ-ñ.ð  Øð ô ð —[‘[Ü.Ø#1Ø#1Ø'Ø"/Ø!-Ø)Ø!ôð  Ø&Ø&Øð !ó ˆFð ×Ñ 1Ò$Ü+Ø6Ø",ôð ð ×(Ñ(Ø—‘ØØ&Ø"3ØØð )ó ÷_
÷ 
ò 
ús   Ã(C6G(Ç(G1)rC  rG  rÝ   rà   r“   r–   c               óF  — | j                  |«       t        | j                  |d«      }	d|i}
|�||
d<   |�||
d<   |�||
d<   |�t        |«      |
d<   	 | j                  j                  |	|
| j                  |«      ¬«      }|j                  «        t        j                  |j                  «       «      }| j#                  |j$                  ||¬«      S # t        j                  $ r<}|j                  j                  d	k(  rt        d
|› d�d¬«      |‚t!        |«       ‚ d}~ww xY w)a}  Capture a snapshot from a running sandbox.

        Blocks until the snapshot is ready (polls with 2s interval).

        Args:
            sandbox_name: Name of the sandbox to capture from.
            name: Snapshot name.
            tag: Tag to publish the snapshot under, within ``name``. Re-using a
                tag moves it to the new snapshot, leaving the previous one
                addressable by id. Defaults server-side to ``latest``.
            docker_image: Optional Docker image tag inside the sandbox to export
                into the snapshot instead of capturing the live root filesystem.
            fs_capacity_bytes: Filesystem capacity in bytes for Docker image export.
            run_config: Override applied over the configuration the captured
                sandbox was running with: ``user`` and ``work_dir`` replace,
                ``env_vars`` merge. The captured sandbox's own ``env_vars``
                are a per-sandbox layer and are not carried into the snapshot.
            timeout: Timeout in seconds when waiting for ready.

        Returns:
            Snapshot in "ready" status.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            ResourceTimeoutError: If snapshot doesn't become ready within timeout.
            ResourceCreationError: If snapshot capture fails.
            SandboxClientError: For other errors.
        r×   rO   NrC  rG  rÝ   rà   r  rü   rý   rþ   ræ   rÿ   r;  )r®   rR   rš   r'   r¢   rï   r¿   rð   r%   rñ   rë   r   ró   rø   r  r   r   rH  rò   )r¤   Úsandbox_namerO   rC  rG  rÝ   rà   r“   r–   rõ   rö   rø   r×   rù   s                 r7   rU  zSandboxClient.capture_snapshot"  s7  € ðP 	×Ñ˜LÔ)Ü�t—~‘~ |°ZÓ@ˆà#)¨4 .ˆØˆ?Ø ˆG�E‰NØÐ#Ø&2ˆG�NÑ#ØÐ(Ø+<ˆGÐ'Ñ(ØÐ!Ü$7¸
Ó$CˆG�LÑ!ð	Ø—z‘z—‘Ø˜'¨4×+@Ñ+@ÀÓ+Ið 'ó ˆHð ×%Ñ%Ô'Ü×)Ñ)¨(¯-©-«/Ó:ˆHð ×%Ñ% h§k¡k¸7ÈGÐ%ÓTÐTøô ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø ˜~¨[Ð9Èôàðô % QÔ'Øûð	ús   ÁA C ÃD Ã$7DÄD c               óš  — | j                   › dt        |«      › �}	 | j                  j                  || j	                  |«      ¬«      }|j                  «        t        j                  |j                  «       «      S # t        j                  $ r<}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       ‚ d}~ww xY w)	a¿  Get a snapshot by ID or by a Docker-style reference.

        Args:
            snapshot_id: Snapshot UUID, ``name:tag``, or a bare ``name``. A bare
                name means ``name:latest``, falling back to the newest ready
                untagged snapshot of that name.

        Returns:
            Snapshot.

        Raises:
            ResourceNotFoundError: If snapshot not found.
            SandboxClientError: For other errors.
        ú/snapshots/rú   rü   ú
Snapshot 'rþ   r×   rÿ   N)rš   rJ   r¢   r©   r¿   rð   r%   rñ   rë   r   ró   rø   r  r   r   ©r¤   rä   r–   rõ   rø   rù   s         r7   Úget_snapshotzSandboxClient.get_snapshotg  s¼   € ð" —‘Ð  Ô,DÀ[Ó,QÐ+RÐSˆð
	Ø—z‘z—~‘~ c°4×3HÑ3HÈÓ3Q�~ÓRˆHØ×%Ñ%Ô'Ü×%Ñ% h§m¡m£oÓ6Ð6øÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø   ¨[Ð9Èôàðô % QÔ'Øûð	ús   œAA; Á;C
Â7CÃC
c               óæ  — | j                   › dt        |«      › �}	 | j                  j                  || j	                  |«      ¬«      }|j                  «        |j                  «       j                  d«      xs g D �cg c]  }t        j                  |«      ‘Œ c}S c c}w # t        j                  $ r<}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       ‚ d	}~ww xY w)
aÄ  List every tag published under a snapshot name.

        Args:
            name: Snapshot name, without a tag.

        Returns:
            Each tag under the name with the snapshot it resolves to. Empty when
            the name exists but currently carries no tags.

        Raises:
            ResourceNotFoundError: If nobody has published under the name.
            SandboxClientError: For other errors, including a name carrying a tag.
        z/snapshots-by-name/rú   Útagsrü   zSnapshot name 'rþ   r×   rÿ   N)rš   rG   r¢   r©   r¿   rð   rë   r&   rñ   r   ró   rø   r  r   r   )r¤   rO   r–   rõ   rø   rC  rù   s          r7   Úlist_snapshot_tagsz SandboxClient.list_snapshot_tags†  sï   € ð  —‘Ð Ð 3Ô4GÈÓ4MÐ3NÐOˆð	Ø—z‘z—~‘~ c°4×3HÑ3HÈÓ3Q�~ÓRˆHØ×%Ñ%Ô'à6>·m±m³o×6IÑ6IÈ&Ó6QÒ6WÐUWÐ6WóÙ6W¨s”×%Ñ% cÕ*Ð6Wñð ùò øô ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø% d V¨;Ð7Àzôàðô % QÔ'Øûð	ús*   œA!B! Á=BÂB! ÂB! Â!C0Â47C+Ã+C0)Úname_containsÚlimitÚoffsetr–   c               ó  — | j                   › d�}i }|�||d<   |�||d<   |�||d<   	 | j                  j                  ||xs d| j                  |«      ¬«      }|j	                  «        |j                  «       }|j                  dg «      D �	cg c]  }	t        j                  |	«      ‘Œ c}	S c c}	w # t        j                  $ r:}
|
j                  j                  dk(  rt        d	|› d
�«      |
‚t        |
«       ‚ d}
~
ww xY w)aV  List snapshots.

        The backend always paginates this endpoint. When ``limit`` is omitted
        the server applies a default page size (currently 50), so a single
        call is not guaranteed to return every snapshot. To iterate through
        all results, repeat the call with increasing ``offset`` values (or an
        explicit ``limit``) until fewer than ``limit`` snapshots come back.

        Args:
            name_contains: Optional case-insensitive substring filter applied
                to snapshot names server-side.
            limit: Optional maximum number of snapshots to return for a single
                request. Must be between 1 and 500 (inclusive); the server
                rejects values outside that range. Defaults to 50 server-side
                when omitted.
            offset: Optional number of snapshots to skip before returning
                results. Must be ``>= 0``. Useful for paginating through
                large result sets in combination with ``limit``.

        Returns:
            A single page of Snapshots matching the provided filters.
        rF  Nre  rf  rg  )Úparamsr–   Ú	snapshotsrü   r  r  )rš   r¢   r©   r¿   rð   rë   r%   rñ   r   ró   rø   r  r   r   )r¤   re  rf  rg  r–   rõ   ri  rø   r  r0  rù   s              r7   Úlist_snapshotszSandboxClient.list_snapshots¦  s  € ð< —‘Ð  
Ð+ˆà!#ˆØÐ$Ø&3ˆF�?Ñ#ØÐØ#ˆF�7‰OØÐØ%ˆF�8Ñð	Ø—z‘z—~‘~ØØ’~ Ø×-Ñ-¨gÓ6ð &ó ˆHð
 ×%Ñ%Ô'Ø—=‘=“?ˆDØ37·8±8¸KÈÔ3LÓMÑ3L¨a”H×&Ñ& qÕ)Ð3LÑMÐMùÒMøÜ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü%Ø.¨s¨eð 4:ð ;óð ðô % QÔ'Øûð	ús*   ¨A%B1 ÂB,Â)B1 Â,B1 Â1C>Ã5C9Ã9C>c               ó^  — | j                   › dt        |«      › �}	 | j                  j                  || j	                  |«      ¬«      }|j                  «        y# t        j                  $ r@}|j                  j                  dk(  rt        d|› d�d¬«      |‚t        |«       Y d}~yd}~ww xY w)	zÏDelete a snapshot.

        Args:
            snapshot_id: Snapshot UUID.

        Raises:
            ResourceNotFoundError: If snapshot not found.
            SandboxClientError: For other errors.
        r^  rú   rü   r_  rþ   r×   rÿ   N)rš   rG   r¢   r  r¿   rð   r   ró   rø   r  r   r   r`  s         r7   Údelete_snapshotzSandboxClient.delete_snapshotà  s¨   € ð —‘Ð  Ô,?ÀÓ,LÐ+MÐNˆð	(Ø—z‘z×(Ñ(¨°d×6KÑ6KÈGÓ6TÐ(ÓUˆHØ×%Ñ%Õ'øÜ×$Ñ$ò 	(Ø�z‰z×%Ñ%¨Ò,Ü+Ø   ¨[Ð9Èôàðô % Q×'Ñ'ûð	(ús   œ<A ÁB,Á,6B'Â'B,i,  g       @c               ót  — ddl }|j                  «       |z   }	 | j                  ||¬«      }|j                  dk(  r|S |j                  dk(  rt	        |j
                  xs dd¬«      ‚||j                  «       z
  }|dk  rt        d	|› d
|› d�d|j                  ¬«      ‚|j                  t        ||«      «       Œ¡)a&  Poll until a snapshot reaches "ready" or "failed" status.

        Args:
            snapshot_id: Snapshot UUID.
            timeout: Maximum time to wait in seconds.
            poll_interval: Time between status checks in seconds.

        Returns:
            Snapshot in "ready" status.

        Raises:
            ResourceCreationError: If snapshot status becomes "failed".
            ResourceTimeoutError: If timeout expires.
            ResourceNotFoundError: If snapshot not found.
            SandboxClientError: For other errors.
        r   Nrú   r-  r.  zSnapshot build failedr×   rÿ   r_  r/  r0  r1  )	r3  r4  ra  r  r   r5  r   r6  r7  )	r¤   rä   r“   r+  r–   r3  r8  r×   r9  s	            r7   rH  zSandboxClient.wait_for_snapshotø  sÊ   € ó0 	à—>‘>Ó# gÑ-ˆØØ×(Ñ(¨¸gÐ(ÓFˆHØ�‰ 'Ò)Ø�Ø�‰ (Ò*Ü+Ø×+Ñ+ÒFÐ/FØ",ôð ð ! 4§>¡>Ó#3Ñ3ˆIØ˜AŠ~Ü*Ø   Ð-?À¸yÈÐJØ",Ø (§¡ôð ð
 �J‰J”s˜=¨)Ó4Ô5ð! r9   )
r’   úOptional[str]r“   Úfloatr”   ro  r•   Úintr–   zOptional[RequestHeaders])rO   rª   r"  ro  )rO   rª   r"  ÚNone©r"  rª   )r"  r.   )r–   ÚRequestHeadersr"  zOptional[dict[str, str]])r"  r0   )r"  rr  )r"  r�   )rÎ   zOptional[type]rÏ   zOptional[BaseException]rÐ   zOptional[Any]r"  rr  r°   )rä   ro  r×   ro  rØ   ro  rO   ro  r“   rq  rÙ   úOptional[int]rÚ   ru  rÛ   ru  rÜ   ru  rÝ   ru  rÞ   úOptional[SandboxMountConfig]rß   úOptional[SandboxProxyConfig]rà   ú*Optional[Union[RunConfig, dict[str, Any]]]r–   rt  r"  r+   )"rä   ro  r×   ro  rØ   ro  rO   ro  r“   rq  rç   ÚboolrÙ   ru  rÚ   ru  rÛ   ru  rÜ   ru  rÝ   ru  rÞ   rv  rß   rw  rà   rx  rè   zOptional[AccessDelegation]r–   rt  r"  r+   )rO   rª   r–   rt  r"  r+   )r–   rt  r"  zlist[Sandbox])rO   rª   r	  ro  rÙ   ru  rÚ   ru  rß   rw  rà   rx  r–   rt  r"  r+   )rO   rª   r–   rt  r"  rr  )rO   rª   r–   rt  r"  r    )rO   rª   r  rq  r  rq  r  rr  r–   rt  r"  r$   )rO   rª   r  rq  r  rq  r  r"   r–   rt  r"  r#   )rO   rª   r  rq  r  rq  r  zOptional[ServiceAccess]r–   rt  r"  z"Union[ServiceURL, ServiceLoginURL])rO   rª   rh   rª   r  ru  r%  ro  r&  z$Optional[DownloadContentDisposition]r–   rt  r"  r   )
rO   rª   r“   rq  r+  rp  r–   rt  r"  r+   )rO   rª   r“   rq  r–   rt  r"  r+   )rO   rª   rG  rª   rÝ   rq  rC  ro  rD  ro  rà   rx  r“   rq  r–   rt  r"  r%   )rO   rª   rq   úUnion[str, os.PathLike[str]]rÝ   ru  rr   rz  r†   úOptional[Mapping[str, str]]r‡   ro  rK  zOptional[Callable[[str], Any]]rÛ   ru  rÜ   ru  r“   rq  r–   rt  r"  r%   )r\  rª   rO   rª   rC  ro  rG  ro  rÝ   ru  rà   rx  r“   rq  r–   rt  r"  r%   )rä   rª   r–   rt  r"  r%   )rO   rª   r–   rt  r"  zlist[SnapshotTag])
re  ro  rf  ru  rg  ru  r–   rt  r"  zlist[Snapshot])rä   rª   r–   rt  r"  rr  )
rä   rª   r“   rq  r+  rp  r–   rt  r"  r%   )'Ú__name__Ú
__module__Ú__qualname__Ú__doc__r§   r®   r³   r·   Úpropertyr»   r¿   rÁ   rÄ   rÆ   rÊ   rÌ   rÑ   rÔ   ræ   râ   r  r  r  r  r  r   r  r)  r:  r>  rA  rI  rZ  rU  ra  rd  rk  rm  rH  r<   r9   r7   r�   r�   Í   sà  „ ñð. '+ØØ!%ØØ,0ñ)<ð $ð)<ð ð	)<ð
 ð)<ð ð)<ð *ó)<óV	ó
óð ò<ó ð<ó8:ó=ó
ó(,óóðà ðð )ðð ð	ð
 
óó<ð &*ðfð #'Ø'+Ø"ØØ*.Ø37Ø#Ø#'Ø+/Ø59Ø59ØAEØ"&ñ!fà"ðfð  ð	fð
 %ðfð ðfð ðfð (ðfð $1ðfð ðfð !ðfð )ðfð 3ðfð 3ðfð ?ðfð   ð!fð" 
ó#fðT &*ðZð #'Ø'+Ø"ØØ#Ø*.Ø37Ø#Ø#'Ø+/Ø59Ø59ØAEØ8<Ø"&ñ%Zà"ðZð  ð	Zð
 %ðZð ðZð ðZð ðZð (ðZð $1ðZð ðZð !ðZð )ðZð 3ðZð 3ðZð  ?ð!Zð" 6ð#Zð$  ð%Zð& 
ó'Zðx CGõ  ðD ;?õ ð: #'Ø*.Ø37Ø59ØAEØ"&ñXàðXð  ð	Xð
 (ðXð $1ðXð 3ðXð ?ðXð  ðXð 
óXðt FJõ (ð2 7;ñ Øð Ø%3ð à	ó ðD ð #&ØØ"&ñàðð ðð
  ðð ðð  ðð 
òó ðð ð #&à"&ñàðð ðð
  ðð ðð  ðð 
òó ðð #&Ø*.Ø"&ñKàðKð ðKð
  ðKð (ðKð  ðKð 
,óKðd -1Ø&*ØDHØ"&ñDàðDð ðDð
 *ðDð $ðDð BðDð  ðDð 
óDðT Ø"Ø"&ñ.6àð.6ð ð	.6ð
 ð.6ð  ð.6ð 
ó.6ðh Ø"&ñ%Màð%Mð ð	%Mð
  ð%Mð 
ó%MðN DHõ (ðF "Ø%)ØAEØØ"&ñAUàðAUð ðAUð ð	AUð ðAUð #ðAUð ?ðAUð ðAUð  ðAUð 
óAUðN ,0ð	\ð 14Ø26Ø $Ø7;Ø#Ø#'ØØ"&ñ\àð\ð 1ð\ð )ð	\ð .ð\ð 0ð\ð ð\ð 5ð\ð ð\ð !ð\ð ð\ð  ð\ð 
ó\ðF "Ø&*Ø+/ØAEØØ"&ñCUàðCUð ðCUð
 ðCUð $ðCUð )ðCUð ?ðCUð ðCUð  ðCUð 
óCUðL >BñØðØ,:ðà	óð@ 7;ñØðØ%3ðà	óðF (,Ø#Ø $Ø"&ñ8ð %ð8ð ð	8ð
 ð8ð  ð8ð 
ó8ðv >Bñ(Øð(Ø,:ð(à	ó(ð8 Ø"Ø"&ñ+6àð+6ð ð	+6ð
 ð+6ð  ð+6ð 
ô+6r9   r�   rs  )r"  ro  )rF   rª   r"  rª   )rN   rª   rO   rª   rP   rª   r"  rª   )re   r   r"  Úbytes)rq   rz  rr   rz  r"  ztuple[Path, str])r‚   rª   rt   rª   rƒ   rª   r„   rª   r…   rª   r†   r{  r‡   ro  r"  rª   )Tr  Ú
__future__r   rZ   Úosr|   r�   r\   r«   Úcollections.abcr   r   Úpathlibr   Útypingr   r   r	   r
   r   Úurllib.parser   Ú	langsmithr   r4   Úlangsmith._openapi_clientr   Ú langsmith._openapi_client._httpxr   Úlangsmith.clientr   Ú$langsmith.sandbox._access_delegationr   r   Úlangsmith.sandbox._exceptionsr   r   r   r   r   Úlangsmith.sandbox._helpersr   r   r   r   r   r   Úlangsmith.sandbox._modelsr   r   r    r!   r"   r#   r$   r%   r&   r'   Úlangsmith.sandbox._mountsr(   r)   Úlangsmith.sandbox._proxy_configr*   Úlangsmith.sandbox._sandboxr+   Úlangsmith.sandbox._tracingr,   Úlangsmith.sandbox._transportr-   Ú8langsmith._openapi_client.resources.sandboxes.registriesr.   rÃ   r0   r8   r=   rª   rt  rG   rJ   rR   rj   rv   r�   r�   r<   r9   r7   Ú<module>r–     s4  ðÙ Kå "ã 	Û 	Û Û Û Û ß -Ý ß @Õ @Ý å 'Ý /Ý 2Ý 2÷÷õ ÷÷ ÷÷ ÷ ÷õ ?Ý .Ý ;Ý 7áõõ Có=ó+ð
 ˜' # s (Ñ+Ñ,€ó!ó"óCóð3Ø,ð3à)ð3ð ó3ð(?àð?ð ð?ð ð	?ð
 ð?ð ð?ð ,ð?ð ð?ð 	ó?÷DV6ò V6r9   