add sandbox runtime control endpoints

This commit is contained in:
Азамат Нураев 2026-04-28 21:53:26 +03:00
parent 0ca0bac9bf
commit 1b38bcfeab
17 changed files with 1408 additions and 119 deletions

View file

@ -32,3 +32,9 @@ class SandboxAlreadyRunningError(SandboxError):
def __init__(self, chat_id: str) -> None:
super().__init__('sandbox_already_running')
self.chat_id = chat_id
class SandboxConflictError(SandboxError):
def __init__(self, chat_id: str) -> None:
super().__init__('sandbox_conflict')
self.chat_id = chat_id

View file

@ -12,6 +12,12 @@ class SandboxStatus(str, Enum):
FAILED = 'failed'
@dataclass(frozen=True, slots=True)
class SandboxEndpoint:
ip: str
port: int
@dataclass(frozen=True, slots=True)
class SandboxSession:
session_id: UUID
@ -20,3 +26,6 @@ class SandboxSession:
status: SandboxStatus
created_at: datetime
expires_at: datetime
agent_id: str = ''
volume_host_path: str = ''
endpoint: SandboxEndpoint | None = None