e2b-claude-toolsets 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ """Sync and native asyncio E2B drivers for Anthropic browser and computer toolsets."""
2
+
3
+ from ._async_browser import AsyncBrowserInitializationError, AsyncE2BBrowserToolset
4
+ from ._async_computer import AsyncE2BComputerToolset
5
+ from ._browser import BrowserInitializationError, E2BBrowserToolset
6
+ from ._computer import E2BComputerToolset
7
+ from ._policy import allow_hosts
8
+ from ._uploads import UploadFile
9
+ from ._viewer import LiveView, ViewerInitializationError, live_view
10
+
11
+ __all__ = [
12
+ "E2BBrowserToolset",
13
+ "E2BComputerToolset",
14
+ "AsyncE2BBrowserToolset",
15
+ "AsyncE2BComputerToolset",
16
+ "AsyncBrowserInitializationError",
17
+ "BrowserInitializationError",
18
+ "LiveView",
19
+ "ViewerInitializationError",
20
+ "allow_hosts",
21
+ "live_view",
22
+ "UploadFile",
23
+ ]
@@ -0,0 +1,26 @@
1
+ """Finish bounded resource cleanup even if its caller is cancelled again."""
2
+
3
+ import asyncio
4
+ from collections.abc import Awaitable
5
+ from typing import TypeVar
6
+
7
+ T = TypeVar("T")
8
+
9
+
10
+ async def finish_cleanup(operation: Awaitable[T]) -> T:
11
+ task = asyncio.ensure_future(operation)
12
+ cancelled = None
13
+ while True:
14
+ try:
15
+ result = await asyncio.shield(task)
16
+ break
17
+ except asyncio.CancelledError as error:
18
+ if task.cancelled():
19
+ raise
20
+ cancelled = error
21
+ if task.done():
22
+ result = task.result()
23
+ break
24
+ if cancelled is not None:
25
+ raise cancelled
26
+ return result