From b5754f3c0d2f91d2d11637fb17c2b08b95ce1ea9 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Thu, 12 Nov 2026 15:58:39 -0800 Subject: [PATCH 1/9] [WIP] Add ai.contrib.sandbox runners for ai.remote I am not sure what library this code actually belongs in, but it is glue for allowing tools/loops to be automatically run on Vercel Sandbox. None of this code is really ai specific. There are two main components: * `ai.contrib.sandbox.runner`: generic runner and client code for running python functions in another process (possibly a remote one on a sandbox). This is sandbox agnostic and just depends on being handed anyio streams for talking to a runner process. * `ai.contrib.sandbox.vercel`: which provides glue for syncing the calling project over to a provided vercel sandbox and hooks up streams to pass to the runner client. (The stream part is actually quite annoying because the sandbox API mangles binary, so we need to base64 everything.) The runner supports running both sync and async functions as well as generators. Results may return out of order. By default generators need to be advanced one element at a time but a "free running" mode can be requested where generators will generate elements without waiting for a request. To avoid either blowing up memory or blocking everything on one slow generator consumer, we have per-generator backpressure. --- pyproject.toml | 18 + src/ai/contrib/__init__.py | 1 + src/ai/contrib/sandbox/__init__.py | 6 + src/ai/contrib/sandbox/runner.py | 784 +++++++++++++++++++++++++++ src/ai/contrib/sandbox/util.py | 100 ++++ src/ai/contrib/sandbox/vercel.py | 382 +++++++++++++ tests/contrib/__init__.py | 0 tests/contrib/sandbox/__init__.py | 0 tests/contrib/sandbox/test_runner.py | 196 +++++++ uv.lock | 438 ++++++++++++++- 10 files changed, 1896 insertions(+), 29 deletions(-) create mode 100644 src/ai/contrib/__init__.py create mode 100644 src/ai/contrib/sandbox/__init__.py create mode 100644 src/ai/contrib/sandbox/runner.py create mode 100644 src/ai/contrib/sandbox/util.py create mode 100644 src/ai/contrib/sandbox/vercel.py create mode 100644 tests/contrib/__init__.py create mode 100644 tests/contrib/sandbox/__init__.py create mode 100644 tests/contrib/sandbox/test_runner.py diff --git a/pyproject.toml b/pyproject.toml index 99d9ad1c..c8e6c1c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,10 @@ otel = [ "opentelemetry-exporter-otlp-proto-http>=1.30", "opentelemetry-sdk>=1.30", ] +sandbox = [ + "anyio>=4.5", + "vercel>=0.13.0", +] vercel = [ "vercel-oidc>=0.8.0", ] @@ -83,12 +87,26 @@ dev = [ "opentelemetry-sdk>=1.43.0", "opentelemetry-exporter-otlp-proto-http>=1.43.0", "typesafe-sdk>=0.7.5", + "vercel>=0.13.0", ] [tool.uv] default-groups = ["dev"] exclude-newer = "2 days" +# vercel-sandbox 1.0.0 and the rest of its family were released 2026-11-13. +[tool.uv.exclude-newer-package] +vercel = false +vercel-sandbox = false +vercel-oidc = false +vercel-internal-core = false +vercel-blob = false +vercel-cache = false +vercel-headers = false +vercel-internal-telemetry = false +vercel-queue = false +vercel-workflow = false + [tool.mypy] python_version = "3.12" strict = true diff --git a/src/ai/contrib/__init__.py b/src/ai/contrib/__init__.py new file mode 100644 index 00000000..4a165077 --- /dev/null +++ b/src/ai/contrib/__init__.py @@ -0,0 +1 @@ +"""Integrations outside the core library; each may need an extra.""" diff --git a/src/ai/contrib/sandbox/__init__.py b/src/ai/contrib/sandbox/__init__.py new file mode 100644 index 00000000..7428810c --- /dev/null +++ b/src/ai/contrib/sandbox/__init__.py @@ -0,0 +1,6 @@ +"""Runners for :mod:`ai.remote`, in another process or a sandbox. + +:mod:`.runner` runs functions in another Python process, such as a +local subprocess; :mod:`.vercel` starts one in a Vercel sandbox, and +needs the ``sandbox`` extra. +""" diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py new file mode 100644 index 00000000..d5dd362e --- /dev/null +++ b/src/ai/contrib/sandbox/runner.py @@ -0,0 +1,784 @@ +"""Run functions in another Python process. + +``python -m ai.contrib.sandbox.runner`` runs a runner, and ``Runner`` +talks to one, started by ``local_runner`` or ``ai.contrib.sandbox.vercel``. + +The runner reads requests from stdin and writes replies to stdout. Each request +is a pickled ``(request_id, command)`` pair, with the command pickled +separately inside it, so a command that fails to unpickle can still be +answered. Commands: + +* ``("init", main_path)`` loads ``main_path`` as the ``__main__`` module, so + functions pickled by reference to ``__main__`` resolve. +* ``("run", func, args)`` calls ``func(*args)``. If that + returns an awaitable, such as from a coroutine function, it runs as a task on + the runner's event loop, concurrently with other requests. +* ``("iter", id, func, args)`` calls ``func(*args)`` and + keeps the result, a sync or async generator or any iterable, under ``id``. +* ``("next", id)`` advances iterator ``id``, replying ``("yield", value)`` or, + once it is exhausted, ``("done", return_value)``. +* ``("close", id)`` closes iterator ``id`` early. +* ``("stream", func, args, window)`` iterates over ``func(*args)`` without + waiting to be asked, replying ``("yield", value)`` for each item and then + ``("done", return_value)``, all under the one request id. Each item uses up + a credit, of which there are ``window`` to start with; with none left, the + iterator isn't advanced until more arrive. Cancelling the request closes the + iterator. +* ``("credit", request_id, n)`` gives stream ``request_id`` ``n`` more credits. +* ``("cancel", request_id)`` cancels that request's task, if it is still + running. Cancelled requests get no reply. + +Sync functions run on the event loop's thread, so they run one at a time and +block other requests while they do. They also run in the runner's root +context, so context variables they set are seen by every later request; async +functions run in a copy of it. + +Every other request but ``stream`` gets exactly one reply, the JSON +``[request_id, "ok", value]`` or ``[request_id, "err", error]``, where +``error`` has the exception's ``type``, ``message`` and ``traceback``. Replies +arrive as requests finish, in any order. Each is framed as an 8-byte big-endian +length followed by the JSON. + +Replies are JSON and not pickles because the runner may be running code that +isn't trusted, and unpickling runs code. So results come back as plain JSON +data, to be validated into whatever type the caller expects, and an exception +comes back as a builtin exception of the same name if there is one and as a +``RemoteError`` otherwise. +""" + +from __future__ import annotations + +import asyncio +import builtins +import dataclasses +import inspect +import io +import itertools +import json +import math +import os +import pickle +import runpy +import struct +import sys +import threading +import traceback +import types +from collections.abc import ( + AsyncIterable, + AsyncIterator, + Awaitable, + Callable, + Iterable, + Iterator, +) +from contextlib import ( + AbstractAsyncContextManager, + AsyncExitStack, + asynccontextmanager, +) +from typing import IO, TYPE_CHECKING, Any, Protocol, Self + +import anyio +import anyio.abc +import pydantic_core +from anyio.streams.buffered import BufferedByteReceiveStream + +from .util import protected + +if TYPE_CHECKING: + from anyio.abc import ByteReceiveStream, ByteSendStream + from anyio.streams.memory import ( + MemoryObjectReceiveStream, + MemoryObjectSendStream, + ) + +_LENGTH = struct.Struct(">Q") + +DEFAULT_WINDOW = 256 + + +class RemoteError(Exception): + """An exception raised in the runner that has no builtin type.""" + + +def encode_reply(request_id: int, status: str, value: Any) -> bytes: + """Frame a reply; raises if ``value`` can't be serialized.""" + data = pydantic_core.to_json([request_id, status, value]) + return _LENGTH.pack(len(data)) + data + + +def _error(exc: BaseException) -> dict[str, str]: + cls = type(exc) + name = cls.__qualname__ + if cls.__module__ != "builtins": + name = f"{cls.__module__}.{name}" + return { + "type": name, + "message": str(exc), + "traceback": "".join(traceback.format_exception(exc)), + } + + +def unwrap_reply(reply: tuple[str, Any]) -> Any: + status, value = reply + if status != "err": + return value + name, message = str(value["type"]), str(value["message"]) + exc: Exception = RemoteError(f"{name}: {message}") + cls = getattr(builtins, name, None) + if isinstance(cls, type) and issubclass(cls, Exception): + try: + exc = cls(message) + except Exception: + pass + exc.add_note(f"Remote traceback:\n{value['traceback']}") + raise exc + + +def _load_main(path: str) -> None: + path = os.path.abspath(path) + sys.path.insert(0, os.path.dirname(path)) + # Same approach as multiprocessing's spawn start method: run the script + # under a name that skips its `if __name__ == "__main__"` block. + main = types.ModuleType("__mp_main__") + sys.modules["__main__"] = sys.modules["__mp_main__"] = main + main.__dict__.update(runpy.run_path(path, run_name="__mp_main__")) + + +class _Server: + """Handles requests on the runner's event loop.""" + + def __init__(self, out: IO[bytes]) -> None: + self._out = out + self._tasks: dict[int, asyncio.Task[None]] = {} + self._iterators: dict[int, Iterator[Any] | AsyncIterator[Any]] = {} + self._credits: dict[int, _Credits] = {} + self._shutting_down = False + task = asyncio.current_task() + assert task is not None + self._root_context = task.get_context() + + def _write(self, data: bytes) -> None: + self._out.write(data) + self._out.flush() + + def _reply(self, request_id: int, status: str, value: Any) -> None: + if self._shutting_down: + return + try: + data = encode_reply(request_id, status, value) + except Exception as exc: + data = encode_reply(request_id, "err", _error(exc)) + self._write(data) + + def start(self, request_id: int, payload: bytes) -> None: + try: + kind, value = self._handle(pickle.loads(payload)) + except Exception as exc: + self._reply(request_id, "err", _error(exc)) + return + match kind: + case "value": + self._reply(request_id, "ok", value) + case "await": + self._tasks[request_id] = asyncio.create_task( + self._finish(request_id, value) + ) + case "stream": + it, window = value + credits = self._credits[request_id] = _Credits(window) + self._tasks[request_id] = asyncio.create_task( + self._stream(request_id, it, credits) + ) + + async def _finish(self, request_id: int, awaitable: Awaitable[Any]) -> None: + try: + value = await awaitable + except asyncio.CancelledError: + self._reply( + request_id, + "err", + _error(RuntimeError("remote call was cancelled")), + ) + except Exception as exc: + self._reply(request_id, "err", _error(exc)) + else: + self._reply(request_id, "ok", value) + finally: + self._tasks.pop(request_id, None) + + async def _stream( + self, + request_id: int, + it: Iterator[Any] | AsyncIterator[Any], + credits: _Credits, + ) -> None: + try: + try: + await self._drain(request_id, it, credits) + finally: + if isinstance(it, AsyncIterator): + if (aclose := getattr(it, "aclose", None)) is not None: + await aclose() + elif (close := getattr(it, "close", None)) is not None: + self._root_context.run(close) + except asyncio.CancelledError: + self._reply( + request_id, + "err", + _error(RuntimeError("remote call was cancelled")), + ) + except Exception as exc: + self._reply(request_id, "err", _error(exc)) + else: + self._reply(request_id, "ok", ("done", None)) + finally: + self._tasks.pop(request_id, None) + self._credits.pop(request_id, None) + + async def _drain( + self, + request_id: int, + it: Iterator[Any] | AsyncIterator[Any], + credits: _Credits, + ) -> None: + """Send each item of ``it``. + + Sync iterators advance in the root context, as in ``next``. An + item that fails to serialize raises, ending the stream. + """ + while True: + await credits.take() + if isinstance(it, AsyncIterator): + try: + item = await it.__anext__() + except StopAsyncIteration: + return + else: + try: + item = self._root_context.run(next, it) + except StopIteration: + return + self._write(encode_reply(request_id, "ok", ("yield", item))) + await asyncio.sleep(0) + + async def shutdown(self) -> None: + self._shutting_down = True + tasks = list(self._tasks.values()) + for task in tasks: + task.cancel() + await asyncio.gather(*tasks, return_exceptions=True) + + def _handle(self, command: tuple[Any, ...]) -> tuple[str, Any]: + """Return what to do with ``command``. + + That's ``("value", value)`` to reply with, ``("await", + awaitable)`` to await and reply with, or ``("stream", (iterator, + window))`` to stream. + """ + match command: + case ("init", path): + _load_main(path) + return "value", None + case ("run", func, args): + result = func(*args) + if inspect.isawaitable(result): + return "await", result + return "value", result + case ("iter", iter_id, func, args): + self._iterators[iter_id] = _as_iterator(func(*args)) + return "value", None + case ("stream", func, args, window): + return "stream", (_as_iterator(func(*args)), window) + case ("credit", target, n): + if credits := self._credits.get(target): + credits.add(n) + return "value", None + case ("next", iter_id): + it = self._iterators[iter_id] + if isinstance(it, AsyncIterator): + return "await", self._anext(iter_id, it) + return "value", self._next(iter_id, it) + case ("close", iter_id): + closing: Any = self._iterators.pop(iter_id, None) + if hasattr(closing, "aclose"): + return "await", closing.aclose() + if hasattr(closing, "close"): + closing.close() + return "value", None + case ("cancel", target): + if task := self._tasks.get(target): + task.cancel() + return "value", None + case _: + raise ValueError(f"unknown command: {command!r}") + + def _next(self, iter_id: int, it: Iterator[Any]) -> tuple[str, Any]: + try: + return "yield", next(it) + except StopIteration: + del self._iterators[iter_id] + return "done", None + except BaseException: + del self._iterators[iter_id] + raise + + async def _anext( + self, iter_id: int, it: AsyncIterator[Any] + ) -> tuple[str, Any]: + try: + return "yield", await it.__anext__() + except StopAsyncIteration: + del self._iterators[iter_id] + return "done", None + except BaseException: + self._iterators.pop(iter_id, None) + raise + + +class _Credits: + """How many more items a stream may send.""" + + def __init__(self, n: int) -> None: + self._n = n + self._added = asyncio.Event() + + def add(self, n: int) -> None: + self._n += n + self._added.set() + + async def take(self) -> None: + while self._n == 0: + self._added.clear() + await self._added.wait() + self._n -= 1 + + +def _as_iterator( + iterable: Iterable[Any] | AsyncIterable[Any], +) -> Iterator[Any] | AsyncIterator[Any]: + if isinstance(iterable, AsyncIterable): + return aiter(iterable) + return iter(iterable) + + +async def _serve(stdin: IO[bytes], out: IO[bytes]) -> None: + loop = asyncio.get_running_loop() + requests: asyncio.Queue[tuple[int, bytes] | None] = asyncio.Queue() + + def read_requests() -> None: + while True: + try: + request = pickle.load(stdin) + except Exception: + request = None + loop.call_soon_threadsafe(requests.put_nowait, request) + if request is None: + return + + threading.Thread(target=read_requests, daemon=True).start() + server = _Server(out) + while (request := await requests.get()) is not None: + server.start(*request) + await server.shutdown() + + +def main() -> None: + """Run a runner on this process's stdin and stdout.""" + stdin = sys.stdin.buffer + out = os.fdopen(os.dup(sys.stdout.fileno()), "wb") + # Anything the called functions print goes to stderr, keeping stdout + # for replies. + os.dup2(sys.stderr.fileno(), sys.stdout.fileno()) + if isinstance(sys.stdout, io.TextIOWrapper): + sys.stdout.reconfigure(line_buffering=True) + asyncio.run(_serve(stdin, out)) + + +type _Reply = tuple[str, Any] | BaseException + + +class _Pending: + def __init__(self) -> None: + self.done = anyio.Event() + self.reply: tuple[str, Any] | None = None + self.error: BaseException | None = None + + +class Process(Protocol): + """A running runner process: its stdin, its stdout, and how it ended. + + ``Runner`` takes an async context manager that starts one and, on + exit, stops it. + """ + + @property + def stdin(self) -> ByteSendStream: ... + + @property + def stdout(self) -> ByteReceiveStream: ... + + async def exit_message(self) -> str: + """Describe how the process ended, once its output has closed.""" + ... + + +class Runner: + """A connection to a runner, used as an async context manager. + + ``process`` starts the runner process on entry and stops it on exit. + ``main_path``, if given, is loaded as the runner's ``__main__``. + Calls can be made concurrently from several tasks; each waits only for its + own reply. + """ + + def __init__( + self, + process: AbstractAsyncContextManager[Process], + main_path: str | None = None, + ) -> None: + self._process_cm = process + self._main_path = main_path + self._iter_ids = itertools.count() + self._request_ids = itertools.count() + self._pending: dict[int, _Pending] = {} + self._streams: dict[int, MemoryObjectSendStream[_Reply]] + self._streams = {} + self._closed = False + # Commands from RemoteIterator.__del__, sent with the next request. + self._abandoned: list[tuple[Any, ...]] = [] + + async def __aenter__(self) -> Self: + async with AsyncExitStack() as stack: + self._process = await stack.enter_async_context(self._process_cm) + await self._start() + stack.push_async_callback(self._stop) + self._exit_stack = stack.pop_all() + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + tb: types.TracebackType | None, + ) -> bool | None: + return await self._exit_stack.__aexit__(exc_type, exc, tb) + + async def _start(self) -> None: + """Start reading replies, then send ``init``.""" + self._stdin = self._process.stdin + self._stdout = BufferedByteReceiveStream(self._process.stdout) + self._send_lock = anyio.Lock() + self._reader_scope = anyio.CancelScope() + self._task_group = anyio.create_task_group() + await self._task_group.__aenter__() + self._task_group.start_soon(self._read_replies) + try: + if self._main_path is not None: + await self._call(("init", self._main_path)) + except BaseException: + await self._stop() + raise + + async def _stop(self) -> None: + self._reader_scope.cancel() + await self._task_group.__aexit__(None, None, None) + + async def _closed_message(self) -> str: + return await self._process.exit_message() + + async def _read_replies(self) -> None: + with self._reader_scope: + await self._read_replies_until_closed() + + async def _read_replies_until_closed(self) -> None: + try: + while True: + (size,) = _LENGTH.unpack( + await self._stdout.receive_exactly(_LENGTH.size) + ) + request_id, status, value = json.loads( + await self._stdout.receive_exactly(size) + ) + if pending := self._pending.get(request_id): + pending.reply = status, value + pending.done.set() + elif stream := self._streams.get(request_id): + stream.send_nowait((status, value)) + except ( + anyio.EndOfStream, + anyio.IncompleteRead, + anyio.BrokenResourceError, + ): + error: BaseException | None = None + except Exception as exc: + error = exc + self._closed = True + if self._pending or self._streams: + if error is None: + error = EOFError(await self._closed_message()) + for pending in self._pending.values(): + pending.error = error + pending.done.set() + for stream in self._streams.values(): + stream.send_nowait(error) + + async def _send(self, request_id: int, command: tuple[Any, ...]) -> None: + data = pickle.dumps((request_id, pickle.dumps(command))) + async with self._send_lock: + # Nothing waits for the replies to abandoned commands, so the + # reader drops them. + closes = [] + while self._abandoned: + close = self._abandoned.pop() + closes.append( + pickle.dumps((next(self._request_ids), pickle.dumps(close))) + ) + # A send interrupted partway would leave half a request in the + # stream. + + # XXX: but is this actually quite what we want?? We might + # still want some kind of timeout... Hm. + await protected(self._stdin.send(b"".join(closes) + data)) + + async def _call(self, command: tuple[Any, ...]) -> Any: + if self._closed: + raise EOFError(await self._closed_message()) + request_id = next(self._request_ids) + pending = self._pending[request_id] = _Pending() + try: + await self._send(request_id, command) + await pending.done.wait() + except anyio.get_cancelled_exc_class(): + if not pending.done.is_set() and not self._closed: + # We are already cancelled, and taking the send lock is an + # anyio checkpoint, so the whole send has to be protected. + await protected( + self._send(next(self._request_ids), ("cancel", request_id)) + ) + raise + finally: + del self._pending[request_id] + if pending.error is not None: + raise pending.error + assert pending.reply is not None + return unwrap_reply(pending.reply) + + async def _open_stream( + self, command: tuple[Any, ...] + ) -> tuple[int, MemoryObjectReceiveStream[_Reply]]: + """Send ``command`` and return its id and a stream of its replies. + + The stream also gets the error if the runner goes away. Each + reply is buffered until it is received, so the command should + limit how many it gets. + """ + if self._closed: + raise EOFError(await self._closed_message()) + request_id = next(self._request_ids) + send, receive = anyio.create_memory_object_stream[_Reply](math.inf) + self._streams[request_id] = send + try: + await self._send(request_id, command) + except BaseException: + await self._close_stream(request_id, cancel=False) + receive.close() + raise + return request_id, receive + + async def _close_stream(self, request_id: int, *, cancel: bool) -> None: + """Stop taking replies to ``request_id``, cancelling it if asked.""" + send = self._streams.pop(request_id, None) + if send is None: + return + send.close() + if cancel and not self._closed: + await protected( + self._send(next(self._request_ids), ("cancel", request_id)) + ) + + async def run[*Ts](self, func: Callable[[*Ts], object], *args: *Ts) -> Any: + """Call ``func(*args)`` remotely and return its result, as JSON data.""" + return await self._call(("run", func, args)) + + def iterate[*Ts]( + self, + func: Callable[[*Ts], Iterable[object] | AsyncIterable[object]], + *args: *Ts, + free_running: bool = False, + window: int = DEFAULT_WINDOW, + ) -> RemoteIterator: + """Iterate remotely over ``func(*args)``, an item per trip. + + Items come back as JSON data. + + With ``free_running``, the runner advances the iterator without + waiting to be asked and sends each item as it comes, saving a + round trip per item. Up to ``window`` items not yet taken are + buffered here; with that many, the runner waits. Credit for + more goes back once half the window has been taken, so a window + that covers a round trip's worth of items never stalls. + + Use ``async with`` to close the remote iterator if you stop early; + otherwise it stays open in the runner until the runner exits. + """ + if window < 1: + raise ValueError(f"window must be at least 1, not {window}") + return RemoteIterator( + self, func, args, free_running=free_running, window=window + ) + + +class RemoteIterator: + """An async iterator over a sync or async iterable in a runner.""" + + def __init__( + self, + runner: Runner, + func: Callable[..., Iterable[object] | AsyncIterable[object]], + args: tuple[Any, ...], + *, + free_running: bool = False, + window: int = DEFAULT_WINDOW, + ) -> None: + self._runner = runner + self._call_args = (func, args) + self._free_running = free_running + self._window = window + self._taken = 0 + self._id = next(runner._iter_ids) + self._request_id = -1 + self._replies: MemoryObjectReceiveStream[_Reply] | None + self._replies = None + self._started = False + self._finished = False + + def __aiter__(self) -> Self: + return self + + async def __anext__(self) -> Any: + if self._finished: + raise StopAsyncIteration + try: + if self._free_running: + kind, value = await self._next_streamed() + else: + kind, value = await self._next_stepped() + except BaseException: + await self.aclose() + raise + if kind == "done": + self._finished = True + raise StopAsyncIteration + return value + + async def _next_stepped(self) -> tuple[str, Any]: + if not self._started: + self._started = True + await self._runner._call(("iter", self._id, *self._call_args)) + kind, value = await self._runner._call(("next", self._id)) + return kind, value + + async def _next_streamed(self) -> tuple[str, Any]: + if not self._started: + self._started = True + self._request_id, self._replies = await self._runner._open_stream( + ("stream", *self._call_args, self._window) + ) + assert self._replies is not None + # Credit is sent here, not as an item is returned, so that a failed + # send can't lose an item already received. + if self._taken >= max(1, self._window // 2): + credit = ("credit", self._request_id, self._taken) + self._taken = 0 + await protected( + self._runner._send(next(self._runner._request_ids), credit) + ) + ended = False + try: + reply = await self._replies.receive() + if isinstance(reply, BaseException): + ended = True + raise reply + ended = reply[0] == "err" + kind, value = unwrap_reply(reply) + ended = kind == "done" + if kind == "yield": + self._taken += 1 + return kind, value + finally: + if ended: + await self._end_stream(cancel=False) + + async def _end_stream(self, *, cancel: bool) -> None: + if self._replies is not None: + self._replies.close() + await self._runner._close_stream(self._request_id, cancel=cancel) + + async def aclose(self) -> None: + if self._started and not self._finished: + self._finished = True + if self._free_running: + await self._end_stream(cancel=True) + elif not self._runner._closed: + await protected(self._runner._call(("close", self._id))) + self._finished = True + + async def __aenter__(self) -> Self: + return self + + async def __aexit__(self, *exc_info: object) -> None: + await self.aclose() + + def __del__(self) -> None: + if not self._started or self._finished: + return + if not self._free_running: + self._runner._abandoned.append(("close", self._id)) + elif send := self._runner._streams.pop(self._request_id, None): + send.close() + self._runner._abandoned.append(("cancel", self._request_id)) + if self._replies is not None: + self._replies.close() + + +@dataclasses.dataclass +class _LocalProcess: + stdin: ByteSendStream + stdout: ByteReceiveStream + proc: anyio.abc.Process + + async def exit_message(self) -> str: + return f"runner exited with {await self.proc.wait()}" + + +@asynccontextmanager +async def local_process( + python: str = sys.executable, +) -> AsyncIterator[Process]: + """Start a runner subprocess on this machine.""" + async with await anyio.open_process( + [python, "-m", _MODULE], stderr=None + ) as proc: + assert proc.stdin is not None and proc.stdout is not None + yield _LocalProcess(proc.stdin, proc.stdout, proc) + + +def local_runner( + main_path: str | None = None, *, python: str = sys.executable +) -> Runner: + """Make a runner subprocess on this machine. + + ``main_path`` defaults to this process's ``__main__``. + """ + if main_path is None: + main_path = getattr(sys.modules["__main__"], "__file__", None) + return Runner(local_process(python), main_path) + + +# This module's name even when it runs as ``__main__``. +_MODULE = "ai.contrib.sandbox.runner" + +if __name__ == "__main__": + main() diff --git a/src/ai/contrib/sandbox/util.py b/src/ai/contrib/sandbox/util.py new file mode 100644 index 00000000..4d947bd6 --- /dev/null +++ b/src/ai/contrib/sandbox/util.py @@ -0,0 +1,100 @@ +"""Helpers for :mod:`ai.contrib.sandbox`.""" + +from __future__ import annotations + +import asyncio +import math +from collections.abc import Awaitable +from contextlib import suppress +from typing import cast + +import anyio + +__all__ = ["protected"] + + +async def protected[T](arg: Awaitable[T]) -> T: + """Wait for a future, deferring cancellation until it is complete. + + If you do + await protected(something()) + + it is approximately equivalent to + await something() + + except that if the coroutine containing it is cancelled, + something() is protected from cancellation, and *additionally* + CancelledError will not be delivered to the caller yet. + If the caller gets cancelled while executing this, however, + the cancellation state *will* remain armed, so that cancellation + should be delivered the next time it blocks + + If anyio is imported, we will enter an anyio CancelScope. As an + optimization, we only do it *after* but only *after* we take a + CancelledError. + + This is useful for shielding cleanup code from cancellation, + especially code in finally blocks. + + """ + loop = None + with suppress(RuntimeError): + loop = asyncio.get_running_loop() + + if not loop: + with anyio.CancelScope(shield=True): + return await arg + + done = False + result: T | None = None + exc: BaseException | None = None + waiter: asyncio.Future[None] | None = None + + async def go() -> None: + nonlocal done, result, exc + try: + result = await arg + except BaseException as e: + exc = e + # swallow + finally: + done = True + if waiter and not waiter.done(): + waiter.set_result(None) + + # The event loop only holds tasks weakly. + _task = asyncio.Task(go(), loop=loop, eager_start=True) + + cancelled: asyncio.CancelledError | None = None + scope: anyio.CancelScope | None = None + try: + while not done: + try: + waiter = asyncio.Future() + await waiter + except asyncio.CancelledError as cex: + if not scope: + scope = anyio.CancelScope(shield=True) + scope.__enter__() + + cancelled = cex + finally: + if scope: + scope.__exit__(None, None, None) + + # anyio redelivers its own cancellations while the scope stays + # cancelled. Rearming one anyway would leak it past the scope on 3.12, + # where uncancel() doesn't clear a pending cancel. + if cancelled and anyio.current_effective_deadline() != -math.inf: + current = asyncio.current_task() + assert current + # For asyncio cancellations, it is edge triggered, so + # we need to recancel the task, so that it gets + # delivered, but then also *uncancel* it, so the count + # doesn't go up. + current.cancel(cancelled.args[0] if cancelled.args else None) + current.uncancel() + + if exc: + raise exc + return cast("T", result) diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py new file mode 100644 index 00000000..fdd6e642 --- /dev/null +++ b/src/ai/contrib/sandbox/vercel.py @@ -0,0 +1,382 @@ +"""Run functions in a Vercel sandbox, in an ``ai.contrib.sandbox`` runner. + +Needs the ``sandbox`` extra: ``pip install 'ai[sandbox]'``. +""" + +from __future__ import annotations + +import base64 +import dataclasses +import importlib.metadata +import os +import posixpath +import shlex +import stat +import subprocess +import sys +import tomllib +from collections.abc import AsyncIterator, Iterable +from contextlib import AsyncExitStack, asynccontextmanager +from os import PathLike +from pathlib import Path +from typing import TYPE_CHECKING, Any + +import anyio +from anyio.abc import ByteReceiveStream, ByteSendStream +from anyio.streams.buffered import BufferedByteReceiveStream +from vercel.sandbox import SandboxApiError, SandboxStdinError + +if TYPE_CHECKING: + from vercel.sandbox import Command, InteractiveSession, Sandbox + +from . import runner as runner_ +from .runner import Process, Runner +from .util import protected + +type StrPath = str | PathLike[str] + + +async def sync_dir(box: Sandbox, src_dir: StrPath, target_dir: str) -> None: + """Copy a local directory to a sandbox. + + Skips .venv*, .env*, .git, .tau. + """ + await sync_paths(box, src_dir, target_dir, _walk(Path(src_dir))) + + +def _walk(src: Path) -> list[Path]: + paths = [] + for root, dirs, files in os.walk(src): + dirs[:] = [d for d in dirs if not _skipped(d)] + for name in files: + if not _skipped(name): + paths.append(Path(root, name).relative_to(src)) + return paths + + +async def sync_paths( + box: Sandbox, src_dir: StrPath, target_dir: str, paths: Iterable[StrPath] +) -> None: + """Copy the given paths, relative to ``src_dir``, to a sandbox. + + Paths that aren't regular files are skipped. + """ + src = Path(src_dir) + await box.fs.mkdir(target_dir) + async with box.fs.batch(cwd=target_dir) as batch: + for rel in paths: + path = src / rel + if not path.is_file(): + continue + batch.write_bytes( + Path(rel).as_posix(), + path.read_bytes(), + mode=stat.S_IMODE(path.stat().st_mode), + ) + + +def project_paths(src_dir: StrPath) -> list[Path]: + """List a project's files: what git lists, else what ``sync_dir`` copies. + + Git lists tracked files and untracked ones it doesn't ignore; of + those, what ``sync_dir`` would skip is still skipped. The paths are + relative to ``src_dir``, for ``sync_paths``. + """ + try: + listed = subprocess.run( + [ + "git", + "ls-files", + "-z", + "--cached", + "--others", + "--exclude-standard", + ], + cwd=src_dir, + capture_output=True, + check=True, + ).stdout + except (OSError, subprocess.CalledProcessError): + return _walk(Path(src_dir)) + return [ + Path(p) + for p in os.fsdecode(listed).split("\0") + if p and not any(_skipped(part) for part in Path(p).parts) + ] + + +async def sync_workspace( + box: Sandbox, src_dir: StrPath, target_dir: str +) -> dict[str, str]: + """Copy a uv project to a sandbox, with its local path sources. + + Each path source goes where its relative path puts it from + ``target_dir``, with the files ``project_paths`` lists. That leaves out + ``.git``, so for a source versioned by ``uv-dynamic-versioning``, the + returned env sets the version to the one installed here; only one + source can be. + """ + await sync_dir(box, src_dir, target_dir) + env: dict[str, str] = {} + for name, path in _path_sources(Path(src_dir)): + if path.is_absolute(): + raise ValueError(f"path source {name} is absolute: {path}") + remote = posixpath.normpath(posixpath.join(target_dir, path.as_posix())) + if remote == os.pardir or remote.startswith(os.pardir + "/"): + raise ValueError(f"path source {name} is outside the sandbox") + local = Path(src_dir, path) + await sync_paths(box, local, remote, project_paths(local)) + if "uv-dynamic-versioning" in _pyproject(local).get("tool", {}): + if _VERSION_BYPASS in env: + raise ValueError( + "more than one path source uses uv-dynamic-versioning" + ) + env[_VERSION_BYPASS] = importlib.metadata.version(name) + return env + + +_VERSION_BYPASS = "UV_DYNAMIC_VERSIONING_BYPASS" + + +def _pyproject(project_dir: Path) -> dict[str, Any]: + with open(project_dir / "pyproject.toml", "rb") as f: + return tomllib.load(f) + + +def _path_sources(project_dir: Path) -> list[tuple[str, Path]]: + sources = _pyproject(project_dir).get("tool", {}).get("uv", {}) + found = [] + for name, entry in sources.get("sources", {}).items(): + for source in entry if isinstance(entry, list) else [entry]: + if "path" in source: + found.append((name, Path(source["path"]))) + return found + + +def _skipped(name: str) -> bool: + return name.startswith((".venv", ".env")) or name in (".git", ".tau") + + +def _remote_main(main_path: StrPath | None, src_dir: StrPath) -> str | None: + """Where ``main_path``, or by default ``__main__``, is in the copy. + + By default, a ``__main__`` outside ``src_dir``, such as an installed + script, isn't loaded. + """ + explicit = main_path is not None + if main_path is None: + main_path = getattr(sys.modules["__main__"], "__file__", None) + if main_path is None: + return None + remote_main = Path(os.path.relpath(main_path, src_dir)) + if remote_main.parts[0] == os.pardir: + if explicit: + raise ValueError(f"{main_path} is not inside {src_dir}") + return None + if any(_skipped(part) for part in remote_main.parts): + if explicit: + raise ValueError(f"{main_path} is not copied to the sandbox") + return None + return remote_main.as_posix() + + +# Sandbox command output doesn't yet pass arbitrary bytes through intact, so +# the runner's stdout is piped through this, which base64-encodes each chunk +# onto its own line. +_BASE64_ENCODER = """\ +import base64, sys +while data := sys.stdin.buffer.read1(): + sys.stdout.buffer.write(base64.b64encode(data) + b"\\n") + sys.stdout.buffer.flush() +""" + + +def _uv_args() -> list[str]: + runner = ["python", "-m", runner_._MODULE] + return ["uv", "run", "--python", _python_version(), *runner] + + +def _python_version() -> str: + return f"{sys.version_info.major}.{sys.version_info.minor}" + + +def _runner_script() -> str: + runner = shlex.join(_uv_args()) + encoder = shlex.join( + [ + *["uv", "run", "--no-project", "--python", _python_version()], + *["python", "-c", _BASE64_ENCODER], + ] + ) + return f"set -o pipefail; {runner} | {encoder}" + + +class Base64ByteReceiveStream(ByteReceiveStream): + """Decode newline-terminated base64 lines from a byte stream.""" + + def __init__(self, stream: ByteReceiveStream) -> None: + self._stream = stream + self._lines = b"" + self._data = b"" + self._eof = False + + async def receive(self, max_bytes: int = 65536) -> bytes: + while not self._data: + line, newline, rest = self._lines.partition(b"\n") + if newline: + self._lines = rest + elif self._eof: + self._lines = b"" + if not line.strip(): + raise anyio.EndOfStream + else: + try: + self._lines += await self._stream.receive() + except anyio.EndOfStream: + self._eof = True + continue + self._data = base64.b64decode(line.strip(), validate=True) + data, self._data = self._data[:max_bytes], self._data[max_bytes:] + return data + + async def aclose(self) -> None: + await self._stream.aclose() + + +@dataclasses.dataclass +class _CommandProcess: + stdin: ByteSendStream + stdout: ByteReceiveStream + cmd: Command + + async def exit_message(self) -> str: + returncode = await self.cmd.wait() + stderr = await self.cmd.stderr.read() if self.cmd.stderr else b"" + text = stderr.decode(errors="replace") + return f"runner exited with {returncode}\n{text}" + + +@asynccontextmanager +async def sandbox_process( + box: Sandbox, + *, + src_dir: StrPath = ".", + target_dir: str = "workspace", + env: dict[str, str] | None = None, +) -> AsyncIterator[Process]: + """Start a runner in a sandbox on a copy of ``src_dir``, with uv. + + The copy is made by ``sync_workspace``. + """ + sync_env = await sync_workspace(box, src_dir, target_dir) + cmd = await box.create_command( + "bash", + ["-c", _runner_script()], + cwd=target_dir, + env={**sync_env, **(env or {})}, + stdin=subprocess.PIPE, + ) + assert cmd.stdin is not None and cmd.stdout is not None + stdout = Base64ByteReceiveStream(cmd.stdout) + try: + yield _CommandProcess(cmd.stdin, stdout, cmd) + except BaseException: + await protected(cmd.kill()) + raise + try: + await cmd.stdin.aclose() + await cmd.wait() + except (SandboxApiError, SandboxStdinError) as exc: + # The sandbox may have stopped, as at its execution time limit. + if not _session_gone(exc): + raise + await stdout.aclose() + if cmd.stderr is not None: + await cmd.stderr.aclose() + + +def sandbox_runner( + box: Sandbox, + main_path: StrPath | None = None, + *, + src_dir: StrPath = ".", + target_dir: str = "workspace", + env: dict[str, str] | None = None, +) -> Runner: + """Make a sandbox runner, running a copy of ``src_dir`` with ``uv run``. + + ``src_dir`` is a uv project that depends on ``ai``. ``main_path`` + is a local path inside it, loaded as ``__main__`` in the runner so + that functions defined there can be sent; it defaults to the local + ``__main__``, when that's inside ``src_dir``. + """ + process = sandbox_process( + box, src_dir=src_dir, target_dir=target_dir, env=env + ) + return Runner(process, _remote_main(main_path, src_dir)) + + +def _session_gone(exc: SandboxApiError | SandboxStdinError) -> bool: + """Whether ``exc`` says the sandbox's session is gone (HTTP 410).""" + cause = exc.cause if isinstance(exc, SandboxStdinError) else exc + return isinstance(cause, SandboxApiError) and cause.status_code == 410 + + +_READY = b"RUN_SYNC_READY\n" + + +@dataclasses.dataclass +class _PtyProcess: + stdin: ByteSendStream + stdout: ByteReceiveStream + pty: InteractiveSession + box: Sandbox + stderr_path: str + + async def exit_message(self) -> str: + returncode = await self.pty.wait() + stderr = await self.box.fs.read_text(self.stderr_path) + return f"runner exited with {returncode}\n{stderr}" + + +@asynccontextmanager +async def pty_sandbox_process( + box: Sandbox, *, src_dir: StrPath = ".", target_dir: str = "workspace" +) -> AsyncIterator[Process]: + """Like ``sandbox_process``, but on a PTY in raw mode, so replies are raw. + + The runner's stderr goes to a file in the sandbox instead of the terminal. + """ + sync_env = await sync_workspace(box, src_dir, target_dir) + env_args = [f"{k}={v}" for k, v in sync_env.items()] + command = shlex.join(["env", *env_args, *_uv_args()]) + stderr_path = f"/tmp/run_sync-{os.urandom(4).hex()}.err" + script = ( + f"cd {shlex.quote(target_dir)} && stty raw -echo" + f" && printf {shlex.quote(_READY.decode())}" + f" && exec {command} 2>{stderr_path}" + ) + stack = AsyncExitStack() + try: + pty = await stack.enter_async_context( + box.open_interactive("sh", ["-c", script]) + ) + stdout = BufferedByteReceiveStream(pty.stream) + await stdout.receive_until(_READY, 65536) + yield _PtyProcess(pty.stream, stdout, pty, box, stderr_path) + except BaseException: + await protected(stack.aclose()) + raise + await stack.aclose() + + +def pty_sandbox_runner( + box: Sandbox, + main_path: StrPath | None = None, + *, + src_dir: StrPath = ".", + target_dir: str = "workspace", +) -> Runner: + """Like ``sandbox_runner``, but with ``pty_sandbox_process``.""" + process = pty_sandbox_process(box, src_dir=src_dir, target_dir=target_dir) + return Runner(process, _remote_main(main_path, src_dir)) diff --git a/tests/contrib/__init__.py b/tests/contrib/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/contrib/sandbox/__init__.py b/tests/contrib/sandbox/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py new file mode 100644 index 00000000..e97a6daf --- /dev/null +++ b/tests/contrib/sandbox/test_runner.py @@ -0,0 +1,196 @@ +from __future__ import annotations + +import asyncio +import contextlib +import functools +import gc +from collections.abc import AsyncGenerator, AsyncIterator, Generator + +import anyio +import pydantic +import pytest + +from ai.contrib.sandbox import runner as runner_ + +# Runner-side state, read back with ``w.run``. +_produced = [0] +_closed: list[str] = [] + + +def gen(n: int, step: int = 1) -> Generator[int, None, str]: + yield from range(0, n, step) + return "rv" # noqa: B901 + + +async def agen(n: int, delay: float = 0.0) -> AsyncGenerator[int]: + for i in range(n): + await asyncio.sleep(delay) + yield i + + +def boom() -> Generator[int]: + yield 1 + raise ValueError("boom") + + +def endless() -> Generator[int]: + try: + i = 0 + while True: + yield i + i += 1 + finally: + _closed.append("closed") + + +def fast(n: int) -> Generator[int]: + for i in range(n): + _produced[0] += 1 + yield i + + +class Point(pydantic.BaseModel): + x: int + y: int + + +class UnbuiltinError(Exception): + pass + + +def point() -> Point: + return Point(x=1, y=2) + + +def unbuiltin() -> None: + raise UnbuiltinError("nope") + + +def produced() -> int: + return _produced[0] + + +def closed() -> list[str]: + return _closed + + +def reset() -> None: + _produced[0] = 0 + _closed.clear() + + +# Not a fixture: the runner has to be closed in the task that opened it. +@contextlib.asynccontextmanager +async def _runner() -> AsyncIterator[runner_.Runner]: + async with runner_.local_runner(main_path=__file__) as w: + await w.run(reset) + yield w + + +async def test_run() -> None: + async with _runner() as w: + assert await w.run(functools.partial(int, base=16), "ff") == 255 + assert await w.run(asyncio.sleep, 0, "slept") == "slept" + with pytest.raises(ZeroDivisionError): + await w.run(divmod, 1, 0) + + +async def test_results_are_json() -> None: + async with _runner() as w: + result = await w.run(point) + assert result == {"x": 1, "y": 2} + assert Point.model_validate(result) == point() + async with w.iterate(map, str, [1, 2]) as it: + assert [x async for x in it] == ["1", "2"] + # Not JSON, and it wouldn't be unpickled here if it were sent. + with pytest.raises(runner_.RemoteError, match="serialize"): + await w.run(object) + assert await w.run(int, "7") == 7 + + +async def test_errors() -> None: + async with _runner() as w: + with pytest.raises( + runner_.RemoteError, match="UnbuiltinError: nope" + ) as e: + await w.run(unbuiltin) + assert "in unbuiltin" in e.value.__notes__[0] + with pytest.raises(ZeroDivisionError) as builtin: + await w.run(divmod, 1, 0) + assert "Remote traceback" in builtin.value.__notes__[0] + + +@pytest.mark.parametrize("free_running", [False, True]) +async def test_iterate(free_running: bool) -> None: + async with _runner() as w: + async with w.iterate(gen, 5, free_running=free_running) as it: + assert [x async for x in it] == [0, 1, 2, 3, 4] + async with w.iterate(agen, 4, free_running=free_running) as it: + assert [x async for x in it] == [0, 1, 2, 3] + with pytest.raises(ValueError, match="boom"): + async with w.iterate(boom, free_running=free_running) as it: + async for _ in it: + pass + + +@pytest.mark.parametrize("free_running", [False, True]) +async def test_close_early(free_running: bool) -> None: + async with _runner() as w: + async with w.iterate(endless, free_running=free_running) as it: + async for x in it: + if x == 3: + break + with anyio.fail_after(5): + while not await w.run(closed): + await anyio.sleep(0.01) + + +@pytest.mark.parametrize("free_running", [False, True]) +async def test_abandoned(free_running: bool) -> None: + async with _runner() as w: + it = w.iterate(endless, free_running=free_running) + await it.__anext__() + del it + gc.collect() + # Abandoned iterators are closed along with the next request. + with anyio.fail_after(5): + while not await w.run(closed): + await anyio.sleep(0.01) + + +async def test_cancel_while_waiting() -> None: + async with _runner() as w: + with anyio.move_on_after(0.1): + async with w.iterate(agen, 100, 1.0, free_running=True) as it: + async for _ in it: + pass + assert await w.run(int, "7") == 7 + + +async def test_free_running_doesnt_wait_to_be_asked() -> None: + async with _runner() as w: + # Asked for one at a time, the rest would take at least 0.2s. + async with w.iterate(agen, 5, 0.05, free_running=True) as it: + assert await it.__anext__() == 0 + await anyio.sleep(0.5) + with anyio.fail_after(0.1): + assert [x async for x in it] == [1, 2, 3, 4] + + +@pytest.mark.parametrize("window", [1, 2, 4, 7]) +async def test_window(window: int) -> None: + async with _runner() as w: + seen = [] + async with w.iterate(fast, 200, free_running=True, window=window) as it: + async for x in it: + seen.append(x) + if len(seen) in (1, 50): + await anyio.sleep(0.1) + assert await w.run(produced) - len(seen) <= window + assert seen == list(range(200)) + + +def test_window_must_be_positive() -> None: + w = runner_.local_runner() + with pytest.raises(ValueError, match="window"): + w.iterate(fast, 1, free_running=True, window=0) diff --git a/uv.lock b/uv.lock index 6f5415f9..7e975046 100644 --- a/uv.lock +++ b/uv.lock @@ -11,6 +11,18 @@ resolution-markers = [ exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. exclude-newer-span = "P2D" +[options.exclude-newer-package] +vercel = false +vercel-blob = false +vercel-cache = false +vercel-headers = false +vercel-internal-core = false +vercel-internal-telemetry = false +vercel-oidc = false +vercel-queue = false +vercel-sandbox = false +vercel-workflow = false + [[package]] name = "ai" source = { editable = "." } @@ -35,6 +47,10 @@ otel = [ { name = "opentelemetry-exporter-otlp-proto-http" }, { name = "opentelemetry-sdk" }, ] +sandbox = [ + { name = "anyio" }, + { name = "vercel" }, +] typesafe = [ { name = "typesafe-sdk" }, ] @@ -58,12 +74,14 @@ dev = [ { name = "ruff" }, { name = "ty" }, { name = "typesafe-sdk" }, + { name = "vercel" }, { name = "vercel-oidc" }, ] [package.metadata] requires-dist = [ { name = "anthropic", marker = "extra == 'anthropic'", specifier = ">=0.83.0,<2.0.0" }, + { name = "anyio", marker = "extra == 'sandbox'", specifier = ">=4.5" }, { name = "httpx2", specifier = ">=2.12.0" }, { name = "mcp", marker = "extra == 'mcp'", specifier = ">=2.0.0,<3.0.0" }, { name = "modelsdotdev", specifier = "==0.*" }, @@ -73,9 +91,10 @@ requires-dist = [ { name = "pydantic", specifier = ">=2.13" }, { name = "typesafe-sdk", marker = "extra == 'typesafe'", specifier = ">=0.7.5,<1" }, { name = "typing-extensions", specifier = ">=4.15.0" }, + { name = "vercel", marker = "extra == 'sandbox'", specifier = ">=0.13.0" }, { name = "vercel-oidc", marker = "extra == 'vercel'", specifier = ">=0.8.0" }, ] -provides-extras = ["anthropic", "mcp", "openai", "otel", "typesafe", "vercel"] +provides-extras = ["anthropic", "mcp", "openai", "otel", "sandbox", "typesafe", "vercel"] [package.metadata.requires-dev] dev = [ @@ -93,6 +112,7 @@ dev = [ { name = "ruff", specifier = "~=0.8.0" }, { name = "ty", specifier = "~=0.0.37" }, { name = "typesafe-sdk", specifier = ">=0.7.5" }, + { name = "vercel", specifier = ">=0.13.0" }, { name = "vercel-oidc", specifier = ">=0.8.0" }, ] @@ -194,6 +214,63 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3a/2a/7cc015f5b9f5db42b7d48157e23356022889fc354a2813c15934b7cb5c0e/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373", size = 67615, upload-time = "2025-10-06T13:54:43.17Z" }, ] +[[package]] +name = "cbor2" +version = "6.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/2f/bf52daccd1027ffdfad3f04ae1730383e5b406abb8a9a98963584dd39563/cbor2-6.2.1.tar.gz", hash = "sha256:086c1588bd407a46739da704b5ee7d15225dc998d9582a0519fc6c9a114b25f7", size = 102760, upload-time = "2026-11-07T00:27:29.111Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c9/19/0706d0331d02b57b89012b84836165662c40befba22494b1c98fb06481fc/cbor2-6.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:41810f070b8e3ee87392e89a00e276840947da9b30a98c72f0c03e07935b654a", size = 415161, upload-time = "2026-11-07T00:26:18.594Z" }, + { url = "https://files.pythonhosted.org/packages/df/47/1b3ec198f0938340b0d2152414efd0d89b741f65dd4e257a3e9f5fa4cfdb/cbor2-6.2.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:830c54f5d6581bce628e0c9970f22f1b94069d123ba3c051192e9f3fd5154400", size = 460079, upload-time = "2026-11-07T00:26:19.895Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ee/52232e48413d136c229e5a1be94839724e011a00ba287c5c133e1962c6da/cbor2-6.2.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6a66bf0322d40534b3e8ff838cdaed345a6a707cabc447c8e4266d2b4f69d572", size = 470878, upload-time = "2026-11-07T00:26:21.31Z" }, + { url = "https://files.pythonhosted.org/packages/da/c3/c68005844c90e4f41bd7ad8c83c293d6fa0457cd126461089fd8ca0d855a/cbor2-6.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c1eb32463e716f29f12ade34b9573817ec9fef9f8c5f01e0fccf5894b30b1296", size = 526932, upload-time = "2026-11-07T00:26:22.797Z" }, + { url = "https://files.pythonhosted.org/packages/3d/1c/15068c104bf0d3dee3fa0e940a24b0d1b26b28ba6f2a2f26e2df3f350878/cbor2-6.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:438d082ba745cd87e2fecacf88e74b1cb8fc20d79f2c791a51cabf6c90abcbc9", size = 539291, upload-time = "2026-11-07T00:26:24.229Z" }, + { url = "https://files.pythonhosted.org/packages/64/82/b4eae2c633eb3f75a6820d886589a2c524e06bb7d5c6441cdf21bd016039/cbor2-6.2.1-cp312-cp312-win32.whl", hash = "sha256:e12f481ce60cae61b85c2111a075544acec66327422b8f543b9fc9cee136be52", size = 287990, upload-time = "2026-11-07T00:26:25.583Z" }, + { url = "https://files.pythonhosted.org/packages/9e/18/f88692ffa59742d5ab0c4450426cf81e143a4dfcd7bc9ff3ef229c7151cf/cbor2-6.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:5800aa7e6f67b86fbd0a074b44e8042d513cb5a831ce1b3e5fe7c19523ae4bd4", size = 312214, upload-time = "2026-11-07T00:26:26.923Z" }, + { url = "https://files.pythonhosted.org/packages/61/60/1027be6be4180311e7c69aef55e4f6ad127177822d0aeaf46f42f9d75970/cbor2-6.2.1-cp312-cp312-win_arm64.whl", hash = "sha256:c23dfc9a7e369fddec7b49ea42a22fd972feb7644d647e8e43797488a2c5c2a1", size = 301904, upload-time = "2026-11-07T00:26:28.241Z" }, + { url = "https://files.pythonhosted.org/packages/c3/6a/e9c70d96b3d3080ce0c5c4fc933998c63516443ed7938279c12d158bd5f0/cbor2-6.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f23eb8f345ba85df3adab97740ec086fa8b2e4c571aaad5cd9b3d5b3655eb4c4", size = 415459, upload-time = "2026-11-07T00:26:29.51Z" }, + { url = "https://files.pythonhosted.org/packages/75/a3/b75655c916496ddc65ab212b4dd04154a9e6dfec7308cb6bc7eb977f253c/cbor2-6.2.1-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:37dc36e64a3e0cbab657e906bdc8d739a3f56134a6a89bad5156ea964d2aad49", size = 459834, upload-time = "2026-11-07T00:26:30.857Z" }, + { url = "https://files.pythonhosted.org/packages/ad/8f/70243f27968d68ae62afc418d08aa39b4c36bbc52cf4e4c5c95e5b86ba30/cbor2-6.2.1-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:def3a679b085095a9316d38a676d5bca3e2d5954d0cad7140f3f0af88e33c2b0", size = 471075, upload-time = "2026-11-07T00:26:33.205Z" }, + { url = "https://files.pythonhosted.org/packages/49/7b/eacaab0a55e905dcfb608aae68422843fc21f50e9fa225364326fd85644e/cbor2-6.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:beb4801453292b88f71b26b62dc3bf445802f3ebf6d0af190e63a4a121971d58", size = 527397, upload-time = "2026-11-07T00:26:34.939Z" }, + { url = "https://files.pythonhosted.org/packages/a8/86/498903f8ef159b96980063ffe113a2009d76af7ed6d5ac8627875fa75aa6/cbor2-6.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:120d2b616488b2a49a04f3a871fd544b68985ae7c3d472e388586a2189d4607f", size = 539606, upload-time = "2026-11-07T00:26:36.628Z" }, + { url = "https://files.pythonhosted.org/packages/59/5e/0e91e5bd7b45293103c084fa9a798a99df550ee5b691360ef673c435dfa6/cbor2-6.2.1-cp313-cp313-win32.whl", hash = "sha256:0baf8b17517b5d94850a076621121d3339644d1bfe894ae789a32f855b6e90fc", size = 288249, upload-time = "2026-11-07T00:26:37.952Z" }, + { url = "https://files.pythonhosted.org/packages/cc/97/4442f30f779c8763a260996cd131b327f859d179bef1b4f8e8d997a57bad/cbor2-6.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:07b3af862e98b85f3d4d1ec94b5d24d54f5c7a9569fed183116a4166b26ef19d", size = 312238, upload-time = "2026-11-07T00:26:39.324Z" }, + { url = "https://files.pythonhosted.org/packages/d6/7d/f10114383b6d1cee67d027c356a356445fe89d903aab27c5c8eca9d7eb67/cbor2-6.2.1-cp313-cp313-win_arm64.whl", hash = "sha256:ef8419796021fc755294125d27e4c98da26ff584b354fcd964a6740e6c5a1dd9", size = 301589, upload-time = "2026-11-07T00:26:40.619Z" }, + { url = "https://files.pythonhosted.org/packages/ef/b3/4a5f7696068eb0b067994dd83bfd684d8e2f54d8d045be886f057d8ee941/cbor2-6.2.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:035e93888a813a67181ec19dd6053ca4f76abd92adf4ec81d4bca0b72388cb19", size = 418536, upload-time = "2026-11-07T00:26:41.932Z" }, + { url = "https://files.pythonhosted.org/packages/c9/fe/27d490d2fdd08d81189421ac12e51f132d6ca9e3c30bd4ab955b044e7952/cbor2-6.2.1-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:6d9767e443c64e3f88fca9adc64aa5761fe0ef35d45cd4a0e63d5bbb773a6138", size = 462156, upload-time = "2026-11-07T00:26:43.587Z" }, + { url = "https://files.pythonhosted.org/packages/8f/29/771926e914ad1e8656efa14d68bc24dbabec7b9aa3d542907aba34cca66c/cbor2-6.2.1-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:7225faafc3d341d905480ce3f821e4d0f23511025532b64d5f44780a5bd625e7", size = 474103, upload-time = "2026-11-07T00:26:45.622Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d3/7bbff48855f073117d00eba44eeb5a38226c92f03d6efc5e9730b7e536d2/cbor2-6.2.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5ea796072147aea911bcea72ae74bbefbfbd3a480f9f55547280c871e33bd284", size = 529863, upload-time = "2026-11-07T00:26:47.326Z" }, + { url = "https://files.pythonhosted.org/packages/1f/c8/8b387d951ea1bf7adfda96d0b8df5680dc8ab9dee029969f15ac7419e91f/cbor2-6.2.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2773c2d4ca770259718a27a28b33d410761d278f52e203209558c74bcf9fb208", size = 543503, upload-time = "2026-11-07T00:26:48.738Z" }, + { url = "https://files.pythonhosted.org/packages/72/3d/ff920a4cbd1910b515994a6ab2b8896f68dd2063ad9cec8838b0a8f9aeb4/cbor2-6.2.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ce6f9135a62b4aa427bd0104526c75fc1e95ad97409083e377797b6d69a7478d", size = 169398, upload-time = "2026-11-07T00:26:50.234Z" }, + { url = "https://files.pythonhosted.org/packages/70/00/3e3f3fc93412f10d9b2dcb115de2d6e13261ef4d616d46f31c6bf8ec4aba/cbor2-6.2.1-cp314-cp314-win32.whl", hash = "sha256:5785a0a9738ede549da72d5c3a2cc40b7fcbf1fbea6c1957dd0d59b64310256e", size = 297452, upload-time = "2026-11-07T00:26:51.502Z" }, + { url = "https://files.pythonhosted.org/packages/d4/6b/70fc24e9a09bbf24ccc0a0d8ad6dec4bd91283caa69a8bf19fae1fe2829c/cbor2-6.2.1-cp314-cp314-win_amd64.whl", hash = "sha256:00176ecde0be58a668ab67b0e0c763c692a9b6f7898894982e04a8c2b02c2715", size = 325358, upload-time = "2026-11-07T00:26:52.764Z" }, + { url = "https://files.pythonhosted.org/packages/37/76/b967978fab062b912b2d4b307fd84d8bffd0f70619a9b237d41d18c62274/cbor2-6.2.1-cp314-cp314-win_arm64.whl", hash = "sha256:623fe0658993f8b438a6e737aebe31313b14907fb5b2aa6f844fc3b9ba8aeb7a", size = 315248, upload-time = "2026-11-07T00:26:54.067Z" }, + { url = "https://files.pythonhosted.org/packages/43/1e/aa230215c18b5d3ae63b3dc1c0102fa0bf7510ab26e927817398522f7be5/cbor2-6.2.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:74a8df13828de73a99b03bd3a4508a99d1f19dac2ab46f3fd361890120ea6583", size = 416638, upload-time = "2026-11-07T00:26:55.351Z" }, + { url = "https://files.pythonhosted.org/packages/38/0c/1995b53add8f59773ead9007c5f56a2441001b32c51500786f0957d8b18e/cbor2-6.2.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:aa789848ab27d04710e64b2ec7a0eb1aa193aa4d43dfe9d9f494d6e2eaed9d83", size = 458585, upload-time = "2026-11-07T00:26:56.7Z" }, + { url = "https://files.pythonhosted.org/packages/c8/b0/e809e40f028001f9da3909a2bff7ebe428893c3526718fa21cb9f106e04a/cbor2-6.2.1-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:23fb300ed63cf367d859c378300b419422fc699f3d91c5889021999214bdf790", size = 475272, upload-time = "2026-11-07T00:26:58.322Z" }, + { url = "https://files.pythonhosted.org/packages/ba/30/b3c455cec4b8a375377406526e031f7fe508afcf878c7d60f100bc76789a/cbor2-6.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:51d6960dbc7fb4607acc932a7d860dd50bc25b6b6e3dc19c7a28d42db4839500", size = 525051, upload-time = "2026-11-07T00:27:00.059Z" }, + { url = "https://files.pythonhosted.org/packages/90/85/d5286f16ce10e8cdea1acf5531c92b9240f96755b6a667a00bf0e8859e99/cbor2-6.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b19a9ffa63de7871ede20ed2cfda1efb12bb8efaf5ac29a331b5308542fc4ea5", size = 543376, upload-time = "2026-11-07T00:27:01.446Z" }, + { url = "https://files.pythonhosted.org/packages/32/09/38d8c347707ad216d3affe82759ff4e8dfebb7e3834d47c78719c96da3a8/cbor2-6.2.1-cp314-cp314t-win32.whl", hash = "sha256:1f2dbec34ebe04f4dab80b5d49d0fd06d1702dc1336c1e780f401a8b378bed30", size = 295260, upload-time = "2026-11-07T00:27:02.783Z" }, + { url = "https://files.pythonhosted.org/packages/c3/7a/b58f720804327e3407ecbf188ff97715e17d79a7828d5f2dfb7c6ec5f5bc/cbor2-6.2.1-cp314-cp314t-win_amd64.whl", hash = "sha256:970e885d314bc79640c0f303ece6e443ec0787539945ad4598fd8ad16fbc41c7", size = 327181, upload-time = "2026-11-07T00:27:04.097Z" }, + { url = "https://files.pythonhosted.org/packages/ae/48/7ed1cf3e48cb0305d1839e21615255f7b3c53928c5fa674b6665591233c7/cbor2-6.2.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2b0c44f260405f66e7f8410ff2f47fd5aeef1b84cea4f90c5efe9f676d84224d", size = 316062, upload-time = "2026-11-07T00:27:05.584Z" }, + { url = "https://files.pythonhosted.org/packages/30/8b/fb18fca199c0844b7453d10e464714101ee70091817d6caf66ac2a554cce/cbor2-6.2.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:ee8aeceef3c4689a9d3569757f874185c5750242255e8ab4463564851f8e611f", size = 410757, upload-time = "2026-11-07T00:27:06.988Z" }, + { url = "https://files.pythonhosted.org/packages/63/6f/50a29e2b2aea34da252abb4d87bbc3160ddbfc0f8d0993a6099249dfb3c0/cbor2-6.2.1-cp315-cp315-manylinux_2_28_aarch64.whl", hash = "sha256:dd789b939587d38319bf9eef6d5bf7523dc52e5d32f261e1b5134ee0da8f22d6", size = 453789, upload-time = "2026-11-07T00:27:08.438Z" }, + { url = "https://files.pythonhosted.org/packages/c4/2c/b9f958c885f00eab55fdc65dbbe7aa1bf0581e6a94dd85e1113e96b21fba/cbor2-6.2.1-cp315-cp315-manylinux_2_28_x86_64.whl", hash = "sha256:e00d1daf9e8750b071a6e6228ba7fb97f98ba3ea7aaab27427cf651eecc65dec", size = 466117, upload-time = "2026-11-07T00:27:09.821Z" }, + { url = "https://files.pythonhosted.org/packages/ae/b5/d3a7525c2c267441348757c523c9d9fdedcdd09cf8046cdf90e0de8c9a52/cbor2-6.2.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:bda666879182490a559e5d845d2deb95dea80b5007e2698d8fbd64a7d453fb0e", size = 520463, upload-time = "2026-11-07T00:27:11.25Z" }, + { url = "https://files.pythonhosted.org/packages/38/68/aa3a233053dfd8f76f7c59532468980253500a8620552503f56b23b0dbbd/cbor2-6.2.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:b3f41fb922f4aa5865ea3cf685585f7aaf30b4b73c230a12c4d685bc8fef1350", size = 533959, upload-time = "2026-11-07T00:27:12.767Z" }, + { url = "https://files.pythonhosted.org/packages/1f/6c/6bf5333f44eb186cac011ab142c9edf767175c95ebfd28d36bbf0f9705c8/cbor2-6.2.1-cp315-cp315-win32.whl", hash = "sha256:8f0079305dd5ed379093624039ed26b88e49687883731e2688dc72cc1756d6c0", size = 289247, upload-time = "2026-11-07T00:27:14.084Z" }, + { url = "https://files.pythonhosted.org/packages/28/af/1a65a2c6d6f0538617c1809b7d782c1d0d53faaf47a654ffeca283246f8b/cbor2-6.2.1-cp315-cp315-win_amd64.whl", hash = "sha256:ff6a31c27d36cb9f3df5b53f04e86c11c55ed607b94136fc7de1d80bd2332273", size = 317753, upload-time = "2026-11-07T00:27:15.394Z" }, + { url = "https://files.pythonhosted.org/packages/1f/9d/247e789f05f0bc9193415cfd861ab875b251fc2397efafe243821400fefa/cbor2-6.2.1-cp315-cp315-win_arm64.whl", hash = "sha256:4582163771c7abf70feaea6093b0bb128de20f3c10ad6eb8f87c899705ad437b", size = 306507, upload-time = "2026-11-07T00:27:16.977Z" }, + { url = "https://files.pythonhosted.org/packages/ec/bd/d5a6a95875a00c64c03022b46acf83327349e8f012b886e652936cc8c30d/cbor2-6.2.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:8d1aef5eaee896b4239b7e0cf2f215b93e46d8a8cc392a7394f94d23ab15ee3b", size = 408531, upload-time = "2026-11-07T00:27:18.335Z" }, + { url = "https://files.pythonhosted.org/packages/75/3d/900658b3f628247149b2908dbc9e3446e318853c9257c7f3dc84fc3371a9/cbor2-6.2.1-cp315-cp315t-manylinux_2_28_aarch64.whl", hash = "sha256:b86cd0ca6fd4abd99958df1bb214dde8b264a0cb02d6f0f69837140d92a1c72f", size = 448286, upload-time = "2026-11-07T00:27:19.662Z" }, + { url = "https://files.pythonhosted.org/packages/0a/ba/c94c36981f66aa18889cbf2c780ed7fbf658e90eefc2b859e04f5d2071a6/cbor2-6.2.1-cp315-cp315t-manylinux_2_28_x86_64.whl", hash = "sha256:8b0d93ae182fb58222b3251b04b53e67c559f6809f160cbc22d7c4f91d2e8538", size = 466790, upload-time = "2026-11-07T00:27:21.081Z" }, + { url = "https://files.pythonhosted.org/packages/cf/0d/0f17eb3674064b84e11ddcecba1d46ef12101a526cb0a70efb10ae278f03/cbor2-6.2.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:432e0c4d9536203fea986767295351c82577ab0ded57758e71c85dea21e147ca", size = 515167, upload-time = "2026-11-07T00:27:22.383Z" }, + { url = "https://files.pythonhosted.org/packages/5c/de/53e51b88cbd3f7495962b30bdce3a098363457be2ac8a207c445891fd0e5/cbor2-6.2.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7dd3791d2339526f6836f13e32b7213ee13cb02c1d71dcb360821ea625d8a6c6", size = 534468, upload-time = "2026-11-07T00:27:23.703Z" }, + { url = "https://files.pythonhosted.org/packages/99/02/1ad2bf2f1d5aa5cf1e48f8b7d2c99190886a4f477da5983cabdb0c9c2265/cbor2-6.2.1-cp315-cp315t-win32.whl", hash = "sha256:d11eda82b6484e73ea1f6b9ffdc4a2e310a53f3bcfee30e788a997f942347e08", size = 286557, upload-time = "2026-11-07T00:27:25.081Z" }, + { url = "https://files.pythonhosted.org/packages/c0/77/cd286d46b303d69314bcb210267e6424da64443b537ff5e3c93c7a10cccc/cbor2-6.2.1-cp315-cp315t-win_amd64.whl", hash = "sha256:02336d65520273d06fd7e4801f4f8c63fbd7a473ef187d40a0e433a8ed5d8e9e", size = 319049, upload-time = "2026-11-07T00:27:26.464Z" }, + { url = "https://files.pythonhosted.org/packages/b5/db/6378497c50834e363fa9bf5f6a04196a46e50e3d9cf8db63166005379c41/cbor2-6.2.1-cp315-cp315t-win_arm64.whl", hash = "sha256:799b9ee84c04dc7422930134247efc8571f61e26a5ea0fa0754bbdf4bf567766", size = 306846, upload-time = "2026-11-07T00:27:27.857Z" }, +] + [[package]] name = "certifi" version = "2026.1.4" @@ -441,16 +518,25 @@ wheels = [ ] [[package]] -name = "httpcore" -version = "1.0.9" +name = "h2" +version = "4.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "certifi" }, - { name = "h11" }, + { name = "hpack" }, + { name = "hyperframe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/85/7c366e69d84c17bb778fe41419e1fbcce3033d5b7ce29bbffff0a98b859f/h2-4.4.1.tar.gz", hash = "sha256:4e866ffb1a869ae14dd9b5e6beb5c24a13da0495ad72b65925ded182521c1516", size = 2157281, upload-time = "2026-08-03T11:45:09.509Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, + { url = "https://files.pythonhosted.org/packages/7e/22/e85faf23bd72a92d1921e37d674ca56eb298a3c8be31fdecef0ff2b3aaac/h2-4.4.1-py3-none-any.whl", hash = "sha256:0e25f1462b23c9cb82d9eb02e28bc706dac2a68cb457c6a0d74d63c8a2a5d0e6", size = 62636, upload-time = "2026-08-03T11:44:59.164Z" }, +] + +[[package]] +name = "hpack" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/26/5b/fcabf6028144a8723726318b07a32c2f3314acdff6265743cf08a344b18e/hpack-4.2.0.tar.gz", hash = "sha256:0895cfa3b5531fc65fe439c05eb65144f123bf7a394fcaa56aa423548d8e45c0", size = 51300, upload-time = "2026-06-23T18:34:46.667Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/b4/4a9fcfb2aef6ba44d9073ecd301443aa00b3dac95de5619f2a7de7ec8a91/hpack-4.2.0-py3-none-any.whl", hash = "sha256:858ac0b02280fa582b5080d68db0899c62a80375e0e5413a74970c5e518b6986", size = 34246, upload-time = "2026-06-23T18:34:45.472Z" }, ] [[package]] @@ -466,21 +552,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d2/74/d370e55600d9bcfa0d9794b0166126d49291a3d2b20c268fc98c453a4948/httpcore2-2.12.0-py3-none-any.whl", hash = "sha256:7e04258ce01013d7d615e5b910a3b27fac937d7a95038227e79652b4ba3b4ceb", size = 83074, upload-time = "2026-08-18T13:22:05.854Z" }, ] -[[package]] -name = "httpx" -version = "0.28.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "certifi" }, - { name = "httpcore" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, -] - [[package]] name = "httpx2" version = "2.12.0" @@ -498,6 +569,14 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/95/411ba65569158e862368917aaf56597f3e5fa3b91b0502919638465a08f3/httpx2-2.12.0-py3-none-any.whl", hash = "sha256:cc8b6eecb8661c146b8f89a60e97456ee086e91a784ed31ac450c3a9e613dd36", size = 95427, upload-time = "2026-08-18T13:22:06.834Z" }, ] +[package.optional-dependencies] +http2 = [ + { name = "h2" }, +] +ws = [ + { name = "wsproto" }, +] + [[package]] name = "httpx2-jsfetch" version = "1.0" @@ -507,6 +586,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9b/43/832f631d32e4f1211caa2ba368317739fe71f0b8530e4c9d15dc454bac2a/httpx2_jsfetch-1.0-py3-none-any.whl", hash = "sha256:cb916b707601e69a07721aabc8f3f6659be3a6893bc1ff5c6f9e02241df2da32", size = 6382, upload-time = "2026-08-07T00:13:06.567Z" }, ] +[[package]] +name = "hyperframe" +version = "6.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/02/e7/94f8232d4a74cc99514c13a9f995811485a6903d48e5d952771ef6322e30/hyperframe-6.1.0.tar.gz", hash = "sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08", size = 26566, upload-time = "2025-01-22T21:41:49.302Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/30/47d0bf6072f7252e6521f3447ccfa40b421b6824517f82854703d0f5a98b/hyperframe-6.1.0-py3-none-any.whl", hash = "sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5", size = 13007, upload-time = "2025-01-22T21:41:47.295Z" }, +] + [[package]] name = "idna" version = "3.19" @@ -1274,6 +1362,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/91/f8/3765e053acd07baa055c96b2065c7fab91f911b3c076dfea71006666f5b0/ruff-0.8.6-py3-none-win_arm64.whl", hash = "sha256:7d7fc2377a04b6e04ffe588caad613d0c460eb2ecba4c0ccbbfe2bc973cbc162", size = 9149556, upload-time = "2025-01-04T12:22:57.173Z" }, ] +[[package]] +name = "semver" +version = "3.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0e/50/2932d6434608c7d954d0d4f4b71b697260e3b40c802425fc84c1eed12440/semver-3.1.1.tar.gz", hash = "sha256:149b26cabada6f63212f97e94505d21578cb1d280cf714827f328d5e70765fea", size = 292174, upload-time = "2026-11-09T11:38:46.145Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/57/1d/793b054cbd0a2e0b4694dacc22bad066d6635ce85dd6cdd1f98d95169e9b/semver-3.1.1-py3-none-any.whl", hash = "sha256:c00cf7dac88a352bc6a4a997d6ac0bf95ba835c589bc0c54f7b76f9e2a45123a", size = 18905, upload-time = "2026-11-09T11:38:44.556Z" }, +] + [[package]] name = "sniffio" version = "1.3.1" @@ -1414,25 +1511,308 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee", size = 68502, upload-time = "2025-12-21T14:16:21.041Z" }, ] +[[package]] +name = "vercel" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2" }, + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "vercel-blob" }, + { name = "vercel-cache" }, + { name = "vercel-headers" }, + { name = "vercel-internal-core" }, + { name = "vercel-internal-telemetry" }, + { name = "vercel-oidc" }, + { name = "vercel-queue" }, + { name = "vercel-sandbox" }, + { name = "vercel-workflow" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c5/99/160cf5a129d0d37a4cccea1c858bc2bce8582e40e2f4fe9c5829f53c8bea/vercel-0.13.0.tar.gz", hash = "sha256:51df27416f11332cfc183f326b0a9a02fc5dda3fa80fef00335fdc5ef46dbbc4", size = 52104, upload-time = "2026-11-13T19:11:11.919Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/51/45/3a533b508626b418e8d32364ff5d9d3aa65c994acca99659a3afa2e19d89/vercel-0.13.0-py3-none-any.whl", hash = "sha256:8ecdd31ef2c33d46ca07f3cc8e37f07c1beefeead762e01032398dc6c1797be0", size = 33131, upload-time = "2026-11-13T19:11:10.937Z" }, +] + +[[package]] +name = "vercel-blob" +version = "0.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2" }, + { name = "pydantic" }, + { name = "vercel-internal-core" }, + { name = "vercel-oidc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/65/18dec10820f6b20d39a37c6477157abec78660c0f12371770797f4e1795c/vercel_blob-0.6.0.tar.gz", hash = "sha256:dd650791c08fdbcde0e524ee05a8241fc969ac2033b922941a7c3b5fbdaa75b0", size = 31877, upload-time = "2026-11-13T19:10:20.309Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c4/f2/f847cdf95575fbf3a88b0ce4082c3ea6cafabb80bf577d08bddc0f972261/vercel_blob-0.6.0-py3-none-any.whl", hash = "sha256:30f01402b52af9f5fd7a00c2da155b0ec465c36854512d51c97871859963e2c7", size = 36154, upload-time = "2026-11-13T19:10:19.36Z" }, +] + +[[package]] +name = "vercel-cache" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "httpx2" }, + { name = "vercel-headers" }, + { name = "vercel-internal-telemetry" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/56/4e/2c838d5d96e30aaebc254f1b66421e45127579994d5e5e2aaab516c19735/vercel_cache-0.8.0.tar.gz", hash = "sha256:427dc669dc3bd98c44a004100e43875990941dedc9321e8a9df3d32ad72e140c", size = 9881, upload-time = "2026-11-13T19:10:49.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/fb/0a2bda95e91ab705c20477300b44aa40c4db3e1654a3bad1905a22f91e07/vercel_cache-0.8.0-py3-none-any.whl", hash = "sha256:9739ebb519c3f954a029a32bf344c1cb14a66f960f7a40797343328b29f6e041", size = 10348, upload-time = "2026-11-13T19:10:48.413Z" }, +] + [[package]] name = "vercel-headers" -version = "0.7.1" +version = "0.8.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/20/50/2fbe5563b1f710c5cec3076efe94df887dd89c7ce0f4238b81f169f5d733/vercel_headers-0.7.1.tar.gz", hash = "sha256:46e63a99a3095f3b4fa324c80e5aeee5886ca474ef5ecbfe6eabb5f2bd64928a", size = 5410, upload-time = "2026-07-16T14:23:35.768Z" } +sdist = { url = "https://files.pythonhosted.org/packages/29/94/016d2de42b653d7100d6de68f4711402660ba439d553a308d3c8e553f7ef/vercel_headers-0.8.0.tar.gz", hash = "sha256:6cf3aa1cb34772c3c708db80dba86127dfffb683158459ea1ec193c3edd2d9c1", size = 6091, upload-time = "2026-11-13T19:10:04.117Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/28/b8/5484e7ecf876c031831623efc547edcf94e2e33db4251d17c2d117c18cb0/vercel_headers-0.7.1-py3-none-any.whl", hash = "sha256:6ef65f0baffdf19775b693265d6118e125251456fb192324f4006dd341c77abc", size = 3907, upload-time = "2026-07-16T14:23:34.942Z" }, + { url = "https://files.pythonhosted.org/packages/81/63/129feb85d027ba780ba5ac65ee0e74dda5953f27cd4adc94ec18b3d34052/vercel_headers-0.8.0-py3-none-any.whl", hash = "sha256:b565d966a4aff1a85410eed5f47e1edfa4c83a6d6b1870477d43bd78d16f16d5", size = 3920, upload-time = "2026-11-13T19:10:03.17Z" }, +] + +[[package]] +name = "vercel-internal-core" +version = "0.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3a/70/a83748e8c77715af566c3726bb43863c512c7964413d90f4ee8fdd28f0a2/vercel_internal_core-0.3.0.tar.gz", hash = "sha256:96e1c107e85b8629e56ef8343602c831e85961c683baa076397815a26f275846", size = 20662, upload-time = "2026-11-13T19:10:10.9Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/00/1d/dadf9c918597a9c8796b56fee1726affa9b5639c096b9519128be71fc495/vercel_internal_core-0.3.0-py3-none-any.whl", hash = "sha256:184f9cb3009490c8bb5069aa99d39b952ece5b157fd50b2ec19e7ac72e654735", size = 24464, upload-time = "2026-11-13T19:10:10.021Z" }, +] + +[[package]] +name = "vercel-internal-telemetry" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "httpx2" }, + { name = "vercel-oidc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ab/5f/9bac3ee6061f099c70367b8a3b8da1891f168d5baf603b69b97762ba8205/vercel_internal_telemetry-0.9.0.tar.gz", hash = "sha256:44defaed932e9cff20e122724282f8f156db80bb599df058237af06f14ab5974", size = 9127, upload-time = "2026-11-13T19:10:29.642Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/83/a7/46375d2ded4ebda9425519962c454c63a90b2d87c656aaf2cefcd4c3c362/vercel_internal_telemetry-0.9.0-py3-none-any.whl", hash = "sha256:f2024806953f1d0ce5fd1cd84872400ab2ccab4eed0e2d1e6aaa8e3f818a8866", size = 8254, upload-time = "2026-11-13T19:10:28.903Z" }, ] [[package]] name = "vercel-oidc" -version = "0.8.0" +version = "0.12.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, - { name = "httpx" }, + { name = "httpx2" }, { name = "vercel-headers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/34/c5/fa8c0c298f86e9e144fb012b3f6d45490e9af240dd6d3319cd2e2441002b/vercel_oidc-0.8.0.tar.gz", hash = "sha256:dbcb1e19697c87f89ae25c5bfeb8018fdb3904d9d92290796cc290ae7eeef61e", size = 16117, upload-time = "2026-08-08T00:16:40.203Z" } +sdist = { url = "https://files.pythonhosted.org/packages/3b/3d/34c4b523533d66c3eba95c9901d9b8634b62106093953d35acd727bef768/vercel_oidc-0.12.0.tar.gz", hash = "sha256:cf0437dd010acc147c8a8572cd22590d579eeec9d335e0717fcf32e377e900b7", size = 17064, upload-time = "2026-11-13T19:10:15.64Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1a/d6/c380d2d171840a67883a30f453b2edb3adabab3b5519941b445c312135c6/vercel_oidc-0.8.0-py3-none-any.whl", hash = "sha256:fb8bb715f20edf5539554951d0374b4956550688c8a8b7ccb69f8275ff464e22", size = 15996, upload-time = "2026-08-08T00:16:39.349Z" }, + { url = "https://files.pythonhosted.org/packages/98/51/4771578d47e97ac1ef67b8e592fbb1cad615482571c75a7dbe48536a83b9/vercel_oidc-0.12.0-py3-none-any.whl", hash = "sha256:727e0af59f988b96964a1d5fcbde314b6ef8c139aa976113917f478e6033e660", size = 17044, upload-time = "2026-11-13T19:10:14.709Z" }, +] + +[[package]] +name = "vercel-queue" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2", extra = ["http2"] }, + { name = "python-multipart" }, + { name = "vercel-headers" }, + { name = "vercel-internal-core" }, + { name = "vercel-oidc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/40/54/05467b8e4aa9552c62e082bef6a0f7ab950ab745886bb59371e0d7958344/vercel_queue-0.11.0.tar.gz", hash = "sha256:8f434e942cabe3a9c4833f9872fcfe7b8e7bddd1131394b0ad7a6cc952c861f6", size = 87665, upload-time = "2026-11-13T19:10:39.676Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/b7/3277177c19ea5d1abb8a57fdc1105c86c7c883dbf8e8ff4db2c554bc7df9/vercel_queue-0.11.0-py3-none-any.whl", hash = "sha256:bae38fc0be6c46f43a3ac9321d4413f5ce34e11c2c69cbd1e2d3386d922571b5", size = 96036, upload-time = "2026-11-13T19:10:38.284Z" }, +] + +[[package]] +name = "vercel-sandbox" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2", extra = ["ws"] }, + { name = "pydantic" }, + { name = "vercel-internal-core" }, + { name = "vercel-oidc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b4/9d/13211274d09e6847f62560c70db1d2d8414bb79895da01a9eca55cdcbb90/vercel_sandbox-1.0.0.tar.gz", hash = "sha256:d3d8c6bbb73cd6d35d85ffb59ed69e3f58e6013397866d1b176b08a42d1246e1", size = 127894, upload-time = "2026-11-13T19:10:44.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9d/1c/4d9c310ba1d2d3dd8ac07a482094fa27ce9719814f9a49e6d64f2ffdee7b/vercel_sandbox-1.0.0-py3-none-any.whl", hash = "sha256:65adc4a093ef2b6c8303646849b545b438aee95a740399087fdbd71e92afef34", size = 144935, upload-time = "2026-11-13T19:10:43.683Z" }, +] + +[[package]] +name = "vercel-workflow" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "cbor2" }, + { name = "cryptography" }, + { name = "httpx2" }, + { name = "pydantic" }, + { name = "semver" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "vercel-headers" }, + { name = "vercel-internal-core" }, + { name = "vercel-oidc" }, + { name = "vercel-queue" }, + { name = "zstandard", marker = "python_full_version < '3.14'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/f0/1a439571cf324cfd3e40b3f58c5b00513be845e2cd97ad4998e298115539/vercel_workflow-0.13.0.tar.gz", hash = "sha256:7c5d8bdaeba60743de872c9127aa81f41d9f65e005998ff142afbe8b7d7a8c8e", size = 142636, upload-time = "2026-11-13T19:10:51.643Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/f1/29eaccc4acc7d3f193450b7619fa0a02448cd7b7c79ccf54af0dcf473914/vercel_workflow-0.13.0-py3-none-any.whl", hash = "sha256:70c72668fa781f2e209722215bfc638468c0037c3e74030a7531b360ec0ff665", size = 156838, upload-time = "2026-11-13T19:10:50.526Z" }, +] + +[[package]] +name = "websockets" +version = "16.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/21/f7/bc3a25c5ec26ce62ce487690becc2f3710bbc7b33338f005ad390db0b986/websockets-16.1.1.tar.gz", hash = "sha256:db234eda965dcce15df96bb9709f587cd87d4d52aaf0e80e2f34ec04c7670c57", size = 182204, upload-time = "2026-07-17T22:51:05.858Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/9d/681cda21c9eee743203a6cb79b9d3d05adad9aa60ec660c6c9bf4dd619ca/websockets-16.1.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cc97814dfb786a83b6e2dc2e79351e1b83e6d715647d6887fcabd83026417a00", size = 179600, upload-time = "2026-07-17T22:49:13.92Z" }, + { url = "https://files.pythonhosted.org/packages/fb/8d/6195a88b45e8d2a8f745fc2046e36f885a3c9763e6767d2c46229bf9510c/websockets-16.1.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e047dc87ef7ca50f4d309bf775ad4a71711c58556d75d7bd0604b2317f43e94b", size = 177272, upload-time = "2026-07-17T22:49:15.453Z" }, + { url = "https://files.pythonhosted.org/packages/73/e3/fe2d498c64dea0095c9a9f9a351af4cd6eef31b618395582bc1f38ba45ff/websockets-16.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01fbdcbac298efe19360b94bc0039c8f746f0220ba570f327577bfee81059175", size = 177542, upload-time = "2026-07-17T22:49:16.875Z" }, + { url = "https://files.pythonhosted.org/packages/fe/ed/f1831681fce0e3242346e5458486003c5f124ed69e5e0b847fd029db4973/websockets-16.1.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0f62863e8a00a6d33c3d6566ec0b89f23787b747ffe0c3bc71ec0e76b82c94b1", size = 187137, upload-time = "2026-07-17T22:49:18.323Z" }, + { url = "https://files.pythonhosted.org/packages/6f/79/4ff9dcc1bb46f6b4c536936dde1fd60f9b564f3304307274db97f4c9496d/websockets-16.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8087e82f842609734c9b5a1330464f8e94e346ba0e18c832c08bafa4b0d63c15", size = 188374, upload-time = "2026-07-17T22:49:19.65Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/5c49b6efb36cab733d23773f6de575e1dba65736ead17d5d2b2a1daef779/websockets-16.1.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2bb5d041a8307d2e18782e7ce777f6fdb1e8c2f5d09291484b18c294b789d9aa", size = 191155, upload-time = "2026-07-17T22:49:21.331Z" }, + { url = "https://files.pythonhosted.org/packages/6e/f6/56ccceda3a4838d18f1d40821480da4775397e8b1eecf4031e20c50e2e90/websockets-16.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1db4de4a0e95673f7545d393c49eeb0c2f18ac1ef93073218c79d5cdb2ee75ab", size = 189011, upload-time = "2026-07-17T22:49:22.889Z" }, + { url = "https://files.pythonhosted.org/packages/86/d6/ad5286241a2bce1107e2798d3bfbd62cf79aee167bdb654f8cb1e9dbf949/websockets-16.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f17dbe07eb3ea7f99e4df9b7e0efefe80fbf30d37a8cc4d561a0aed310bc8847", size = 187766, upload-time = "2026-07-17T22:49:24.339Z" }, + { url = "https://files.pythonhosted.org/packages/bc/67/d65c970b7e347fdca69479beb7811c2060529956730a7a4e3ae7c66b0e31/websockets-16.1.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4b57693728576d84ede0a77987ab16881b783d2cd9f1dc180a8fbbc3f79c4428", size = 185173, upload-time = "2026-07-17T22:49:25.743Z" }, + { url = "https://files.pythonhosted.org/packages/1d/5b/14af3cd4ee69d8ea9baca58f3dc3cfb1ba78332a347fd478cb096549d60e/websockets-16.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2a636ff1e7a5c4edf71ef0e79adae7f25dba93b4fcbe3dc958733477ffeb0eaf", size = 187809, upload-time = "2026-07-17T22:49:27.147Z" }, + { url = "https://files.pythonhosted.org/packages/7b/11/be301710d70de97e3e7b3586e6d492c9c06d6a61bf1c2202c36cf0c75607/websockets-16.1.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d6bec75c290fe484a8ba4cacdf838501e17c06ecfbbf31eede81a9e431bd7751", size = 186412, upload-time = "2026-07-17T22:49:28.611Z" }, + { url = "https://files.pythonhosted.org/packages/db/07/fe1435bf6fe738a3d3b54dbe0c18dabf12cba4d909ac8b58b539ce27c1f4/websockets-16.1.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:54509b8e92fee4453e152b7558ddef37ce9705a044922f2095a6105e3f80c96f", size = 188290, upload-time = "2026-07-17T22:49:29.965Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0a/81f394aff8efcbb01208c1ced77df0a3c7fcce584a88c7273663697946c2/websockets-16.1.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:f0aa4aad3b1b69ad3fd85a0fd0952ec64331c762bd77ec51cc814170873890b2", size = 185844, upload-time = "2026-07-17T22:49:31.447Z" }, + { url = "https://files.pythonhosted.org/packages/39/5c/dd485b995473f415510251fe9bd708f2d24458f439fce958daf8d66dc7c6/websockets-16.1.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:42290eb6db4ccaca7012656738214f8514082fb6fa40cdeb61bb9a471b52e383", size = 186823, upload-time = "2026-07-17T22:49:33.104Z" }, + { url = "https://files.pythonhosted.org/packages/9d/0b/f78de76ff446f1e66af12b43c48a35f31744de93cfdec2f4ea67d5d7bbf1/websockets-16.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:53260c8930da5771cec89439bff99c20c8cb03ddb9588b980697355a83cd4bd3", size = 187102, upload-time = "2026-07-17T22:49:34.616Z" }, + { url = "https://files.pythonhosted.org/packages/37/a1/4cf892007778eaf84ad162bfc98046e0ed89b63ac55949e3236626b2a23f/websockets-16.1.1-cp312-cp312-win32.whl", hash = "sha256:1d27fa8462ad6a1cb36206a3d0640b2333340def181fae11ed7f9adeaa5c0747", size = 179943, upload-time = "2026-07-17T22:49:36.213Z" }, + { url = "https://files.pythonhosted.org/packages/d9/de/6abe251d28c3a3f217096575400b27750b18e0b1d2fff3a2a239960fea07/websockets-16.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:b436f6ec4fc3a6b4237c84d3f83170ed2b40bb584222f0ac47a0c8a5921980c7", size = 180243, upload-time = "2026-07-17T22:49:37.626Z" }, + { url = "https://files.pythonhosted.org/packages/ce/fd/6ec6c6d2850aea25b1b2aa9901a016980bb87d01e89b3eb00470b1b5d471/websockets-16.1.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ab59169ace05dcb49a1d4118f0bde139557adf45091bd85747e36bf5de984dd1", size = 179587, upload-time = "2026-07-17T22:49:38.959Z" }, + { url = "https://files.pythonhosted.org/packages/5f/d8/1d299d2dd34087db39831a34cc645ef8a6f89d78efada6983093513cd81c/websockets-16.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5e3b7d601f6f84156b08cc4a5e541c2b50ad7b36cfc302b657a12477c904a5df", size = 177272, upload-time = "2026-07-17T22:49:40.293Z" }, + { url = "https://files.pythonhosted.org/packages/3d/86/0a70d3ae2f0f2256bb41302d9804dbca65d4360281e7feb3e1f94102ac46/websockets-16.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cd2ca96a082a36964aca83e992f72abeb61b7306c1a6cba4c7d06a7b93750cac", size = 177530, upload-time = "2026-07-17T22:49:41.786Z" }, + { url = "https://files.pythonhosted.org/packages/b5/c2/c676c69444d9db448b3f0a55a98dcc534affce0bce961d9d2f0b8499b10a/websockets-16.1.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f5d497865f05bb222cab7016c6034542e84e5f29f49c6fd3f4939cda7197b5b8", size = 187197, upload-time = "2026-07-17T22:49:43.658Z" }, + { url = "https://files.pythonhosted.org/packages/0b/13/88137fbaf726ebe29d62c1117fa11fa2bbb6209dc79d4ad738efbe36a2aa/websockets-16.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bae954c382e013d5ea5b190d2830526bfa45ad121c326da0049b8c769f185db6", size = 188433, upload-time = "2026-07-17T22:49:45.147Z" }, + { url = "https://files.pythonhosted.org/packages/01/6d/46c2f2ce6751cb26f39293e1ecbf8544cb01321397cd476c2756b98c216d/websockets-16.1.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e09f753a169951eb4f28c2c774f71069304f66e7277e0f5a2892423599cfa854", size = 189868, upload-time = "2026-07-17T22:49:46.581Z" }, + { url = "https://files.pythonhosted.org/packages/29/2b/170a9e8097636cfde4dc3c592b6e00b18a44a2f5407606d96ca542dd5838/websockets-16.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:024193f8551a2b0eafbdd160911012c4e6c228c28430c84433253299a9e42d6a", size = 189059, upload-time = "2026-07-17T22:49:47.972Z" }, + { url = "https://files.pythonhosted.org/packages/a7/48/f0d4ebc9ab4b473b8861b9e20fdb663d515d42f7befdf62cdb60fee7a1ec/websockets-16.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:aabe464bfd13bd25f4821faf111da6fefdc389f870265a53105580e45b0a2e49", size = 187814, upload-time = "2026-07-17T22:49:49.344Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ba/39a41d3ae8e72696a9492581900611c5a91e2b07563b0bcd2523adea9854/websockets-16.1.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a28fcbc9b6baf54a2e23f8655f308e4ccc6afdd7266f8fe7954f320dcda0f785", size = 185229, upload-time = "2026-07-17T22:49:50.787Z" }, + { url = "https://files.pythonhosted.org/packages/3c/36/ac15b604f850d1907f0a85ed721cefe47cd45034b3620069b829746cccbe/websockets-16.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:79eace538c6a97e96d0d03d4f9d314f9677f5ed85a8a984992ffd90b13cb8a56", size = 187874, upload-time = "2026-07-17T22:49:52.228Z" }, + { url = "https://files.pythonhosted.org/packages/a8/f3/3fbd5d71d59299c3770faa5884d4f45070236ca5a35ab3a61830812c409a/websockets-16.1.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:496af849a472b531f758dbd4d61338f5000538cb1a7b3d20d9d32a264517f509", size = 186469, upload-time = "2026-07-17T22:49:53.776Z" }, + { url = "https://files.pythonhosted.org/packages/b4/fc/dd90349bba58af2a53ef2ddd9c32716c81eb6d59a0687939fff561860878/websockets-16.1.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5283810d2646741a0d8da2aa733d6aefa0545809afccb2a5d105a26bc45125f1", size = 188347, upload-time = "2026-07-17T22:49:55.202Z" }, + { url = "https://files.pythonhosted.org/packages/4c/f3/f73ba86427682da59b78c11d77ba56d5b801c32e84afe79b274bbd6a9bb2/websockets-16.1.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4e3b680b1e0a27457e727a0d572fd81dffa87b6dbf8b228ab57da64f7d85aead", size = 185903, upload-time = "2026-07-17T22:49:56.75Z" }, + { url = "https://files.pythonhosted.org/packages/34/7c/f95eb20e80104173b3a0a092291f89ea4047ef6e608e0a57ca06eb14eecb/websockets-16.1.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:69159730a823dde3ea8d08783e8d47ef135a6d7e8d44eb127e32b321c9db8e3e", size = 186855, upload-time = "2026-07-17T22:49:58.467Z" }, + { url = "https://files.pythonhosted.org/packages/b0/35/dd875b3e050ff232d60fa377707f890e369f74d134f1be32e8f68879747c/websockets-16.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ed5bb271084b46530ee2ddc0410537a9961152c5ccba2fc98c5276d992ccba87", size = 187140, upload-time = "2026-07-17T22:50:00.016Z" }, + { url = "https://files.pythonhosted.org/packages/e8/dc/5cbfcb41824502f6af93b8f3943a4d06c67c23c7d2e31eb18748c4a5b2a7/websockets-16.1.1-cp313-cp313-win32.whl", hash = "sha256:cfb70b4eb56cac4da0a83588f3ad50d46beb0690391082f3d4e2d488c70b68ea", size = 179928, upload-time = "2026-07-17T22:50:01.685Z" }, + { url = "https://files.pythonhosted.org/packages/b0/c1/71e5deb5b7f8f226997ab64908c184ac3105c0155ce2d486f318e5dd08a8/websockets-16.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:d9531d9cbeac99af6f038fb1bc351403531f7d634a2c2e10e2f7c854c6ed5b68", size = 180242, upload-time = "2026-07-17T22:50:03.117Z" }, + { url = "https://files.pythonhosted.org/packages/73/a2/ba78a164eeea4620df4a4df4bd2ed6017438c4655cc0f36f2c0bc0432355/websockets-16.1.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:443aefe96b7fdb132e2a70806cca1f2af49bb3f28e47abcd7c2e9dcf4d8fa1b8", size = 179635, upload-time = "2026-07-17T22:50:05.001Z" }, + { url = "https://files.pythonhosted.org/packages/b9/08/d26d7a7628cd4ac34cbbdb63ac80914ca842ed8e42938c40a53567806df3/websockets-16.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6456ff333092d509127d75a638cb411afae8ff17f092635015d1902efec8a293", size = 177320, upload-time = "2026-07-17T22:50:06.427Z" }, + { url = "https://files.pythonhosted.org/packages/0f/45/ebec83e6269536aa5932533c67b0af5c781f3e73fdbcd68672dcf43f4f44/websockets-16.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fce6c48559c86d1ac3632ccb1bebc7d5442fbe79bd9bb0e40379ee54be2a4051", size = 177544, upload-time = "2026-07-17T22:50:07.834Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d5/abc614d2297f6c1c3e01e61260364457a47c25cc1cf6a879038902bc6aa8/websockets-16.1.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:92b820d345f7a3fc7b8163949ee92df910f290c3fc517b3d5301c78065adafe1", size = 187270, upload-time = "2026-07-17T22:50:09.275Z" }, + { url = "https://files.pythonhosted.org/packages/52/71/4c99af3b87dff1b2927981f6876607d4acb45338c665242168d3982f7758/websockets-16.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a606d9c24035242a3e256e9d5b77ed9cd6bccfcb7cf993e5ca3c0f6f68fb6a7", size = 188509, upload-time = "2026-07-17T22:50:10.722Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b4/5c8ca14b0df7eb84ed0524165c5359150210140817a3312aee57bf62a1cf/websockets-16.1.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:414e596c75f74e0994084694189d7dc9229fb278e33064d6784b73ffbba3ca31", size = 189882, upload-time = "2026-07-17T22:50:12.293Z" }, + { url = "https://files.pythonhosted.org/packages/25/c1/bedfba9e70557129cb8083748d167bdcc01483dedf0f0df143676df05cbe/websockets-16.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:536676848fc5961aca9d20389951f59169508f765637a172403dc5434d722fa0", size = 189114, upload-time = "2026-07-17T22:50:13.789Z" }, + { url = "https://files.pythonhosted.org/packages/df/09/aa835b2787835aebd839114be5de51b797cb480b63ba42b26d34dfe147cb/websockets-16.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:97fd3a0e8b53efa41970ac1dff3d8cf0d2884cadeb4caaf95db7ad1526926ee3", size = 187861, upload-time = "2026-07-17T22:50:15.179Z" }, + { url = "https://files.pythonhosted.org/packages/20/26/f6408330694dbc9830857d9d23bc14ac4f6875127a480cfdda8d5ca21198/websockets-16.1.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7b1b19636af86a3c7995d4d028dbe376f39b4bf31541146f9c123582a6c94562", size = 185286, upload-time = "2026-07-17T22:50:16.741Z" }, + { url = "https://files.pythonhosted.org/packages/17/9a/e0675e70dd8a80762cf35bb18799d3f290a4890ffe6439bc51d222796083/websockets-16.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:41c8e77f17294c0ac18008a7309b99b34ee72247ef10b6dff4c3f8b5ac29896b", size = 187935, upload-time = "2026-07-17T22:50:18.213Z" }, + { url = "https://files.pythonhosted.org/packages/33/c1/3234cfb86afde01b81e9bddcc6e534c440975d60a13991259e833069ab3e/websockets-16.1.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:9f63bcef7f4b02b06b35fc01c93b96c43b5e88e1e8868676caacf493d5a31f3a", size = 186444, upload-time = "2026-07-17T22:50:19.67Z" }, + { url = "https://files.pythonhosted.org/packages/89/87/9c15206e1d778923d8daa9657de07aa62ea815e13448319c98458c37b281/websockets-16.1.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:dab9eb87869da2d6ed3af3f3adf28414baae6ec9d4df355ffc18889132f3436c", size = 188409, upload-time = "2026-07-17T22:50:21.28Z" }, + { url = "https://files.pythonhosted.org/packages/f2/00/cf5de5c67676de2d3eef8b2a518f168f6796595447a5b7161ba0d012915c/websockets-16.1.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:43e3a9fdd7cbf7ba6040c31fae0faf84ca1474fef777c4e37912f1540f854499", size = 185958, upload-time = "2026-07-17T22:50:22.719Z" }, + { url = "https://files.pythonhosted.org/packages/62/c0/731b6ddede2e4136912ec4cff2cffbda35af73546be4762c3d7bd3bd79af/websockets-16.1.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:056ae37939ed7e9974f364f5864e76e49182622d8f9751ac1903c0d09b013985", size = 186911, upload-time = "2026-07-17T22:50:24.108Z" }, + { url = "https://files.pythonhosted.org/packages/8c/7f/39c634472c4469a24a7c09cecddffb08fac6d0e74f73881a94ee8a40a196/websockets-16.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a0eadbbf2c30f01efa58e1f110eb6fa293261f6b0b1aa38f7f48707107690af9", size = 187204, upload-time = "2026-07-17T22:50:25.548Z" }, + { url = "https://files.pythonhosted.org/packages/26/89/9667c256c256dafcc62d21328ce7a40067da857969b68ee9af375b0aaf72/websockets-16.1.1-cp314-cp314-win32.whl", hash = "sha256:195c978b065fa40910582464f99d6b15c8b314c68e0546549a55ed83f4735328", size = 179603, upload-time = "2026-07-17T22:50:27.086Z" }, + { url = "https://files.pythonhosted.org/packages/bd/dd/1c099d6c0fc5deb6b46ccdbb6981fdb4b12c917869cb3952408409dc18db/websockets-16.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:4e8d01cc3bcae7bbf8167f944aeafefed590fae5693552bba9794a9df68371cc", size = 179948, upload-time = "2026-07-17T22:50:28.521Z" }, + { url = "https://files.pythonhosted.org/packages/35/25/9956b2d5e0529d5d23924f21bba1440d4c5c88a562e4f08550871ffa97a7/websockets-16.1.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0ffd3031ea8bda8d61762e84220186105ba3b748b3c8da2ae4f7816fac03e573", size = 179963, upload-time = "2026-07-17T22:50:29.982Z" }, + { url = "https://files.pythonhosted.org/packages/17/06/55ffc976c488b6aee9ea05761ff7c4e88e7c1fd82818c8ca7b556ad2f90c/websockets-16.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:84a2cef8deffbd9ab8ee0ea546a2a6a7030c28f44e6cdd4547dbfeb489eb8999", size = 177497, upload-time = "2026-07-17T22:50:31.396Z" }, + { url = "https://files.pythonhosted.org/packages/0c/e8/f7dac2e980bacc92bdc26cebae4ae4d50cae5380732c50980598fc0bbae4/websockets-16.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3df13f73af9b3b38ab1195eb299ecb67a4330c911c97ae04043ff74085728abe", size = 177698, upload-time = "2026-07-17T22:50:32.829Z" }, + { url = "https://files.pythonhosted.org/packages/b2/39/26762f734113e22da2b942c3aca85798e0c0405d64c256549540ff31e5a1/websockets-16.1.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:23253dd5bcae3f9aaee0a1d30967a8dbd52e5d3cff93a2e5b84df57b77d4750d", size = 187561, upload-time = "2026-07-17T22:50:34.24Z" }, + { url = "https://files.pythonhosted.org/packages/11/94/c3f330851806b9b02138b774d593478323e73c99238681b4b93efe64e02d/websockets-16.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c1c5705e314449e3308872fe084b8571ce078ee4fc55a98a769bdefe5917392", size = 188732, upload-time = "2026-07-17T22:50:36.088Z" }, + { url = "https://files.pythonhosted.org/packages/d1/f2/eb2c450f052de334ae33cf200ece6e87b0e14d186807074e4eb1cd2cdea2/websockets-16.1.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:69e52d175a0a7d1e13b4b67ad41c560b7d98e8c6f6126eb0bda496c784faf8c7", size = 190872, upload-time = "2026-07-17T22:50:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/70/31/2ac8cecf3a74f7fed9132129fc3d90b3998a1554570c11a69b2a8c20332d/websockets-16.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1f79c89b5eb034d1722938a891916582f8f7f503f58ca22518a63c3f2cd18499", size = 189305, upload-time = "2026-07-17T22:50:39.53Z" }, + { url = "https://files.pythonhosted.org/packages/6a/cf/8ab19650d3c0d4562c92e70ab47c257c4aa5c6a713ed87fe63766b31fefc/websockets-16.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:39f2a024af5c345ffe8fcf1ee18c049c024c94df393bb09b044a6917c77bde43", size = 188033, upload-time = "2026-07-17T22:50:40.912Z" }, + { url = "https://files.pythonhosted.org/packages/66/d7/a49a38a6127a4acb134fb1912b215d900cc657605cff32445bf519f3acc4/websockets-16.1.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:952303a7318d4cbe1011400839bb2051c9f84fa0a35923267f5daba34b15d458", size = 185748, upload-time = "2026-07-17T22:50:42.559Z" }, + { url = "https://files.pythonhosted.org/packages/95/3e/ad1fa40388c7f2e0bb2c7930d0090b6c5498594bd1cdaec18864df3d9e97/websockets-16.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:249116b4a76063d930a46391ad56e135c286e4562a18309029fc2c73f4ed4c62", size = 188285, upload-time = "2026-07-17T22:50:43.974Z" }, + { url = "https://files.pythonhosted.org/packages/35/b8/d5db28ca264b9104f82196f92dc8843e35fd391f763d42e4ad358f5bc97e/websockets-16.1.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:61922544a0587a13fd3f53e4c0e5e606510c7b0d9d22c8444e5fae22a06b38cb", size = 186777, upload-time = "2026-07-17T22:50:45.474Z" }, + { url = "https://files.pythonhosted.org/packages/42/9c/726cb39d0cc43ae848dce4aa2acb04eecc6738b1264ec6d700bf6bcfb9f8/websockets-16.1.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:46dcaa042cd1de6c59e7d9269fa63ff7572b6df40510600b678f0826b3c7af51", size = 188682, upload-time = "2026-07-17T22:50:46.973Z" }, + { url = "https://files.pythonhosted.org/packages/be/c7/1168704de8c2dd483edabe4a22cbe4465dd8be8dd95561d214f9fe092871/websockets-16.1.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:38565aca3e01ea8734e578fb2118dade0ecb0250533f29e22b8d1a7a196cf4d0", size = 186377, upload-time = "2026-07-17T22:50:48.413Z" }, + { url = "https://files.pythonhosted.org/packages/ca/40/f9ff2d630ffce4e7dfea0b2288e1caf9ebbf9ff8a9ec9396136ce8b94935/websockets-16.1.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:42f599f4d48c7e1a3338fdaac3acd075be3b3cf02d4b274f3bf2767aedd3d217", size = 187148, upload-time = "2026-07-17T22:50:49.845Z" }, + { url = "https://files.pythonhosted.org/packages/b5/71/e177c8299f78d7cbe2d14df228643c10c70c0e86e108e092056bbcc16e46/websockets-16.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dcc04fedf83effaeb9cce98abc9469bb1b42ef85f03e01c8c1f4438ef7555737", size = 187578, upload-time = "2026-07-17T22:50:51.619Z" }, + { url = "https://files.pythonhosted.org/packages/49/b2/b6987faf330f5af5c787a2610124c2e8403d51724f9001ec4fff6311fe7a/websockets-16.1.1-cp314-cp314t-win32.whl", hash = "sha256:8483c2096363120eea8b07c06ae7304d520f686665fffd4811fad423930a65d7", size = 179729, upload-time = "2026-07-17T22:50:53.269Z" }, + { url = "https://files.pythonhosted.org/packages/a2/6e/fbac6ed878dd362fbad7d415fa4f84d38e3e33fed8cde45c64e783acf826/websockets-16.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:bcce07e23e5769375158f5efdcdafa8d5cd014b93c6683865b840ed65b96f231", size = 180072, upload-time = "2026-07-17T22:50:54.969Z" }, + { url = "https://files.pythonhosted.org/packages/be/4d/2d0d67834092e354d2b0498f014a41249a89556bc406cf86f3e1557bb463/websockets-16.1.1-py3-none-any.whl", hash = "sha256:6abbd3e82c731c8e531714466acd5d87b5e88ac3243465337ba71d68e23ae7e3", size = 173814, upload-time = "2026-07-17T22:51:04.184Z" }, +] + +[[package]] +name = "wsproto" +version = "1.3.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c7/79/12135bdf8b9c9367b8701c2c19a14c913c120b882d50b014ca0d38083c2c/wsproto-1.3.2.tar.gz", hash = "sha256:b86885dcf294e15204919950f666e06ffc6c7c114ca900b060d6e16293528294", size = 50116, upload-time = "2025-11-20T18:18:01.871Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a4/f5/10b68b7b1544245097b2a1b8238f66f2fc6dcaeb24ba5d917f52bd2eed4f/wsproto-1.3.2-py3-none-any.whl", hash = "sha256:61eea322cdf56e8cc904bd3ad7573359a242ba65688716b0710a5eb12beab584", size = 24405, upload-time = "2025-11-20T18:18:00.454Z" }, +] + +[[package]] +name = "zstandard" +version = "0.25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fd/aa/3e0508d5a5dd96529cdc5a97011299056e14c6505b678fd58938792794b1/zstandard-0.25.0.tar.gz", hash = "sha256:7713e1179d162cf5c7906da876ec2ccb9c3a9dcbdffef0cc7f70c3667a205f0b", size = 711513, upload-time = "2025-09-14T22:15:54.002Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/fc/f26eb6ef91ae723a03e16eddb198abcfce2bc5a42e224d44cc8b6765e57e/zstandard-0.25.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7b3c3a3ab9daa3eed242d6ecceead93aebbb8f5f84318d82cee643e019c4b73b", size = 795738, upload-time = "2025-09-14T22:16:56.237Z" }, + { url = "https://files.pythonhosted.org/packages/aa/1c/d920d64b22f8dd028a8b90e2d756e431a5d86194caa78e3819c7bf53b4b3/zstandard-0.25.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:913cbd31a400febff93b564a23e17c3ed2d56c064006f54efec210d586171c00", size = 640436, upload-time = "2025-09-14T22:16:57.774Z" }, + { url = "https://files.pythonhosted.org/packages/53/6c/288c3f0bd9fcfe9ca41e2c2fbfd17b2097f6af57b62a81161941f09afa76/zstandard-0.25.0-cp312-cp312-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl", hash = "sha256:011d388c76b11a0c165374ce660ce2c8efa8e5d87f34996aa80f9c0816698b64", size = 5343019, upload-time = "2025-09-14T22:16:59.302Z" }, + { url = "https://files.pythonhosted.org/packages/1e/15/efef5a2f204a64bdb5571e6161d49f7ef0fffdbca953a615efbec045f60f/zstandard-0.25.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6dffecc361d079bb48d7caef5d673c88c8988d3d33fb74ab95b7ee6da42652ea", size = 5063012, upload-time = "2025-09-14T22:17:01.156Z" }, + { url = "https://files.pythonhosted.org/packages/b7/37/a6ce629ffdb43959e92e87ebdaeebb5ac81c944b6a75c9c47e300f85abdf/zstandard-0.25.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:7149623bba7fdf7e7f24312953bcf73cae103db8cae49f8154dd1eadc8a29ecb", size = 5394148, upload-time = "2025-09-14T22:17:03.091Z" }, + { url = "https://files.pythonhosted.org/packages/e3/79/2bf870b3abeb5c070fe2d670a5a8d1057a8270f125ef7676d29ea900f496/zstandard-0.25.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6a573a35693e03cf1d67799fd01b50ff578515a8aeadd4595d2a7fa9f3ec002a", size = 5451652, upload-time = "2025-09-14T22:17:04.979Z" }, + { url = "https://files.pythonhosted.org/packages/53/60/7be26e610767316c028a2cbedb9a3beabdbe33e2182c373f71a1c0b88f36/zstandard-0.25.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5a56ba0db2d244117ed744dfa8f6f5b366e14148e00de44723413b2f3938a902", size = 5546993, upload-time = "2025-09-14T22:17:06.781Z" }, + { url = "https://files.pythonhosted.org/packages/85/c7/3483ad9ff0662623f3648479b0380d2de5510abf00990468c286c6b04017/zstandard-0.25.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:10ef2a79ab8e2974e2075fb984e5b9806c64134810fac21576f0668e7ea19f8f", size = 5046806, upload-time = "2025-09-14T22:17:08.415Z" }, + { url = "https://files.pythonhosted.org/packages/08/b3/206883dd25b8d1591a1caa44b54c2aad84badccf2f1de9e2d60a446f9a25/zstandard-0.25.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aaf21ba8fb76d102b696781bddaa0954b782536446083ae3fdaa6f16b25a1c4b", size = 5576659, upload-time = "2025-09-14T22:17:10.164Z" }, + { url = "https://files.pythonhosted.org/packages/9d/31/76c0779101453e6c117b0ff22565865c54f48f8bd807df2b00c2c404b8e0/zstandard-0.25.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1869da9571d5e94a85a5e8d57e4e8807b175c9e4a6294e3b66fa4efb074d90f6", size = 4953933, upload-time = "2025-09-14T22:17:11.857Z" }, + { url = "https://files.pythonhosted.org/packages/18/e1/97680c664a1bf9a247a280a053d98e251424af51f1b196c6d52f117c9720/zstandard-0.25.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:809c5bcb2c67cd0ed81e9229d227d4ca28f82d0f778fc5fea624a9def3963f91", size = 5268008, upload-time = "2025-09-14T22:17:13.627Z" }, + { url = "https://files.pythonhosted.org/packages/1e/73/316e4010de585ac798e154e88fd81bb16afc5c5cb1a72eeb16dd37e8024a/zstandard-0.25.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f27662e4f7dbf9f9c12391cb37b4c4c3cb90ffbd3b1fb9284dadbbb8935fa708", size = 5433517, upload-time = "2025-09-14T22:17:16.103Z" }, + { url = "https://files.pythonhosted.org/packages/5b/60/dd0f8cfa8129c5a0ce3ea6b7f70be5b33d2618013a161e1ff26c2b39787c/zstandard-0.25.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:99c0c846e6e61718715a3c9437ccc625de26593fea60189567f0118dc9db7512", size = 5814292, upload-time = "2025-09-14T22:17:17.827Z" }, + { url = "https://files.pythonhosted.org/packages/fc/5f/75aafd4b9d11b5407b641b8e41a57864097663699f23e9ad4dbb91dc6bfe/zstandard-0.25.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:474d2596a2dbc241a556e965fb76002c1ce655445e4e3bf38e5477d413165ffa", size = 5360237, upload-time = "2025-09-14T22:17:19.954Z" }, + { url = "https://files.pythonhosted.org/packages/ff/8d/0309daffea4fcac7981021dbf21cdb2e3427a9e76bafbcdbdf5392ff99a4/zstandard-0.25.0-cp312-cp312-win32.whl", hash = "sha256:23ebc8f17a03133b4426bcc04aabd68f8236eb78c3760f12783385171b0fd8bd", size = 436922, upload-time = "2025-09-14T22:17:24.398Z" }, + { url = "https://files.pythonhosted.org/packages/79/3b/fa54d9015f945330510cb5d0b0501e8253c127cca7ebe8ba46a965df18c5/zstandard-0.25.0-cp312-cp312-win_amd64.whl", hash = "sha256:ffef5a74088f1e09947aecf91011136665152e0b4b359c42be3373897fb39b01", size = 506276, upload-time = "2025-09-14T22:17:21.429Z" }, + { url = "https://files.pythonhosted.org/packages/ea/6b/8b51697e5319b1f9ac71087b0af9a40d8a6288ff8025c36486e0c12abcc4/zstandard-0.25.0-cp312-cp312-win_arm64.whl", hash = "sha256:181eb40e0b6a29b3cd2849f825e0fa34397f649170673d385f3598ae17cca2e9", size = 462679, upload-time = "2025-09-14T22:17:23.147Z" }, + { url = "https://files.pythonhosted.org/packages/35/0b/8df9c4ad06af91d39e94fa96cc010a24ac4ef1378d3efab9223cc8593d40/zstandard-0.25.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ec996f12524f88e151c339688c3897194821d7f03081ab35d31d1e12ec975e94", size = 795735, upload-time = "2025-09-14T22:17:26.042Z" }, + { url = "https://files.pythonhosted.org/packages/3f/06/9ae96a3e5dcfd119377ba33d4c42a7d89da1efabd5cb3e366b156c45ff4d/zstandard-0.25.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a1a4ae2dec3993a32247995bdfe367fc3266da832d82f8438c8570f989753de1", size = 640440, upload-time = "2025-09-14T22:17:27.366Z" }, + { url = "https://files.pythonhosted.org/packages/d9/14/933d27204c2bd404229c69f445862454dcc101cd69ef8c6068f15aaec12c/zstandard-0.25.0-cp313-cp313-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl", hash = "sha256:e96594a5537722fdfb79951672a2a63aec5ebfb823e7560586f7484819f2a08f", size = 5343070, upload-time = "2025-09-14T22:17:28.896Z" }, + { url = "https://files.pythonhosted.org/packages/6d/db/ddb11011826ed7db9d0e485d13df79b58586bfdec56e5c84a928a9a78c1c/zstandard-0.25.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:bfc4e20784722098822e3eee42b8e576b379ed72cca4a7cb856ae733e62192ea", size = 5063001, upload-time = "2025-09-14T22:17:31.044Z" }, + { url = "https://files.pythonhosted.org/packages/db/00/87466ea3f99599d02a5238498b87bf84a6348290c19571051839ca943777/zstandard-0.25.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:457ed498fc58cdc12fc48f7950e02740d4f7ae9493dd4ab2168a47c93c31298e", size = 5394120, upload-time = "2025-09-14T22:17:32.711Z" }, + { url = "https://files.pythonhosted.org/packages/2b/95/fc5531d9c618a679a20ff6c29e2b3ef1d1f4ad66c5e161ae6ff847d102a9/zstandard-0.25.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:fd7a5004eb1980d3cefe26b2685bcb0b17989901a70a1040d1ac86f1d898c551", size = 5451230, upload-time = "2025-09-14T22:17:34.41Z" }, + { url = "https://files.pythonhosted.org/packages/63/4b/e3678b4e776db00f9f7b2fe58e547e8928ef32727d7a1ff01dea010f3f13/zstandard-0.25.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8e735494da3db08694d26480f1493ad2cf86e99bdd53e8e9771b2752a5c0246a", size = 5547173, upload-time = "2025-09-14T22:17:36.084Z" }, + { url = "https://files.pythonhosted.org/packages/4e/d5/ba05ed95c6b8ec30bd468dfeab20589f2cf709b5c940483e31d991f2ca58/zstandard-0.25.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3a39c94ad7866160a4a46d772e43311a743c316942037671beb264e395bdd611", size = 5046736, upload-time = "2025-09-14T22:17:37.891Z" }, + { url = "https://files.pythonhosted.org/packages/50/d5/870aa06b3a76c73eced65c044b92286a3c4e00554005ff51962deef28e28/zstandard-0.25.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:172de1f06947577d3a3005416977cce6168f2261284c02080e7ad0185faeced3", size = 5576368, upload-time = "2025-09-14T22:17:40.206Z" }, + { url = "https://files.pythonhosted.org/packages/5d/35/398dc2ffc89d304d59bc12f0fdd931b4ce455bddf7038a0a67733a25f550/zstandard-0.25.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3c83b0188c852a47cd13ef3bf9209fb0a77fa5374958b8c53aaa699398c6bd7b", size = 4954022, upload-time = "2025-09-14T22:17:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/9a/5c/36ba1e5507d56d2213202ec2b05e8541734af5f2ce378c5d1ceaf4d88dc4/zstandard-0.25.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1673b7199bbe763365b81a4f3252b8e80f44c9e323fc42940dc8843bfeaf9851", size = 5267889, upload-time = "2025-09-14T22:17:43.577Z" }, + { url = "https://files.pythonhosted.org/packages/70/e8/2ec6b6fb7358b2ec0113ae202647ca7c0e9d15b61c005ae5225ad0995df5/zstandard-0.25.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:0be7622c37c183406f3dbf0cba104118eb16a4ea7359eeb5752f0794882fc250", size = 5433952, upload-time = "2025-09-14T22:17:45.271Z" }, + { url = "https://files.pythonhosted.org/packages/7b/01/b5f4d4dbc59ef193e870495c6f1275f5b2928e01ff5a81fecb22a06e22fb/zstandard-0.25.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:5f5e4c2a23ca271c218ac025bd7d635597048b366d6f31f420aaeb715239fc98", size = 5814054, upload-time = "2025-09-14T22:17:47.08Z" }, + { url = "https://files.pythonhosted.org/packages/b2/e5/fbd822d5c6f427cf158316d012c5a12f233473c2f9c5fe5ab1ae5d21f3d8/zstandard-0.25.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f187a0bb61b35119d1926aee039524d1f93aaf38a9916b8c4b78ac8514a0aaf", size = 5360113, upload-time = "2025-09-14T22:17:48.893Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e0/69a553d2047f9a2c7347caa225bb3a63b6d7704ad74610cb7823baa08ed7/zstandard-0.25.0-cp313-cp313-win32.whl", hash = "sha256:7030defa83eef3e51ff26f0b7bfb229f0204b66fe18e04359ce3474ac33cbc09", size = 436936, upload-time = "2025-09-14T22:17:52.658Z" }, + { url = "https://files.pythonhosted.org/packages/d9/82/b9c06c870f3bd8767c201f1edbdf9e8dc34be5b0fbc5682c4f80fe948475/zstandard-0.25.0-cp313-cp313-win_amd64.whl", hash = "sha256:1f830a0dac88719af0ae43b8b2d6aef487d437036468ef3c2ea59c51f9d55fd5", size = 506232, upload-time = "2025-09-14T22:17:50.402Z" }, + { url = "https://files.pythonhosted.org/packages/d4/57/60c3c01243bb81d381c9916e2a6d9e149ab8627c0c7d7abb2d73384b3c0c/zstandard-0.25.0-cp313-cp313-win_arm64.whl", hash = "sha256:85304a43f4d513f5464ceb938aa02c1e78c2943b29f44a750b48b25ac999a049", size = 462671, upload-time = "2025-09-14T22:17:51.533Z" }, + { url = "https://files.pythonhosted.org/packages/3d/5c/f8923b595b55fe49e30612987ad8bf053aef555c14f05bb659dd5dbe3e8a/zstandard-0.25.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:e29f0cf06974c899b2c188ef7f783607dbef36da4c242eb6c82dcd8b512855e3", size = 795887, upload-time = "2025-09-14T22:17:54.198Z" }, + { url = "https://files.pythonhosted.org/packages/8d/09/d0a2a14fc3439c5f874042dca72a79c70a532090b7ba0003be73fee37ae2/zstandard-0.25.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:05df5136bc5a011f33cd25bc9f506e7426c0c9b3f9954f056831ce68f3b6689f", size = 640658, upload-time = "2025-09-14T22:17:55.423Z" }, + { url = "https://files.pythonhosted.org/packages/5d/7c/8b6b71b1ddd517f68ffb55e10834388d4f793c49c6b83effaaa05785b0b4/zstandard-0.25.0-cp314-cp314-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl", hash = "sha256:f604efd28f239cc21b3adb53eb061e2a205dc164be408e553b41ba2ffe0ca15c", size = 5379849, upload-time = "2025-09-14T22:17:57.372Z" }, + { url = "https://files.pythonhosted.org/packages/a4/86/a48e56320d0a17189ab7a42645387334fba2200e904ee47fc5a26c1fd8ca/zstandard-0.25.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:223415140608d0f0da010499eaa8ccdb9af210a543fac54bce15babbcfc78439", size = 5058095, upload-time = "2025-09-14T22:17:59.498Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ad/eb659984ee2c0a779f9d06dbfe45e2dc39d99ff40a319895df2d3d9a48e5/zstandard-0.25.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2e54296a283f3ab5a26fc9b8b5d4978ea0532f37b231644f367aa588930aa043", size = 5551751, upload-time = "2025-09-14T22:18:01.618Z" }, + { url = "https://files.pythonhosted.org/packages/61/b3/b637faea43677eb7bd42ab204dfb7053bd5c4582bfe6b1baefa80ac0c47b/zstandard-0.25.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ca54090275939dc8ec5dea2d2afb400e0f83444b2fc24e07df7fdef677110859", size = 6364818, upload-time = "2025-09-14T22:18:03.769Z" }, + { url = "https://files.pythonhosted.org/packages/31/dc/cc50210e11e465c975462439a492516a73300ab8caa8f5e0902544fd748b/zstandard-0.25.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e09bb6252b6476d8d56100e8147b803befa9a12cea144bbe629dd508800d1ad0", size = 5560402, upload-time = "2025-09-14T22:18:05.954Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ae/56523ae9c142f0c08efd5e868a6da613ae76614eca1305259c3bf6a0ed43/zstandard-0.25.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a9ec8c642d1ec73287ae3e726792dd86c96f5681eb8df274a757bf62b750eae7", size = 4955108, upload-time = "2025-09-14T22:18:07.68Z" }, + { url = "https://files.pythonhosted.org/packages/98/cf/c899f2d6df0840d5e384cf4c4121458c72802e8bda19691f3b16619f51e9/zstandard-0.25.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a4089a10e598eae6393756b036e0f419e8c1d60f44a831520f9af41c14216cf2", size = 5269248, upload-time = "2025-09-14T22:18:09.753Z" }, + { url = "https://files.pythonhosted.org/packages/1b/c0/59e912a531d91e1c192d3085fc0f6fb2852753c301a812d856d857ea03c6/zstandard-0.25.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f67e8f1a324a900e75b5e28ffb152bcac9fbed1cc7b43f99cd90f395c4375344", size = 5430330, upload-time = "2025-09-14T22:18:11.966Z" }, + { url = "https://files.pythonhosted.org/packages/a0/1d/7e31db1240de2df22a58e2ea9a93fc6e38cc29353e660c0272b6735d6669/zstandard-0.25.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:9654dbc012d8b06fc3d19cc825af3f7bf8ae242226df5f83936cb39f5fdc846c", size = 5811123, upload-time = "2025-09-14T22:18:13.907Z" }, + { url = "https://files.pythonhosted.org/packages/f6/49/fac46df5ad353d50535e118d6983069df68ca5908d4d65b8c466150a4ff1/zstandard-0.25.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4203ce3b31aec23012d3a4cf4a2ed64d12fea5269c49aed5e4c3611b938e4088", size = 5359591, upload-time = "2025-09-14T22:18:16.465Z" }, + { url = "https://files.pythonhosted.org/packages/c2/38/f249a2050ad1eea0bb364046153942e34abba95dd5520af199aed86fbb49/zstandard-0.25.0-cp314-cp314-win32.whl", hash = "sha256:da469dc041701583e34de852d8634703550348d5822e66a0c827d39b05365b12", size = 444513, upload-time = "2025-09-14T22:18:20.61Z" }, + { url = "https://files.pythonhosted.org/packages/3a/43/241f9615bcf8ba8903b3f0432da069e857fc4fd1783bd26183db53c4804b/zstandard-0.25.0-cp314-cp314-win_amd64.whl", hash = "sha256:c19bcdd826e95671065f8692b5a4aa95c52dc7a02a4c5a0cac46deb879a017a2", size = 516118, upload-time = "2025-09-14T22:18:17.849Z" }, + { url = "https://files.pythonhosted.org/packages/f0/ef/da163ce2450ed4febf6467d77ccb4cd52c4c30ab45624bad26ca0a27260c/zstandard-0.25.0-cp314-cp314-win_arm64.whl", hash = "sha256:d7541afd73985c630bafcd6338d2518ae96060075f9463d7dc14cfb33514383d", size = 476940, upload-time = "2025-09-14T22:18:19.088Z" }, ] From 87300d7c200a6425aac8734e912e01835d3b392e Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 10:37:18 -0800 Subject: [PATCH 2/9] fail when a runner oversteps its credit --- src/ai/contrib/sandbox/runner.py | 29 +++++++++++++++----- tests/contrib/sandbox/test_runner.py | 41 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index d5dd362e..7c41dc05 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -55,7 +55,6 @@ import io import itertools import json -import math import os import pickle import runpy @@ -505,7 +504,14 @@ async def _read_replies_until_closed(self) -> None: pending.reply = status, value pending.done.set() elif stream := self._streams.get(request_id): - stream.send_nowait((status, value)) + try: + stream.send_nowait((status, value)) + except anyio.WouldBlock: + # More than it had credit for; the iterator raises + # once it finds the stream closed. + del self._streams[request_id] + stream.close() + self._abandoned.append(("cancel", request_id)) except ( anyio.EndOfStream, anyio.IncompleteRead, @@ -522,7 +528,10 @@ async def _read_replies_until_closed(self) -> None: pending.error = error pending.done.set() for stream in self._streams.values(): - stream.send_nowait(error) + try: + stream.send_nowait(error) + except anyio.WouldBlock: + stream.close() async def _send(self, request_id: int, command: tuple[Any, ...]) -> None: data = pickle.dumps((request_id, pickle.dumps(command))) @@ -566,7 +575,7 @@ async def _call(self, command: tuple[Any, ...]) -> Any: return unwrap_reply(pending.reply) async def _open_stream( - self, command: tuple[Any, ...] + self, command: tuple[Any, ...], window: int ) -> tuple[int, MemoryObjectReceiveStream[_Reply]]: """Send ``command`` and return its id and a stream of its replies. @@ -577,7 +586,9 @@ async def _open_stream( if self._closed: raise EOFError(await self._closed_message()) request_id = next(self._request_ids) - send, receive = anyio.create_memory_object_stream[_Reply](math.inf) + # Room for a window of items, the reply that ends the stream, and + # an error from here; a runner that fills it has ignored its credit. + send, receive = anyio.create_memory_object_stream[_Reply](window + 2) self._streams[request_id] = send try: await self._send(request_id, command) @@ -684,7 +695,7 @@ async def _next_streamed(self) -> tuple[str, Any]: if not self._started: self._started = True self._request_id, self._replies = await self._runner._open_stream( - ("stream", *self._call_args, self._window) + ("stream", *self._call_args, self._window), self._window ) assert self._replies is not None # Credit is sent here, not as an item is returned, so that a failed @@ -697,7 +708,11 @@ async def _next_streamed(self) -> tuple[str, Any]: ) ended = False try: - reply = await self._replies.receive() + try: + reply = await self._replies.receive() + except anyio.EndOfStream: + ended = True + raise RuntimeError("runner sent more than its credit") from None if isinstance(reply, BaseException): ended = True raise reply diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index e97a6daf..ec1f6bd0 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -5,6 +5,7 @@ import functools import gc from collections.abc import AsyncGenerator, AsyncIterator, Generator +from typing import cast import anyio import pydantic @@ -194,3 +195,43 @@ def test_window_must_be_positive() -> None: w = runner_.local_runner() with pytest.raises(ValueError, match="window"): w.iterate(fast, 1, free_running=True, window=0) + + +@contextlib.asynccontextmanager +async def _flooding_process(items: int) -> AsyncIterator[runner_.Process]: + """A runner that answers its first request with ``items`` items at once.""" + send, receive = anyio.create_memory_object_stream[bytes](items) + + class Stdin: + async def send(self, data: bytes) -> None: + if not receive.statistics().current_buffer_used: + for i in range(items): + send.send_nowait( + runner_.encode_reply(0, "ok", ["yield", i]) + ) + + class Flood: + stdin = Stdin() + stdout = receive + + async def exit_message(self) -> str: + return "flood over" + + try: + yield cast("runner_.Process", Flood()) + finally: + send.close() + receive.close() + + +async def test_items_beyond_credit_fail_the_stream() -> None: + window = 4 + async with runner_.Runner(_flooding_process(100)) as w: + seen = [] + async with w.iterate(gen, 0, free_running=True, window=window) as it: + with pytest.raises(RuntimeError, match="credit"): + async for x in it: + seen.append(x) + await anyio.sleep(0.01) + assert len(seen) <= window + 3 + assert not w._streams From 5a65ca9ce7122057756d025e6c58a112f5c91a0c Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 11:19:32 -0800 Subject: [PATCH 3/9] bound the base64 buffer size --- src/ai/contrib/sandbox/vercel.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py index fdd6e642..068bbfbc 100644 --- a/src/ai/contrib/sandbox/vercel.py +++ b/src/ai/contrib/sandbox/vercel.py @@ -183,9 +183,10 @@ def _remote_main(main_path: StrPath | None, src_dir: StrPath) -> str | None: # Sandbox command output doesn't yet pass arbitrary bytes through intact, so # the runner's stdout is piped through this, which base64-encodes each chunk # onto its own line. -_BASE64_ENCODER = """\ +_BASE64_CHUNK = 65536 +_BASE64_ENCODER = f"""\ import base64, sys -while data := sys.stdin.buffer.read1(): +while data := sys.stdin.buffer.read1({_BASE64_CHUNK}): sys.stdout.buffer.write(base64.b64encode(data) + b"\\n") sys.stdout.buffer.flush() """ @@ -223,6 +224,8 @@ def __init__(self, stream: ByteReceiveStream) -> None: async def receive(self, max_bytes: int = 65536) -> bytes: while not self._data: line, newline, rest = self._lines.partition(b"\n") + if len(line) > 2 * _BASE64_CHUNK: + raise ValueError("runner sent an overlong base64 line") if newline: self._lines = rest elif self._eof: From 27a4e5eb72b2677ced54c31e0a1ef5c1d97a0de2 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 11:37:55 -0800 Subject: [PATCH 4/9] bound message size --- src/ai/contrib/sandbox/runner.py | 34 ++++++++++++++++++++-------- src/ai/contrib/sandbox/vercel.py | 14 ++++++++++-- tests/contrib/sandbox/test_runner.py | 34 ++++++++++++++++++---------- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index 7c41dc05..95b50149 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -95,6 +95,7 @@ _LENGTH = struct.Struct(">Q") DEFAULT_WINDOW = 256 +DEFAULT_MAX_REPLY_BYTES = 64 * 1024 * 1024 class RemoteError(Exception): @@ -436,15 +437,19 @@ def __init__( self, process: AbstractAsyncContextManager[Process], main_path: str | None = None, + *, + max_reply_bytes: int = DEFAULT_MAX_REPLY_BYTES, ) -> None: self._process_cm = process self._main_path = main_path + self._max_reply_bytes = max_reply_bytes self._iter_ids = itertools.count() self._request_ids = itertools.count() self._pending: dict[int, _Pending] = {} self._streams: dict[int, MemoryObjectSendStream[_Reply]] self._streams = {} self._closed = False + self._read_error: Exception | None = None # Commands from RemoteIterator.__del__, sent with the next request. self._abandoned: list[tuple[Any, ...]] = [] @@ -484,8 +489,8 @@ async def _stop(self) -> None: self._reader_scope.cancel() await self._task_group.__aexit__(None, None, None) - async def _closed_message(self) -> str: - return await self._process.exit_message() + async def _closed_error(self) -> Exception: + return self._read_error or EOFError(await self._process.exit_message()) async def _read_replies(self) -> None: with self._reader_scope: @@ -497,6 +502,11 @@ async def _read_replies_until_closed(self) -> None: (size,) = _LENGTH.unpack( await self._stdout.receive_exactly(_LENGTH.size) ) + if size > self._max_reply_bytes: + raise ValueError( + f"runner sent a {size}-byte reply; the limit is " + f"{self._max_reply_bytes}" + ) request_id, status, value = json.loads( await self._stdout.receive_exactly(size) ) @@ -517,13 +527,12 @@ async def _read_replies_until_closed(self) -> None: anyio.IncompleteRead, anyio.BrokenResourceError, ): - error: BaseException | None = None + pass except Exception as exc: - error = exc + self._read_error = exc self._closed = True if self._pending or self._streams: - if error is None: - error = EOFError(await self._closed_message()) + error = await self._closed_error() for pending in self._pending.values(): pending.error = error pending.done.set() @@ -553,7 +562,7 @@ async def _send(self, request_id: int, command: tuple[Any, ...]) -> None: async def _call(self, command: tuple[Any, ...]) -> Any: if self._closed: - raise EOFError(await self._closed_message()) + raise await self._closed_error() request_id = next(self._request_ids) pending = self._pending[request_id] = _Pending() try: @@ -584,7 +593,7 @@ async def _open_stream( limit how many it gets. """ if self._closed: - raise EOFError(await self._closed_message()) + raise await self._closed_error() request_id = next(self._request_ids) # Room for a window of items, the reply that ends the stream, and # an error from here; a runner that fills it has ignored its credit. @@ -781,7 +790,10 @@ async def local_process( def local_runner( - main_path: str | None = None, *, python: str = sys.executable + main_path: str | None = None, + *, + python: str = sys.executable, + max_reply_bytes: int = DEFAULT_MAX_REPLY_BYTES, ) -> Runner: """Make a runner subprocess on this machine. @@ -789,7 +801,9 @@ def local_runner( """ if main_path is None: main_path = getattr(sys.modules["__main__"], "__file__", None) - return Runner(local_process(python), main_path) + return Runner( + local_process(python), main_path, max_reply_bytes=max_reply_bytes + ) # This module's name even when it runs as ``__main__``. diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py index 068bbfbc..545f0b00 100644 --- a/src/ai/contrib/sandbox/vercel.py +++ b/src/ai/contrib/sandbox/vercel.py @@ -305,6 +305,7 @@ def sandbox_runner( src_dir: StrPath = ".", target_dir: str = "workspace", env: dict[str, str] | None = None, + max_reply_bytes: int = runner_.DEFAULT_MAX_REPLY_BYTES, ) -> Runner: """Make a sandbox runner, running a copy of ``src_dir`` with ``uv run``. @@ -316,7 +317,11 @@ def sandbox_runner( process = sandbox_process( box, src_dir=src_dir, target_dir=target_dir, env=env ) - return Runner(process, _remote_main(main_path, src_dir)) + return Runner( + process, + _remote_main(main_path, src_dir), + max_reply_bytes=max_reply_bytes, + ) def _session_gone(exc: SandboxApiError | SandboxStdinError) -> bool: @@ -379,7 +384,12 @@ def pty_sandbox_runner( *, src_dir: StrPath = ".", target_dir: str = "workspace", + max_reply_bytes: int = runner_.DEFAULT_MAX_REPLY_BYTES, ) -> Runner: """Like ``sandbox_runner``, but with ``pty_sandbox_process``.""" process = pty_sandbox_process(box, src_dir=src_dir, target_dir=target_dir) - return Runner(process, _remote_main(main_path, src_dir)) + return Runner( + process, + _remote_main(main_path, src_dir), + max_reply_bytes=max_reply_bytes, + ) diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index ec1f6bd0..bfe644fb 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -198,27 +198,27 @@ def test_window_must_be_positive() -> None: @contextlib.asynccontextmanager -async def _flooding_process(items: int) -> AsyncIterator[runner_.Process]: - """A runner that answers its first request with ``items`` items at once.""" - send, receive = anyio.create_memory_object_stream[bytes](items) +async def _scripted_process( + output: list[bytes], +) -> AsyncIterator[runner_.Process]: + """A runner that answers its first request with ``output``, all at once.""" + send, receive = anyio.create_memory_object_stream[bytes](len(output)) class Stdin: async def send(self, data: bytes) -> None: - if not receive.statistics().current_buffer_used: - for i in range(items): - send.send_nowait( - runner_.encode_reply(0, "ok", ["yield", i]) - ) + while output: + send.send_nowait(output.pop(0)) - class Flood: + class Scripted: stdin = Stdin() stdout = receive async def exit_message(self) -> str: - return "flood over" + await anyio.sleep_forever() + raise AssertionError try: - yield cast("runner_.Process", Flood()) + yield cast("runner_.Process", Scripted()) finally: send.close() receive.close() @@ -226,7 +226,8 @@ async def exit_message(self) -> str: async def test_items_beyond_credit_fail_the_stream() -> None: window = 4 - async with runner_.Runner(_flooding_process(100)) as w: + flood = [runner_.encode_reply(0, "ok", ["yield", i]) for i in range(100)] + async with runner_.Runner(_scripted_process(flood)) as w: seen = [] async with w.iterate(gen, 0, free_running=True, window=window) as it: with pytest.raises(RuntimeError, match="credit"): @@ -235,3 +236,12 @@ async def test_items_beyond_credit_fail_the_stream() -> None: await anyio.sleep(0.01) assert len(seen) <= window + 3 assert not w._streams + + +async def test_oversized_reply_closes_the_runner() -> None: + reply = runner_.encode_reply(0, "ok", "x" * 100) + process = _scripted_process([reply]) + async with runner_.Runner(process, max_reply_bytes=50) as w: + for _ in range(2): + with pytest.raises(ValueError, match="limit is 50"): + await w.run(produced) From ab56b84506a7ac1cc74c1fbafac6866d8a210eb0 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 14:36:33 -0800 Subject: [PATCH 5/9] bound the stderr kept from a sandbox runner, drop the pty runner --- src/ai/contrib/sandbox/vercel.py | 127 +++++++++++-------------------- 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py index 545f0b00..f74cd486 100644 --- a/src/ai/contrib/sandbox/vercel.py +++ b/src/ai/contrib/sandbox/vercel.py @@ -16,18 +16,17 @@ import sys import tomllib from collections.abc import AsyncIterator, Iterable -from contextlib import AsyncExitStack, asynccontextmanager +from contextlib import asynccontextmanager, suppress from os import PathLike from pathlib import Path from typing import TYPE_CHECKING, Any import anyio from anyio.abc import ByteReceiveStream, ByteSendStream -from anyio.streams.buffered import BufferedByteReceiveStream from vercel.sandbox import SandboxApiError, SandboxStdinError if TYPE_CHECKING: - from vercel.sandbox import Command, InteractiveSession, Sandbox + from vercel.sandbox import Command, Sandbox from . import runner as runner_ from .runner import Process, Runner @@ -251,14 +250,19 @@ class _CommandProcess: stdin: ByteSendStream stdout: ByteReceiveStream cmd: Command + stderr: bytearray + stderr_done: anyio.Event async def exit_message(self) -> str: returncode = await self.cmd.wait() - stderr = await self.cmd.stderr.read() if self.cmd.stderr else b"" - text = stderr.decode(errors="replace") + await self.stderr_done.wait() + text = self.stderr.decode(errors="replace") return f"runner exited with {returncode}\n{text}" +_STDERR_TAIL = 65536 + + @asynccontextmanager async def sandbox_process( box: Sandbox, @@ -280,22 +284,44 @@ async def sandbox_process( stdin=subprocess.PIPE, ) assert cmd.stdin is not None and cmd.stdout is not None + raw_stderr = cmd.stderr + assert raw_stderr is not None stdout = Base64ByteReceiveStream(cmd.stdout) + stderr = bytearray() + stderr_done = anyio.Event() + + # The sandbox client buffers stderr until it's read, so it's read as it + # comes, and only its end is kept. + async def keep_stderr_tail() -> None: + try: + with suppress(Exception): + async for chunk in raw_stderr: + stderr.extend(chunk) + del stderr[:-_STDERR_TAIL] + finally: + stderr_done.set() + + task_group = anyio.create_task_group() + await task_group.__aenter__() + task_group.start_soon(keep_stderr_tail) try: - yield _CommandProcess(cmd.stdin, stdout, cmd) - except BaseException: - await protected(cmd.kill()) - raise - try: - await cmd.stdin.aclose() - await cmd.wait() - except (SandboxApiError, SandboxStdinError) as exc: - # The sandbox may have stopped, as at its execution time limit. - if not _session_gone(exc): + try: + yield _CommandProcess(cmd.stdin, stdout, cmd, stderr, stderr_done) + except BaseException: + await protected(cmd.kill()) raise - await stdout.aclose() - if cmd.stderr is not None: - await cmd.stderr.aclose() + try: + await cmd.stdin.aclose() + await cmd.wait() + except (SandboxApiError, SandboxStdinError) as exc: + # The sandbox may have stopped, as at its execution time limit. + if not _session_gone(exc): + raise + await stdout.aclose() + finally: + task_group.cancel_scope.cancel() + await task_group.__aexit__(None, None, None) + await raw_stderr.aclose() def sandbox_runner( @@ -328,68 +354,3 @@ def _session_gone(exc: SandboxApiError | SandboxStdinError) -> bool: """Whether ``exc`` says the sandbox's session is gone (HTTP 410).""" cause = exc.cause if isinstance(exc, SandboxStdinError) else exc return isinstance(cause, SandboxApiError) and cause.status_code == 410 - - -_READY = b"RUN_SYNC_READY\n" - - -@dataclasses.dataclass -class _PtyProcess: - stdin: ByteSendStream - stdout: ByteReceiveStream - pty: InteractiveSession - box: Sandbox - stderr_path: str - - async def exit_message(self) -> str: - returncode = await self.pty.wait() - stderr = await self.box.fs.read_text(self.stderr_path) - return f"runner exited with {returncode}\n{stderr}" - - -@asynccontextmanager -async def pty_sandbox_process( - box: Sandbox, *, src_dir: StrPath = ".", target_dir: str = "workspace" -) -> AsyncIterator[Process]: - """Like ``sandbox_process``, but on a PTY in raw mode, so replies are raw. - - The runner's stderr goes to a file in the sandbox instead of the terminal. - """ - sync_env = await sync_workspace(box, src_dir, target_dir) - env_args = [f"{k}={v}" for k, v in sync_env.items()] - command = shlex.join(["env", *env_args, *_uv_args()]) - stderr_path = f"/tmp/run_sync-{os.urandom(4).hex()}.err" - script = ( - f"cd {shlex.quote(target_dir)} && stty raw -echo" - f" && printf {shlex.quote(_READY.decode())}" - f" && exec {command} 2>{stderr_path}" - ) - stack = AsyncExitStack() - try: - pty = await stack.enter_async_context( - box.open_interactive("sh", ["-c", script]) - ) - stdout = BufferedByteReceiveStream(pty.stream) - await stdout.receive_until(_READY, 65536) - yield _PtyProcess(pty.stream, stdout, pty, box, stderr_path) - except BaseException: - await protected(stack.aclose()) - raise - await stack.aclose() - - -def pty_sandbox_runner( - box: Sandbox, - main_path: StrPath | None = None, - *, - src_dir: StrPath = ".", - target_dir: str = "workspace", - max_reply_bytes: int = runner_.DEFAULT_MAX_REPLY_BYTES, -) -> Runner: - """Like ``sandbox_runner``, but with ``pty_sandbox_process``.""" - process = pty_sandbox_process(box, src_dir=src_dir, target_dir=target_dir) - return Runner( - process, - _remote_main(main_path, src_dir), - max_reply_bytes=max_reply_bytes, - ) From af55f3b7ddbe14a13e4f5d6837f9f35992a7345b Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 15:05:40 -0800 Subject: [PATCH 6/9] add a timeout for aclose --- src/ai/contrib/sandbox/runner.py | 12 ++++++++++-- tests/contrib/sandbox/test_runner.py | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index 95b50149..8ec53f02 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -75,6 +75,7 @@ AbstractAsyncContextManager, AsyncExitStack, asynccontextmanager, + suppress, ) from typing import IO, TYPE_CHECKING, Any, Protocol, Self @@ -96,6 +97,7 @@ DEFAULT_WINDOW = 256 DEFAULT_MAX_REPLY_BYTES = 64 * 1024 * 1024 +_CLOSE_TIMEOUT = 20.0 class RemoteError(Exception): @@ -686,7 +688,8 @@ async def __anext__(self) -> Any: else: kind, value = await self._next_stepped() except BaseException: - await self.aclose() + with suppress(TimeoutError): + await self.aclose() raise if kind == "done": self._finished = True @@ -746,7 +749,12 @@ async def aclose(self) -> None: if self._free_running: await self._end_stream(cancel=True) elif not self._runner._closed: - await protected(self._runner._call(("close", self._id))) + + async def close() -> None: + with anyio.fail_after(_CLOSE_TIMEOUT): + await self._runner._call(("close", self._id)) + + await protected(close()) self._finished = True async def __aenter__(self) -> Self: diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index bfe644fb..677f6b62 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -44,6 +44,13 @@ def endless() -> Generator[int]: _closed.append("closed") +async def stuck() -> AsyncGenerator[int]: + try: + yield 1 + finally: + await asyncio.sleep(3600) + + def fast(n: int) -> Generator[int]: for i in range(n): _produced[0] += 1 @@ -159,6 +166,16 @@ async def test_abandoned(free_running: bool) -> None: await anyio.sleep(0.01) +async def test_close_times_out(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(runner_, "_CLOSE_TIMEOUT", 0.1) + async with _runner() as w: + it = w.iterate(stuck) + assert await it.__anext__() == 1 + with anyio.fail_after(5), pytest.raises(TimeoutError): + await it.aclose() + assert await w.run(int, "7") == 7 + + async def test_cancel_while_waiting() -> None: async with _runner() as w: with anyio.move_on_after(0.1): From a071735c066d7ff6d938e9d5da21d4c968fbb2eb Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 17:30:37 -0800 Subject: [PATCH 7/9] WIP --- src/ai/contrib/sandbox/runner.py | 11 +++++++++++ src/ai/contrib/sandbox/vercel.py | 3 +++ tests/contrib/sandbox/test_runner.py | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index 8ec53f02..58a0bb01 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -425,6 +425,8 @@ async def exit_message(self) -> str: """Describe how the process ended, once its output has closed.""" ... + async def kill(self) -> None: ... + class Runner: """A connection to a runner, used as an async context manager. @@ -532,6 +534,7 @@ async def _read_replies_until_closed(self) -> None: pass except Exception as exc: self._read_error = exc + await protected(self._process.kill()) self._closed = True if self._pending or self._streams: error = await self._closed_error() @@ -784,6 +787,14 @@ class _LocalProcess: async def exit_message(self) -> str: return f"runner exited with {await self.proc.wait()}" + async def kill(self) -> None: + self.proc.kill() + # asyncio doesn't count the process as exited until its pipes + # have closed, and one with unread output never does. + with suppress(anyio.BrokenResourceError, anyio.ClosedResourceError): + async for _ in self.stdout: + pass + @asynccontextmanager async def local_process( diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py index f74cd486..1615e8d6 100644 --- a/src/ai/contrib/sandbox/vercel.py +++ b/src/ai/contrib/sandbox/vercel.py @@ -259,6 +259,9 @@ async def exit_message(self) -> str: text = self.stderr.decode(errors="replace") return f"runner exited with {returncode}\n{text}" + async def kill(self) -> None: + await self.cmd.kill() + _STDERR_TAIL = 65536 diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index 677f6b62..eff17cfe 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -74,6 +74,10 @@ def unbuiltin() -> None: raise UnbuiltinError("nope") +def big(n: int) -> str: + return "x" * n + + def produced() -> int: return _produced[0] @@ -234,6 +238,9 @@ async def exit_message(self) -> str: await anyio.sleep_forever() raise AssertionError + async def kill(self) -> None: + pass + try: yield cast("runner_.Process", Scripted()) finally: @@ -262,3 +269,12 @@ async def test_oversized_reply_closes_the_runner() -> None: for _ in range(2): with pytest.raises(ValueError, match="limit is 50"): await w.run(produced) + + +async def test_oversized_reply_kills_the_runner() -> None: + with anyio.fail_after(10): + async with runner_.local_runner( + main_path=__file__, max_reply_bytes=50 + ) as w: + with pytest.raises(ValueError, match="limit is 50"): + await w.run(big, 10_000_000) From c5ccf76ef08b0ac116d995e6426f49cada6e0cb7 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 17:40:45 -0800 Subject: [PATCH 8/9] kill the task if it doesn't go down easy --- src/ai/contrib/sandbox/runner.py | 33 ++++++++++++++++++---------- src/ai/contrib/sandbox/vercel.py | 15 ++++++++----- tests/contrib/sandbox/test_runner.py | 6 ++--- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index 58a0bb01..2cb79ab8 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -425,8 +425,6 @@ async def exit_message(self) -> str: """Describe how the process ended, once its output has closed.""" ... - async def kill(self) -> None: ... - class Runner: """A connection to a runner, used as an async context manager. @@ -534,7 +532,6 @@ async def _read_replies_until_closed(self) -> None: pass except Exception as exc: self._read_error = exc - await protected(self._process.kill()) self._closed = True if self._pending or self._streams: error = await self._closed_error() @@ -787,14 +784,6 @@ class _LocalProcess: async def exit_message(self) -> str: return f"runner exited with {await self.proc.wait()}" - async def kill(self) -> None: - self.proc.kill() - # asyncio doesn't count the process as exited until its pipes - # have closed, and one with unread output never does. - with suppress(anyio.BrokenResourceError, anyio.ClosedResourceError): - async for _ in self.stdout: - pass - @asynccontextmanager async def local_process( @@ -805,7 +794,27 @@ async def local_process( [python, "-m", _MODULE], stderr=None ) as proc: assert proc.stdin is not None and proc.stdout is not None - yield _LocalProcess(proc.stdin, proc.stdout, proc) + stdin, stdout = proc.stdin, proc.stdout + + async def stop() -> None: + await stdin.aclose() + with anyio.move_on_after(_CLOSE_TIMEOUT): + await proc.wait() + + async def kill() -> None: + proc.kill() + # asyncio doesn't count the process as exited until its pipes + # have closed, and one with unread output never does. + with suppress(anyio.BrokenResourceError, anyio.ClosedResourceError): + async for _ in stdout: + pass + + try: + yield _LocalProcess(stdin, stdout, proc) + await protected(stop()) + finally: + if proc.returncode is None: + await protected(kill()) def local_runner( diff --git a/src/ai/contrib/sandbox/vercel.py b/src/ai/contrib/sandbox/vercel.py index 1615e8d6..ffb99e2d 100644 --- a/src/ai/contrib/sandbox/vercel.py +++ b/src/ai/contrib/sandbox/vercel.py @@ -259,9 +259,6 @@ async def exit_message(self) -> str: text = self.stderr.decode(errors="replace") return f"runner exited with {returncode}\n{text}" - async def kill(self) -> None: - await self.cmd.kill() - _STDERR_TAIL = 65536 @@ -313,9 +310,17 @@ async def keep_stderr_tail() -> None: except BaseException: await protected(cmd.kill()) raise + stdin = cmd.stdin + + async def stop() -> None: + await stdin.aclose() + with anyio.move_on_after(runner_._CLOSE_TIMEOUT) as scope: + await cmd.wait() + if scope.cancelled_caught: + await cmd.kill() + try: - await cmd.stdin.aclose() - await cmd.wait() + await protected(stop()) except (SandboxApiError, SandboxStdinError) as exc: # The sandbox may have stopped, as at its execution time limit. if not _session_gone(exc): diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index eff17cfe..da84f32c 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -238,9 +238,6 @@ async def exit_message(self) -> str: await anyio.sleep_forever() raise AssertionError - async def kill(self) -> None: - pass - try: yield cast("runner_.Process", Scripted()) finally: @@ -271,7 +268,8 @@ async def test_oversized_reply_closes_the_runner() -> None: await w.run(produced) -async def test_oversized_reply_kills_the_runner() -> None: +async def test_stuck_runner_is_killed(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(runner_, "_CLOSE_TIMEOUT", 0.5) with anyio.fail_after(10): async with runner_.local_runner( main_path=__file__, max_reply_bytes=50 From 5e596b965fa690712452b40d11fba0661fed0b0d Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Mon, 16 Nov 2026 17:44:51 -0800 Subject: [PATCH 9/9] wait for a cancelled next before closing an async iterator --- src/ai/contrib/sandbox/runner.py | 15 ++++++++++++++- tests/contrib/sandbox/test_runner.py | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/ai/contrib/sandbox/runner.py b/src/ai/contrib/sandbox/runner.py index 2cb79ab8..bfbc31fc 100644 --- a/src/ai/contrib/sandbox/runner.py +++ b/src/ai/contrib/sandbox/runner.py @@ -156,6 +156,7 @@ def __init__(self, out: IO[bytes]) -> None: self._tasks: dict[int, asyncio.Task[None]] = {} self._iterators: dict[int, Iterator[Any] | AsyncIterator[Any]] = {} self._credits: dict[int, _Credits] = {} + self._advancing: dict[int, asyncio.Task[Any]] = {} self._shutting_down = False task = asyncio.current_task() assert task is not None @@ -305,7 +306,7 @@ def _handle(self, command: tuple[Any, ...]) -> tuple[str, Any]: case ("close", iter_id): closing: Any = self._iterators.pop(iter_id, None) if hasattr(closing, "aclose"): - return "await", closing.aclose() + return "await", self._aclose(iter_id, closing) if hasattr(closing, "close"): closing.close() return "value", None @@ -329,6 +330,9 @@ def _next(self, iter_id: int, it: Iterator[Any]) -> tuple[str, Any]: async def _anext( self, iter_id: int, it: AsyncIterator[Any] ) -> tuple[str, Any]: + task = asyncio.current_task() + assert task is not None + self._advancing[iter_id] = task try: return "yield", await it.__anext__() except StopAsyncIteration: @@ -337,6 +341,15 @@ async def _anext( except BaseException: self._iterators.pop(iter_id, None) raise + finally: + del self._advancing[iter_id] + + async def _aclose(self, iter_id: int, it: Any) -> None: + # A cancelled __anext__ may still be cleaning up, and aclose() + # raises while it runs. + if advancing := self._advancing.get(iter_id): + await asyncio.wait([advancing]) + await it.aclose() class _Credits: diff --git a/tests/contrib/sandbox/test_runner.py b/tests/contrib/sandbox/test_runner.py index da84f32c..e56b10eb 100644 --- a/tests/contrib/sandbox/test_runner.py +++ b/tests/contrib/sandbox/test_runner.py @@ -51,6 +51,15 @@ async def stuck() -> AsyncGenerator[int]: await asyncio.sleep(3600) +async def slow_to_close() -> AsyncGenerator[int]: + try: + yield 1 + await asyncio.sleep(3600) + finally: + await asyncio.sleep(0.2) + _closed.append("closed") + + def fast(n: int) -> Generator[int]: for i in range(n): _produced[0] += 1 @@ -180,6 +189,16 @@ async def test_close_times_out(monkeypatch: pytest.MonkeyPatch) -> None: assert await w.run(int, "7") == 7 +async def test_cancel_while_stepping_into_slow_cleanup() -> None: + async with _runner() as w: + with anyio.move_on_after(0.3) as scope: + async with w.iterate(slow_to_close) as it: + async for _ in it: + pass + assert scope.cancelled_caught + assert await w.run(closed) == ["closed"] + + async def test_cancel_while_waiting() -> None: async with _runner() as w: with anyio.move_on_after(0.1):