cua-agent 0.4.10__tar.gz → 0.4.12__tar.gz

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.

Potentially problematic release.


This version of cua-agent might be problematic. Click here for more details.

Files changed (37) hide show
  1. {cua_agent-0.4.10 → cua_agent-0.4.12}/PKG-INFO +10 -1
  2. {cua_agent-0.4.10 → cua_agent-0.4.12}/README.md +1 -0
  3. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/cli.py +4 -4
  4. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/computer_handler.py +12 -2
  5. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/__init__.py +2 -1
  6. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/anthropic.py +601 -504
  7. cua_agent-0.4.12/agent/loops/glm45v.py +902 -0
  8. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/responses.py +45 -0
  9. {cua_agent-0.4.10 → cua_agent-0.4.12}/pyproject.toml +10 -1
  10. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/__init__.py +0 -0
  11. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/__main__.py +0 -0
  12. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/adapters/__init__.py +0 -0
  13. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/adapters/huggingfacelocal_adapter.py +0 -0
  14. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/agent.py +0 -0
  15. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/__init__.py +0 -0
  16. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/base.py +0 -0
  17. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/budget_manager.py +0 -0
  18. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/image_retention.py +0 -0
  19. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/logging.py +0 -0
  20. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/pii_anonymization.py +0 -0
  21. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/telemetry.py +0 -0
  22. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/callbacks/trajectory_saver.py +0 -0
  23. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/decorators.py +0 -0
  24. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/base.py +0 -0
  25. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/composed_grounded.py +0 -0
  26. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/gta1.py +0 -0
  27. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/model_types.csv +0 -0
  28. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/omniparser.py +0 -0
  29. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/openai.py +0 -0
  30. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/loops/uitars.py +0 -0
  31. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/telemetry.py +0 -0
  32. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/types.py +0 -0
  33. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/ui/__init__.py +0 -0
  34. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/ui/__main__.py +0 -0
  35. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/ui/gradio/__init__.py +0 -0
  36. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/ui/gradio/app.py +0 -0
  37. {cua_agent-0.4.10 → cua_agent-0.4.12}/agent/ui/gradio/ui_components.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cua-agent
3
- Version: 0.4.10
3
+ Version: 0.4.12
4
4
  Summary: CUA (Computer Use) Agent for AI-driven computer interaction
5
5
  Author-Email: TryCua <gh@trycua.com>
6
6
  Requires-Python: >=3.11
@@ -25,16 +25,24 @@ Provides-Extra: uitars
25
25
  Provides-Extra: uitars-mlx
26
26
  Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "uitars-mlx"
27
27
  Provides-Extra: uitars-hf
28
+ Requires-Dist: accelerate; extra == "uitars-hf"
29
+ Requires-Dist: torch; extra == "uitars-hf"
28
30
  Requires-Dist: transformers>=4.54.0; extra == "uitars-hf"
29
31
  Provides-Extra: ui
30
32
  Requires-Dist: gradio>=5.23.3; extra == "ui"
31
33
  Requires-Dist: python-dotenv>=1.0.1; extra == "ui"
32
34
  Provides-Extra: cli
33
35
  Requires-Dist: yaspin>=3.1.0; extra == "cli"
36
+ Provides-Extra: glm45v-hf
37
+ Requires-Dist: accelerate; extra == "glm45v-hf"
38
+ Requires-Dist: torch; extra == "glm45v-hf"
39
+ Requires-Dist: transformers-v4.55.0-GLM-4.5V-preview; extra == "glm45v-hf"
34
40
  Provides-Extra: all
35
41
  Requires-Dist: ultralytics>=8.0.0; extra == "all"
36
42
  Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "all"
37
43
  Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "all"
44
+ Requires-Dist: accelerate; extra == "all"
45
+ Requires-Dist: torch; extra == "all"
38
46
  Requires-Dist: transformers>=4.54.0; extra == "all"
39
47
  Requires-Dist: gradio>=5.23.3; extra == "all"
40
48
  Requires-Dist: python-dotenv>=1.0.1; extra == "all"
@@ -80,6 +88,7 @@ pip install "cua-agent[omni]" # Omniparser + any LLM support
80
88
  pip install "cua-agent[uitars]" # UI-TARS
