Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Rename agent/core packages to cua_agent/cua_core to avoid namespace collisions (#1319)

ddupontf13f728808d1
diff --git a/blog/app-use.md b/blog/app-use.md
index 1985713c2b..862eedb16b 100644
--- a/blog/app-use.md
+++ b/blog/app-use.md
@@ -83,7 +83,7 @@ python -m agent.ui.gradio.app
```python
import asyncio
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def main():
computer = Computer()
diff --git a/blog/build-your-own-operator-on-macos-2.md b/blog/build-your-own-operator-on-macos-2.md
index a6edd63bb4..75fabff7a0 100644
--- a/blog/build-your-own-operator-on-macos-2.md
+++ b/blog/build-your-own-operator-on-macos-2.md
@@ -211,7 +211,7 @@ With the `cua-agent` framework, creating a Computer-Use Agent becomes remarkably
```python
import asyncio
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def run_simple_task():
async with Computer() as macos_computer:
@@ -263,7 +263,7 @@ Another advantage of the cua-agent framework is easily chaining multiple tasks.
```python
import asyncio
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def run_multi_task_workflow():
async with Computer() as macos_computer:
@@ -355,7 +355,7 @@ One of the most powerful features of the framework is the ability to use local m
```python
import asyncio
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def run_with_local_model():
async with Computer() as macos_computer:
@@ -481,7 +481,7 @@ For a visual interface to your agent, the package also includes a Gradio UI:
1. Create a file named `launch_ui.py` with the following code:
```python
-from agent.ui.gradio.app import create_gradio_ui
+from cua_agent.ui.gradio.app import create_gradio_ui
# Create and launch the UI
if __name__ == "__main__":
@@ -575,7 +575,7 @@ Let's look at a more complex example that automates a GitHub workflow:
import asyncio
import logging
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def github_workflow():
async with Computer(verbosity=logging.INFO) as macos_computer:
diff --git a/blog/cloud-windows-ga-macos-preview.md b/blog/cloud-windows-ga-macos-preview.md
index dde36f46bf..28250489da 100644
--- a/blog/cloud-windows-ga-macos-preview.md
+++ b/blog/cloud-windows-ga-macos-preview.md
@@ -68,7 +68,7 @@ async with provider:
Run an agent on Windows to automate a workflow:
```python
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
agent = ComputerAgent(
model="anthropic/claude-sonnet-4-5-20250929",
diff --git a/blog/cua-vlm-router.md b/blog/cua-vlm-router.md
index cead5b7803..4aac106143 100644
--- a/blog/cua-vlm-router.md
+++ b/blog/cua-vlm-router.md
@@ -55,7 +55,7 @@ Use it with the Agent SDK (make sure to set your environment variable):
```python
import asyncio
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
from computer import Computer
async def main():
diff --git a/blog/hud-agent-evals.md b/blog/hud-agent-evals.md
index e179ef86da..1c7e31ec8a 100644
--- a/blog/hud-agent-evals.md
+++ b/blog/hud-agent-evals.md
@@ -34,7 +34,7 @@ export OPENAI_API_KEY="your_openai_key" # For OpenAI models
### Quick Start - Single Task
```python
-from agent.integrations.hud import run_single_task
+from cua_agent.integrations.hud import run_single_task
await run_single_task(
dataset="hud-evals/OSWorld-Verified-XLang",
@@ -46,7 +46,7 @@ await run_single_task(
### Run a dataset (parallel execution)
```python
-from agent.integrations.hud import run_full_dataset
+from cua_agent.integrations.hud import run_full_dataset
# Test on OSWorld (367 computer-use tasks)
await run_full_dataset(
diff --git a/blog/human-in-the-loop.md b/blog/human-in-the-loop.md
index c0664cd671..6ab1bea988 100644
--- a/blog/human-in-the-loop.md
+++ b/blog/human-in-the-loop.md
@@ -46,8 +46,8 @@ The web UI will show pending completions. Click any completion to take control o
Perfect for creating demonstrations or when you want full manual control:
```python
-from agent import ComputerAgent
-from agent.computer import computer
+from cua_agent import ComputerAgent
+from cua_agent.computer import computer
agent = ComputerAgent(
"human/human",
diff --git a/blog/introducing-cua-cloud-containers.md b/blog/introducing-cua-cloud-containers.md
index 872dc5b6bf..f2ac67213e 100644
--- a/blog/introducing-cua-cloud-containers.md
+++ b/blog/introducing-cua-cloud-containers.md
@@ -45,7 +45,7 @@ export CUA_CONTAINER_NAME=my-agent-container
```python
import asyncio
from computer import Computer, VMProviderType
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def run_cloud_agent():
# Create a remote Linux computer with Cua Cloud
@@ -92,7 +92,7 @@ Let's automate a complete GitHub workflow:
import asyncio
import os
from computer import Computer, VMProviderType
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def github_automation():
"""Automate GitHub repository management tasks."""
@@ -143,7 +143,7 @@ Run multiple agents in parallel to scrape different websites:
```python
import asyncio
from computer import Computer, VMProviderType
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
async def scrape_website(site_name, url):
"""Scrape a website using a cloud agent."""
diff --git a/blog/ubuntu-docker-support.md b/blog/ubuntu-docker-support.md
index 3a54aa2d4a..e308e2199f 100644
--- a/blog/ubuntu-docker-support.md
+++ b/blog/ubuntu-docker-support.md
@@ -77,7 +77,7 @@ await computer.run()
### Make an agent that drives this desktop
```python
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
# assumes `computer` is the instance created above
agent = ComputerAgent("openrouter/z-ai/glm-4.5v", tools=[computer])
@@ -121,7 +121,7 @@ A compact pattern for running multiple desktops and agents side-by-side:
```python
import asyncio
from computer import Computer
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
# Create multiple computer instances (each gets its own desktop)
computers = []
diff --git a/blog/windows-sandbox.md b/blog/windows-sandbox.md
index 141e0e4ca2..e966664d03 100644
--- a/blog/windows-sandbox.md
+++ b/blog/windows-sandbox.md
@@ -93,7 +93,7 @@ python -m agent.ui
```python
import asyncio
from computer import Computer, VMProviderType
-from agent import ComputerAgent, LLM
+from cua_agent import ComputerAgent, LLM
async def test_windows_agent():
# Create Windows Sandbox computer
diff --git a/docs/content/docs/cua/guide/advanced/custom-tools.mdx b/docs/content/docs/cua/guide/advanced/custom-tools.mdx
index 2b58aa0e5f..3628978328 100644
--- a/docs/content/docs/cua/guide/advanced/custom-tools.mdx
+++ b/docs/content/docs/cua/guide/advanced/custom-tools.mdx
@@ -29,7 +29,7 @@ agent = ComputerAgent(model="cua/microsoft/fara-7b", tools=[computer])
To silence the warning, pass the correct tool explicitly:
```python
-from agent.tools.browser_tool import BrowserTool
+from cua_agent.tools.browser_tool import BrowserTool
browser_tool = BrowserTool(interface=computer.interface)
agent = ComputerAgent(model="cua/microsoft/fara-7b", tools=[browser_tool])
diff --git a/docs/content/docs/cua/guide/fundamentals/agent-loops.mdx b/docs/content/docs/cua/guide/fundamentals/agent-loops.mdx
index 0fa73fb6d6..54493f68a6 100644
--- a/docs/content/docs/cua/guide/fundamentals/agent-loops.mdx
+++ b/docs/content/docs/cua/guide/fundamentals/agent-loops.mdx
@@ -124,7 +124,7 @@ async for result in agent.run(messages, stream=True):
The agent respects the `max_trajectory_budget` you set. When the budget is exceeded, the agent raises an exception:
```python
-from agent.exceptions import BudgetExceededException
+from cua_agent.exceptions import BudgetExceededException
agent = ComputerAgent(
model="anthropic/claude-sonnet-4-5-20250929",
diff --git a/docs/content/docs/cua/guide/fundamentals/callbacks.mdx b/docs/content/docs/cua/guide/fundamentals/callbacks.mdx
index 13bc488858..03afdcbe37 100644
--- a/docs/content/docs/cua/guide/fundamentals/callbacks.mdx
+++ b/docs/content/docs/cua/guide/fundamentals/callbacks.mdx
@@ -169,7 +169,7 @@ This is a simple way to guide agent behavior without modifying agent loops.
Callbacks can implement these hooks (all are optional):
```python
-from agent.callbacks.base import AsyncCallbackHandler
+from cua_agent.callbacks.base import AsyncCallbackHandler
class MyCallback(AsyncCallbackHandler):
async def on_run_start(self, kwargs, old_items):
@@ -214,7 +214,7 @@ class MyCallback(AsyncCallbackHandler):
Build your own callback by extending `AsyncCallbackHandler`:
```python
-from agent.callbacks.base import AsyncCallbackHandler
+from cua_agent.callbacks.base import AsyncCallbackHandler
class ActionCounterCallback(AsyncCallbackHandler):
def __init__(self):
diff --git a/docs/content/docs/cua/guide/integrations/hud.mdx b/docs/content/docs/cua/guide/integrations/hud.mdx
index 8981192f10..3656d69346 100644
--- a/docs/content/docs/cua/guide/integrations/hud.mdx
+++ b/docs/content/docs/cua/guide/integrations/hud.mdx
@@ -40,7 +40,7 @@ You can run a single task from a HUD dataset for quick verification.
### Example
```python
-from agent.integrations.hud import run_single_task
+from cua_agent.integrations.hud import run_single_task
await run_single_task(
dataset="hud-evals/OSWorld-Verified", # or another HUD dataset
@@ -61,7 +61,7 @@ To benchmark your agent at scale, you can run an entire dataset (or a subset) in
### Example
```python
-from agent.integrations.hud import run_full_dataset
+from cua_agent.integrations.hud import run_full_dataset
results = await run_full_dataset(
dataset="hud-evals/OSWorld-Verified", # can also pass a Dataset or list[dict]
diff --git a/examples/agents/test_linux_agent.py b/examples/agents/test_linux_agent.py
index b878d11bc6..64b82d6fb4 100644
--- a/examples/agents/test_linux_agent.py
+++ b/examples/agents/test_linux_agent.py
@@ -19,7 +19,7 @@ import os
import subprocess
import pytest
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
from cua_sandbox import Image, Sandbox
pytestmark = pytest.mark.asyncio
diff --git a/libs/cua-bench/cua_bench/agents/qwen35_agent.py b/libs/cua-bench/cua_bench/agents/qwen35_agent.py
index 8c292d72df..c9a14c9708 100644
--- a/libs/cua-bench/cua_bench/agents/qwen35_agent.py
+++ b/libs/cua-bench/cua_bench/agents/qwen35_agent.py
@@ -143,7 +143,7 @@ class Qwen35Agent(BaseAgent):
) -> AgentResult:
"""Run the task using the Qwen3.5 model via the CUA Computer Agent SDK."""
try:
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
except ImportError as e:
raise RuntimeError(
"qwen35-agent requires the `cua-agent` package to be installed. "
diff --git a/libs/cua-bench/cua_bench/agents/qwen3vl_agent.py b/libs/cua-bench/cua_bench/agents/qwen3vl_agent.py
index c827d680fd..0eb26ec31a 100644
--- a/libs/cua-bench/cua_bench/agents/qwen3vl_agent.py
+++ b/libs/cua-bench/cua_bench/agents/qwen3vl_agent.py
@@ -143,7 +143,7 @@ class Qwen3VLAgent(BaseAgent):
) -> AgentResult:
"""Run the task using the Qwen3-VL model via the CUA Computer Agent SDK."""
try:
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
except ImportError as e:
raise RuntimeError(
"qwen3vl-agent requires the `cua-agent` package to be installed. "
diff --git a/libs/cua-bench/cua_bench/telemetry/events.py b/libs/cua-bench/cua_bench/telemetry/events.py
index edb62793e3..41c23a44e5 100644
--- a/libs/cua-bench/cua_bench/telemetry/events.py
+++ b/libs/cua-bench/cua_bench/telemetry/events.py
@@ -19,9 +19,9 @@ import platform
from datetime import datetime, timezone
from typing import Any, Callable, Dict, Optional
-from core.telemetry import is_telemetry_enabled as _core_is_telemetry_enabled
-from core.telemetry import record_event as _core_record_event
-from core.telemetry.posthog import PostHogTelemetryClient
+from cua_core.telemetry import is_telemetry_enabled as _core_is_telemetry_enabled
+from cua_core.telemetry import record_event as _core_record_event
+from cua_core.telemetry.posthog import PostHogTelemetryClient
logger = logging.getLogger("cua_bench.telemetry")
diff --git a/libs/cua-bench/pyproject.toml b/libs/cua-bench/pyproject.toml
index 8c85789a4f..5ae9fe053f 100644
--- a/libs/cua-bench/pyproject.toml
+++ b/libs/cua-bench/pyproject.toml
@@ -53,7 +53,7 @@ dependencies = [
"docker>=7.0.0",
# CUA SDK
"cua-computer>=0.4.19",
- "cua-core>=0.1.18",
+ "cua-core>=0.3.0,<0.4.0",
"playwright>=1.55.0",
]
@@ -70,7 +70,7 @@ browser = [
# Agent support
agents = [
- "cua-agent>=0.6.2",
+ "cua-agent>=0.8.0",
"anthropic>=0.26.0",
]
diff --git a/libs/python/agent/benchmarks/utils.py b/libs/python/agent/benchmarks/utils.py
index b654cc51b6..2b66790d48 100644
--- a/libs/python/agent/benchmarks/utils.py
+++ b/libs/python/agent/benchmarks/utils.py
@@ -24,7 +24,7 @@ from tqdm import tqdm
# Add parent directory to path for imports
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
-from agent.agent import ComputerAgent
+from cua_agent.agent import ComputerAgent
from models.base import ModelProtocol
diff --git a/libs/python/agent/agent/__init__.py b/libs/python/agent/cua_agent/__init__.py
similarity index 100%
rename from libs/python/agent/agent/__init__.py
rename to libs/python/agent/cua_agent/__init__.py
diff --git a/libs/python/agent/agent/__main__.py b/libs/python/agent/cua_agent/__main__.py
similarity index 100%
rename from libs/python/agent/agent/__main__.py
rename to libs/python/agent/cua_agent/__main__.py
diff --git a/libs/python/agent/agent/adapters/__init__.py b/libs/python/agent/cua_agent/adapters/__init__.py
similarity index 100%
rename from libs/python/agent/agent/adapters/__init__.py
rename to libs/python/agent/cua_agent/adapters/__init__.py
diff --git a/libs/python/agent/agent/adapters/azure_ml_adapter.py b/libs/python/agent/cua_agent/adapters/azure_ml_adapter.py
similarity index 100%
rename from libs/python/agent/agent/adapters/azure_ml_adapter.py
rename to libs/python/agent/cua_agent/adapters/azure_ml_adapter.py
diff --git a/libs/python/agent/agent/adapters/cua_adapter.py b/libs/python/agent/cua_agent/adapters/cua_adapter.py
similarity index 99%
rename from libs/python/agent/agent/adapters/cua_adapter.py
rename to libs/python/agent/cua_agent/adapters/cua_adapter.py
index 45f7e32731..56b447ca91 100644
--- a/libs/python/agent/agent/adapters/cua_adapter.py
+++ b/libs/python/agent/cua_agent/adapters/cua_adapter.py
@@ -1,7 +1,7 @@
import os
from typing import Any, AsyncIterator, Iterator
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
from litellm import acompletion, completion
from litellm.llms.custom_llm import CustomLLM
from litellm.types.utils import GenericStreamingChunk, ModelResponse
diff --git a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py b/libs/python/agent/cua_agent/adapters/huggingfacelocal_adapter.py
similarity index 100%
rename from libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
rename to libs/python/agent/cua_agent/adapters/huggingfacelocal_adapter.py
diff --git a/libs/python/agent/agent/adapters/human_adapter.py b/libs/python/agent/cua_agent/adapters/human_adapter.py
similarity index 100%
rename from libs/python/agent/agent/adapters/human_adapter.py
rename to libs/python/agent/cua_agent/adapters/human_adapter.py
diff --git a/libs/python/agent/agent/adapters/mlxvlm_adapter.py b/libs/python/agent/cua_agent/adapters/mlxvlm_adapter.py
similarity index 100%
rename from libs/python/agent/agent/adapters/mlxvlm_adapter.py
rename to libs/python/agent/cua_agent/adapters/mlxvlm_adapter.py
diff --git a/libs/python/agent/agent/adapters/models/__init__.py b/libs/python/agent/cua_agent/adapters/models/__init__.py
similarity index 100%
rename from libs/python/agent/agent/adapters/models/__init__.py
rename to libs/python/agent/cua_agent/adapters/models/__init__.py
diff --git a/libs/python/agent/agent/adapters/models/generic.py b/libs/python/agent/cua_agent/adapters/models/generic.py
similarity index 100%
rename from libs/python/agent/agent/adapters/models/generic.py
rename to libs/python/agent/cua_agent/adapters/models/generic.py
diff --git a/libs/python/agent/agent/adapters/models/internvl.py b/libs/python/agent/cua_agent/adapters/models/internvl.py
similarity index 100%
rename from libs/python/agent/agent/adapters/models/internvl.py
rename to libs/python/agent/cua_agent/adapters/models/internvl.py
diff --git a/libs/python/agent/agent/adapters/models/opencua.py b/libs/python/agent/cua_agent/adapters/models/opencua.py
similarity index 100%
rename from libs/python/agent/agent/adapters/models/opencua.py
rename to libs/python/agent/cua_agent/adapters/models/opencua.py
diff --git a/libs/python/agent/agent/adapters/models/qwen2_5_vl.py b/libs/python/agent/cua_agent/adapters/models/qwen2_5_vl.py
similarity index 100%
rename from libs/python/agent/agent/adapters/models/qwen2_5_vl.py
rename to libs/python/agent/cua_agent/adapters/models/qwen2_5_vl.py
diff --git a/libs/python/agent/agent/adapters/yutori_adapter.py b/libs/python/agent/cua_agent/adapters/yutori_adapter.py
similarity index 100%
rename from libs/python/agent/agent/adapters/yutori_adapter.py
rename to libs/python/agent/cua_agent/adapters/yutori_adapter.py
diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/cua_agent/agent.py
similarity index 99%
rename from libs/python/agent/agent/agent.py
rename to libs/python/agent/cua_agent/agent.py
index 3d64a4dbc6..a2ea6e762c 100644
--- a/libs/python/agent/agent/agent.py
+++ b/libs/python/agent/cua_agent/agent.py
@@ -24,7 +24,7 @@ from typing import (
import litellm
import litellm.utils
-from core.telemetry import is_telemetry_enabled, record_event
+from cua_core.telemetry import is_telemetry_enabled, record_event
from litellm.responses.utils import Usage
from .adapters import (
diff --git a/libs/python/agent/agent/callbacks/__init__.py b/libs/python/agent/cua_agent/callbacks/__init__.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/__init__.py
rename to libs/python/agent/cua_agent/callbacks/__init__.py
diff --git a/libs/python/agent/agent/callbacks/base.py b/libs/python/agent/cua_agent/callbacks/base.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/base.py
rename to libs/python/agent/cua_agent/callbacks/base.py
diff --git a/libs/python/agent/agent/callbacks/budget_manager.py b/libs/python/agent/cua_agent/callbacks/budget_manager.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/budget_manager.py
rename to libs/python/agent/cua_agent/callbacks/budget_manager.py
diff --git a/libs/python/agent/agent/callbacks/image_retention.py b/libs/python/agent/cua_agent/callbacks/image_retention.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/image_retention.py
rename to libs/python/agent/cua_agent/callbacks/image_retention.py
diff --git a/libs/python/agent/agent/callbacks/logging.py b/libs/python/agent/cua_agent/callbacks/logging.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/logging.py
rename to libs/python/agent/cua_agent/callbacks/logging.py
diff --git a/libs/python/agent/agent/callbacks/operator_validator.py b/libs/python/agent/cua_agent/callbacks/operator_validator.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/operator_validator.py
rename to libs/python/agent/cua_agent/callbacks/operator_validator.py
diff --git a/libs/python/agent/agent/callbacks/otel.py b/libs/python/agent/cua_agent/callbacks/otel.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/otel.py
rename to libs/python/agent/cua_agent/callbacks/otel.py
diff --git a/libs/python/agent/agent/callbacks/pii_anonymization.py b/libs/python/agent/cua_agent/callbacks/pii_anonymization.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/pii_anonymization.py
rename to libs/python/agent/cua_agent/callbacks/pii_anonymization.py
diff --git a/libs/python/agent/agent/callbacks/prompt_instructions.py b/libs/python/agent/cua_agent/callbacks/prompt_instructions.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/prompt_instructions.py
rename to libs/python/agent/cua_agent/callbacks/prompt_instructions.py
diff --git a/libs/python/agent/agent/callbacks/telemetry.py b/libs/python/agent/cua_agent/callbacks/telemetry.py
similarity index 99%
rename from libs/python/agent/agent/callbacks/telemetry.py
rename to libs/python/agent/cua_agent/callbacks/telemetry.py
index 8836208fb5..ad58b7d2e3 100644
--- a/libs/python/agent/agent/callbacks/telemetry.py
+++ b/libs/python/agent/cua_agent/callbacks/telemetry.py
@@ -7,7 +7,7 @@ import time
import uuid
from typing import Any, Dict, List, Optional, Union
-from core.telemetry import (
+from cua_core.telemetry import (
is_telemetry_enabled,
record_event,
)
diff --git a/libs/python/agent/agent/callbacks/trajectory_saver.py b/libs/python/agent/cua_agent/callbacks/trajectory_saver.py
similarity index 100%
rename from libs/python/agent/agent/callbacks/trajectory_saver.py
rename to libs/python/agent/cua_agent/callbacks/trajectory_saver.py
diff --git a/libs/python/agent/agent/cli.py b/libs/python/agent/cua_agent/cli.py
similarity index 100%
rename from libs/python/agent/agent/cli.py
rename to libs/python/agent/cua_agent/cli.py
diff --git a/libs/python/agent/agent/computers/__init__.py b/libs/python/agent/cua_agent/computers/__init__.py
similarity index 100%
rename from libs/python/agent/agent/computers/__init__.py
rename to libs/python/agent/cua_agent/computers/__init__.py
diff --git a/libs/python/agent/agent/computers/base.py b/libs/python/agent/cua_agent/computers/base.py
similarity index 100%
rename from libs/python/agent/agent/computers/base.py
rename to libs/python/agent/cua_agent/computers/base.py
diff --git a/libs/python/agent/agent/computers/cua.py b/libs/python/agent/cua_agent/computers/cua.py
similarity index 100%
rename from libs/python/agent/agent/computers/cua.py
rename to libs/python/agent/cua_agent/computers/cua.py
diff --git a/libs/python/agent/agent/computers/custom.py b/libs/python/agent/cua_agent/computers/custom.py
similarity index 100%
rename from libs/python/agent/agent/computers/custom.py
rename to libs/python/agent/cua_agent/computers/custom.py
diff --git a/libs/python/agent/agent/computers/sandbox.py b/libs/python/agent/cua_agent/computers/sandbox.py
similarity index 100%
rename from libs/python/agent/agent/computers/sandbox.py
rename to libs/python/agent/cua_agent/computers/sandbox.py
diff --git a/libs/python/agent/agent/decorators.py b/libs/python/agent/cua_agent/decorators.py
similarity index 100%
rename from libs/python/agent/agent/decorators.py
rename to libs/python/agent/cua_agent/decorators.py
diff --git a/libs/python/agent/agent/human_tool/__init__.py b/libs/python/agent/cua_agent/human_tool/__init__.py
similarity index 100%
rename from libs/python/agent/agent/human_tool/__init__.py
rename to libs/python/agent/cua_agent/human_tool/__init__.py
diff --git a/libs/python/agent/agent/human_tool/__main__.py b/libs/python/agent/cua_agent/human_tool/__main__.py
similarity index 100%
rename from libs/python/agent/agent/human_tool/__main__.py
rename to libs/python/agent/cua_agent/human_tool/__main__.py
diff --git a/libs/python/agent/agent/human_tool/server.py b/libs/python/agent/cua_agent/human_tool/server.py
similarity index 100%
rename from libs/python/agent/agent/human_tool/server.py
rename to libs/python/agent/cua_agent/human_tool/server.py
diff --git a/libs/python/agent/agent/human_tool/ui.py b/libs/python/agent/cua_agent/human_tool/ui.py
similarity index 100%
rename from libs/python/agent/agent/human_tool/ui.py
rename to libs/python/agent/cua_agent/human_tool/ui.py
diff --git a/libs/python/agent/agent/integrations/hud/__init__.py b/libs/python/agent/cua_agent/integrations/hud/__init__.py
similarity index 99%
rename from libs/python/agent/agent/integrations/hud/__init__.py
rename to libs/python/agent/cua_agent/integrations/hud/__init__.py
index 2dd64ac4c0..73305e8230 100644
--- a/libs/python/agent/agent/integrations/hud/__init__.py
+++ b/libs/python/agent/cua_agent/integrations/hud/__init__.py
@@ -12,7 +12,7 @@ Exports:
import time
from typing import Any, Optional
-from agent.computers import is_agent_computer
+from cua_agent.computers import is_agent_computer
from datasets import Dataset, load_dataset
from hud import trace
from hud.datasets import Task, run_dataset
diff --git a/libs/python/agent/agent/integrations/hud/agent.py b/libs/python/agent/cua_agent/integrations/hud/agent.py
similarity index 97%
rename from libs/python/agent/agent/integrations/hud/agent.py
rename to libs/python/agent/cua_agent/integrations/hud/agent.py
index e830d53cfe..5bf5532817 100644
--- a/libs/python/agent/agent/integrations/hud/agent.py
+++ b/libs/python/agent/cua_agent/integrations/hud/agent.py
@@ -20,11 +20,11 @@ from typing import Any, ClassVar, Optional
import hud
import mcp.types as types
-from agent.agent import ComputerAgent as BaseComputerAgent
-from agent.callbacks import PromptInstructionsCallback
-from agent.callbacks.trajectory_saver import TrajectorySaverCallback
-from agent.computers import is_agent_computer
-from agent.responses import make_failed_tool_call_items
+from cua_agent.agent import ComputerAgent as BaseComputerAgent
+from cua_agent.callbacks import PromptInstructionsCallback
+from cua_agent.callbacks.trajectory_saver import TrajectorySaverCallback
+from cua_agent.computers import is_agent_computer
+from cua_agent.responses import make_failed_tool_call_items
from hud.agents import MCPAgent
from hud.tools.computer.settings import computer_settings
from hud.types import AgentResponse, MCPToolCall, MCPToolResult, Trace
diff --git a/libs/python/agent/agent/integrations/hud/proxy.py b/libs/python/agent/cua_agent/integrations/hud/proxy.py
similarity index 98%
rename from libs/python/agent/agent/integrations/hud/proxy.py
rename to libs/python/agent/cua_agent/integrations/hud/proxy.py
index 3b06219678..d17ee4e323 100644
--- a/libs/python/agent/agent/integrations/hud/proxy.py
+++ b/libs/python/agent/cua_agent/integrations/hud/proxy.py
@@ -12,8 +12,8 @@ import traceback
import uuid
from typing import Any, Dict, List, Optional
-from agent.agent import ComputerAgent as BaseComputerAgent
-from agent.callbacks import PromptInstructionsCallback
+from cua_agent.agent import ComputerAgent as BaseComputerAgent
+from cua_agent.callbacks import PromptInstructionsCallback
from hud.agents import OperatorAgent
from hud.tools.computer.settings import computer_settings
diff --git a/libs/python/agent/agent/loops/__init__.py b/libs/python/agent/cua_agent/loops/__init__.py
similarity index 93%
rename from libs/python/agent/agent/loops/__init__.py
rename to libs/python/agent/cua_agent/loops/__init__.py
index 1bad824017..cdba930d19 100644
--- a/libs/python/agent/agent/loops/__init__.py
+++ b/libs/python/agent/cua_agent/loops/__init__.py
@@ -1,50 +1,50 @@
-"""
-Agent loops for agent
-"""
-
-# Import the loops to register them
-from . import (
- anthropic,
- composed_grounded,
- fara,
- gelato,
- gemini,
- generic_vlm,
- glm45v,
- gta1,
- holo,
- internvl,
- moondream3,
- omniparser,
- openai,
- opencua,
- qwen3vl,
- qwen35,
- uiins,
- uitars,
- uitars2,
- yutori,
-)
-
-__all__ = [
- "anthropic",
- "composed_grounded",
- "gelato",
- "gemini",
- "generic_vlm",
- "fara",
- "glm45v",
- "gta1",
- "holo",
- "internvl",
- "moondream3",
- "omniparser",
- "openai",
- "opencua",
- "qwen3vl",
- "qwen35",
- "uiins",
- "uitars",
- "uitars2",
- "yutori",
-]
+"""
+Agent loops for agent
+"""
+
+# Import the loops to register them
+from . import (
+ anthropic,
+ composed_grounded,
+ fara,
+ gelato,
+ gemini,
+ generic_vlm,
+ glm45v,
+ gta1,
+ holo,
+ internvl,
+ moondream3,
+ omniparser,
+ openai,
+ opencua,
+ qwen3vl,
+ qwen35,
+ uiins,
+ uitars,
+ uitars2,
+ yutori,
+)
+
+__all__ = [
+ "anthropic",
+ "composed_grounded",
+ "gelato",
+ "gemini",
+ "generic_vlm",
+ "fara",
+ "glm45v",
+ "gta1",
+ "holo",
+ "internvl",
+ "moondream3",
+ "omniparser",
+ "openai",
+ "opencua",
+ "qwen3vl",
+ "qwen35",
+ "uiins",
+ "uitars",
+ "uitars2",
+ "yutori",
+]
diff --git a/libs/python/agent/agent/loops/anthropic.py b/libs/python/agent/cua_agent/loops/anthropic.py
similarity index 100%
rename from libs/python/agent/agent/loops/anthropic.py
rename to libs/python/agent/cua_agent/loops/anthropic.py
diff --git a/libs/python/agent/agent/loops/base.py b/libs/python/agent/cua_agent/loops/base.py
similarity index 100%
rename from libs/python/agent/agent/loops/base.py
rename to libs/python/agent/cua_agent/loops/base.py
diff --git a/libs/python/agent/agent/loops/composed_grounded.py b/libs/python/agent/cua_agent/loops/composed_grounded.py
similarity index 100%
rename from libs/python/agent/agent/loops/composed_grounded.py
rename to libs/python/agent/cua_agent/loops/composed_grounded.py
diff --git a/libs/python/agent/agent/loops/fara/__init__.py b/libs/python/agent/cua_agent/loops/fara/__init__.py
similarity index 100%
rename from libs/python/agent/agent/loops/fara/__init__.py
rename to libs/python/agent/cua_agent/loops/fara/__init__.py
diff --git a/libs/python/agent/agent/loops/fara/config.py b/libs/python/agent/cua_agent/loops/fara/config.py
similarity index 100%
rename from libs/python/agent/agent/loops/fara/config.py
rename to libs/python/agent/cua_agent/loops/fara/config.py
diff --git a/libs/python/agent/agent/loops/fara/helpers.py b/libs/python/agent/cua_agent/loops/fara/helpers.py
similarity index 100%
rename from libs/python/agent/agent/loops/fara/helpers.py
rename to libs/python/agent/cua_agent/loops/fara/helpers.py
diff --git a/libs/python/agent/agent/loops/fara/schema.py b/libs/python/agent/cua_agent/loops/fara/schema.py
similarity index 100%
rename from libs/python/agent/agent/loops/fara/schema.py
rename to libs/python/agent/cua_agent/loops/fara/schema.py
diff --git a/libs/python/agent/agent/loops/gelato.py b/libs/python/agent/cua_agent/loops/gelato.py
similarity index 96%
rename from libs/python/agent/agent/loops/gelato.py
rename to libs/python/agent/cua_agent/loops/gelato.py
index e3032472dd..f97a3ab8f7 100644
--- a/libs/python/agent/agent/loops/gelato.py
+++ b/libs/python/agent/cua_agent/loops/gelato.py
@@ -1,183 +1,183 @@
-"""
-Gelato agent loop implementation for click prediction using litellm.acompletion
-Model: https://huggingface.co/mlfoundations/Gelato-30B-A3B
-Code: https://github.com/mlfoundations/Gelato/tree/main
-"""
-
-import base64
-import math
-import re
-from io import BytesIO
-from typing import Any, Dict, List, Optional, Tuple
-
-import litellm
-from PIL import Image
-
-from ..decorators import register_agent
-from ..loops.base import AsyncAgentConfig
-from ..types import AgentCapability
-
-SYSTEM_PROMPT = """
-You are an expert UI element locator. Given a GUI image and a user's element description, provide the coordinates of the specified element as a single (x,y) point. For elements with area, return the center point.
-
-Output the coordinate pair exactly:
-(x,y)
-"""
-
-
-def extract_coordinates(raw_string):
- """
- Extract the coordinates from the raw string.
- Args:
- raw_string: str (e.g. "(100, 200)")
- Returns:
- x: float (e.g. 100.0)
- y: float (e.g. 200.0)
- """
- try:
- matches = re.findall(r"\((-?\d*\.?\d+),\s*(-?\d*\.?\d+)\)", raw_string)
- return [tuple(map(int, match)) for match in matches][0]
- except:
- return 0, 0
-
-
-def smart_resize(
- height: int,
- width: int,
- factor: int = 28,
- min_pixels: int = 3136,
- max_pixels: int = 8847360,
-) -> Tuple[int, int]:
- """Smart resize function similar to qwen_vl_utils."""
- # Calculate the total pixels
- total_pixels = height * width
-
- # If already within bounds, return original dimensions
- if min_pixels <= total_pixels <= max_pixels:
- # Round to nearest factor
- new_height = (height // factor) * factor
- new_width = (width // factor) * factor
- return new_height, new_width
-
- # Calculate scaling factor
- if total_pixels > max_pixels:
- scale = (max_pixels / total_pixels) ** 0.5
- else:
- scale = (min_pixels / total_pixels) ** 0.5
-
- # Apply scaling
- new_height = int(height * scale)
- new_width = int(width * scale)
-
- # Round to nearest factor
- new_height = (new_height // factor) * factor
- new_width = (new_width // factor) * factor
-
- # Ensure minimum size
- new_height = max(new_height, factor)
- new_width = max(new_width, factor)
-
- return new_height, new_width
-
-
-@register_agent(models=r".*Gelato.*")
-class GelatoConfig(AsyncAgentConfig):
- """Gelato agent configuration implementing AsyncAgentConfig protocol for click prediction."""
-
- def __init__(self):
- self.current_model = None
- self.last_screenshot_b64 = None
-
- async def predict_step(
- self,
- messages: List[Dict[str, Any]],
- model: str,
- tools: Optional[List[Dict[str, Any]]] = None,
- max_retries: Optional[int] = None,
- stream: bool = False,
- computer_handler=None,
- _on_api_start=None,
- _on_api_end=None,
- _on_usage=None,
- _on_screenshot=None,
- **kwargs,
- ) -> Dict[str, Any]:
- raise NotImplementedError()
-
- async def predict_click(
- self, model: str, image_b64: str, instruction: str, **kwargs
- ) -> Optional[Tuple[float, float]]:
- """
- Predict click coordinates using UI-Ins model via litellm.acompletion.
-
- Args:
- model: The UI-Ins model name
- image_b64: Base64 encoded image
- instruction: Instruction for where to click
-
- Returns:
- Tuple of (x, y) coordinates or None if prediction fails
- """
- # Decode base64 image
- image_data = base64.b64decode(image_b64)
- image = Image.open(BytesIO(image_data))
- width, height = image.width, image.height
-
- # Smart resize the image (similar to qwen_vl_utils)
- resized_height, resized_width = smart_resize(
- height,
- width,
- factor=28, # Default factor for Qwen models
- min_pixels=3136,
- max_pixels=4096 * 2160,
- )
- resized_image = image.resize((resized_width, resized_height))
- scale_x, scale_y = width / resized_width, height / resized_height
-
- # Convert resized image back to base64
- buffered = BytesIO()
- resized_image.save(buffered, format="PNG")
- resized_image_b64 = base64.b64encode(buffered.getvalue()).decode()
-
- # Prepare system and user messages
- system_message = {
- "role": "system",
- "content": [{"type": "text", "text": SYSTEM_PROMPT.strip()}],
- }
-
- user_message = {
- "role": "user",
- "content": [
- {
- "type": "image_url",
- "image_url": {"url": f"data:image/png;base64,{resized_image_b64}"},
- },
- {"type": "text", "text": instruction},
- ],
- }
-
- # Prepare API call kwargs
- api_kwargs = {
- "model": model,
- "messages": [system_message, user_message],
- "max_tokens": 2056,
- "temperature": 0.0,
- **kwargs,
- }
-
- # Use liteLLM acompletion
- response = await litellm.acompletion(**api_kwargs)
-
- # Extract response text
- output_text = response.choices[0].message.content # type: ignore
-
- # Extract and rescale coordinates
- pred_x, pred_y = extract_coordinates(output_text) # type: ignore
- pred_x *= scale_x
- pred_y *= scale_y
-
- return (math.floor(pred_x), math.floor(pred_y))
-
- def get_capabilities(self) -> List[AgentCapability]:
- """Return the capabilities supported by this agent."""
- return ["click"]
+"""
+Gelato agent loop implementation for click prediction using litellm.acompletion
+Model: https://huggingface.co/mlfoundations/Gelato-30B-A3B
+Code: https://github.com/mlfoundations/Gelato/tree/main
+"""
+
+import base64
+import math
+import re
+from io import BytesIO
+from typing import Any, Dict, List, Optional, Tuple
+
+import litellm
+from PIL import Image
+
+from ..decorators import register_agent
+from ..loops.base import AsyncAgentConfig
+from ..types import AgentCapability
+
+SYSTEM_PROMPT = """
+You are an expert UI element locator. Given a GUI image and a user's element description, provide the coordinates of the specified element as a single (x,y) point. For elements with area, return the center point.
+
+Output the coordinate pair exactly:
+(x,y)
+"""
+
+
+def extract_coordinates(raw_string):
+ """
+ Extract the coordinates from the raw string.
+ Args:
+ raw_string: str (e.g. "(100, 200)")
+ Returns:
+ x: float (e.g. 100.0)
+ y: float (e.g. 200.0)
+ """
+ try:
+ matches = re.findall(r"\((-?\d*\.?\d+),\s*(-?\d*\.?\d+)\)", raw_string)
+ return [tuple(map(int, match)) for match in matches][0]
+ except:
+ return 0, 0
+
+
+def smart_resize(
+ height: int,
+ width: int,
+ factor: int = 28,
+ min_pixels: int = 3136,
+ max_pixels: int = 8847360,
+) -> Tuple[int, int]:
+ """Smart resize function similar to qwen_vl_utils."""
+ # Calculate the total pixels
+ total_pixels = height * width
+
+ # If already within bounds, return original dimensions
+ if min_pixels <= total_pixels <= max_pixels:
+ # Round to nearest factor
+ new_height = (height // factor) * factor
+ new_width = (width // factor) * factor
+ return new_height, new_width
+
+ # Calculate scaling factor
+ if total_pixels > max_pixels:
+ scale = (max_pixels / total_pixels) ** 0.5
+ else:
+ scale = (min_pixels / total_pixels) ** 0.5
+
+ # Apply scaling
+ new_height = int(height * scale)
+ new_width = int(width * scale)
+
+ # Round to nearest factor
+ new_height = (new_height // factor) * factor
+ new_width = (new_width // factor) * factor
+
+ # Ensure minimum size
+ new_height = max(new_height, factor)
+ new_width = max(new_width, factor)
+
+ return new_height, new_width
+
+
+@register_agent(models=r".*Gelato.*")
+class GelatoConfig(AsyncAgentConfig):
+ """Gelato agent configuration implementing AsyncAgentConfig protocol for click prediction."""
+
+ def __init__(self):
+ self.current_model = None
+ self.last_screenshot_b64 = None
+
+ async def predict_step(
+ self,
+ messages: List[Dict[str, Any]],
+ model: str,
+ tools: Optional[List[Dict[str, Any]]] = None,
+ max_retries: Optional[int] = None,
+ stream: bool = False,
+ computer_handler=None,
+ _on_api_start=None,
+ _on_api_end=None,
+ _on_usage=None,
+ _on_screenshot=None,
+ **kwargs,
+ ) -> Dict[str, Any]:
+ raise NotImplementedError()
+
+ async def predict_click(
+ self, model: str, image_b64: str, instruction: str, **kwargs
+ ) -> Optional[Tuple[float, float]]:
+ """
+ Predict click coordinates using UI-Ins model via litellm.acompletion.
+
+ Args:
+ model: The UI-Ins model name
+ image_b64: Base64 encoded image
+ instruction: Instruction for where to click
+
+ Returns:
+ Tuple of (x, y) coordinates or None if prediction fails
+ """
+ # Decode base64 image
+ image_data = base64.b64decode(image_b64)
+ image = Image.open(BytesIO(image_data))
+ width, height = image.width, image.height
+
+ # Smart resize the image (similar to qwen_vl_utils)
+ resized_height, resized_width = smart_resize(
+ height,
+ width,
+ factor=28, # Default factor for Qwen models
+ min_pixels=3136,
+ max_pixels=4096 * 2160,
+ )
+ resized_image = image.resize((resized_width, resized_height))
+ scale_x, scale_y = width / resized_width, height / resized_height
+
+ # Convert resized image back to base64
+ buffered = BytesIO()
+ resized_image.save(buffered, format="PNG")
+ resized_image_b64 = base64.b64encode(buffered.getvalue()).decode()
+
+ # Prepare system and user messages
+ system_message = {
+ "role": "system",
+ "content": [{"type": "text", "text": SYSTEM_PROMPT.strip()}],
+ }
+
+ user_message = {
+ "role": "user",
+ "content": [
+ {
+ "type": "image_url",
+ "image_url": {"url": f"data:image/png;base64,{resized_image_b64}"},
+ },
+ {"type": "text", "text": instruction},
+ ],
+ }
+
+ # Prepare API call kwargs
+ api_kwargs = {
+ "model": model,
+ "messages": [system_message, user_message],
+ "max_tokens": 2056,
+ "temperature": 0.0,
+ **kwargs,
+ }
+
+ # Use liteLLM acompletion
+ response = await litellm.acompletion(**api_kwargs)
+
+ # Extract response text
+ output_text = response.choices[0].message.content # type: ignore
+
+ # Extract and rescale coordinates
+ pred_x, pred_y = extract_coordinates(output_text) # type: ignore
+ pred_x *= scale_x
+ pred_y *= scale_y
+
+ return (math.floor(pred_x), math.floor(pred_y))
+
+ def get_capabilities(self) -> List[AgentCapability]:
+ """Return the capabilities supported by this agent."""
+ return ["click"]
diff --git a/libs/python/agent/agent/loops/gemini.py b/libs/python/agent/cua_agent/loops/gemini.py
similarity index 100%
rename from libs/python/agent/agent/loops/gemini.py
rename to libs/python/agent/cua_agent/loops/gemini.py
diff --git a/libs/python/agent/agent/loops/generic_vlm.py b/libs/python/agent/cua_agent/loops/generic_vlm.py
similarity index 100%
rename from libs/python/agent/agent/loops/generic_vlm.py
rename to libs/python/agent/cua_agent/loops/generic_vlm.py
diff --git a/libs/python/agent/agent/loops/glm45v.py b/libs/python/agent/cua_agent/loops/glm45v.py
similarity index 100%
rename from libs/python/agent/agent/loops/glm45v.py
rename to libs/python/agent/cua_agent/loops/glm45v.py
diff --git a/libs/python/agent/agent/loops/gta1.py b/libs/python/agent/cua_agent/loops/gta1.py
similarity index 100%
rename from libs/python/agent/agent/loops/gta1.py
rename to libs/python/agent/cua_agent/loops/gta1.py
diff --git a/libs/python/agent/agent/loops/holo.py b/libs/python/agent/cua_agent/loops/holo.py
similarity index 100%
rename from libs/python/agent/agent/loops/holo.py
rename to libs/python/agent/cua_agent/loops/holo.py
diff --git a/libs/python/agent/agent/loops/internvl.py b/libs/python/agent/cua_agent/loops/internvl.py
similarity index 100%
rename from libs/python/agent/agent/loops/internvl.py
rename to libs/python/agent/cua_agent/loops/internvl.py
diff --git a/libs/python/agent/agent/loops/model_types.csv b/libs/python/agent/cua_agent/loops/model_types.csv
similarity index 100%
rename from libs/python/agent/agent/loops/model_types.csv
rename to libs/python/agent/cua_agent/loops/model_types.csv
diff --git a/libs/python/agent/agent/loops/moondream3.py b/libs/python/agent/cua_agent/loops/moondream3.py
similarity index 100%
rename from libs/python/agent/agent/loops/moondream3.py
rename to libs/python/agent/cua_agent/loops/moondream3.py
diff --git a/libs/python/agent/agent/loops/omniparser.py b/libs/python/agent/cua_agent/loops/omniparser.py
similarity index 100%
rename from libs/python/agent/agent/loops/omniparser.py
rename to libs/python/agent/cua_agent/loops/omniparser.py
diff --git a/libs/python/agent/agent/loops/openai.py b/libs/python/agent/cua_agent/loops/openai.py
similarity index 100%
rename from libs/python/agent/agent/loops/openai.py
rename to libs/python/agent/cua_agent/loops/openai.py
diff --git a/libs/python/agent/agent/loops/opencua.py b/libs/python/agent/cua_agent/loops/opencua.py
similarity index 100%
rename from libs/python/agent/agent/loops/opencua.py
rename to libs/python/agent/cua_agent/loops/opencua.py
diff --git a/libs/python/agent/agent/loops/qwen35.py b/libs/python/agent/cua_agent/loops/qwen35.py
similarity index 100%
rename from libs/python/agent/agent/loops/qwen35.py
rename to libs/python/agent/cua_agent/loops/qwen35.py
diff --git a/libs/python/agent/agent/loops/qwen3vl.py b/libs/python/agent/cua_agent/loops/qwen3vl.py
similarity index 100%
rename from libs/python/agent/agent/loops/qwen3vl.py
rename to libs/python/agent/cua_agent/loops/qwen3vl.py
diff --git a/libs/python/agent/agent/loops/uiins.py b/libs/python/agent/cua_agent/loops/uiins.py
similarity index 97%
rename from libs/python/agent/agent/loops/uiins.py
rename to libs/python/agent/cua_agent/loops/uiins.py
index 109569481e..62a4ede69b 100644
--- a/libs/python/agent/agent/loops/uiins.py
+++ b/libs/python/agent/cua_agent/loops/uiins.py
@@ -1,175 +1,175 @@
-"""
-UI-Ins agent loop implementation for click prediction using litellm.acompletion
-Paper: https://arxiv.org/pdf/2510.202861
-Code: https://github.com/alibaba/UI-Ins
-"""
-
-import asyncio
-import base64
-import json
-import math
-import re
-import uuid
-from io import BytesIO
-from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
-
-import litellm
-from PIL import Image
-
-from ..decorators import register_agent
-from ..loops.base import AsyncAgentConfig
-from ..types import AgentCapability, AgentResponse, Messages, Tools
-
-SYSTEM_PROMPT = """You are a GUI agent. You are given a task and your action history, with screenshots. You need to perform the next action to complete the task.\n\n## Output Format\nReturn a json object with a reasoning process in tags, a function name and arguments within XML tags:\n```\n\n...\n\n\n{"name": "grounding", "arguments": }\n\n```\n represents the following item of the action space:\n## Action Space{"action": "click", "coordinate": [x, y]}\nYour task is to accurately locate a UI element based on the instruction. You should first analyze instruction in tags and finally output the function in tags.\n"""
-
-
-def parse_coordinates(raw_string: str) -> tuple[int, int]:
- matches = re.findall(r"\[(\d+),\s*(\d+)\]", raw_string)
- if matches:
- return tuple(map(int, matches[0]))
- return -1, -1
-
-
-def smart_resize(
- height: int,
- width: int,
- factor: int = 28,
- min_pixels: int = 3136,
- max_pixels: int = 8847360,
-) -> Tuple[int, int]:
- """Smart resize function similar to qwen_vl_utils."""
- # Calculate the total pixels
- total_pixels = height * width
-
- # If already within bounds, return original dimensions
- if min_pixels <= total_pixels <= max_pixels:
- # Round to nearest factor
- new_height = (height // factor) * factor
- new_width = (width // factor) * factor
- return new_height, new_width
-
- # Calculate scaling factor
- if total_pixels > max_pixels:
- scale = (max_pixels / total_pixels) ** 0.5
- else:
- scale = (min_pixels / total_pixels) ** 0.5
-
- # Apply scaling
- new_height = int(height * scale)
- new_width = int(width * scale)
-
- # Round to nearest factor
- new_height = (new_height // factor) * factor
- new_width = (new_width // factor) * factor
-
- # Ensure minimum size
- new_height = max(new_height, factor)
- new_width = max(new_width, factor)
-
- return new_height, new_width
-
-
-@register_agent(models=r".*UI-Ins.*")
-class UIInsConfig(AsyncAgentConfig):
- """UI-Ins agent configuration implementing AsyncAgentConfig protocol for click prediction."""
-
- def __init__(self):
- self.current_model = None
- self.last_screenshot_b64 = None
-
- async def predict_step(
- self,
- messages: List[Dict[str, Any]],
- model: str,
- tools: Optional[List[Dict[str, Any]]] = None,
- max_retries: Optional[int] = None,
- stream: bool = False,
- computer_handler=None,
- _on_api_start=None,
- _on_api_end=None,
- _on_usage=None,
- _on_screenshot=None,
- **kwargs,
- ) -> Dict[str, Any]:
- raise NotImplementedError()
-
- async def predict_click(
- self, model: str, image_b64: str, instruction: str, **kwargs
- ) -> Optional[Tuple[float, float]]:
- """
- Predict click coordinates using UI-Ins model via litellm.acompletion.
-
- Args:
- model: The UI-Ins model name
- image_b64: Base64 encoded image
- instruction: Instruction for where to click
-
- Returns:
- Tuple of (x, y) coordinates or None if prediction fails
- """
- # Decode base64 image
- image_data = base64.b64decode(image_b64)
- image = Image.open(BytesIO(image_data))
- width, height = image.width, image.height
-
- # Smart resize the image (similar to qwen_vl_utils)
- resized_height, resized_width = smart_resize(
- height,
- width,
- factor=28, # Default factor for Qwen models
- min_pixels=3136,
- max_pixels=4096 * 2160,
- )
- resized_image = image.resize((resized_width, resized_height))
- scale_x, scale_y = width / resized_width, height / resized_height
-
- # Convert resized image back to base64
- buffered = BytesIO()
- resized_image.save(buffered, format="PNG")
- resized_image_b64 = base64.b64encode(buffered.getvalue()).decode()
-
- # Prepare system and user messages
- system_message = {
- "role": "system",
- "content": [
- {"type": "text", "text": "You are a helpful assistant."},
- {"type": "text", "text": SYSTEM_PROMPT},
- ],
- }
-
- user_message = {
- "role": "user",
- "content": [
- {
- "type": "image_url",
- "image_url": {"url": f"data:image/png;base64,{resized_image_b64}"},
- },
- {"type": "text", "text": instruction},
- ],
- }
-
- # Prepare API call kwargs
- api_kwargs = {
- "model": model,
- "messages": [system_message, user_message],
- "max_tokens": 2056,
- "temperature": 0.0,
- **kwargs,
- }
-
- # Use liteLLM acompletion
- response = await litellm.acompletion(**api_kwargs)
-
- # Extract response text
- output_text = response.choices[0].message.content # type: ignore
-
- # Extract and rescale coordinates
- pred_x, pred_y = parse_coordinates(output_text) # type: ignore
- pred_x *= scale_x
- pred_y *= scale_y
-
- return (math.floor(pred_x), math.floor(pred_y))
-
- def get_capabilities(self) -> List[AgentCapability]:
- """Return the capabilities supported by this agent."""
- return ["click"]
+"""
+UI-Ins agent loop implementation for click prediction using litellm.acompletion
+Paper: https://arxiv.org/pdf/2510.202861
+Code: https://github.com/alibaba/UI-Ins
+"""
+
+import asyncio
+import base64
+import json
+import math
+import re
+import uuid
+from io import BytesIO
+from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
+
+import litellm
+from PIL import Image
+
+from ..decorators import register_agent
+from ..loops.base import AsyncAgentConfig
+from ..types import AgentCapability, AgentResponse, Messages, Tools
+
+SYSTEM_PROMPT = """You are a GUI agent. You are given a task and your action history, with screenshots. You need to perform the next action to complete the task.\n\n## Output Format\nReturn a json object with a reasoning process in tags, a function name and arguments within XML tags:\n```\n\n...\n\n\n{"name": "grounding", "arguments": }\n\n```\n represents the following item of the action space:\n## Action Space{"action": "click", "coordinate": [x, y]}\nYour task is to accurately locate a UI element based on the instruction. You should first analyze instruction in tags and finally output the function in tags.\n"""
+
+
+def parse_coordinates(raw_string: str) -> tuple[int, int]:
+ matches = re.findall(r"\[(\d+),\s*(\d+)\]", raw_string)
+ if matches:
+ return tuple(map(int, matches[0]))
+ return -1, -1
+
+
+def smart_resize(
+ height: int,
+ width: int,
+ factor: int = 28,
+ min_pixels: int = 3136,
+ max_pixels: int = 8847360,
+) -> Tuple[int, int]:
+ """Smart resize function similar to qwen_vl_utils."""
+ # Calculate the total pixels
+ total_pixels = height * width
+
+ # If already within bounds, return original dimensions
+ if min_pixels <= total_pixels <= max_pixels:
+ # Round to nearest factor
+ new_height = (height // factor) * factor
+ new_width = (width // factor) * factor
+ return new_height, new_width
+
+ # Calculate scaling factor
+ if total_pixels > max_pixels:
+ scale = (max_pixels / total_pixels) ** 0.5
+ else:
+ scale = (min_pixels / total_pixels) ** 0.5
+
+ # Apply scaling
+ new_height = int(height * scale)
+ new_width = int(width * scale)
+
+ # Round to nearest factor
+ new_height = (new_height // factor) * factor
+ new_width = (new_width // factor) * factor
+
+ # Ensure minimum size
+ new_height = max(new_height, factor)
+ new_width = max(new_width, factor)
+
+ return new_height, new_width
+
+
+@register_agent(models=r".*UI-Ins.*")
+class UIInsConfig(AsyncAgentConfig):
+ """UI-Ins agent configuration implementing AsyncAgentConfig protocol for click prediction."""
+
+ def __init__(self):
+ self.current_model = None
+ self.last_screenshot_b64 = None
+
+ async def predict_step(
+ self,
+ messages: List[Dict[str, Any]],
+ model: str,
+ tools: Optional[List[Dict[str, Any]]] = None,
+ max_retries: Optional[int] = None,
+ stream: bool = False,
+ computer_handler=None,
+ _on_api_start=None,
+ _on_api_end=None,
+ _on_usage=None,
+ _on_screenshot=None,
+ **kwargs,
+ ) -> Dict[str, Any]:
+ raise NotImplementedError()
+
+ async def predict_click(
+ self, model: str, image_b64: str, instruction: str, **kwargs
+ ) -> Optional[Tuple[float, float]]:
+ """
+ Predict click coordinates using UI-Ins model via litellm.acompletion.
+
+ Args:
+ model: The UI-Ins model name
+ image_b64: Base64 encoded image
+ instruction: Instruction for where to click
+
+ Returns:
+ Tuple of (x, y) coordinates or None if prediction fails
+ """
+ # Decode base64 image
+ image_data = base64.b64decode(image_b64)
+ image = Image.open(BytesIO(image_data))
+ width, height = image.width, image.height
+
+ # Smart resize the image (similar to qwen_vl_utils)
+ resized_height, resized_width = smart_resize(
+ height,
+ width,
+ factor=28, # Default factor for Qwen models
+ min_pixels=3136,
+ max_pixels=4096 * 2160,
+ )
+ resized_image = image.resize((resized_width, resized_height))
+ scale_x, scale_y = width / resized_width, height / resized_height
+
+ # Convert resized image back to base64
+ buffered = BytesIO()
+ resized_image.save(buffered, format="PNG")
+ resized_image_b64 = base64.b64encode(buffered.getvalue()).decode()
+
+ # Prepare system and user messages
+ system_message = {
+ "role": "system",
+ "content": [
+ {"type": "text", "text": "You are a helpful assistant."},
+ {"type": "text", "text": SYSTEM_PROMPT},
+ ],
+ }
+
+ user_message = {
+ "role": "user",
+ "content": [
+ {
+ "type": "image_url",
+ "image_url": {"url": f"data:image/png;base64,{resized_image_b64}"},
+ },
+ {"type": "text", "text": instruction},
+ ],
+ }
+
+ # Prepare API call kwargs
+ api_kwargs = {
+ "model": model,
+ "messages": [system_message, user_message],
+ "max_tokens": 2056,
+ "temperature": 0.0,
+ **kwargs,
+ }
+
+ # Use liteLLM acompletion
+ response = await litellm.acompletion(**api_kwargs)
+
+ # Extract response text
+ output_text = response.choices[0].message.content # type: ignore
+
+ # Extract and rescale coordinates
+ pred_x, pred_y = parse_coordinates(output_text) # type: ignore
+ pred_x *= scale_x
+ pred_y *= scale_y
+
+ return (math.floor(pred_x), math.floor(pred_y))
+
+ def get_capabilities(self) -> List[AgentCapability]:
+ """Return the capabilities supported by this agent."""
+ return ["click"]
diff --git a/libs/python/agent/agent/loops/uitars.py b/libs/python/agent/cua_agent/loops/uitars.py
similarity index 100%
rename from libs/python/agent/agent/loops/uitars.py
rename to libs/python/agent/cua_agent/loops/uitars.py
diff --git a/libs/python/agent/agent/loops/uitars2.py b/libs/python/agent/cua_agent/loops/uitars2.py
similarity index 100%
rename from libs/python/agent/agent/loops/uitars2.py
rename to libs/python/agent/cua_agent/loops/uitars2.py
diff --git a/libs/python/agent/agent/loops/yutori.py b/libs/python/agent/cua_agent/loops/yutori.py
similarity index 100%
rename from libs/python/agent/agent/loops/yutori.py
rename to libs/python/agent/cua_agent/loops/yutori.py
diff --git a/libs/python/agent/agent/playground/__init__.py b/libs/python/agent/cua_agent/playground/__init__.py
similarity index 100%
rename from libs/python/agent/agent/playground/__init__.py
rename to libs/python/agent/cua_agent/playground/__init__.py
diff --git a/libs/python/agent/agent/playground/server.py b/libs/python/agent/cua_agent/playground/server.py
similarity index 100%
rename from libs/python/agent/agent/playground/server.py
rename to libs/python/agent/cua_agent/playground/server.py
diff --git a/libs/python/agent/agent/proxy/examples.py b/libs/python/agent/cua_agent/proxy/examples.py
similarity index 100%
rename from libs/python/agent/agent/proxy/examples.py
rename to libs/python/agent/cua_agent/proxy/examples.py
diff --git a/libs/python/agent/agent/proxy/handlers.py b/libs/python/agent/cua_agent/proxy/handlers.py
similarity index 100%
rename from libs/python/agent/agent/proxy/handlers.py
rename to libs/python/agent/cua_agent/proxy/handlers.py
diff --git a/libs/python/agent/agent/responses.py b/libs/python/agent/cua_agent/responses.py
similarity index 100%
rename from libs/python/agent/agent/responses.py
rename to libs/python/agent/cua_agent/responses.py
diff --git a/libs/python/agent/agent/tools/__init__.py b/libs/python/agent/cua_agent/tools/__init__.py
similarity index 100%
rename from libs/python/agent/agent/tools/__init__.py
rename to libs/python/agent/cua_agent/tools/__init__.py
diff --git a/libs/python/agent/agent/tools/base.py b/libs/python/agent/cua_agent/tools/base.py
similarity index 100%
rename from libs/python/agent/agent/tools/base.py
rename to libs/python/agent/cua_agent/tools/base.py
diff --git a/libs/python/agent/agent/tools/browser_tool.py b/libs/python/agent/cua_agent/tools/browser_tool.py
similarity index 100%
rename from libs/python/agent/agent/tools/browser_tool.py
rename to libs/python/agent/cua_agent/tools/browser_tool.py
diff --git a/libs/python/agent/agent/types.py b/libs/python/agent/cua_agent/types.py
similarity index 100%
rename from libs/python/agent/agent/types.py
rename to libs/python/agent/cua_agent/types.py
diff --git a/libs/python/agent/agent/ui/__init__.py b/libs/python/agent/cua_agent/ui/__init__.py
similarity index 100%
rename from libs/python/agent/agent/ui/__init__.py
rename to libs/python/agent/cua_agent/ui/__init__.py
diff --git a/libs/python/agent/agent/ui/__main__.py b/libs/python/agent/cua_agent/ui/__main__.py
similarity index 100%
rename from libs/python/agent/agent/ui/__main__.py
rename to libs/python/agent/cua_agent/ui/__main__.py
diff --git a/libs/python/agent/agent/ui/gradio/__init__.py b/libs/python/agent/cua_agent/ui/gradio/__init__.py
similarity index 100%
rename from libs/python/agent/agent/ui/gradio/__init__.py
rename to libs/python/agent/cua_agent/ui/gradio/__init__.py
diff --git a/libs/python/agent/agent/ui/gradio/app.py b/libs/python/agent/cua_agent/ui/gradio/app.py
similarity index 98%
rename from libs/python/agent/agent/ui/gradio/app.py
rename to libs/python/agent/cua_agent/ui/gradio/app.py
index a3d02fc342..2f1b60fbd2 100644
--- a/libs/python/agent/agent/ui/gradio/app.py
+++ b/libs/python/agent/cua_agent/ui/gradio/app.py
@@ -29,8 +29,8 @@ from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union, cast
import gradio as gr
# Import from agent package
-from agent import ComputerAgent
-from agent.types import AgentResponse, Messages
+from cua_agent import ComputerAgent
+from cua_agent.types import AgentResponse, Messages
try:
from computer import Computer
@@ -251,7 +251,7 @@ def create_agent(
def launch_ui():
"""Standalone function to launch the Gradio app."""
- from agent.ui.gradio.ui_components import create_gradio_ui
+ from cua_agent.ui.gradio.ui_components import create_gradio_ui
print("Starting Gradio app for Cua Agent...")
demo = create_gradio_ui()
diff --git a/libs/python/agent/agent/ui/gradio/ui_components.py b/libs/python/agent/cua_agent/ui/gradio/ui_components.py
similarity index 100%
rename from libs/python/agent/agent/ui/gradio/ui_components.py
rename to libs/python/agent/cua_agent/ui/gradio/ui_components.py
diff --git a/libs/python/agent/example.py b/libs/python/agent/example.py
index 66eb6f51d6..7d8f20a7a9 100644
--- a/libs/python/agent/example.py
+++ b/libs/python/agent/example.py
@@ -5,7 +5,7 @@ Example usage of the agent library with docstring-based tool definitions.
import asyncio
import logging
-from agent import ComputerAgent
+from cua_agent import ComputerAgent
from computer import Computer
from computer.helpers import sandboxed
diff --git a/libs/python/agent/pyproject.toml b/libs/python/agent/pyproject.toml
index 8071a1e90d..4c03bf1251 100644
--- a/libs/python/agent/pyproject.toml
+++ b/libs/python/agent/pyproject.toml
@@ -19,7 +19,7 @@ dependencies = [
"pydantic>=2.6.4",
"rich>=13.7.1",
"python-dotenv>=1.0.1",
- "cua-core>=0.1.18,<0.2.0",
+ "cua-core>=0.3.0,<0.4.0",
"certifi>=2024.2.2",
"litellm==1.80.0",
"Pillow>=10.0.0"
@@ -130,4 +130,4 @@ constraint-dependencies = ["fastrtc>0.43.0", "mlx-audio>0.2.3"]
distribution = true
[tool.pdm.build]
-includes = ["agent/"]
\ No newline at end of file
+includes = ["cua_agent/"]
\ No newline at end of file
diff --git a/libs/python/agent/tests/test_computer_agent.py b/libs/python/agent/tests/test_computer_agent.py
index b6de1e86ef..9770ba7ac3 100644
--- a/libs/python/agent/tests/test_computer_agent.py
+++ b/libs/python/agent/tests/test_computer_agent.py
@@ -16,7 +16,7 @@ class TestComputerAgentInitialization:
@patch("agent.agent.litellm")
def test_agent_initialization_with_model(self, mock_litellm, disable_telemetry):
"""Test that agent can be initialized with a model string."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929")
@@ -27,7 +27,7 @@ class TestComputerAgentInitialization:
@patch("agent.agent.litellm")
def test_agent_initialization_with_tools(self, mock_litellm, disable_telemetry, mock_computer):
"""Test that agent can be initialized with tools."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929", tools=[mock_computer])
@@ -37,7 +37,7 @@ class TestComputerAgentInitialization:
@patch("agent.agent.litellm")
def test_agent_initialization_with_max_budget(self, mock_litellm, disable_telemetry):
"""Test that agent can be initialized with max trajectory budget."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
budget = 5.0
agent = ComputerAgent(
@@ -49,7 +49,7 @@ class TestComputerAgentInitialization:
@patch("agent.agent.litellm")
def test_agent_requires_model(self, mock_litellm, disable_telemetry):
"""Test that agent requires a model parameter."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
with pytest.raises(TypeError):
# Should fail without model parameter - intentionally missing required argument
@@ -63,7 +63,7 @@ class TestComputerAgentRun:
@patch("agent.agent.litellm")
async def test_agent_run_with_messages(self, mock_litellm, disable_telemetry, sample_messages):
"""Test that agent.run() works with valid messages."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
# Mock liteLLM response
mock_response = {
@@ -90,7 +90,7 @@ class TestComputerAgentRun:
def test_agent_has_run_method(self, disable_telemetry):
"""Test that agent has run method available."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929")
@@ -100,7 +100,7 @@ class TestComputerAgentRun:
def test_agent_has_agent_loop(self, disable_telemetry):
"""Test that agent has agent_loop initialized."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929")
@@ -114,13 +114,13 @@ class TestComputerAgentTypes:
def test_messages_type_exists(self):
"""Test that Messages type is exported."""
- from agent import Messages
+ from cua_agent import Messages
assert Messages is not None
def test_agent_response_type_exists(self):
"""Test that AgentResponse type is exported."""
- from agent import AgentResponse
+ from cua_agent import AgentResponse
assert AgentResponse is not None
@@ -130,7 +130,7 @@ class TestComputerAgentIntegration:
def test_agent_accepts_computer_tool(self, disable_telemetry, mock_computer):
"""Test that agent can be initialized with Computer tool."""
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929", tools=[mock_computer])
diff --git a/libs/python/agent/tests/test_telemetry_events.py b/libs/python/agent/tests/test_telemetry_events.py
index 0ad8396b5b..123fb6fa49 100644
--- a/libs/python/agent/tests/test_telemetry_events.py
+++ b/libs/python/agent/tests/test_telemetry_events.py
@@ -14,7 +14,7 @@ class TestAgentTelemetryEvents:
@patch("agent.agent.is_telemetry_enabled", return_value=True)
def test_agent_init_event(self, mock_telemetry_enabled, mock_record_event):
"""Test that agent_init event is emitted with correct args_provided."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
# Create agent with various args
agent = ComputerAgent(
@@ -42,7 +42,7 @@ class TestAgentTelemetryEvents:
@patch("agent.agent.is_telemetry_enabled", return_value=True)
def test_agent_init_minimal_args(self, mock_telemetry_enabled, mock_record_event):
"""Test agent_init with minimal args (defaults)."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929")
@@ -63,7 +63,7 @@ class TestAgentTelemetryEvents:
@patch("agent.agent.is_telemetry_enabled", return_value=False)
def test_no_events_when_telemetry_disabled(self, mock_telemetry_enabled, mock_record_event):
"""Test that no events are emitted when telemetry is disabled."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
agent = ComputerAgent(
model="anthropic/claude-sonnet-4-5-20250929",
@@ -86,7 +86,7 @@ class TestActionTelemetryEvents:
@patch("agent.agent.is_telemetry_enabled", return_value=True)
async def test_computer_action_executed_event(self, mock_telemetry_enabled, mock_record_event):
"""Test that computer_action_executed is emitted for computer calls."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929")
agent.telemetry_enabled = True
diff --git a/libs/python/agent/tests/test_tool_resolution.py b/libs/python/agent/tests/test_tool_resolution.py
index 0034896529..54470680d8 100644
--- a/libs/python/agent/tests/test_tool_resolution.py
+++ b/libs/python/agent/tests/test_tool_resolution.py
@@ -12,9 +12,9 @@ import warnings
from unittest.mock import MagicMock, Mock, patch
import pytest
-from agent.computers import is_agent_computer
-from agent.tools.browser_tool import BrowserTool
-from agent.types import AgentConfigInfo
+from cua_agent.computers import is_agent_computer
+from cua_agent.tools.browser_tool import BrowserTool
+from cua_agent.types import AgentConfigInfo
# Mock agent config class for testing
@@ -52,7 +52,7 @@ class TestToolResolution:
@pytest.mark.asyncio
async def test_fara_auto_wraps_computer_to_browser_tool(self, mock_computer):
"""FARA auto-wraps Computer to BrowserTool with warning."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
# Patch find_agent_config to return FARA config
fara_config = AgentConfigInfo(
@@ -66,8 +66,8 @@ class TestToolResolution:
def mock_is_agent_computer(tool):
return tool is mock_computer
- with patch("agent.agent.find_agent_config", return_value=fara_config):
- with patch("agent.agent.is_agent_computer", side_effect=mock_is_agent_computer):
+ with patch("cua_agent.agent.find_agent_config", return_value=fara_config):
+ with patch("cua_agent.agent.is_agent_computer", side_effect=mock_is_agent_computer):
agent = ComputerAgent(model="cua/microsoft/fara-7b", tools=[mock_computer])
# Tool resolution happens in _resolve_tools, which is async
with pytest.warns(UserWarning, match="Auto-wrapping Computer to BrowserTool"):
@@ -79,7 +79,7 @@ class TestToolResolution:
def test_fara_accepts_explicit_browser_tool_no_warning(self, mock_browser_tool):
"""FARA accepts explicit BrowserTool without warning."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
# Patch find_agent_config to return FARA config
fara_config = AgentConfigInfo(
@@ -89,7 +89,7 @@ class TestToolResolution:
tool_type="browser",
)
- with patch("agent.agent.find_agent_config", return_value=fara_config):
+ with patch("cua_agent.agent.find_agent_config", return_value=fara_config):
# Should not raise any warnings
with warnings.catch_warnings():
warnings.simplefilter("error")
@@ -101,7 +101,7 @@ class TestToolResolution:
def test_claude_accepts_any_tool_no_wrapping(self, mock_computer):
"""Claude (general model) accepts any tool without wrapping."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
# Patch find_agent_config to return Claude config (no tool_type)
claude_config = AgentConfigInfo(
@@ -111,7 +111,7 @@ class TestToolResolution:
tool_type=None, # General model, no tool type requirement
)
- with patch("agent.agent.find_agent_config", return_value=claude_config):
+ with patch("cua_agent.agent.find_agent_config", return_value=claude_config):
with warnings.catch_warnings():
warnings.simplefilter("error") # Fail if any warning
agent = ComputerAgent(model="claude-sonnet-4", tools=[mock_computer])
@@ -123,7 +123,7 @@ class TestToolResolution:
@pytest.mark.asyncio
async def test_custom_tools_pass_through(self, mock_computer):
"""Custom function tools pass through unchanged."""
- from agent.agent import ComputerAgent
+ from cua_agent.agent import ComputerAgent
def custom_tool():
"""A custom tool function."""
@@ -141,8 +141,8 @@ class TestToolResolution:
def mock_is_agent_computer(tool):
return tool is mock_computer
- with patch("agent.agent.find_agent_config", return_value=fara_config):
- with patch("agent.agent.is_agent_computer", side_effect=mock_is_agent_computer):
+ with patch("cua_agent.agent.find_agent_config", return_value=fara_config):
+ with patch("cua_agent.agent.is_agent_computer", side_effect=mock_is_agent_computer):
agent = ComputerAgent(
model="cua/microsoft/fara-7b", tools=[mock_computer, custom_tool]
)
@@ -197,7 +197,7 @@ class TestRegisterAgentDecorator:
def test_register_agent_with_tool_type(self):
"""@register_agent accepts tool_type parameter"""
- from agent.decorators import _agent_configs, register_agent
+ from cua_agent.decorators import _agent_configs, register_agent
# Clear registry for test
original_configs = _agent_configs.copy()
@@ -217,7 +217,7 @@ class TestRegisterAgentDecorator:
return ["step"]
# Find the registered config
- from agent.decorators import find_agent_config
+ from cua_agent.decorators import find_agent_config
config = find_agent_config("test-model-123")
assert config is not None
@@ -230,7 +230,7 @@ class TestRegisterAgentDecorator:
def test_register_agent_without_tool_type(self):
"""@register_agent without tool_type defaults to None"""
- from agent.decorators import _agent_configs, register_agent
+ from cua_agent.decorators import _agent_configs, register_agent
# Clear registry for test
original_configs = _agent_configs.copy()
@@ -250,7 +250,7 @@ class TestRegisterAgentDecorator:
return ["step"]
# Find the registered config
- from agent.decorators import find_agent_config
+ from cua_agent.decorators import find_agent_config
config = find_agent_config("general-model-123")
assert config is not None
diff --git a/libs/python/computer-server/computer_server/main.py b/libs/python/computer-server/computer_server/main.py
index 2bf0435a12..85bdffdc9c 100644
--- a/libs/python/computer-server/computer_server/main.py
+++ b/libs/python/computer-server/computer_server/main.py
@@ -14,7 +14,7 @@ from typing import Any, Dict, List, Literal, Optional, Union, cast
import aiohttp
import uvicorn
-from core.telemetry import record_event
+from cua_core.telemetry import record_event
from fastapi import (
FastAPI,
Header,
@@ -41,7 +41,7 @@ except ImportError:
AUTH_SESSION_TTL_SECONDS: int = int(os.environ.get("CUA_AUTH_TTL_SECONDS", "60"))
try:
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
HAS_AGENT = True
except ImportError:
@@ -279,7 +279,7 @@ class AuthenticationManager:
logger.info(f"Authenticating with TryCUA API for container: {container_name}")
try:
- from core.http import cua_version_headers
+ from cua_core.http import cua_version_headers
async with aiohttp.ClientSession() as session:
headers = {"Authorization": f"Bearer {api_key}", **cua_version_headers()}
@@ -982,7 +982,7 @@ async def agent_response_endpoint(
# Define a direct computer tool that implements the AsyncComputerHandler protocol
# and delegates to our existing automation/file/accessibility handlers.
- from agent.computers import AsyncComputerHandler # runtime-checkable Protocol
+ from cua_agent.computers import AsyncComputerHandler # runtime-checkable Protocol
class DirectComputerInterface:
"""Interface wrapper providing BrowserTool compatibility.
diff --git a/libs/python/computer-server/pyproject.toml b/libs/python/computer-server/pyproject.toml
index 1fe53bc3f4..ed67c23c8d 100644
--- a/libs/python/computer-server/pyproject.toml
+++ b/libs/python/computer-server/pyproject.toml
@@ -34,7 +34,7 @@ dependencies = [
"python-xlib>=0.33; sys_platform == 'linux'",
"pywin32>=310; sys_platform == 'win32'",
"python-certifi-win32; sys_platform == 'win32'",
- "cua-core>=0.1.18",
+ "cua-core>=0.3.0,<0.4.0",
"grpcio==1.78.0",
"protobuf==6.31.1",
]
diff --git a/libs/python/computer/computer/__init__.py b/libs/python/computer/computer/__init__.py
index a7b8df31ce..294ac0d50c 100644
--- a/libs/python/computer/computer/__init__.py
+++ b/libs/python/computer/computer/__init__.py
@@ -11,7 +11,7 @@ logger = logging.getLogger("computer")
# Initialize telemetry when the package is imported
try:
# Import from core telemetry
- from core.telemetry import (
+ from cua_core.telemetry import (
is_telemetry_enabled,
record_event,
)
diff --git a/libs/python/computer/computer/computer.py b/libs/python/computer/computer/computer.py
index f24f87b966..f73fa9d8d0 100644
--- a/libs/python/computer/computer/computer.py
+++ b/libs/python/computer/computer/computer.py
@@ -30,7 +30,7 @@ except Exception: # pragma: no cover
P = ParamSpec("P")
R = TypeVar("R")
-from core.telemetry import is_telemetry_enabled, record_event
+from cua_core.telemetry import is_telemetry_enabled, record_event
from PIL import Image
from . import helpers
@@ -44,7 +44,7 @@ from .tracing_wrapper import TracingInterfaceWrapper
# Import OTEL functions for session-level metrics
try:
- from core.telemetry import (
+ from cua_core.telemetry import (
is_otel_enabled,
record_operation,
track_concurrent,
diff --git a/libs/python/computer/computer/interface/generic.py b/libs/python/computer/computer/interface/generic.py
index 8e6c431a01..c012365425 100644
--- a/libs/python/computer/computer/interface/generic.py
+++ b/libs/python/computer/computer/interface/generic.py
@@ -5,7 +5,7 @@ from typing import Any, Dict, List, Optional, Tuple
import aiohttp
import websockets
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
from PIL import Image
from ..logger import Logger, LogLevel
diff --git a/libs/python/computer/computer/otel_wrapper.py b/libs/python/computer/computer/otel_wrapper.py
index 59aaed23c1..e7731f7509 100644
--- a/libs/python/computer/computer/otel_wrapper.py
+++ b/libs/python/computer/computer/otel_wrapper.py
@@ -14,7 +14,7 @@ from .interface.base import BaseComputerInterface
# Import OTEL functions - available when cua-core[telemetry] is installed
try:
- from core.telemetry import (
+ from cua_core.telemetry import (
create_span,
is_otel_enabled,
record_error,
diff --git a/libs/python/computer/computer/providers/cloud/provider.py b/libs/python/computer/computer/providers/cloud/provider.py
index aa66ebcee4..200c45cf8e 100644
--- a/libs/python/computer/computer/providers/cloud/provider.py
+++ b/libs/python/computer/computer/providers/cloud/provider.py
@@ -22,7 +22,7 @@ import os
from urllib.parse import urlparse
import aiohttp
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
DEFAULT_API_BASE = os.getenv("CUA_API_BASE", "https://api.cua.ai")
diff --git a/libs/python/computer/computer/providers/cloud/providerv2.py b/libs/python/computer/computer/providers/cloud/providerv2.py
index 707b6a4a31..944af1802d 100644
--- a/libs/python/computer/computer/providers/cloud/providerv2.py
+++ b/libs/python/computer/computer/providers/cloud/providerv2.py
@@ -18,7 +18,7 @@ import asyncio
import os
import aiohttp
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
DEFAULT_API_BASE = os.getenv("CUA_API_BASE", "https://api.cua.ai")
diff --git a/libs/python/computer/pyproject.toml b/libs/python/computer/pyproject.toml
index 11fd2c351f..735c41de8f 100644
--- a/libs/python/computer/pyproject.toml
+++ b/libs/python/computer/pyproject.toml
@@ -15,7 +15,7 @@ dependencies = [
"websocket-client>=1.8.0",
"websockets>=12.0",
"aiohttp>=3.9.0",
- "cua-core>=0.1.18,<0.2.0",
+ "cua-core>=0.3.0,<0.4.0",
"pydantic>=2.11.1",
"mslex>=1.3.0",
]
diff --git a/libs/python/core/core/__init__.py b/libs/python/core/cua_core/__init__.py
similarity index 51%
rename from libs/python/core/core/__init__.py
rename to libs/python/core/cua_core/__init__.py
index 1af2cfbe08..d013a7e230 100644
--- a/libs/python/core/core/__init__.py
+++ b/libs/python/core/cua_core/__init__.py
@@ -2,4 +2,4 @@
__version__ = "0.1.8"
-from core.http import CUA_CLIENT_VERSION_HEADER, cua_version_headers
+from cua_core.http import CUA_CLIENT_VERSION_HEADER, cua_version_headers
diff --git a/libs/python/core/core/http.py b/libs/python/core/cua_core/http.py
similarity index 100%
rename from libs/python/core/core/http.py
rename to libs/python/core/cua_core/http.py
diff --git a/libs/python/core/core/telemetry/__init__.py b/libs/python/core/cua_core/telemetry/__init__.py
similarity index 91%
rename from libs/python/core/core/telemetry/__init__.py
rename to libs/python/core/cua_core/telemetry/__init__.py
index 19374123a2..f7e3044548 100644
--- a/libs/python/core/core/telemetry/__init__.py
+++ b/libs/python/core/cua_core/telemetry/__init__.py
@@ -5,7 +5,7 @@ and operational metrics via OpenTelemetry.
"""
# OpenTelemetry instrumentation for Four Golden Signals
-from core.telemetry.otel import (
+from cua_core.telemetry.otel import (
create_span,
instrument_async,
instrument_sync,
@@ -15,7 +15,7 @@ from core.telemetry.otel import (
record_tokens,
track_concurrent,
)
-from core.telemetry.posthog import (
+from cua_core.telemetry.posthog import (
destroy_telemetry_client,
is_telemetry_enabled,
record_event,
diff --git a/libs/python/core/core/telemetry/otel.py b/libs/python/core/cua_core/telemetry/otel.py
similarity index 100%
rename from libs/python/core/core/telemetry/otel.py
rename to libs/python/core/cua_core/telemetry/otel.py
diff --git a/libs/python/core/core/telemetry/posthog.py b/libs/python/core/cua_core/telemetry/posthog.py
similarity index 100%
rename from libs/python/core/core/telemetry/posthog.py
rename to libs/python/core/cua_core/telemetry/posthog.py
diff --git a/libs/python/core/pyproject.toml b/libs/python/core/pyproject.toml
index 8aaae1e29a..71cbf96ae4 100644
--- a/libs/python/core/pyproject.toml
+++ b/libs/python/core/pyproject.toml
@@ -33,7 +33,7 @@ telemetry = [
distribution = true
[tool.pdm.build]
-includes = ["core/"]
+includes = ["cua_core/"]
source-includes = ["tests/", "README.md", "LICENSE"]
[tool.pytest.ini_options]
diff --git a/libs/python/core/tests/test_telemetry.py b/libs/python/core/tests/test_telemetry.py
index 1376b750a6..fb6ac440e8 100644
--- a/libs/python/core/tests/test_telemetry.py
+++ b/libs/python/core/tests/test_telemetry.py
@@ -21,7 +21,7 @@ class TestTelemetryEnabled:
monkeypatch.delenv("CUA_TELEMETRY_ENABLED", raising=False)
monkeypatch.delenv("CUA_TELEMETRY_DISABLED", raising=False)
- from core.telemetry import is_telemetry_enabled
+ from cua_core.telemetry import is_telemetry_enabled
assert is_telemetry_enabled() is True
@@ -29,7 +29,7 @@ class TestTelemetryEnabled:
"""Test that telemetry can be disabled with CUA_TELEMETRY_ENABLED=false."""
monkeypatch.setenv("CUA_TELEMETRY_ENABLED", "false")
- from core.telemetry import is_telemetry_enabled
+ from cua_core.telemetry import is_telemetry_enabled
assert is_telemetry_enabled() is False
@@ -38,7 +38,7 @@ class TestTelemetryEnabled:
"""Test that telemetry respects various disable values."""
monkeypatch.setenv("CUA_TELEMETRY_ENABLED", value)
- from core.telemetry import is_telemetry_enabled
+ from cua_core.telemetry import is_telemetry_enabled
assert is_telemetry_enabled() is False
@@ -48,7 +48,7 @@ class TestTelemetryEnabled:
monkeypatch.delenv("CUA_TELEMETRY_DISABLED", raising=False)
monkeypatch.setenv("CUA_TELEMETRY_ENABLED", value)
- from core.telemetry import is_telemetry_enabled
+ from cua_core.telemetry import is_telemetry_enabled
assert is_telemetry_enabled() is True
@@ -60,7 +60,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_client_initialization(self, mock_path, mock_posthog, disable_telemetry):
"""Test that client initializes correctly."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
# Mock the storage directory
mock_storage_dir = MagicMock()
@@ -82,7 +82,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_installation_id_generation(self, mock_path, mock_posthog, disable_telemetry):
"""Test that installation ID is generated if not exists."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
# Mock file system: Path.home() / ".config" / "cua" / "installation_id"
mock_id_file = MagicMock()
@@ -106,7 +106,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_installation_id_persistence(self, mock_path, mock_posthog, disable_telemetry):
"""Test that installation ID is read from file if exists."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
existing_id = "test-installation-id-123"
@@ -131,7 +131,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_record_event_when_disabled(self, mock_path, mock_posthog, monkeypatch):
"""Test that events are not recorded when telemetry is disabled."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
# Disable telemetry explicitly using the correct environment variable
monkeypatch.setenv("CUA_TELEMETRY_ENABLED", "false")
@@ -155,7 +155,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_record_event_when_enabled(self, mock_path, mock_posthog, monkeypatch):
"""Test that events are recorded when telemetry is enabled."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
# Enable telemetry
monkeypatch.delenv("CUA_TELEMETRY_DISABLED", raising=False)
@@ -184,7 +184,7 @@ class TestPostHogTelemetryClient:
@patch("core.telemetry.posthog.Path")
def test_singleton_pattern(self, mock_path, mock_posthog, disable_telemetry):
"""Test that get_client returns the same instance."""
- from core.telemetry.posthog import PostHogTelemetryClient
+ from cua_core.telemetry.posthog import PostHogTelemetryClient
# Mock file system
mock_storage_dir = MagicMock()
@@ -207,7 +207,7 @@ class TestRecordEvent:
@patch("core.telemetry.posthog.PostHogTelemetryClient")
def test_record_event_calls_client(self, mock_client_class, disable_telemetry):
"""Test that record_event delegates to the client."""
- from core.telemetry import record_event
+ from cua_core.telemetry import record_event
mock_client_instance = Mock()
mock_client_class.get_client.return_value = mock_client_instance
@@ -222,7 +222,7 @@ class TestRecordEvent:
@patch("core.telemetry.posthog.PostHogTelemetryClient")
def test_record_event_without_properties(self, mock_client_class, disable_telemetry):
"""Test that record_event works without properties."""
- from core.telemetry import record_event
+ from cua_core.telemetry import record_event
mock_client_instance = Mock()
mock_client_class.get_client.return_value = mock_client_instance
@@ -240,7 +240,7 @@ class TestDestroyTelemetryClient:
@patch("core.telemetry.posthog.PostHogTelemetryClient")
def test_destroy_client_calls_class_method(self, mock_client_class):
"""Test that destroy_telemetry_client delegates correctly."""
- from core.telemetry import destroy_telemetry_client
+ from cua_core.telemetry import destroy_telemetry_client
destroy_telemetry_client()
diff --git a/libs/python/cua-cli/cua_cli/api/client.py b/libs/python/cua-cli/cua_cli/api/client.py
index 5b92e9d479..b1faf4d014 100644
--- a/libs/python/cua-cli/cua_cli/api/client.py
+++ b/libs/python/cua-cli/cua_cli/api/client.py
@@ -7,7 +7,7 @@ from typing import Any, Optional
from urllib.parse import quote
import aiohttp
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
from cua_cli.auth.store import require_api_key
DEFAULT_API_BASE = "https://api.cua.ai"
diff --git a/libs/python/cua-cli/cua_cli/commands/auth.py b/libs/python/cua-cli/cua_cli/commands/auth.py
index c1b019f538..b234f3fc89 100644
--- a/libs/python/cua-cli/cua_cli/commands/auth.py
+++ b/libs/python/cua-cli/cua_cli/commands/auth.py
@@ -5,7 +5,7 @@ import os
from pathlib import Path
import aiohttp
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
from cua_cli.auth.browser import authenticate_via_browser
from cua_cli.auth.store import (
ACTIVE_WORKSPACE_KEY,
diff --git a/libs/python/cua-cli/cua_cli/commands/do.py b/libs/python/cua-cli/cua_cli/commands/do.py
index 1fa4fc22e7..02cc186989 100644
--- a/libs/python/cua-cli/cua_cli/commands/do.py
+++ b/libs/python/cua-cli/cua_cli/commands/do.py
@@ -325,7 +325,7 @@ async def _send(provider_type: str, name: str, command: str, params: dict) -> di
return await _host_dispatch(command, params)
import aiohttp
- from core.http import cua_version_headers
+ from cua_core.http import cua_version_headers
api_url = await _get_api_url(provider_type, name)
headers = {"Content-Type": "application/json", **cua_version_headers()}
diff --git a/libs/python/cua-cli/cua_cli/commands/mcp.py b/libs/python/cua-cli/cua_cli/commands/mcp.py
index 4ff12d32ea..b36421420f 100644
--- a/libs/python/cua-cli/cua_cli/commands/mcp.py
+++ b/libs/python/cua-cli/cua_cli/commands/mcp.py
@@ -413,7 +413,7 @@ async def _register_computer_tools(
server_url = await _get_server_url(sandbox_name)
api_key = get_api_key()
- from core.http import cua_version_headers
+ from cua_core.http import cua_version_headers
headers = {
"Content-Type": "application/json",
diff --git a/libs/python/cua-cli/cua_cli/commands/workspace.py b/libs/python/cua-cli/cua_cli/commands/workspace.py
index 5d23434f93..73b76b1194 100644
--- a/libs/python/cua-cli/cua_cli/commands/workspace.py
+++ b/libs/python/cua-cli/cua_cli/commands/workspace.py
@@ -5,7 +5,7 @@ import asyncio
import os
import aiohttp
-from core.http import cua_version_headers
+from cua_core.http import cua_version_headers
from cua_cli.auth.browser import authenticate_via_browser
from cua_cli.auth.store import (
_get_store,
diff --git a/libs/python/cua-cli/cua_cli/main.py b/libs/python/cua-cli/cua_cli/main.py
index 1fa86782c3..5aabb711c1 100644
--- a/libs/python/cua-cli/cua_cli/main.py
+++ b/libs/python/cua-cli/cua_cli/main.py
@@ -11,7 +11,7 @@ from cua_cli.commands import workspace as workspace_cmd
from cua_cli.utils.output import print_error
try:
- from core.telemetry import is_telemetry_enabled, record_event
+ from cua_core.telemetry import is_telemetry_enabled, record_event
_TELEMETRY_AVAILABLE = True
except ImportError:
diff --git a/libs/python/cua-cli/pyproject.toml b/libs/python/cua-cli/pyproject.toml
index 08e824c3ea..bee132659b 100644
--- a/libs/python/cua-cli/pyproject.toml
+++ b/libs/python/cua-cli/pyproject.toml
@@ -29,7 +29,7 @@ requires-python = ">=3.12,<3.14"
dependencies = [
# Core CUA packages
"cua-computer>=0.5.0",
- "cua-core>=0.1.18",
+ "cua-core>=0.3.0,<0.4.0",
# Host automation (used by cua do switch host)
"cua-auto[all]>=0.1.0",
# HTTP client
diff --git a/libs/python/cua-sandbox/cua_sandbox/sandbox.py b/libs/python/cua-sandbox/cua_sandbox/sandbox.py
index c1f3c49242..b43f4142bd 100644
--- a/libs/python/cua-sandbox/cua_sandbox/sandbox.py
+++ b/libs/python/cua-sandbox/cua_sandbox/sandbox.py
@@ -43,7 +43,7 @@ from typing import (
)
try:
- from core.telemetry import is_telemetry_enabled, record_event
+ from cua_core.telemetry import is_telemetry_enabled, record_event
_TELEMETRY_AVAILABLE = True
except ImportError:
diff --git a/libs/python/cua-sandbox/pyproject.toml b/libs/python/cua-sandbox/pyproject.toml
index 3422731260..103de19ebf 100644
--- a/libs/python/cua-sandbox/pyproject.toml
+++ b/libs/python/cua-sandbox/pyproject.toml
@@ -28,7 +28,7 @@ classifiers = [
requires-python = ">=3.11,<3.14"
dependencies = [
- "cua-core>=0.1.18,<0.2.0",
+ "cua-core>=0.3.0,<0.4.0",
"cua-auto>=0.1.2",
"websockets>=12.0",
"httpx>=0.27.0",
@@ -89,7 +89,7 @@ testpaths = [
[dependency-groups]
dev = [
- "cua-agent>=0.7.38",
+ "cua-agent>=0.8.0",
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
]
diff --git a/libs/python/cua/cua/callbacks.py b/libs/python/cua/cua/callbacks.py
index 660b701d1a..1faf1263b9 100644
--- a/libs/python/cua/cua/callbacks.py
+++ b/libs/python/cua/cua/callbacks.py
@@ -5,7 +5,7 @@ Usage::
from cua.callbacks import LoggingCallback, BudgetManagerCallback
"""
-from agent.callbacks import (
+from cua_agent.callbacks import (
AsyncCallbackHandler,
BudgetManagerCallback,
ImageRetentionCallback,
diff --git a/libs/python/cua/cua/tools.py b/libs/python/cua/cua/tools.py
index bf4b4b22ad..6bb0deeaa1 100644
--- a/libs/python/cua/cua/tools.py
+++ b/libs/python/cua/cua/tools.py
@@ -5,7 +5,7 @@ Usage::
from cua.tools import BrowserTool, BaseTool, register_tool
"""
-from agent.tools import (
+from cua_agent.tools import (
TOOL_REGISTRY,
BaseComputerTool,
BaseTool,
@@ -14,7 +14,7 @@ from agent.tools import (
get_tool,
register_tool,
)
-from agent.types import IllegalArgumentError, ToolError
+from cua_agent.types import IllegalArgumentError, ToolError
__all__ = [
"BaseTool",
diff --git a/libs/python/cua/pyproject.toml b/libs/python/cua/pyproject.toml
index ee412b1007..f633be4be8 100644
--- a/libs/python/cua/pyproject.toml
+++ b/libs/python/cua/pyproject.toml
@@ -28,8 +28,8 @@ classifiers = [
requires-python = ">=3.12,<3.14"
dependencies = [
- "cua-sandbox>=0.1.1",
- "cua-agent[cloud]>=0.7.38",
+ "cua-sandbox>=0.1.11",
+ "cua-agent[cloud]>=0.8.0",
"cua-cli>=0.1.8",
]
diff --git a/libs/python/mcp-server/mcp_server/server.py b/libs/python/mcp-server/mcp_server/server.py
index 3aff058ca6..b909c42f0b 100644
--- a/libs/python/mcp-server/mcp_server/server.py
+++ b/libs/python/mcp-server/mcp_server/server.py
@@ -35,7 +35,7 @@ except ImportError as e:
sys.exit(1)
try:
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
from computer import Computer
logger.debug("Successfully imported Computer and Agent modules")
diff --git a/libs/python/mcp-server/pyproject.toml b/libs/python/mcp-server/pyproject.toml
index 5287492853..44cc7a6b94 100644
--- a/libs/python/mcp-server/pyproject.toml
+++ b/libs/python/mcp-server/pyproject.toml
@@ -13,7 +13,7 @@ authors = [
]
dependencies = [
"mcp>=1.6.0,<2.0.0",
- "cua-agent[all]>=0.4.0,<0.5.0",
+ "cua-agent[all]>=0.8.0",
"cua-computer>=0.4.0,<0.5.0",
]
diff --git a/scripts/playground.sh b/scripts/playground.sh
index 3e5427cf9b..811d6d9eb0 100755
--- a/scripts/playground.sh
+++ b/scripts/playground.sh
@@ -256,8 +256,8 @@ import os
from pathlib import Path
from dotenv import load_dotenv
from computer import Computer
-from agent import ComputerAgent, LLM, AgentLoop, LLMProvider
-from agent.ui.gradio.ui_components import create_gradio_ui
+from cua_agent import ComputerAgent, LLM, AgentLoop, LLMProvider
+from cua_agent.ui.gradio.ui_components import create_gradio_ui
# Load environment variables from .env.local
load_dotenv(Path(__file__).parent / ".env.local")
@@ -291,8 +291,8 @@ import os
from pathlib import Path
from dotenv import load_dotenv
from computer import Computer
-from agent import ComputerAgent, LLM, AgentLoop, LLMProvider
-from agent.ui.gradio.ui_components import create_gradio_ui
+from cua_agent import ComputerAgent, LLM, AgentLoop, LLMProvider
+from cua_agent.ui.gradio.ui_components import create_gradio_ui
# Load environment variables from .env.local
load_dotenv(Path(__file__).parent / ".env.local")
diff --git a/tests/agent_loop_testing/agent_test.py b/tests/agent_loop_testing/agent_test.py
index 4642d7acbc..fcde186040 100644
--- a/tests/agent_loop_testing/agent_test.py
+++ b/tests/agent_loop_testing/agent_test.py
@@ -131,7 +131,7 @@ async def test_cua_agent(model_name: str):
try:
# Import the real Cua agent
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
# Create mock computer
mock_computer = MockComputer()
diff --git a/tests/agent_loop_testing/agent_test_uitars.py b/tests/agent_loop_testing/agent_test_uitars.py
index b682e78b2d..b54a921c4d 100644
--- a/tests/agent_loop_testing/agent_test_uitars.py
+++ b/tests/agent_loop_testing/agent_test_uitars.py
@@ -115,7 +115,7 @@ async def test_cua_agent(model_name: str):
try:
# Import the real CUA agent
- from agent import ComputerAgent
+ from cua_agent import ComputerAgent
# Create mock computer
mock_computer = MockComputer()
diff --git a/tests/test_telemetry.py b/tests/test_telemetry.py
index 4c7f9865c4..6e6097b1ca 100644
--- a/tests/test_telemetry.py
+++ b/tests/test_telemetry.py
@@ -24,7 +24,7 @@ for path in pythonpath.split(":"):
sys.path.insert(0, path) # Insert at beginning to prioritize
print(f"Added to sys.path: {path}")
-from core.telemetry import destroy_telemetry_client, is_telemetry_enabled, record_event
+from cua_core.telemetry import destroy_telemetry_client, is_telemetry_enabled, record_event
class TestTelemetry: