Ë
    ñÏj=¬  ã                  óÖ  — d Z ddlmZ ddlZddl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mZmZ ddlmZ ddlmZmZ dd	l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& ddlm'Z( ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z;m<Z< ddl7m=Z> ddl?m@Z@ ddlAmBZB ddlCmDZDmEZEmFZFmGZG erddlHmIZI ddlJmKZK ddlLmMZM eeeNeNf      ZOe G d„ d«      «       ZPy)z0AsyncSandbox class for async sandbox operations.é    )ÚannotationsN)ÚMapping)Ú	dataclassÚfield)ÚTYPE_CHECKINGÚAnyÚCallableÚLiteralÚOptionalÚUnionÚoverload)Úhttpx)ÚAccessDelegationÚ_access_delegation_from_dict)ÚDataplaneNotConfiguredErrorÚResourceNotFoundErrorÚSandboxRetryableConnectionError)Úbuild_range_header)Úfile_chunk_from_response)Úfile_stat_from_response)Úhandle_sandbox_http_error)Úraise_file_http_error)Úresolve_close_input)Úresolve_command_run_config)ÚAsyncCommandHandleÚAsyncServiceURLÚDownloadContentDispositionÚDownloadURLÚExecutionResultÚ	FileChunkÚFileStatÚ
GlobResultÚ
GrepResultÚ	RunConfigÚSnapshotÚ_run_config_from_dictÚ_StreamEndedBeforeStarted)ÚMISSING_TRANSPORT_MSGÚrequire_sse_supportsÚresume_sse_stream_asyncÚrun_sse_stream_asyncÚsse_transport_selected)Ústart_payload)Úadd_sandbox_metadata)ÚAsyncTunnel)ÚWEBSOCKETS_AVAILABLEÚ_retry_delayÚconnect_deadlineÚopen_timeout_for)ÚAsyncSandboxClient)ÚSandboxClient©ÚSandboxc                  ó–  — e Zd ZU dZded<   dZded<   dZded<   dZded	<   dZded
<   dZ	ded<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<    edd¬«      Zded<    edd¬«      Zded<   e	 dP	 	 	 	 	 	 	 dQd „«       Zdd!œdRd"„ZdSd#„Z	 	 	 	 	 	 	 	 dTd$„ZdUd%„Zed&d&d&d&d&d&d&d&d&d&d&d&d&d&d'œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dVd(„«       Zed&d&d&d&d&d&d&d&d&d&d&d&d&d)œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dWd*„«       Zd+ddddd,ddd-dd.dddd'œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dXd/„Zd-dd.ddd0œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dYd1„Zd-dd.ddd0œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dYd2„Z d3d3dddd4œ	 	 	 	 	 	 	 	 	 	 	 	 	 dZd5„Z!d+dd6œ	 	 	 	 	 	 	 	 	 d[d7„Z"d+dd6œ	 	 	 	 	 	 	 d\d8„Z#d+dd6œ	 	 	 	 	 	 	 d]d9„Z$dddddd+dd:œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d^d;„Z%dd+dd<œ	 	 	 	 	 	 	 	 	 	 	 d_d=„Z&dd+dd<œ	 	 	 	 	 	 	 	 	 d`d>„Z'ddd+dd?œ	 	 	 	 	 	 	 	 	 	 	 	 	 dad@„Z(	 	 	 	 	 	 	 	 	 	 dbdA„Z)d3dBddCœ	 	 	 	 	 	 	 	 	 dcdD„Z*d.ddEœ	 	 	 	 	 	 	 dddF„Z+dddddGœ	 	 	 	 	 	 	 	 	 	 	 dedH„Z,dIdd6œ	 	 	 	 	 dfdJ„Z-ddKœdgdL„Z.ddKœdgdM„Z/dd+ddNœ	 	 	 	 	 	 	 	 	 dhdO„Z0y)iÚAsyncSandboxaf	  Represents an active sandbox for running commands and file operations async.

    This class is typically obtained from AsyncSandboxClient.sandbox() and supports
    the async context manager protocol for automatic cleanup.

    Attributes:
        name: Display name (can be updated).
        dataplane_url: URL for data plane operations (file I/O, command execution).
            Only functional when status is "ready".
        id: Unique identifier (UUID). Remains constant even if name changes.
            May be None for resources created before ID support was added.
        status: Sandbox lifecycle status. One of "provisioning", "ready",
            "failed", "stopped".
        status_message: Human-readable details when status is "failed", None otherwise.
        created_at: Timestamp when the sandbox was created.
        updated_at: Timestamp when the sandbox was last updated.
        idle_ttl_seconds: Idle timeout TTL in seconds (``0`` means disabled).
            Newly-created sandboxes receive a server-side default of ``600``
            seconds (10 minutes) when the caller did not set ``idle_ttl_seconds``
            explicitly. The launcher stops the sandbox after this many idle
            seconds; deletion is anchored to ``stopped_at`` and controlled by
            ``delete_after_stop_seconds`` (see below).
        delete_after_stop_seconds: Seconds after a sandbox enters the
            ``stopped`` state before it (and its filesystem clone) are
            permanently deleted. ``0`` disables stop-anchored deletion;
            ``None`` falls back to the server default.
        stopped_at: Timestamp when the sandbox transitioned to ``stopped``,
            or ``None`` while running. The deletion deadline is
            ``stopped_at + delete_after_stop_seconds``.
        snapshot_id: Snapshot ID used to create this sandbox.
        vcpus: Number of vCPUs allocated.
        mem_bytes: Memory allocation in bytes.
        fs_capacity_bytes: Root filesystem capacity in bytes.
        run_config: User, working directory and environment the sandbox's
            commands run with. None on sandboxes created before the server
            recorded it.

    Example:
        async with await client.sandbox(
            snapshot_id="<snapshot-uuid>"
        ) as sandbox:
            result = await sandbox.run("python --version")
            print(result.stdout)
    ÚstrÚnameNúOptional[str]Údataplane_urlÚidÚreadyÚstatusÚstatus_messageÚ
created_atÚ
updated_atúOptional[int]Úidle_ttl_secondsÚdelete_after_stop_secondsÚ
stopped_atÚsnapshot_idÚvcpusÚ	mem_bytesÚfs_capacity_byteszOptional[RunConfig]Ú
run_configzOptional[AccessDelegation]Úaccess_delegationF)ÚreprÚdefaultr4   Ú_clientTÚboolÚ_auto_deletec           
     ó‚  —  | di d|j                  dd«      “d|j                  d«      “d|j                  d«      “d|j                  dd«      “d|j                  d«      “d|j                  d«      “d	|j                  d	«      “d
|j                  d
«      “d|j                  d«      “d|j                  d«      “d|j                  d«      “d|j                  d«      “d|j                  d«      “d|j                  d«      “dt        |j                  d«      «      “dt        |j                  d«      «      “d|“d|“ŽS )aD  Create an AsyncSandbox from API response dict.

        Args:
            data: API response dictionary containing sandbox data.
            client: Parent AsyncSandboxClient for operations.
            auto_delete: Whether to delete the sandbox on context exit.

        Returns:
            AsyncSandbox instance.
        r;   Ú r=   r>   r@   r?   rA   rB   rC   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rP   rR   © )Úgetr&   r   )ÚclsÚdataÚclientÚauto_deletes       ú]/var/www/html/gaurav-v2/venv/lib/python3.12/site-packages/langsmith/sandbox/_async_sandbox.pyÚ	from_dictzAsyncSandbox.from_dictš   sf  € ñ" ò 
Ø—‘˜& "Ô%ð
àŸ(™( ?Ô3ð
ð �x‰x˜Œ~ð
ð —8‘8˜H gÔ.ð	
ð
  Ÿ8™8Ð$4Ô5ð
ð —x‘x Ô-ð
ð —x‘x Ô-ð
ð "ŸX™XÐ&8Ô9ð
ð '+§h¡hÐ/JÔ&Kð
ð —x‘x Ô-ð
ð Ÿ™ Ô/ð
ð —(‘(˜7Ô#ð
ð —h‘h˜{Ô+ð
ð #Ÿh™hÐ':Ô;ð
ô -¨T¯X©X°lÓ-CÔDð
ô  ;Ø—‘Ð,Ó-ôð!
ñ& ð'
ñ( %ð)
ð 	
ó    )rY   c               óþ  — ddl m}  |di d| j                  “d| j                  “d| j                  “d| j
                  “d| j                  “d| j                  “d	| j                  “d
| j                  “d| j                  “d| j                  “d| j                  “d| j                  “d| j                  “d| j                  “d| j                   “d| j"                  “d|�|n| j$                  j'                  «       “dd“ŽS )a  Create a Sandbox for the same underlying sandbox.

        The returned instance has ``auto_delete`` disabled so the sandbox's
        lifecycle stays tied to this instance; both refer to the same
        server-side sandbox.

        Args:
            client: SandboxClient to use for operations. If not provided,
                one is created with the same configuration as this sandbox's
                client (see :meth:`AsyncSandboxClient.to_sync`).

        Returns:
            Sandbox referring to the same sandbox.
        r   r6   r;   r=   r>   r@   rA   rB   rC   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rP   rR   FrU   )Úlangsmith.sandbox._sandboxr7   r;   r=   r>   r@   rA   rB   rC   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rP   Úto_sync)ÚselfrY   r7   s      r[   r`   zAsyncSandbox.to_syncÂ   s'  € õ 	7áò 
Ø—’ð
à×,Ò,ð
ð �wŠwð
ð —;’;ð	
ð
  ×.Ò.ð
ð —’ð
ð —’ð
ð "×2Ò2ð
ð '+×&DÒ&Dð
ð —’ð
ð ×(Ò(ð
ð —*’*ð
ð —n’nð
ð #×4Ò4ð
ð —’ð
ð  #×4Ò4ð!
ð" %Ð0‘F°d·l±l×6JÑ6JÓ6Løð#
ñ$ ð%
ð 	
r]   c              ƒ  ó8   K  — t        | j                  «       | S ­w)zEnter async context manager.)r.   r>   ©ra   s    r[   Ú
__aenter__zAsyncSandbox.__aenter__è   s   è ø€ ä˜TŸW™WÔ%Øˆùs   ‚c              ƒ  óÎ   K  — t        | j                  «       | j                  r/	 | j                  j	                  | j
                  «      ƒ d{  –—†  yy7 Œ# t        $ r Y yw xY w­w)z<Exit async context manager, optionally deleting the sandbox.N)r.   r>   rR   rP   Údelete_sandboxr;   Ú	Exception)ra   Úexc_typeÚexc_valÚexc_tbs       r[   Ú	__aexit__zAsyncSandbox.__aexit__í   sW   è ø€ ô 	˜TŸW™WÔ%Ø×ÒðØ—l‘l×1Ñ1°$·)±)Ó<×<Ñ<ð à<ùÜò áðüs:   ‚"A%¥(A ÁAÁA ÁA%ÁA Á	A"ÁA%Á!A"Á"A%c                óŽ   — t        | j                  «       | j                  st        d| j                  › d�«      ‚| j                  S )aã  Return the dataplane URL.

        The client does not gate on lifecycle status: a stopped sandbox is
        resumed by the platform when the dataplane request arrives, so only the
        presence of a URL is required here. A genuinely not-ready box surfaces
        the server's ``SandboxNotReadyError`` from the request itself.

        Returns:
            The dataplane URL.

        Raises:
            DataplaneNotConfiguredError: If dataplane_url is not configured.
        z	Sandbox 'zW' does not have a dataplane_url configured. Runtime operations require a dataplane URL.)r.   r>   r=   r   r;   rc   s    r[   Ú_require_dataplane_urlz#AsyncSandbox._require_dataplane_urlü   sI   € ô 	˜TŸW™WÔ%Ø×!Ò!Ü-Ø˜DŸI™I˜;ð '>ð >óð ð ×!Ñ!Ð!r]   .)ÚtimeoutÚenvÚcwdrL   Úclose_inputÚshellÚ	on_stdoutÚ	on_stderrÚidle_timeoutÚkill_on_disconnectÚttl_secondsÚptyÚheadersÚwaitc             ƒ  ó   K  — y ­w©NrU   ©ra   Úcommandrn   ro   rp   rL   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   s                   r[   ÚrunzAsyncSandbox.run  s   è ø€ ð& ùó   ‚)rn   ro   rp   rL   rq   rr   rs   rt   ru   rv   rw   rx   ry   c             ƒ  ó   K  — y ­wr|   rU   r}   s                   r[   r   zAsyncSandbox.run'  s   è ø€ ð& !ùr€   é<   z	/bin/bashi,  iX  c             ƒ  ó6  K  — |s|s|	rt        d«      ‚t        |||¬«      }t        ||¬«      }| j                  «        t	        «       r| j
                  }n"t        r| j                  }nt        t        «      ‚ |||||||||||	|
||||¬«      ƒ d{  –—† S 7 Œ­w)aæ  Execute a command in the sandbox asynchronously.

        Args:
            command: Shell command to execute.
            timeout: Command timeout in seconds.
            env: Environment variables to set for the command. Deprecated in
                favour of ``run_config.env_vars``; the two cannot be combined.
            cwd: Working directory for command execution. If None, uses sandbox
                default. Deprecated in favour of ``run_config.work_dir``; the
                two cannot be combined.
            run_config: User, working directory and environment for this one
                command, layered over the sandbox's own. Accepts a
                :class:`RunConfig` or a plain dict.
            close_input: Half-close the command's stdin so a command that
                reads it sees EOF rather than blocking until the timeout.
                Defaults to True for a non-PTY command, which means
                ``send_input()`` on the returned handle raises unless this is
                set to False. Ignored under ``pty=True``, where input and
                output share one terminal file descriptor -- send an EOT byte
                (``0x04``) as input instead.
            shell: Shell to use for command execution. Defaults to "/bin/bash".
            on_stdout: Callback invoked with each stdout chunk as it arrives.
                Blocks until the command completes and returns ExecutionResult.
                Cannot be combined with wait=False.
            on_stderr: Callback invoked with each stderr chunk as it arrives.
                Blocks until the command completes and returns ExecutionResult.
                Cannot be combined with wait=False.
            idle_timeout: Idle timeout in seconds. If the command has no
                connected clients for this duration, it is killed. Defaults
                to 300 (5 minutes). Set to -1 for no idle timeout.
                Only applies to WebSocket execution.
            kill_on_disconnect: If True, kill the command immediately when
                the last client disconnects. Defaults to False (command
                continues running and can be reconnected to).
            ttl_seconds: How long (in seconds) a finished command's session
                is kept for reconnection. Defaults to 600 (10 minutes).
                Set to -1 to keep indefinitely.
            pty: If True, allocate a pseudo-terminal for the command.
                Useful for commands that require a TTY (e.g., interactive
                programs, commands that use terminal control codes).
                Defaults to False.
            wait: If True (default), block until the command completes and
                return ExecutionResult. If False, return an
                AsyncCommandHandle immediately for streaming output,
                kill, stdin input, and reconnection. Cannot be combined
                with on_stdout/on_stderr callbacks.

        Returns:
            ExecutionResult when wait=True (default).
            AsyncCommandHandle when wait=False.

        Raises:
            ValueError: If wait=False is combined with callbacks.
            DataplaneNotConfiguredError: If dataplane_url is not configured.
            SandboxOperationError: If command execution fails.
            CommandTimeoutError: If command exceeds its timeout.
            SandboxConnectionError: If connection to sandbox fails after retries.
            SandboxNotReadyError: If sandbox is not ready.
            SandboxClientError: For other errors.
        z}Cannot combine wait=False with on_stdout/on_stderr callbacks. Use wait=False and iterate the CommandHandle, or use callbacks.)ro   rp   )rx   )rn   ro   rp   rL   Úclose_stdinrr   rz   rs   rt   ru   rv   rw   rx   ry   N)
Ú
ValueErrorÚ_resolve_command_run_configÚ_resolve_close_inputrm   r,   Ú_run_sser0   Ú_run_wsÚImportErrorr(   )ra   r~   rn   ro   rp   rL   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   Úresolved_run_configr„   Úrunners                      r[   r   zAsyncSandbox.run<  s¸   è ø€ ñ^ ™¡iÜðRóð ô :¸*È#ÐSVÔWÐÜ*¨;¸CÔ@ˆà×#Ñ#Ô%ä!Ô#Ø—]‘]‰FÝ!Ø—\‘\‰FäÔ3Ó4Ð4ÙØØØØØ*Ø#ØØØØØ%Ø1Ø#ØØô
÷ 
ð 	
ð 
ús   ‚BBÂBÂB)ru   rv   rw   rx   ry   c          
   ƒ  óš  K  — ddl }ddlm} ddlm} | j                  «       }| j                  j                  } |«       j                  }|||||||||dœ	}|�||d<   |rd|d<   | j                  j                  |«      }|r||d	<   d}t        «       }	 t        |«      |d
<    ||||fi |¤Žƒ d{  –—† \  }}t        ||| |	|
||¬«      }	 |j                  «       ƒ d{  –—†  	 |s|S |j2                  ƒ d{  –—† S 7 ŒK7 Œ# t        t        f$ r¶}|dz  }|t        j                   kD  r‚ t#        t        j$                  d|dz
  z  z  t        j&                  «      }t)        |t        «      rt+        ||«      }|�)|t-        j.                  «       z
  }|dk  r‚ t#        ||«      } |j0                  |«      ƒ d{  –—†7   Y d}~nd}~ww xY w�Œ67 ŒÒ­w)z"Execute via WebSocket /execute/ws.r   N)Úrun_ws_stream_async©Úuuid7)	Ú
command_idrn   ro   rp   rr   ru   rv   rw   rx   rL   Tr„   ry   Úopen_timeout)rs   rt   Ústdin_closedrx   é   é   )ÚasyncioÚlangsmith.sandbox._ws_executerŽ   Úlangsmith.uuidr�   rm   rP   Ú_api_keyÚhexÚ_ws_default_headersr2   r3   r   Ú_ensure_startedr'   r   ÚMAX_AUTO_RECONNECTSÚminÚ_BACKOFF_BASEÚ_BACKOFF_MAXÚ
isinstancer1   ÚtimeÚ	monotonicÚsleepÚresult) ra   r~   rn   ro   rp   rL   r„   rr   rz   rs   rt   ru   rv   rw   rx   ry   r–   rŽ   r�   r=   Úapi_keyr‘   Ú	ws_kwargsÚmergedÚattemptÚdeadlineÚ
msg_streamÚcontrolÚhandleÚexcÚbackoffÚ	remainings                                    r[   r‰   zAsyncSandbox._run_ws­  s	  è ø€ ó( 	åEÝ(à×3Ñ3Ó5ˆØ—,‘,×'Ñ'ˆñ “W—[‘[ˆ
ð %ØØØØØ(Ø"4Ø&Øñ
%
ˆ	ð Ð!Ø&0ˆI�lÑ#ÙØ'+ˆI�mÑ$Ø—‘×1Ñ1°'Ó:ˆÙØ#)ˆI�iÑ àˆÜ#Ó%ˆØÜ(8¸Ó(BˆI�nÑ%Ù(;ØØØñ)ð ñ	)÷ #ÑˆJ˜ô (ØØØØ#Ø#Ø(ØôˆFð-Ø×,Ñ,Ó.×.Ð.Øñ. ØˆMà—]‘]×"Ð"ðW#øð  /ùô *Ü/ðò -ð ˜1‘�ØÔ/×CÑCÒCØÜÜ&×4Ñ4¸¸gÈ¹kÑ8JÑKÜ&×3Ñ3ó�ô ˜cÔ#BÔCÜ*¨3°Ó8�GØÐ'Ø (¬4¯>©>Ó+;Ñ ;�IØ  A’~ØÜ! '¨9Ó5�GØ#�g—m‘m GÓ,×,Ö,ûð)-úñ) ðZ #úsg   ‚B-GÂ/C;Â0GÃ
C? ÃC=ÃC? Ã"GÃ6G	Ã7GÃ=C? Ã?GÄB&F?Æ4F7Æ5F?Æ:GÆ?GÇGc             ƒ  ó´  K  — ddl m} t        |||¬«       | j                  «       }t	        | |«       j
                  |||||||¬«	      }t        | j                  j                  ||| j                  j                  |«      ¬«      ƒ d{  –—† \  }}t        ||| |	|
d¬«      }|j                  «       ƒ d{  –—†  |s|S |j                  ƒ d{  –—† S 7 ŒH7 Œ7 Œ­w)	z=Execute via the SSE endpoints /execute/stream/{start,resume}.r   r�   )rx   r„   rv   )r‘   rn   rr   ru   rw   ro   rp   rL   ©ry   NT)rs   rt   r“   )r˜   r�   r)   rm   Ú_sse_start_payloadrš   r+   rP   Ú_httpÚ_request_headersr   rœ   r¥   )ra   r~   rn   ro   rp   rL   r„   rr   rz   rs   rt   ru   rv   rw   rx   ry   r�   r=   Úpayloadr«   r¬   r­   s                         r[   rˆ   zAsyncSandbox._run_sse  së   è ø€ õ( 	)äØ ÐASõ	
ð ×3Ñ3Ó5ˆô
 %ØÙ“w—{‘{ØØØ%Ø#ØØØ!ô

ˆô %9Ø�L‰L×ÑØØØ—L‘L×1Ñ1°'Ó:ô	%
÷ 
Ñˆ
�Gô $ØØØØØØô
ˆð ×$Ñ$Ó&×&Ð&ÙØˆMØ—]‘]×"Ð"ð#
øð 	'øð #ús6   ‚BCÂ	CÂ
+CÂ5CÂ6CÃCÃCÃCÃCr   )Ústdout_offsetÚstderr_offsetr“   rx   ry   c          
   ƒ  óÐ  K  — ddl m} | j                  «       }t        «       r[t	        | j
                  j                  ||||| j
                  j                  |«      ¬«      ƒ d{  –—† \  }	}
t        |	|
| |||d¬«      S ||dœ}| j
                  j                  |«      }|r||d<    ||| j
                  j                  |fi |¤Žƒ d{  –—† \  }}t        ||| |||||¬	«      S 7 Œ}7 Œ­w)
a¹  Reconnect to a running or recently-finished command.

        Resumes output from the given byte offsets. Any output produced while
        the client was disconnected is replayed from the server's ring buffer.

        Args:
            command_id: The command ID from handle.command_id.
            stdout_offset: Byte offset to resume stdout from (default: 0).
            stderr_offset: Byte offset to resume stderr from (default: 0).

        Returns:
            An AsyncCommandHandle for the command.

        Raises:
            SandboxOperationError: If command_id is not found or session expired.
            SandboxConnectionError: If connection to sandbox fails after retries.
        r   )Úreconnect_ws_stream_async)r·   r¸   ry   NT)r‘   r·   r¸   r“   )r·   r¸   ry   )r‘   r·   r¸   r“   rx   )r—   rº   rm   r,   r*   rP   r´   rµ   r   r›   r™   )ra   r‘   r·   r¸   r“   rx   ry   rº   r=   r«   r¬   Úreconnect_kwargsr¨   Ú	ws_streamÚ
ws_controls                  r[   Ú	reconnectzAsyncSandbox.reconnectO  s  è ø€ õ6 	Là×3Ñ3Ó5ˆä!Ô#Ü(?Ø—‘×"Ñ"ØØØ+Ø+ØŸ™×5Ñ5°gÓ>ô)÷ #ÑˆJ˜ô &ØØØØ%Ø+Ø+Ø!ôð ð +Ø*ñ,
Ðð —‘×1Ñ1°'Ó:ˆÙØ*0Ð˜YÑ'á&?ØØ�L‰L×!Ñ!Øñ'
ð ñ	'
÷ !
Ñˆ	�:ô "ØØØØ!Ø'Ø'Ø%Øô	
ð 		
ðC#øð4!
ús%   ‚A"C&Á$C"Á%A"C&ÃC$ÃC&Ã$C&©rn   ry   c          	   ƒ  óš  K  — | j                  «       }|› d�}t        |t        «      r|j                  d«      }dd|fi}	 | j                  j
                  j                  |d|i||| j                  j                  |«      ¬«      ƒ d{  –—† }|j                  «        y7 Œ# t        j                  $ r}	t        |	«       Y d}	~	yd}	~	ww xY w­w)a9  Write content to a file in the sandbox asynchronously.

        Args:
            path: Target file path in the sandbox.
            content: File content (str or bytes).
            timeout: Request timeout in seconds.

        Raises:
            DataplaneNotConfiguredError: If dataplane_url is not configured.
            SandboxOperationError: If file write fails.
            SandboxConnectionError: If connection to sandbox fails after retries.
            SandboxNotReadyError: If sandbox is not ready.
            SandboxClientError: For other errors.
        z/uploadzutf-8ÚfileÚpath)ÚparamsÚfilesrn   ry   N)rm   r¡   r:   ÚencoderP   r´   Úpostrµ   Úraise_for_statusr   ÚHTTPStatusErrorr   )
ra   rÂ   Úcontentrn   ry   r=   ÚurlrÄ   ÚresponseÚes
             r[   ÚwritezAsyncSandbox.write›  sË   è ø€ ð, ×3Ñ3Ó5ˆØ�˜wÐ'ˆô �gœsÔ#Ø—n‘n WÓ-ˆGà˜& 'Ð*Ð+ˆð
	)Ø!Ÿ\™\×/Ñ/×4Ñ4ØØ �~ØØØŸ™×5Ñ5°gÓ>ð 5ó ÷ ˆHð ×%Ñ%Õ'ðùô ×$Ñ$ò 	)Ü% a×(Ñ(ûð	)üsB   ‚=CÁ AB  ÂBÂ	B  ÂCÂB  Â CÂ3CÂ>CÃCÃCc             ƒ  óÈ  K  — | j                  «       }|› d�}	 | j                  j                  j                  |d|i|| j                  j	                  |«      ¬«      ƒ d{  –—† }|j                  «        |j                  S 7 Œ # t        j                  $ rI}|j                  j                  dk(  rt        d|› d| j                  › d�d	¬
«      |‚t        |«       ‚ d}~ww xY w­w)a×  Read a file from the sandbox asynchronously.

        Args:
            path: File path to read. Supports both absolute paths (e.g., /tmp/file.txt)
                  and relative paths (resolved from /home/user/).
            timeout: Request timeout in seconds.

        Returns:
            File contents as bytes.

        Raises:
            DataplaneNotConfiguredError: If dataplane_url is not configured.
            ResourceNotFoundError: If the file doesn't exist.
            SandboxOperationError: If file read fails.
            SandboxConnectionError: If connection to sandbox fails after retries.
            SandboxNotReadyError: If sandbox is not ready.
            SandboxClientError: For other errors.
        ú	/downloadrÂ   ©rÃ   rn   ry   Ni”  zFile 'z' not found in sandbox 'Ú'rÁ   )Úresource_type)rm   rP   r´   rV   rµ   rÇ   rÉ   r   rÈ   rË   Ústatus_coder   r;   r   )ra   rÂ   rn   ry   r=   rÊ   rË   rÌ   s           r[   ÚreadzAsyncSandbox.readÆ  së   è ø€ ð* ×3Ñ3Ó5ˆØ�˜yÐ)ˆð	Ø!Ÿ\™\×/Ñ/×3Ñ3ØØ �~ØØŸ™×5Ñ5°gÓ>ð	 4ó ÷ ˆHð ×%Ñ%Ô'Ø×#Ñ#Ð#ðùô ×$Ñ$ò 	Ø�z‰z×%Ñ%¨Ò,Ü+Ø˜T˜FÐ":¸4¿9¹9¸+ÀQÐGØ"(ôð ðô & aÔ(àûð	üs<   ‚C"™AB Á BÁ!B Â C"ÂB ÂCÂACÃCÃC"c          	   ƒ  ón  K  — | j                  «       }	 | j                  j                  j                  d|› d�d|i|| j                  j	                  |«      ¬«      ƒ d{  –—† }|j                  «        t        |«      S 7 Œ# t        j                  $ r}t        ||| j                  ¬«       ‚ d}~ww xY w­w)a–  Report a file's size and validators without transferring it.

        Args:
            path: File path to stat.
            timeout: Request timeout in seconds.
            headers: Extra request headers.

        Returns:
            FileStat with the size and the ``ETag`` to pass to
            :meth:`read_range`.

        Raises:
            ResourceNotFoundError: If the file doesn't exist.
        ÚHEADrÏ   rÂ   rÐ   N©rÂ   Úsandbox_name)rm   rP   r´   Úrequestrµ   rÇ   r   rÈ   Ú_raise_file_http_errorr;   Ú_file_stat_from_response)ra   rÂ   rn   ry   r=   rË   rÌ   s          r[   ÚstatzAsyncSandbox.statñ  s²   è ø€ ð" ×3Ñ3Ó5ˆð	Ø!Ÿ\™\×/Ñ/×7Ñ7ØØ �/ Ð+Ø �~ØØŸ™×5Ñ5°gÓ>ð 8ó ÷ ˆHð ×%Ñ%Ô'ô (¨Ó1Ð1ðùô ×$Ñ$ò 	Ü" 1¨4¸d¿i¹iÕHØûð	üs;   ‚B5”AB ÁA?Á B Á4B5Á?B ÂB2ÂB-Â-B2Â2B5)ÚstartÚendÚsuffix_bytesÚif_rangeÚif_none_matchrn   ry   c             ƒ  óê  K  — t        |||¬«      }	t        | j                  j                  |«      xs i «      }
|	|
d<   |r||
d<   |r||
d<   | j	                  «       }	 | j                  j
                  j                  |› d�d|i||
¬«      ƒ d{  –—† }|j                  d	k7  r|j                  «        t        |«      S 7 Œ.# t        j                  $ r}t        ||| j                  ¬
«       ‚ d}~ww xY w­w)a+  Read part of a file, for chunked reads and resumed downloads.

        Args:
            path: File path to read.
            start: First byte to return. With ``end``, an inclusive range.
            end: Last byte to return, inclusive. Clamped to EOF rather than
                rejected.
            suffix_bytes: Return the last N bytes. Mutually exclusive with
                ``start``/``end``.
            if_range: An ``ETag`` from an earlier chunk. The range is honored
                only while the file still matches it; a rewrite answers 200
                with the whole file, reported as ``partial=False`` so a
                resuming caller restarts instead of splicing two versions.
            if_none_match: An ``ETag`` the caller already holds. An unchanged
                file answers with ``unchanged=True`` and no bytes.
            timeout: Request timeout in seconds.
            headers: Extra request headers.

        Returns:
            FileChunk with the bytes and where they sit in the file.

        Raises:
            ValueError: If no range is given, or suffix_bytes is combined
                with start/end.
            SandboxOperationError: If the range starts past the end of the
                file (416).
            ResourceNotFoundError: If the file doesn't exist.
        )rÝ   rÞ   rß   ÚRangezIf-RangezIf-None-MatchrÏ   rÂ   rÐ   Ni0  r×   )Ú_build_range_headerÚdictrP   rµ   rm   r´   rV   rÓ   rÇ   r   rÈ   rÚ   r;   Ú_file_chunk_from_response)ra   rÂ   rÝ   rÞ   rß   rà   rá   rn   ry   Úrange_headerÚrequest_headersr=   rË   rÌ   s                 r[   Ú
read_rangezAsyncSandbox.read_range  s  è ø€ ôP +Ø˜S¨|ô
ˆô ˜tŸ|™|×<Ñ<¸WÓEÒKÈÓLˆØ#/ˆ˜Ñ ÙØ*2ˆO˜JÑ'ÙØ/<ˆO˜OÑ,à×3Ñ3Ó5ˆð	Ø!Ÿ\™\×/Ñ/×3Ñ3Ø �/ Ð+Ø �~ØØ'ð	 4ó ÷ ˆHð ×#Ñ# sÒ*Ø×)Ñ)Ô+ô )¨Ó2Ð2ðùô ×$Ñ$ò 	Ü" 1¨4¸d¿i¹iÕHØûð	üs<   ‚AC3Á1B? ÂB=Â#B? Â2C3Â=B? Â?C0ÃC+Ã+C0Ã0C3©Úlimitrn   ry   c             ƒ  óŠ   K  — ||dœ}|�||d<   | j                  d|||¬«      ƒ d{  –—† }t        j                  |«      S 7 Œ­w)a;  Find files and directories matching a pattern.

        Args:
            pattern: Match against each entry's path relative to ``path``.
                Supports ``**`` for any number of segments plus ``*``, ``?``
                and ``[...]`` within one segment.
            path: Absolute path of the directory to search under.
            limit: Maximum matches to return.
            timeout: Request timeout in seconds.
            headers: Extra request headers.

        Returns:
            GlobResult; check ``truncated`` before treating it as complete.
        ©ÚpatternrÂ   Nrë   Úglobr¿   )Ú_file_searchr"   r\   )ra   rî   rÂ   rë   rn   ry   r¶   rX   s           r[   rï   zAsyncSandbox.globR  s]   è ø€ ð. /6¸tÑ"DˆØÐØ$ˆG�GÑØ×&Ñ&Ø�G W°gð 'ó 
÷ 
ˆô ×#Ñ# DÓ)Ð)ð
ús   ‚%A§A¨Ac             ƒ  óJ   K  — | j                  d||||¬«      ƒ d{  –—† S 7 Œ­w)a±  List a directory's immediate entries, without recursing.

        A convenience over :meth:`glob` with the pattern ``*``.

        Args:
            path: Absolute path of the directory to list.
            limit: Maximum entries to return.
            timeout: Request timeout in seconds.
            headers: Extra request headers.

        Returns:
            GlobResult holding the directory's files and subdirectories.
        Ú*rê   N)rï   )ra   rÂ   rë   rn   ry   s        r[   ÚlszAsyncSandbox.lsq  s(   è ø€ ð* —Y‘Y˜s D°¸wÐPW�YÓX×XÐXÐXús   ‚#œ!�#)rï   rë   rn   ry   c             ƒ  ó˜   K  — ||dœ}|�||d<   |�||d<   | j                  d|||¬«      ƒ d{  –—† }t        j                  |«      S 7 Œ­w)a‹  Search file contents for a literal string.

        Args:
            pattern: Literal text to search for. Not a regular expression.
            path: Absolute path of the directory to search under.
            glob: Restrict which files are searched. A bare ``*.py`` matches
                by basename at any depth; a pattern containing ``/`` or
                ``**`` matches the path relative to ``path``.
            limit: Maximum matches to return.
            timeout: Request timeout in seconds.
            headers: Extra request headers.

        Returns:
            GrepResult; check ``truncated`` before treating it as complete.
        rí   Nrï   rë   Úgrepr¿   )rð   r#   r\   )	ra   rî   rÂ   rï   rë   rn   ry   r¶   rX   s	            r[   rõ   zAsyncSandbox.grepˆ  sl   è ø€ ð2 /6¸tÑ"DˆØÐØ"ˆG�F‰OØÐØ$ˆG�GÑØ×&Ñ&Ø�G W°gð 'ó 
÷ 
ˆô ×#Ñ# DÓ)Ð)ð
ús   ‚,A
®A¯A
c             ƒ  ó|  K  — | j                  «       }	 | j                  j                  j                  |› d|› �||| j                  j	                  |«      ¬«      ƒ d{  –—† }|j                  «        |j                  «       S 7 Œ$# t        j                  $ r!}t        ||d   | j                  ¬«       ‚ d}~ww xY w­w)z6POST one of the read-only filesystem search endpoints.Ú/)Újsonrn   ry   NrÂ   r×   )rm   rP   r´   rÆ   rµ   rÇ   r   rÈ   rÚ   r;   rø   )ra   Ú	operationr¶   rn   ry   r=   rË   rÌ   s           r[   rð   zAsyncSandbox._file_search«  s´   è ø€ ð ×3Ñ3Ó5ˆð
	Ø!Ÿ\™\×/Ñ/×4Ñ4Ø �/  9 +Ð.ØØØŸ™×5Ñ5°gÓ>ð	 5ó ÷ ˆHð ×%Ñ%Ô'ð �}‰}‹Ððùô ×$Ñ$ò 	Ü" 1¨7°6©?ÈÏÉÕSØûð	üs;   ‚B<”A
B ÁBÁB Á3B<ÂB ÂB9ÂB4Â4B9Â9B<é   ©Ú
local_portÚmax_reconnectsry   c             ƒ  óx  K  — d|cxk  rdk  sn t        d|› d�«      ‚|rd|cxk  rdk  sn t        d|› d�«      ‚| j                  «       }| j                  j                  }t	        ||||||¬«      }t        j                  «       }|j                  d|j                  j                  «      ƒ d{  –—†  |S 7 Œ­w)a[  Open a TCP tunnel to a port inside the sandbox.

        Creates a local TCP listener that forwards connections through a
        yamux-multiplexed WebSocket to the specified port inside the sandbox.
        Works with any TCP protocol (databases, Redis, HTTP, etc.).

        Usage::

            async with await sandbox.tunnel(remote_port=5432) as t:
                conn = await asyncpg.connect(host="127.0.0.1", port=t.local_port)

        Args:
            remote_port: TCP port inside the sandbox to tunnel to (1-65535).
            local_port: Local port to listen on. Defaults to mirroring
                remote_port. Use 0 to let the OS pick an available port.
            max_reconnects: Maximum number of automatic reconnect attempts
                when the WebSocket session drops. Set to 0 to disable.

        Returns:
            An AsyncTunnel instance (async context manager).

        Raises:
            ValueError: If port values are out of range.
            DataplaneNotConfiguredError: If dataplane_url is not configured.
            SandboxNotReadyError: If sandbox is not ready.
        r”   iÿÿ  z-remote_port must be between 1 and 65535 (got Ú)z,local_port must be between 1 and 65535 (got rû   N)
r…   rm   rP   r™   r/   r–   Úget_running_loopÚrun_in_executorÚ_tunnelÚ_start)	ra   Úremote_portrü   rý   ry   r=   r¦   ÚtÚloops	            r[   ÚtunnelzAsyncSandbox.tunnelÂ  sÎ   è ø€ ðD �KÔ( 5Ô(ÜØ?À¸}ÈAÐNóð ñ ˜a :Ô6°Ô6ÜØ>¸z¸lÈ!ÐLóð ð ×3Ñ3Ó5ˆØ—,‘,×'Ñ'ˆÜØØØØ!Ø)Øô
ˆô ×'Ñ'Ó)ˆØ×"Ñ" 4¨¯©×)9Ñ)9Ó:×:Ð:Øˆð 	;ús   ‚B/B:Â1B8Â2B:©Úexpires_in_secondsry   c             ƒ  óÀ   K  — t        | j                  «       | j                  j                  | j                  |||¬«      ƒ d{  –—† }| j                  |_        |S 7 Œ­w)aÉ  Get an authenticated URL for a service running in this sandbox.

        Returns an :class:`AsyncServiceURL` whose async accessors
        auto-refresh the token transparently before it expires.

        Args:
            port: Port the service is listening on inside the sandbox.
            expires_in_seconds: Token TTL in seconds (1--86400, default 600).
            headers: Optional per-request header overrides.

        Returns:
            AsyncServiceURL 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.
        r  N)r.   r>   rP   Úservicer;   Ú_sandbox_id)ra   Úportr	  ry   r  s        r[   r  zAsyncSandbox.serviceú  sZ   è ø€ ô2 	˜TŸW™WÔ%ØŸ™×,Ñ,Ø�I‰IØØ1Øð	 -ó 
÷ 
ˆð #Ÿg™gˆÔØˆð
ús   ‚AAÁAÁA©r	  Úcontent_typeÚcontent_dispositionry   c             ƒ  óž   K  — t        | j                  «       | j                  j                  | j                  |||||¬«      ƒ d{  –—† S 7 Œ­w)aÐ  Create a link that downloads one file from this sandbox.

        The link carries its own token, so anyone holding the URL can fetch
        that one file without a LangSmith credential. 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:
            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.
        r  N)r.   r>   rP   Úgenerate_download_urlr;   )ra   rÂ   r	  r  r  ry   s         r[   r  z"AsyncSandbox.generate_download_url  sQ   è ø€ ôL 	˜TŸW™WÔ%Ø—\‘\×7Ñ7Ø�I‰IØØ1Ø%Ø 3Øð 8ó 
÷ 
ð 	
ð 
ús   ‚AAÁAÁAéx   c             ƒ  óÞ   K  — t        | j                  «       | j                  j                  | j                  ||¬«      ƒ d{  –—† }|j
                  | _        |j                  | _        y7 Œ'­w)a1  Start a stopped sandbox and wait until ready.

        After starting, the sandbox's status and dataplane_url are updated
        in place.

        Args:
            timeout: Timeout in seconds when waiting for ready.
            headers: Optional per-request header overrides.

        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.
        r¿   N)r.   r>   rP   Ústart_sandboxr;   r@   r=   )ra   rn   ry   Ú	refresheds       r[   rÝ   zAsyncSandbox.startM  s_   è ø€ ô* 	˜TŸW™WÔ%ØŸ,™,×4Ñ4Ø�I‰I˜w°ð 5ó 
÷ 
ˆ	ð  ×&Ñ&ˆŒØ&×4Ñ4ˆÕð	
ús   ‚AA-ÁA+Á(A-r²   c             ƒ  ó¦   K  — t        | j                  «       | j                  j                  | j                  |¬«      ƒ d{  –—†  d| _        y7 Œ­w)a  Stop a running sandbox (preserves sandbox files for later restart).

        Args:
            headers: Optional per-request header overrides.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        r²   NÚstopped)r.   r>   rP   Ústop_sandboxr;   r@   ©ra   ry   s     r[   ÚstopzAsyncSandbox.stopi  sD   è ø€ ô 	˜TŸW™WÔ%Ø�l‰l×'Ñ'¨¯	©	¸7Ð'ÓC×CÐCð  ˆ�ð 	Dús   ‚A AÁAÁAc             ƒ  ó˜   K  — t        | j                  «       | j                  j                  | j                  |¬«      ƒ d{  –—†  y7 Œ­w)zäDelete this sandbox.

        Args:
            headers: Optional per-request header overrides.

        Raises:
            ResourceNotFoundError: If sandbox not found.
            SandboxClientError: For other errors.
        r²   N)r.   r>   rP   rf   r;   r  s     r[   ÚdeletezAsyncSandbox.deletey  s5   è ø€ ô 	˜TŸW™WÔ%Ø�l‰l×)Ñ)¨$¯)©)¸WÐ)ÓE×EÒEús   ‚A A
ÁAÁA
©rL   rn   ry   c             ƒ  óœ   K  — t        | j                  «       | j                  j                  | j                  ||||¬«      ƒ d{  –—† S 7 Œ­w)aÖ  Capture a snapshot from this sandbox.

        Args:
            name: Snapshot name.
            run_config: Override applied over the configuration this sandbox
                is running with: ``user`` and ``work_dir`` replace,
                ``env_vars`` merge.
            timeout: Timeout in seconds when waiting for ready.
            headers: Optional per-request header overrides.

        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  N)r.   r>   rP   Úcapture_snapshotr;   )ra   r;   rL   rn   ry   s        r[   r   zAsyncSandbox.capture_snapshot†  sM   è ø€ ô6 	˜TŸW™WÔ%Ø—\‘\×2Ñ2Ø�I‰IØØ!ØØð 3ó 
÷ 
ð 	
ð 
ús   ‚AAÁA
ÁA)T)rX   údict[str, Any]rY   r4   rZ   rQ   Úreturnr9   )rY   zOptional[SandboxClient]r"  r7   )r"  r9   )rh   zOptional[type]ri   zOptional[BaseException]rj   zOptional[Any]r"  ÚNone)r"  r:   ) r~   r:   rn   Úintro   úOptional[dict[str, str]]rp   r<   rL   ú*Optional[Union[RunConfig, dict[str, Any]]]rq   úOptional[bool]rr   r:   rs   úOptional[Callable[[str], Any]]rt   r(  ru   r$  rv   rQ   rw   r$  rx   rQ   ry   ÚRequestHeadersrz   zLiteral[True]r"  r   ) r~   r:   rn   r$  ro   r%  rp   r<   rL   r&  rq   r'  rr   r:   rs   r(  rt   r(  ru   r$  rv   rQ   rw   r$  rx   rQ   ry   r)  rz   zLiteral[False]r"  r   ) r~   r:   rn   r$  ro   r%  rp   r<   rL   r&  rq   r'  rr   r:   rs   r(  rt   r(  ru   r$  rv   rQ   rw   r$  rx   rQ   ry   r)  rz   rQ   r"  ú*Union[ExecutionResult, AsyncCommandHandle]) r~   r:   rn   r$  ro   r%  rp   r<   rL   zOptional[dict[str, Any]]r„   rQ   rr   r:   rz   rQ   rs   r(  rt   r(  ru   r$  rv   rQ   rw   r$  rx   rQ   ry   r)  r"  r*  )r‘   r:   r·   r$  r¸   r$  r“   rQ   rx   rQ   ry   r)  r"  r   )
rÂ   r:   rÉ   zUnion[str, bytes]rn   r$  ry   r)  r"  r#  )rÂ   r:   rn   r$  ry   r)  r"  Úbytes)rÂ   r:   rn   r$  ry   r)  r"  r!   )rÂ   r:   rÝ   rD   rÞ   rD   rß   rD   rà   r<   rá   r<   rn   r$  ry   r)  r"  r    )rî   r:   rÂ   r:   rë   rD   rn   r$  ry   r)  r"  r"   )
rÂ   r:   rë   rD   rn   r$  ry   r)  r"  r"   )rî   r:   rÂ   r:   rï   r<   rë   rD   rn   r$  ry   r)  r"  r#   )
rù   r:   r¶   r!  rn   r$  ry   r)  r"  r!  )
r  r$  rü   r$  rý   r$  ry   r)  r"  r/   )r  r$  r	  r$  ry   r)  r"  r   )rÂ   r:   r	  rD   r  r<   r  z$Optional[DownloadContentDisposition]ry   r)  r"  r   )rn   r$  ry   r)  r"  r#  )ry   r)  r"  r#  )
r;   r:   rL   r&  rn   r$  ry   r)  r"  r%   )1Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r=   r>   r@   rA   rB   rC   rE   rF   rG   rH   rI   rJ   rK   rL   rM   r   rP   rR   Úclassmethodr\   r`   rd   rk   rm   r   r   r‰   rˆ   r¾   rÍ   rÔ   rÜ   ré   rï   ró   rõ   rð   r  r  r  rÝ   r  r  r   rU   r]   r[   r9   r9   U   s8	  … ñ+ð\ ƒIØ#'€M�=Ó'Ø€BˆÓØ€FˆCÓØ$(€N�MÓ(Ø $€J�Ó$Ø $€J�Ó$Ø&*Ð�mÓ*Ø/3Ð˜}Ó3Ø $€J�Ó$Ø!%€K�Ó%Ø€Eˆ=ÓØ#€Iˆ}Ó#Ø'+Ð�}Ó+Ø&*€JÐ#Ó*Ø48ÐÐ1Ó8ñ #(¨U¸DÔ"A€GÐÓAÙ E°4Ô8€L�$Ó8àð
 !ð	%
àð%
ð #ð%
ð ð	%
ð
 
ò%
ó ð%
ðN <@õ $
óLð
à ðð )ðð ð	ð
 
óó"ð, ð
 Ø(+Ø ØADØ&)ØØ47Ø47ØØ#&ØØØ"%Ø!ñ#àðð ð	ð
 &ðð ðð ?ðð $ðð ðð 2ðð 2ðð ðð !ðð ðð ðð   ð!ð" ð#ð$ 
ò%ó ðð( ð
 Ø(+Ø ØADØ&)ØØ47Ø47ØØ#&ØØØ"%ñ!!àð!ð ð	!ð
 &ð!ð ð!ð ?ð!ð $ð!ð ð!ð 2ð!ð 2ð!ð ð!ð !ð!ð ð!ð ð!ð   ð!!ð" ð#!ð$ 
ò%!ó ð!ð0 Ø(,Ø!ØAEØ&*Ø Ø48Ø48ØØ#(ØØØ"&Øñ#o
àðo
ð ð	o
ð
 &ðo
ð ðo
ð ?ðo
ð $ðo
ð ðo
ð 2ðo
ð 2ðo
ð ðo
ð !ðo
ð ðo
ð ðo
ð   ð!o
ð" ð#o
ð$ 
4ó%o
ð|  Ø#(ØØØ"&ñ#d#àðd#ð ð	d#ð
 &ðd#ð ðd#ð -ðd#ð ðd#ð ðd#ð ðd#ð 2ðd#ð 2ðd#ð ðd#ð !ðd#ð ðd#ð  ð!d#ð"  ð#d#ð$ 
4ó%d#ðf  Ø#(ØØØ"&ñ#:#àð:#ð ð	:#ð
 &ð:#ð ð:#ð -ð:#ð ð:#ð ð:#ð ð:#ð 2ð:#ð 2ð:#ð ð:#ð !ð:#ð ð:#ð  ð!:#ð"  ð#:#ð$ 
4ó%:#ð@ ØØ"ØØ"&ñJ
àðJ
ð ð	J
ð
 ðJ
ð ðJ
ð ðJ
ð  ðJ
ð 
óJ
ðb Ø"&ñ))àð))ð #ð))ð
 ð))ð  ð))ð 
