update container to sandbox

This commit is contained in:
f-trycua
2025-10-08 18:14:39 -07:00
parent 8ee2d422b9
commit 9d8dd768bf
12 changed files with 141 additions and 249 deletions

View File

@@ -1,8 +1,8 @@
# Introducing Cua Cloud Containers: Computer-Use Agents in the Cloud
# Introducing Cua Cloud Sandbox: Computer-Use Agents in the Cloud
*Published on May 28, 2025 by Francesco Bonacci*
Welcome to the next chapter in our Computer-Use Agent journey! In [Part 1](./build-your-own-operator-on-macos-1), we showed you how to build your own Operator on macOS. In [Part 2](./build-your-own-operator-on-macos-2), we explored the cua-agent framework. Today, we're excited to introduce **Cua Cloud Containers** the easiest way to deploy Computer-Use Agents at scale.
Welcome to the next chapter in our Computer-Use Agent journey! In [Part 1](./build-your-own-operator-on-macos-1), we showed you how to build your own Operator on macOS. In [Part 2](./build-your-own-operator-on-macos-2), we explored the cua-agent framework. Today, we're excited to introduce **Cua Cloud Sandbox** the easiest way to deploy Computer-Use Agents at scale.
<div align="center">
<video src="https://github.com/user-attachments/assets/63a2addf-649f-4468-971d-58d38dd43ee6" width="600" controls></video>
@@ -10,9 +10,9 @@ Welcome to the next chapter in our Computer-Use Agent journey! In [Part 1](./bui
## What is Cua Cloud?
Think of Cua Cloud as **Docker for Computer-Use Agents**. Instead of managing VMs, installing dependencies, and configuring environments, you can launch pre-configured cloud containers with a single command. Each container comes with a **full desktop environment** accessible via browser (via noVNC), all CUA-related dependencies pre-configured (with a PyAutoGUI-compatible server), and **pay-per-use pricing** that scales with your needs.
Think of Cua Cloud as **Docker for Computer-Use Agents**. Instead of managing VMs, installing dependencies, and configuring environments, you can launch pre-configured Cloud Sandbox instances with a single command. Each sandbox comes with a **full desktop environment** accessible via browser (via noVNC), all CUA-related dependencies pre-configured (with a PyAutoGUI-compatible server), and **pay-per-use pricing** that scales with your needs.
## Why Cua Cloud Containers?
## Why Cua Cloud Sandbox?
Four months ago, we launched [**Lume**](https://github.com/trycua/cua/tree/main/libs/lume) and [**Cua**](https://github.com/trycua/cua) with the goal to bring sandboxed VMs and Computer-Use Agents on Apple Silicon. The developer's community response was incredible 🎉
@@ -40,7 +40,7 @@ export CUA_API_KEY=your_api_key_here
export CUA_CONTAINER_NAME=my-agent-container
```
### Step 2: Launch Your First Container
### Step 2: Launch Your First Sandbox
```python
import asyncio
@@ -80,7 +80,7 @@ We're launching with **three compute tiers** to match your workload needs:
- **Medium** (2 vCPU, 8GB RAM) - Ideal for most production workloads
- **Large** (8 vCPU, 32GB RAM) - Built for complex, resource-intensive operations
Each tier includes a **full Linux with Xfce desktop environment** with pre-configured browser, **secure VNC access** with SSL, persistent storage during your session, and automatic cleanup on termination.
Each tier includes a **full Linux with Xfce desktop environment** with pre-configured browser, **secure VNC access** with SSL, persistent storage during your session, and automatic cleanup on termination for sandboxes.
## How some customers are using Cua Cloud today
@@ -202,23 +202,23 @@ asyncio.run(parallel_scraping())
## Cost Optimization Tips
To optimize your costs, use appropriate container sizes for your workload and implement timeouts to prevent runaway tasks. Batch related operations together to minimize container spin-up time, and always remember to terminate containers when your work is complete.
To optimize your costs, use appropriate sandbox sizes for your workload and implement timeouts to prevent runaway tasks. Batch related operations together to minimize sandbox spin-up time, and always remember to terminate sandboxes when your work is complete.
## Security Considerations
Cua Cloud runs all containers in isolated environments with encrypted VNC connections. Your API keys are never exposed in trajectories.
Cua Cloud runs all sandboxes in isolated environments with encrypted VNC connections. Your API keys are never exposed in trajectories.
## What's Next for Cua Cloud
We're just getting started! Here's what's coming in the next few months:
### Elastic Autoscaled Container Pools
### Elastic Autoscaled Sandbox Pools
Soon you'll be able to create elastic container pools that automatically scale based on demand. Define minimum and maximum container counts, and let Cua Cloud handle the rest. Perfect for batch processing, scheduled automations, and handling traffic spikes without manual intervention.
Soon you'll be able to create elastic sandbox pools that automatically scale based on demand. Define minimum and maximum sandbox counts, and let Cua Cloud handle the rest. Perfect for batch processing, scheduled automations, and handling traffic spikes without manual intervention.
### Windows and macOS Cloud Support
While we're launching with Linux containers, Windows and macOS cloud machines are coming soon. Run Windows-specific automations, test cross-platform workflows, or leverage macOS-exclusive applications all in the cloud with the same simple API.
While we're launching with Linux sandboxes, Windows and macOS cloud machines are coming soon. Run Windows-specific automations, test cross-platform workflows, or leverage macOS-exclusive applications all in the cloud with the same simple API.
Stay tuned for updates and join our [**Discord**](https://discord.gg/cua-ai) to vote on which features you'd like to see first!

View File

@@ -2,7 +2,7 @@
*Published on June 10, 2025 by Francesco Bonacci*
Yesterday, Apple announced their new [Containerization framework](https://github.com/apple/containerization) at WWDC. Since then, our Discord and X users have been asking what this means for Cua virtualization capabilities on Apple Silicon. We've been working in this space for months - from [Lume](https://github.com/trycua/cua/tree/main/libs/lume) to [Lumier](https://github.com/trycua/cua/tree/main/libs/lumier) to [Cua Cloud Containers](./introducing-cua-cloud-containers). Here's our take on Apple's announcement.
Yesterday, Apple announced their new [Containerization framework](https://github.com/apple/containerization) at WWDC. Since then, our Discord and X users have been asking what this means for Cua virtualization capabilities on Apple Silicon. We've been working in this space for months - from [Lume](https://github.com/trycua/cua/tree/main/libs/lume) to [Lumier](https://github.com/trycua/cua/tree/main/libs/lumier) to [Cua Cloud Sandbox](./introducing-cua-cloud-containers). Here's our take on Apple's announcement.
## Our Story
@@ -168,7 +168,7 @@ Apple's announcement confirms we're on the right path. Here's what we're looking
- [Apple Containerization Framework](https://github.com/apple/containerization)
- [Lume - Direct VM Management](https://github.com/trycua/cua/tree/main/libs/lume)
- [Lumier - Docker Interface for VMs](https://github.com/trycua/cua/tree/main/libs/lumier)
- [Cua Cloud Containers](https://trycua.com)
- [Cua Cloud Sandbox](https://trycua.com)
- [Join our Discord](https://discord.gg/cua-ai)
---

View File

@@ -235,7 +235,7 @@ print(f"Security audit: {audit_result}")
### Desktop automation in the cloud
Here's where things get really interesting. Cua cloud containers come with full desktop environments, so you can automate GUIs:
Here's where things get really interesting. Cua Cloud Sandbox comes with full desktop environments, so you can automate GUIs:
```python
@sandboxed("desktop_env")

View File

@@ -9,9 +9,9 @@ Before we can automate apps using AI, we need to first connect to a Computer Ser
Cua Computers are preconfigured virtual machines running the Computer Server. They can be either macOS, Linux, or Windows. They're found in either a cloud-native container, or on your host desktop.
## cua cloud container
## Cua Cloud Sandbox
This is a cloud container running the Computer Server. This is the easiest & safest way to get a cua computer, and can be done by going on the trycua.com website.
This is a Cloud Sandbox running the Computer Server. This is the easiest & safest way to get a cua computer, and can be done by going on the trycua.com website.
<Tabs items={['Python', 'TypeScript']}>
<Tab value="Python">
@@ -25,7 +25,7 @@ This is a cloud container running the Computer Server. This is the easiest & saf
api_key="your-api-key"
)
await computer.run() # Connect to the container
await computer.run() # Connect to the sandbox
```
</Tab>
@@ -39,75 +39,22 @@ This is a cloud container running the Computer Server. This is the easiest & saf
apiKey: "your-api-key"
});
await computer.run(); // Connect to the container
await computer.run(); // Connect to the sandbox
```
</Tab>
</Tabs>
## cua local containers
## Cua Local Sandbox
cua provides local containers using different providers depending on your host operating system:
Cua provides local sandboxes using different providers depending on your host operating system:
<Tabs items={['Lume (macOS Only)', 'Windows Sandbox (Windows Only)', 'Docker (macOS, Windows, Linux)']}>
<Tab value="Lume (macOS Only)">
1. Install lume cli
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
```
2. Start a local cua container
```bash
lume run macos-sequoia-cua:latest
```
3. Connect with Computer
```python
from computer import Computer
computer = Computer(
os_type="macos",
provider_type="lume",
name="macos-sequoia-cua:latest"
)
await computer.run() # Launch & connect to the container
```
</Tab>
<Tab value="Windows Sandbox (Windows Only)">
1. Enable Windows Sandbox (requires Windows 10 Pro/Enterprise or Windows 11)
2. Install pywinsandbox dependency
```bash
pip install -U git+git://github.com/karkason/pywinsandbox.git
```
3. Windows Sandbox will be automatically configured when you run the CLI
```python
from computer import Computer
computer = Computer(
os_type="windows",
provider_type="winsandbox",
ephemeral=True # Windows Sandbox is always ephemeral
)
await computer.run() # Launch & connect to Windows Sandbox
```
</Tab>
<Tabs items={['KASM on Docker (macOS, Windows, Linux)', 'Windows Sandbox (Windows Only)', 'macOS VM (with Lume CLI)']}>
<Tab value="Docker (macOS, Windows, Linux)">
1. Install Docker Desktop or Docker Engine
2. Build or pull the CUA Ubuntu container
2. Build or pull the CUA Ubuntu sandbox
```bash
# Option 1: Pull from Docker Hub
@@ -130,7 +77,60 @@ cua provides local containers using different providers depending on your host o
name="my-cua-container"
)
await computer.run() # Launch & connect to Docker container
await computer.run() # Launch & connect to Docker sandbox
```
</Tab>
<Tab value="Windows Sandbox (Windows Only)">
1. Enable Windows Sandbox (requires Windows 10 Pro/Enterprise or Windows 11)
2. Install pywinsandbox dependency
```bash
pip install -U git+git://github.com/karkason/pywinsandbox.git
```
3. Windows Sandbox will be automatically configured when you run the CLI
```python
from computer import Computer
computer = Computer(
os_type="windows",
provider_type="winsandbox",
ephemeral=True # Windows Sandbox is always ephemeral
)
await computer.run() # Launch & connect to Windows Sandbox
```
</Tab>
<Tab value="Lume (macOS Only)">
1. Install lume cli
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
```
2. Start a local cua sandbox
```bash
lume run macos-sequoia-cua:latest
```
3. Connect with Computer
```python
from computer import Computer
computer = Computer(
os_type="macos",
provider_type="lume",
name="macos-sequoia-cua:latest"
)
await computer.run() # Launch & connect to the sandbox
```
</Tab>

View File

@@ -21,15 +21,15 @@ You can run your Cua computer in the cloud (recommended for easiest setup), loca
<Tabs items={['☁️ Cloud', '🐳 Docker', '🍎 Lume', '🪟 Windows Sandbox']}>
<Tab value="☁️ Cloud">
Cua cloud containers are virtual machines that run Ubuntu.
Cua Cloud Sandbox provides virtual machines that run Ubuntu.
1. Go to [trycua.com/signin](https://www.trycua.com/signin)
2. Navigate to **Dashboard > Containers > Create Instance**
3. Create a **Medium, Ubuntu 22** container
4. Note your container name and API key
3. Create a **Medium, Ubuntu 22** sandbox
4. Note your sandbox name and API key
Your cloud container will be automatically configured and ready to use.
Your Cloud Sandbox will be automatically configured and ready to use.
</Tab>
<Tab value="🍎 Lume">
@@ -42,7 +42,7 @@ You can run your Cua computer in the cloud (recommended for easiest setup), loca
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
```
2. Start a local Cua container:
2. Start a local Cua sandbox:
```bash
lume run macos-sequoia-cua:latest
@@ -69,7 +69,7 @@ You can run your Cua computer in the cloud (recommended for easiest setup), loca
1. Install Docker Desktop or Docker Engine:
2. Pull the CUA Ubuntu container:
2. Pull the CUA Ubuntu sandbox:
```bash
docker pull --platform=linux/amd64 trycua/cua-ubuntu:latest
@@ -106,7 +106,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
name="your-container-name",
api_key="your-api-key"
)
await computer.run() # Connect to the container
await computer.run() # Connect to the sandbox
```
</Tab>
<Tab value="🍎 Lume">
@@ -192,7 +192,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
name: "your-container-name",
apiKey: "your-api-key"
});
await computer.run(); // Connect to the container
await computer.run(); // Connect to the sandbox
```
</Tab>
<Tab value="🍎 Lume">

View File

@@ -1,13 +1,13 @@
# cua-cloud-openai Example
This example demonstrates how to control a cua Cloud container using the OpenAI `computer-use-preview` model and the `@trycua/computer` TypeScript library.
This example demonstrates how to control a Cua Cloud Sandbox using the OpenAI `computer-use-preview` model and the `@trycua/computer` TypeScript library.
## Overview
- Connects to a cua Cloud container via the `@trycua/computer` library
- Connects to a Cua Cloud Sandbox via the `@trycua/computer` library
- Sends screenshots and instructions to OpenAI's computer-use model
- Executes AI-generated actions (clicks, typing, etc.) inside the container
- Designed for Linux containers, but can be adapted for other OS types
- Executes AI-generated actions (clicks, typing, etc.) inside the sandbox
- Designed for Linux sandboxes, but can be adapted for other OS types
## Getting Started
@@ -20,8 +20,8 @@ This example demonstrates how to control a cua Cloud container using the OpenAI
2. **Set up environment variables:**
Create a `.env` file with the following variables:
- `OPENAI_API_KEY` — your OpenAI API key
- `CUA_API_KEY` — your cua Cloud API key
- `CUA_CONTAINER_NAME` — the name of your provisioned container
- `CUA_API_KEY` — your Cua Cloud API key
- `CUA_CONTAINER_NAME` — the name of your provisioned sandbox
3. **Run the example:**
@@ -38,7 +38,7 @@ This example demonstrates how to control a cua Cloud container using the OpenAI
For a step-by-step tutorial and more detailed explanation, see the accompanying blog post:
➡️ [Controlling a cua Cloud Container with JavaScript](https://placeholder-url-to-blog-post.com)
➡️ [Controlling a Cua Cloud Sandbox with JavaScript](https://placeholder-url-to-blog-post.com)
_(This link will be updated once the article is published.)_

View File

@@ -5,7 +5,7 @@ This folder contains Jupyter notebooks that demonstrate the core functionality o
## Available Notebooks
### Core Components
- **`computer_nb.ipynb`** - Demonstrates the Computer API for programmatically operating sandbox VMs using either Cua Cloud Containers or local Lume VMs on Apple Silicon macOS systems
- **`computer_nb.ipynb`** - Demonstrates the Computer API for programmatically operating sandbox VMs using either Cua Cloud Sandbox or local Lume VMs on Apple Silicon macOS systems
- **`agent_nb.ipynb`** - Shows how to use CUA's Agent to run automated workflows in virtual sandboxes with various AI models (OpenAI, Anthropic, local models)
- **`pylume_nb.ipynb`** - Quickstart guide for the pylume Python library, which handles VM creation, management, and image operations
- **`computer_server_nb.ipynb`** - Demonstrates how to host and configure the Computer server that powers the Computer API

View File

@@ -3,11 +3,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Agent\n",
"\n",
"This notebook demonstrates how to use Cua's Agent to run workflows in virtual sandboxes, either using Cua Cloud Containers or local VMs on Apple Silicon Macs."
]
"source": "## Agent\n\nThis notebook demonstrates how to use Cua's Agent to run workflows in virtual sandboxes, either using Cua Cloud Sandbox or local VMs on Apple Silicon Macs."
},
{
"cell_type": "markdown",
@@ -61,9 +57,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Agent allows you to run an agentic workflow in virtual sandbox instances. You can choose between cloud containers or local VMs."
]
"source": "Agent allows you to run an agentic workflow in virtual sandbox instances. You can choose between Cloud Sandbox or local VMs."
},
{
"cell_type": "code",
@@ -96,32 +90,17 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Option 1: Agent with Cua Cloud Containers\n",
"\n",
"Use cloud containers for running agents from any system without local setup."
]
"source": "## Option 1: Agent with Cua Cloud Sandbox\n\nUse Cloud Sandbox for running agents from any system without local setup."
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prerequisites for Cloud Containers\n",
"\n",
"To use Cua Cloud Containers, you need to:\n",
"1. Sign up at https://trycua.com\n",
"2. Create a Cloud Container\n",
"3. Generate an API Key\n",
"\n",
"Once you have these, you can connect to your cloud container and run agents on it."
]
"source": "### Prerequisites for Cloud Sandbox\n\nTo use Cua Cloud Sandbox, you need to:\n1. Sign up at https://trycua.com\n2. Create a Cloud Sandbox\n3. Generate an API Key\n\nOnce you have these, you can connect to your Cloud Sandbox and run agents on it."
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get Cua API credentials and container details"
]
"source": "Get Cua API credentials and sandbox details"
},
{
"cell_type": "code",
@@ -138,60 +117,31 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Choose the OS type for your container (linux or macos)"
]
"source": "Choose the OS type for your sandbox (linux or macos)"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os_type = input(\"Enter the OS type of your container (linux/macos) [default: linux]: \").lower() or \"linux\""
]
"source": "os_type = input(\"Enter the OS type of your sandbox (linux/macos) [default: linux]: \").lower() or \"linux\""
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create an agent with cloud container"
]
"source": "### Create an agent with Cloud Sandbox"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import logging\n",
"from pathlib import Path\n",
"\n",
"# Connect to your existing cloud container\n",
"computer = Computer(\n",
" os_type=os_type,\n",
" api_key=cua_api_key,\n",
" name=container_name,\n",
" provider_type=VMProviderType.CLOUD,\n",
" verbosity=logging.INFO\n",
")\n",
"\n",
"# Create agent\n",
"agent = ComputerAgent(\n",
" model=\"openai/computer-use-preview\",\n",
" tools=[computer],\n",
" trajectory_dir=str(Path(\"trajectories\")),\n",
" only_n_most_recent_images=3,\n",
" verbosity=logging.INFO\n",
")\n"
]
"source": "import logging\nfrom pathlib import Path\n\n# Connect to your existing Cloud Sandbox\ncomputer = Computer(\n os_type=os_type,\n api_key=cua_api_key,\n name=container_name,\n provider_type=VMProviderType.CLOUD,\n verbosity=logging.INFO\n)\n\n# Create agent\nagent = ComputerAgent(\n model=\"openai/computer-use-preview\",\n tools=[computer],\n trajectory_dir=str(Path(\"trajectories\")),\n only_n_most_recent_images=3,\n verbosity=logging.INFO\n)\n"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Run tasks on cloud container"
]
"source": "Run tasks on Cloud Sandbox"
},
{
"cell_type": "code",
@@ -565,4 +515,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

View File

@@ -3,11 +3,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Computer\n",
"\n",
"This notebook demonstrates how to use Computer to operate sandbox VMs programmatically, either using Cua Cloud Containers or local Lume VMs on Apple Silicon macOS systems."
]
"source": "## Computer\n\nThis notebook demonstrates how to use Computer to operate sandbox VMs programmatically, either using Cua Cloud Sandbox or local Lume VMs on Apple Silicon macOS systems."
},
{
"cell_type": "markdown",
@@ -513,25 +509,12 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Option 1: Cua Cloud Containers\n",
"\n",
"Cua Cloud Containers provide remote VMs that can be accessed from any system without local setup."
]
"source": "## Option 1: Cua Cloud Sandbox\n\nCua Cloud Sandbox provides remote VMs that can be accessed from any system without local setup."
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prerequisites for Cloud Containers\n",
"\n",
"To use Cua Cloud Containers, you need to:\n",
"1. Sign up at https://trycua.com\n",
"2. Create a Cloud Container\n",
"3. Generate an API Key\n",
"\n",
"Once you have these, you can connect to your cloud container using its name."
]
"source": "### Prerequisites for Cloud Sandbox\n\nTo use Cua Cloud Sandbox, you need to:\n1. Sign up at https://trycua.com\n2. Create a Cloud Sandbox\n3. Generate an API Key\n\nOnce you have these, you can connect to your Cloud Sandbox using its name."
},
{
"cell_type": "code",
@@ -551,25 +534,19 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Choose the OS type for your container (linux or macos)"
]
"source": "Choose the OS type for your sandbox (linux or macos)"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os_type = input(\"Enter the OS type of your container (linux/macos) [default: linux]: \").lower() or \"linux\""
]
"source": "os_type = input(\"Enter the OS type of your sandbox (linux/macos) [default: linux]: \").lower() or \"linux\""
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Connect to your Cloud Container"
]
"source": "### Connect to your Cloud Sandbox"
},
{
"cell_type": "code",
@@ -583,23 +560,14 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Connect to your existing Cua Cloud Container"
]
"source": "Connect to your existing Cua Cloud Sandbox"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"computer = Computer(\n",
" os_type=os_type, # Must match the OS type of your cloud container\n",
" api_key=cua_api_key,\n",
" name=container_name,\n",
" provider_type=VMProviderType.CLOUD,\n",
")"
]
"source": "computer = Computer(\n os_type=os_type, # Must match the OS type of your Cloud Sandbox\n api_key=cua_api_key,\n name=container_name,\n provider_type=VMProviderType.CLOUD,\n)"
},
{
"cell_type": "markdown",
@@ -1106,4 +1074,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

View File

@@ -56,12 +56,7 @@
"cell_type": "markdown",
"id": "47171dc3",
"metadata": {},
"source": [
"1. Create a Cua account at https://www.trycua.com/\n",
"2. Start a small Cua container at https://www.trycua.com/dashboard/containers (If you need credits, ask us!)\n",
"3. Create a HUD account at https://www.hud.so/\n",
"4. Create a .env file:"
]
"source": "1. Create a Cua account at https://www.trycua.com/\n2. Start a small Cua sandbox at https://www.trycua.com/dashboard/containers (If you need credits, ask us!)\n3. Create a HUD account at https://www.hud.so/\n4. Create a .env file:"
},
{
"cell_type": "code",
@@ -151,21 +146,13 @@
"cell_type": "markdown",
"id": "a07b09ee",
"metadata": {},
"source": [
"## 🖱️ Test your agent\n",
"\n",
"Run your agent on a test scenario in a Cua cloud container."
]
"source": "## 🖱️ Test your agent\n\nRun your agent on a test scenario in a Cua Cloud Sandbox."
},
{
"cell_type": "markdown",
"id": "12b9c22c",
"metadata": {},
"source": [
"Connect to an existing cloud container through the Cua SDK.\n",
"\n",
"You can access the computer through VNC on the [Cua Dashboard](https://www.trycua.com/dashboard)."
]
"source": "Connect to an existing Cloud Sandbox through the Cua SDK.\n\nYou can access the computer through VNC on the [Cua Dashboard](https://www.trycua.com/dashboard)."
},
{
"cell_type": "code",
@@ -173,20 +160,7 @@
"id": "a210e959",
"metadata": {},
"outputs": [],
"source": [
"from computer import Computer, VMProviderType\n",
"\n",
"# Connect to your existing cloud container\n",
"computer = Computer(\n",
" os_type=\"linux\",\n",
" provider_type=VMProviderType.CLOUD,\n",
" name=os.getenv(\"CUA_CONTAINER_NAME\") or \"\",\n",
" api_key=os.getenv(\"CUA_API_KEY\"),\n",
" verbosity=logging.INFO\n",
")\n",
"\n",
"agent_config[\"tools\"] = [ computer ]"
]
"source": "from computer import Computer, VMProviderType\n\n# Connect to your existing Cloud Sandbox\ncomputer = Computer(\n os_type=\"linux\",\n provider_type=VMProviderType.CLOUD,\n name=os.getenv(\"CUA_CONTAINER_NAME\") or \"\",\n api_key=os.getenv(\"CUA_API_KEY\"),\n verbosity=logging.INFO\n)\n\nagent_config[\"tools\"] = [ computer ]"
},
{
"cell_type": "markdown",
@@ -283,4 +257,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}

