feat: add sandbox and local impl

This commit is contained in:
Henry Li
2026-01-14 07:19:34 +08:00
parent 4b5f529903
commit 57a02acb59
8 changed files with 432 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from src.sandbox.local.local_sandbox import LocalSandbox
from src.sandbox.sandbox import Sandbox
from src.sandbox.sandbox_provider import SandboxProvider
_singleton: LocalSandbox | None = None
class LocalSandboxProvider(SandboxProvider):
def acquire(self) -> Sandbox:
global _singleton
if _singleton is None:
_singleton = LocalSandbox("local")
return _singleton.id
def get(self, sandbox_id: str) -> None:
if _singleton is None:
self.acquire()
return _singleton
def release(self, sandbox_id: str) -> None:
pass