ó))ðX ,.Èñ)Øð)Ø%(ð)Ø8Fð)à	ó)ðX ,.Èñ2Øð2Ø%(ð2Ø8Fð2à	ó2ðH  $Ø!Ø&*Ø"&Ø'+ØØ"&ñ?3àð?3ð ð	?3ð
 ð?3ð $ð?3ð  ð?3ð %ð?3ð ð?3ð  ð?3ð 
ó?3ðL  $ØØ"&ñ*àð*ð ð*ð
 ð*ð ð*ð  ð*ð 
ó*ðF  $ØØ"&ñYàðYð ð	Yð
 ðYð  ðYð 
óYð8 #Ø#ØØ"&ñ!*àð!*ð ð!*ð
 ð!*ð ð!*ð ð!*ð  ð!*ð 
ó!*ðFàðð  ðð
 ðð  ðð 
óð6 ØØ"&ñ6àð6ð ð	6ð
 ð6ð  ð6ð 
ó6ðx #&Ø"&ñ!àð!ð  ð	!ð
  ð!ð 
ó!ðN -1Ø&*ØDHØ"&ñ.
àð.
ð *ð	.
ð
 $ð.
ð Bð.
ð  ð.
ð 
ó.
ðf Ø"&ñ	5ð ð5ð  ð	5ð
 
ó5ð8 7;õ  ð  9=õ Fð" BFØØ"&ñ"
àð"
ð ?ð	"
ð
 ð"
ð  ð"
ð 
ô"
r]   r9   )Qr/  Ú
__future__r   r–   r¢   Úcollections.abcr   Údataclassesr   r   Útypingr   r   r	   r
   r   r   r   Ú langsmith._openapi_client._httpxr   Ú$langsmith.sandbox._access_delegationr   r   Úlangsmith.sandbox._exceptionsr   r   r   Úlangsmith.sandbox._helpersr   rä   r   ræ   r   rÛ   r   r   rÚ   r   r‡   r   r†   Úlangsmith.sandbox._modelsr   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   Úlangsmith.sandbox._sse_executer(   r)   r*   r+   r,   r-   r³   Úlangsmith.sandbox._tracingr.   Úlangsmith.sandbox._tunnelr/   r—   r0   r1   r2   r3   Úlangsmith.sandbox._async_clientr4   Úlangsmith.sandbox._clientr5   r_   r7   r:   r)  r9   rU   r]   r[   Ú<module>r@     sÉ   ðÙ 6å "ã Û Ý #ß (ß S× SÑ Så 2÷÷ñ õ
õõõõõõ÷÷ ÷ õ ÷õ õõ <Ý 1÷ó ñ ÝBÝ7Ý2ð ˜' # s (Ñ+Ñ,€ð ÷R
ð R
ó ñR
r]   