View File

@@ -80,16 +80,16 @@ trap cleanup EXIT
echo ""
echo "Choose your Cua setup:"
echo "1) ☁️ Cua Cloud Containers (works on any system)"
echo "1) ☁️ Cua Cloud Sandbox (works on any system)"
echo "2) 🖥️ Local macOS VMs (requires Apple Silicon Mac + macOS 15+)"
echo "3) 🖥️ Local Windows VMs (requires Windows 10 / 11)"
echo ""
read -p "Enter your choice (1, 2, or 3): " CHOICE
if [[ "$CHOICE" == "1" ]]; then
# Cua Cloud Container setup
# Cua Cloud Sandbox setup
echo ""
print_info "Setting up Cua Cloud Containers..."
print_info "Setting up Cua Cloud Sandbox..."
echo ""
# Check if existing .env.local already has CUA_API_KEY
@@ -116,15 +116,15 @@ if [[ "$CHOICE" == "1" ]]; then
# If no valid API key found, prompt for one
if [[ -z "$CUA_API_KEY" ]]; then
echo "To use Cua Cloud Containers, you need to:"
echo "To use Cua Cloud Sandbox, you need to:"
echo "1. Sign up at https://trycua.com"
echo "2. Create a Cloud Container"
echo "2. Create a Cloud Sandbox"
echo "3. Generate an Api Key"
echo ""
read -p "Enter your Cua Api Key: " CUA_API_KEY
if [[ -z "$CUA_API_KEY" ]]; then
print_error "Cua Api Key is required for Cloud Containers."
print_error "Cua Api Key is required for Cloud Sandbox."
exit 1
fi
else
@@ -142,7 +142,7 @@ elif [[ "$CHOICE" == "2" ]]; then
# Check for Apple Silicon Mac
if [[ $(uname -s) != "Darwin" || $(uname -m) != "arm64" ]]; then
print_error "Local macOS VMs require an Apple Silicon Mac (M1/M2/M3/M4)."
echo "💡 Consider using Cua Cloud Containers instead (option 1)."
echo "💡 Consider using Cua Cloud Sandbox instead (option 1)."
exit 1
fi
@@ -150,7 +150,7 @@ elif [[ "$CHOICE" == "2" ]]; then
OSVERSION=$(sw_vers -productVersion)
if [[ $(echo "$OSVERSION 15.0" | tr " " "\n" | sort -V | head -n 1) != "15.0" ]]; then
print_error "Local macOS VMs require macOS 15 (Sequoia) or newer. You have $OSVERSION."
echo "💡 Consider using Cua Cloud Containers instead (option 1)."
echo "💡 Consider using Cua Cloud Sandbox instead (option 1)."
exit 1
fi
@@ -165,7 +165,7 @@ elif [[ "$CHOICE" == "3" ]]; then
# Check if we're on Windows
if [[ $(uname -s) != MINGW* && $(uname -s) != CYGWIN* && $(uname -s) != MSYS* ]]; then
print_error "Local Windows VMs require Windows 10 or 11."
echo "💡 Consider using Cua Cloud Containers instead (option 1)."
echo "💡 Consider using Cua Cloud Sandbox instead (option 1)."
echo ""
echo "🔗 If you are using WSL, refer to the blog post to get started: https://www.trycua.com/blog/windows-sandbox"
exit 1
@@ -303,7 +303,7 @@ chmod +x "$DEMO_DIR/start_ui.sh"
print_success "Setup complete!"
if [[ "$USE_CLOUD" == "true" ]]; then
echo "☁️ Cua Cloud Container setup complete!"
echo "☁️ Cua Cloud Sandbox setup complete!"
else
echo "🖥️ Cua Local VM setup complete!"
fi

