cua-computer 0.4.7__py3-none-any.whl → 0.4.8__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.
@@ -36,7 +36,7 @@ class DockerProvider(BaseVMProvider):
36
36
  """
37
37
 
38
38
  def __init__(
39
- self,
39
+ self,
40
40
  port: Optional[int] = 8000,
41
41
  host: str = "localhost",
42
42
  storage: Optional[str] = None,
@@ -47,13 +47,16 @@ class DockerProvider(BaseVMProvider):
47
47
  vnc_port: Optional[int] = 6901,
48
48
  ):
49
49
  """Initialize the Docker VM Provider.
50
-
50
+
51
51
  Args:
52
52
  port: Currently unused (VM provider port)
53
53
  host: Hostname for the API server (default: localhost)
54
54
  storage: Path for persistent VM storage
55
55
  shared_path: Path for shared folder between host and container
56
56
  image: Docker image to use (default: "trycua/cua-ubuntu:latest")
57
+ Supported images:
58
+ - "trycua/cua-ubuntu:latest" (Kasm-based)
59
+ - "trycua/cua-docker-xfce:latest" (vanilla XFCE)
57
60
  verbose: Enable verbose logging
58
61
  ephemeral: Use ephemeral (temporary) storage
59
62
  vnc_port: Port for VNC interface (default: 6901)
@@ -62,19 +65,35 @@ class DockerProvider(BaseVMProvider):
62
65
  self.api_port = 8000
63
66
  self.vnc_port = vnc_port
64
67
  self.ephemeral = ephemeral
65
-
68
+
66
69
  # Handle ephemeral storage (temporary directory)
67
70
  if ephemeral:
68
71
  self.storage = "ephemeral"
69
72
  else:
70
73
  self.storage = storage
71
-
74
+
72
75
  self.shared_path = shared_path
73
76
  self.image = image
74
77
  self.verbose = verbose
75
78
  self._container_id = None
76
79
  self._running_containers = {} # Track running containers by name
80
+
81
+ # Detect image type and configure user directory accordingly
82
+ self._detect_image_config()
77
83
 
84
+ def _detect_image_config(self):
85
+ """Detect image type and configure paths accordingly."""
86
+ # Detect if this is a docker-xfce image or Kasm image
87
+ if "docker-xfce" in self.image.lower() or "xfce" in self.image.lower():
88
+ self._home_dir = "/home/cua"
89
+ self._image_type = "docker-xfce"
90
+ logger.info(f"Detected docker-xfce image: using {self._home_dir}")
91
+ else:
92
+ # Default to Kasm configuration
93
+ self._home_dir = "/home/kasm-user"
94
+ self._image_type = "kasm"
95
+ logger.info(f"Detected Kasm image: using {self._home_dir}")
96
+
78
97
  @property
79
98
  def provider_type(self) -> VMProviderType:
80
99
  """Return the provider type."""
@@ -277,12 +296,13 @@ class DockerProvider(BaseVMProvider):
277
296
  # Add volume mounts if storage is specified
278
297
  storage_path = storage or self.storage
279
298
  if storage_path and storage_path != "ephemeral":
280
- # Mount storage directory
281
- cmd.extend(["-v", f"{storage_path}:/home/kasm-user/storage"])
282
-
299
+ # Mount storage directory using detected home directory
300
+ cmd.extend(["-v", f"{storage_path}:{self._home_dir}/storage"])
301
+
283
302
  # Add shared path if specified
284
303
  if self.shared_path:
285
- cmd.extend(["-v", f"{self.shared_path}:/home/kasm-user/shared"])
304
+ # Mount shared directory using detected home directory
305
+ cmd.extend(["-v", f"{self.shared_path}:{self._home_dir}/shared"])
286
306
 
287
307
  # Add environment variables
288
308
  cmd.extend(["-e", "VNC_PW=password"]) # Set VNC password
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cua-computer
3
- Version: 0.4.7
3
+ Version: 0.4.8
4
4
  Summary: Computer-Use Interface (CUI) framework powering Cua
5
5
  Author-Email: TryCua <gh@trycua.com>
6
6
  Requires-Python: >=3.11
@@ -17,7 +17,7 @@ computer/providers/base.py,sha256=GB_TBuetNlp2vDkFYr3IUg5bQsHWHDv0g8BlSjsnFXQ,36
17
17
  computer/providers/cloud/__init__.py,sha256=SDAcfhI2BlmVBrBZOHxQd3i1bJZjMIfl7QgmqjXa4z8,144
18
18
  computer/providers/cloud/provider.py,sha256=XEdCrnZzRwvvkPHIwfhfJl3xB6W7tZKdBI0duKEXLw4,2930
19
19
  computer/providers/docker/__init__.py,sha256=Sv_78qeNyx1i7YySDHUL9trgkGv3eZXrf2BwqxFCUws,386
20
- computer/providers/docker/provider.py,sha256=_wgMhQVgxe0A984Chpb27Fu_deVy4tWuzyEmnyQ081A,20062
20
+ computer/providers/docker/provider.py,sha256=YDk4uQAu2rtr_D8PtfyxKOpYzEWDd1LLHXlWT16AVv0,21020
21
21
  computer/providers/factory.py,sha256=8TmwktXpNBsIur8XdE4HC1B21pLARpAIABSRig_8vW4,6727
22
22
  computer/providers/lume/__init__.py,sha256=E6hTbVQF5lLZD8JyG4rTwUnCBO4q9K8UkYNQ31R0h7c,193
23
23
  computer/providers/lume/provider.py,sha256=grLZeXd4Y8iYsNq2gfNGcQq1bnTcNYNepEv-mxmROG4,20562
@@ -32,7 +32,7 @@ computer/ui/__main__.py,sha256=Jwy2oC_mGZLN0fX7WLqpjaQkbXMeM3ISrUc8WSRUG0c,284
32
32
  computer/ui/gradio/__init__.py,sha256=5_KimixM48-X74FCsLw7LbSt39MQfUMEL8-M9amK3Cw,117
33
33
  computer/ui/gradio/app.py,sha256=_V6FI-g0GJGMEk-C2iPFtxPO1Gn0juCaeCrWsBtjC4E,70395
34
34
  computer/utils.py,sha256=zY50NXB7r51GNLQ6l7lhG_qv0_ufpQ8n0-SDhCei8m4,2838
35
- cua_computer-0.4.7.dist-info/METADATA,sha256=SWQCKzu495JnTmbXHCk_cvktFnYfP2touK6ZPSw7YmQ,3776
36
- cua_computer-0.4.7.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
37
- cua_computer-0.4.7.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
38
- cua_computer-0.4.7.dist-info/RECORD,,
35
+ cua_computer-0.4.8.dist-info/METADATA,sha256=kGvzQGh2TSpsfoTj1DQSK6aNy96OqLaYnNaEADDquiQ,3776
36
+ cua_computer-0.4.8.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
37
+ cua_computer-0.4.8.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
38
+ cua_computer-0.4.8.dist-info/RECORD,,