openorbit 0.3.0__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.
app/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Local Agent Improvement Console API."""
app/docker.py ADDED
@@ -0,0 +1,36 @@
1
+ """Linux-only Docker availability checks and safe executor configuration."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import platform
6
+ import shutil
7
+ import subprocess
8
+ from dataclasses import dataclass
9
+
10
+
11
+ @dataclass(frozen=True)
12
+ class DockerStatus:
13
+ supported: bool
14
+ available: bool
15
+ reason: str
16
+ version: str | None = None
17
+
18
+
19
+ def preflight_docker() -> DockerStatus:
20
+ """Return Docker Engine availability without creating images or containers."""
21
+ if platform.system() != "Linux":
22
+ return DockerStatus(False, False, "Docker parallel execution is supported on Linux only.")
23
+ executable = shutil.which("docker")
24
+ if not executable:
25
+ return DockerStatus(True, False, "Docker CLI is not installed or not on PATH.")
26
+ result = subprocess.run(
27
+ [executable, "version", "--format", "{{.Server.Version}}"],
28
+ text=True,
29
+ stdout=subprocess.PIPE,
30
+ stderr=subprocess.PIPE,
31
+ timeout=10,
32
+ check=False,
33
+ )
34
+ if result.returncode != 0:
35
+ return DockerStatus(True, False, "Docker daemon is not reachable.")
36
+ return DockerStatus(True, True, "Docker Engine is ready.", result.stdout.strip())