View File

@@ -22,18 +22,18 @@ TMP_DIR=$(mktemp -d)
cd "$TMP_DIR"
trap cleanup EXIT
# Ask user to choose between local macOS VMs or Cua Cloud Containers
# Ask user to choose between local macOS VMs or Cua Cloud Sandbox
echo ""
echo "Choose your Cua setup:"
echo "1) ☁️ Cua Cloud Containers (works on any system)"
echo "1) ☁️ Cua Cloud Sandbox (works on any system)"
echo "2) 🖥️ Local macOS VMs (requires Apple Silicon Mac + macOS 15+)"
echo ""
read -p "Enter your choice (1 or 2): " CHOICE
if [[ "$CHOICE" == "1" ]]; then
# Cua Cloud Container setup
# Cua Cloud Sandbox setup
echo ""
echo "☁️ Setting up Cua Cloud Containers..."
echo "☁️ Setting up Cua Cloud Sandbox..."
echo ""
# Check if existing .env.local already has CUA_API_KEY (check current dir and demo dir)
@@ -61,15 +61,15 @@ if [[ "$CHOICE" == "1" ]]; then
# If no valid API key found, prompt for one
if [[ -z "$CUA_API_KEY" ]]; then
echo "To use Cua Cloud Containers, you need to:"
echo "To use Cua Cloud Sandbox, you need to:"
echo "1. Sign up at https://trycua.com"
echo "2. Create a Cloud Container"
echo "2. Create a Cloud Sandbox"
echo "3. Generate an Api Key"
echo ""
read -p "Enter your Cua Api Key: " CUA_API_KEY
if [[ -z "$CUA_API_KEY" ]]; then
echo "❌ Cua Api Key is required for Cloud Containers."
echo "❌ Cua Api Key is required for Cloud Sandbox."
exit 1
fi
fi
@@ -84,7 +84,7 @@ elif [[ "$CHOICE" == "2" ]]; then
# Check for Apple Silicon Mac
if [[ $(uname -s) != "Darwin" || $(uname -m) != "arm64" ]]; then
echo "❌ Local macOS VMs require an Apple Silicon Mac (M1/M2/M3/M4)."
echo "💡 Consider using Cua Cloud Containers instead (option 1)."
echo "💡 Consider using Cua Cloud Sandbox instead (option 1)."
exit 1
fi
@@ -92,7 +92,7 @@ elif [[ "$CHOICE" == "2" ]]; then
OSVERSION=$(sw_vers -productVersion)
if [[ $(echo "$OSVERSION 15.0" | tr " " "\n" | sort -V | head -n 1) != "15.0" ]]; then
echo "❌ Local macOS VMs require macOS 15 (Sequoia) or newer. You have $OSVERSION."
echo "💡 Consider using Cua Cloud Containers instead (option 1)."
echo "💡 Consider using Cua Cloud Sandbox instead (option 1)."
exit 1
fi
@@ -249,7 +249,7 @@ chmod +x "$DEMO_DIR/start_ui.sh"
echo "✅ Setup complete!"
if [[ "$USE_CLOUD" == "true" ]]; then
# Create run_demo.py for cloud containers
# Create run_demo.py for cloud sandbox
cat > "$DEMO_DIR/run_demo.py" << 'EOF'
import asyncio
import os
@@ -276,7 +276,7 @@ if not openai_key and not anthropic_key:
print("\n⚠ No OpenAI or Anthropic API keys found in .env.local.")
print("Please add at least one API key to use AI agents.")
print("🚀 Starting CUA playground with Cloud Containers...")
print("🚀 Starting CUA playground with Cloud Sandbox...")
print("📝 Edit .env.local to update your API keys")
# Launch the Gradio UI and open it in the browser
@@ -314,7 +314,7 @@ app.launch(share=False, inbrowser=True)
EOF
fi
echo "☁️ CUA Cloud Container setup complete!"
echo "☁️ CUA Cloud Sandbox setup complete!"
echo "📝 Edit $DEMO_DIR/.env.local to update your API keys"
echo "🖥️ Start the playground by running: $DEMO_DIR/start_ui.sh"