81
89
  pip install "cua-agent[uitars-mlx]" # UI-TARS + MLX support
82
90
  pip install "cua-agent[uitars-hf]" # UI-TARS + Huggingface support
91
+ pip install "cua-agent[glm45v-hf]" # GLM-4.5V + Huggingface support
83
92
  pip install "cua-agent[ui]" # Gradio UI support
84
93
  ```
85
94
 
@@ -37,6 +37,7 @@ pip install "cua-agent[omni]" # Omniparser + any LLM support
37
37
  pip install "cua-agent[uitars]" # UI-TARS
38
38
  pip install "cua-agent[uitars-mlx]" # UI-TARS + MLX support
39
39
  pip install "cua-agent[uitars-hf]" # UI-TARS + Huggingface support
40
+ pip install "cua-agent[glm45v-hf]" # GLM-4.5V + Huggingface support
40
41
  pip install "cua-agent[ui]" # Gradio UI support
41
42
  ```
42
43
 
@@ -94,14 +94,14 @@ def print_action(action_type: str, details: Dict[str, Any], total_cost: float):
94
94
  # Format action details
95
95
  args_str = ""
96
96
  if action_type == "click" and "x" in details and "y" in details:
97
- args_str = f"({details['x']}, {details['y']})"
97
+ args_str = f"_{details['button']}({details['x']}, {details['y']})"
98
98
  elif action_type == "type" and "text" in details:
99
99
  text = details["text"]
100
100
  if len(text) > 50:
101
101
  text = text[:47] + "..."
102
- args_str = f'"{text}"'
103
- elif action_type == "key" and "key" in details:
104
- args_str = f"'{details['key']}'"
102
+ args_str = f'("{text}")'
103
+ elif action_type == "key" and "text" in details:
104
+ args_str = f"('{details['text']}')"
105
105
  elif action_type == "scroll" and "x" in details and "y" in details:
106
106
  args_str = f"({details['x']}, {details['y']})"
107
107
 
@@ -3,7 +3,7 @@ Computer handler implementation for OpenAI computer-use-preview protocol.
3
3
  """
4
4
 
5
5
  import base64
6
- from typing import Dict, List, Any, Literal, Union
6
+ from typing import Dict, List, Any, Literal, Union, Optional
7
7
  from .types import Computer
8
8
 
9
9
 
@@ -14,11 +14,13 @@ class OpenAIComputerHandler:
14
14
  """Initialize with a computer interface (from tool schema)."""
15
15
  self.interface = computer_interface
16
16
 
17
+ # ==== Computer-Use-Preview Action Space ====
18
+
17
19
  async def get_environment(self) -> Literal["windows", "mac", "linux", "browser"]:
18
20
  """Get the current environment type."""
19
21
  # For now, return a default - this could be enhanced to detect actual environment
20
22
  return "windows"
21
-
23
+
22
24
  async def get_dimensions(self) -> tuple[int, int]:
23
25
  """Get screen dimensions as (width, height)."""
24
26
  screen_size = await self.interface.get_screen_size()
@@ -94,6 +96,14 @@ class OpenAIComputerHandler:
94
96
  # For now, return empty string
95
97
  return ""
96
98
 
99
+ # ==== Anthropic Computer Action Space ====
100
+ async def left_mouse_down(self, x: Optional[int] = None, y: Optional[int] = None) -> None:
101
+ """Left mouse down at coordinates."""
102
+ await self.interface.mouse_down(x, y, button="left")
103
+
104
+ async def left_mouse_up(self, x: Optional[int] = None, y: Optional[int] = None) -> None:
105
+ """Left mouse up at coordinates."""
106
+ await self.interface.mouse_up(x, y, button="left")
97
107
 
98
108
  def acknowledge_safety_check_callback(message: str, allow_always: bool = False) -> bool:
99
109
  """Safety check callback for user acknowledgment."""
@@ -9,5 +9,6 @@ from . import uitars
9
9
  from . import omniparser
10
10
  from . import gta1
11
11
  from . import composed_grounded
12
+ from . import glm45v
12
13
 
13
- __all__ = ["anthropic", "openai", "uitars", "omniparser", "gta1", "composed_grounded"]
14
+ __all__ = ["anthropic", "openai", "uitars", "omniparser", "gta1", "composed_grounded", "glm45v"]