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.

clean up legacy examples and scripts

Francesco Bonacci0f93f1a98270
diff --git a/.cursorignore b/.cursorignore
index 57a5589db6..d7148b8e9a 100644
--- a/.cursorignore
+++ b/.cursorignore
@@ -156,10 +156,6 @@ weights/icon_detect/model.pt.zip.part*
libs/python/omniparser/weights/icon_detect/model.pt
-# Example test data and output
-examples/test_data/
-examples/output/
-
/screenshots/
/experiments/
@@ -230,4 +226,4 @@ fastlane/test_output
ignore
# .release
-.release/
\ No newline at end of file
+.release/
diff --git a/.dockerignore b/.dockerignore
index 8546ffff3e..5acc27fa22 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -29,9 +29,6 @@ build
# Docs
docs/site
-# Notebooks
-notebooks/.ipynb_checkpoints
-
# Docker
Dockerfile
-.dockerignore
\ No newline at end of file
+.dockerignore
diff --git a/.gitignore b/.gitignore
index f1f7a42c6c..68d90d6d3b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,9 +132,6 @@ weights/icon_detect/model.pt
weights/icon_detect/model.pt.zip
weights/icon_detect/model.pt.zip.part*
libs/python/omniparser/weights/icon_detect/model.pt
-# Example test data and output
-examples/test_data/
-examples/output/
/screenshots/
/experiments/
/logs/
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 5870156618..5cad4bf5f4 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,152 +1,22 @@
{
- "configurations": [
- {
- "name": "Agent UI",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/agent_ui_examples.py",
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "Computer UI",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/computer_ui_examples.py",
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "Run Computer Examples",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/computer_examples.py",
- "console": "integratedTerminal",
- "justMyCode": true,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "Run Agent Examples",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/agent_examples.py",
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "SOM: Run Experiments (No OCR)",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/som_examples.py",
- "args": [
- "examples/test_data",
- "--output-dir",
- "examples/output",
- "--ocr",
- "none",
- "--mode",
- "experiment"
- ],
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "SOM: Run Experiments (EasyOCR)",
- "type": "debugpy",
- "request": "launch",
- "program": "examples/som_examples.py",
- "args": [
- "examples/test_data",
- "--output-dir",
- "examples/output",
- "--ocr",
- "easyocr",
- "--mode",
- "experiment"
- ],
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "Run Computer Server",
- "type": "debugpy",
- "request": "launch",
- "program": "${workspaceFolder}/libs/python/computer-server/run_server.py",
- "console": "integratedTerminal",
- "justMyCode": true,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer:${workspaceFolder:cua-root}/libs/python/agent:${workspaceFolder:cua-root}/libs/python/som"
- }
- },
- {
- "name": "Run Computer Server with Args",
- "type": "debugpy",
- "request": "launch",
- "program": "${workspaceFolder}/libs/python/computer-server/run_server.py",
- "args": [
- "--host",
- "0.0.0.0",
- "--port",
- "8000",
- "--log-level",
- "debug"
- ],
- "console": "integratedTerminal",
- "justMyCode": false,
- "python": "${workspaceFolder:cua-root}/.venv/bin/python",
- "cwd": "${workspaceFolder:cua-root}",
- "env": {
- "PYTHONPATH": "${workspaceFolder:cua-root}/libs/python/core:${workspaceFolder:cua-root}/libs/python/computer-server"
- }
- },
- {
- "type": "lldb",
- "request": "launch",
- "args": [],
- "cwd": "${workspaceFolder:cua-root}/libs/lume",
- "name": "Debug lume (libs/lume)",
- "program": "${workspaceFolder:cua-root}/libs/lume/.build/debug/lume",
- "preLaunchTask": "swift: Build Debug lume (libs/lume)"
- },
- {
- "type": "lldb",
- "request": "launch",
- "args": [],
- "cwd": "${workspaceFolder:cua-root}/libs/lume",
- "name": "Release lume (libs/lume)",
- "program": "${workspaceFolder:cua-root}/libs/lume/.build/release/lume",
- "preLaunchTask": "swift: Build Release lume (libs/lume)"
- }
- ]
-}
\ No newline at end of file
+ "configurations": [
+ {
+ "type": "lldb",
+ "request": "launch",
+ "args": [],
+ "cwd": "${workspaceFolder:cua-root}/libs/lume",
+ "name": "Debug lume (libs/lume)",
+ "program": "${workspaceFolder:cua-root}/libs/lume/.build/debug/lume",
+ "preLaunchTask": "swift: Build Debug lume (libs/lume)"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "args": [],
+ "cwd": "${workspaceFolder:cua-root}/libs/lume",
+ "name": "Release lume (libs/lume)",
+ "program": "${workspaceFolder:cua-root}/libs/lume/.build/release/lume",
+ "preLaunchTask": "swift: Build Release lume (libs/lume)"
+ }
+ ]
+}
diff --git a/.vscode/py.code-workspace b/.vscode/py.code-workspace
index adb0469596..965d8b3962 100644
--- a/.vscode/py.code-workspace
+++ b/.vscode/py.code-workspace
@@ -66,8 +66,6 @@
"**/build/**",
".pdm-build/**",
"**/.git/**",
- "examples/**",
- "notebooks/**",
"logs/**",
"screenshots/**"
],
@@ -93,7 +91,7 @@
"${workspaceFolder:cua-root}/libs/python/core",
"${workspaceFolder:cua-root}/libs/python/computer",
"${workspaceFolder:cua-root}/libs/python/agent",
- "${workspaceFolder:cua-root}/libs/python/som",
+ "${workspaceFolder:cua-root}/libs/python/som"
],
"python.languageServer": "None",
"[python]": {
@@ -102,14 +100,6 @@
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
- },
- "files.associations": {
- "examples/computer_examples.py": "python",
- "examples/agent_examples.py": "python"
- },
- "python.interpreterPaths": {
- "examples/computer_examples.py": "${workspaceFolder}/libs/python/computer/.venv/bin/python",
- "examples/agent_examples.py": "${workspaceFolder}/libs/python/agent/.venv/bin/python"
}
},
"tasks": {
@@ -137,33 +127,5 @@
"problemMatcher": []
}
]
- },
- "compounds": [
- {
- "name": "Run Computer Examples + Server",
- "configurations": ["Run Computer Examples", "Run Computer Server"],
- "stopAll": true,
- "presentation": {
- "group": "Computer",
- "order": 1
- }
- },
- {
- "name": "Run Server with Keep-Alive Client",
- "configurations": ["Run Computer Server", "Test Server Connection (Keep Alive)"],
- "stopAll": true,
- "presentation": {
- "group": "Computer",
- "order": 2
- }
- }
- ],
- "inputs": [
- {
- "id": "imagePath",
- "type": "promptString",
- "description": "Path to the image file or directory for icon detection",
- "default": "${workspaceFolder}/examples/test_data"
- }
- ]
-}
\ No newline at end of file
+ }
+}
diff --git a/Development.md b/Development.md
index 6d843eabb1..ea08974da5 100644
--- a/Development.md
+++ b/Development.md
@@ -107,35 +107,6 @@ This installs all dependencies in the virtual environment `.venv`. Each Cua pack
The `.venv` environment is configured as the default VS Code Python interpreter in [`.vscode/settings.json`](.vscode/settings.json).
-### Running Python Scripts
-
-Use `uv run` to execute Python scripts:
-
-```bash
-uv run python examples/agent_examples.py
-```
-
-Alternatively, activate the virtual environment manually:
-
-```bash
-source .venv/bin/activate # On Windows: .venv\Scripts\activate
-python examples/agent_examples.py
-```
-
-### Running Examples
-
-The Python workspace includes launch configurations for running examples:
-
-- "Run Computer Examples" - Runs computer examples
-- "Run Agent Examples" - Runs agent examples
-- "SOM" configurations - Various settings for running SOM
-- "Run Computer Examples + Server" - Runs both Computer Examples and Server simultaneously
-
-To run examples from VS Code/Cursor:
-
-1. Press F5 or use the Run/Debug view
-2. Select the desired configuration
-
## Code Formatting
The Cua project follows strict code formatting standards to ensure consistency across all packages.
@@ -239,7 +210,6 @@ uv run mypy .
# JavaScript/TypeScript checks
pnpm prettier:check
-node ./scripts/typescript-typecheck.js
```
</details>
@@ -271,11 +241,6 @@ pnpm install
pnpm prettier:format
```
-- **TypeScript type checking**:
- ```bash
- node ./scripts/typescript-typecheck.js
- ```
-
#### VS Code Integration
The workspace config ensures Prettier is used automatically for JS/TS/JSON/Markdown/YAML files. Ensure `editor.formatOnSave` is enabled in VS Code.
diff --git a/blog/bringing-computer-use-to-the-web.md b/blog/bringing-computer-use-to-the-web.md
index 8c87d0b3c6..84838a06b8 100644
--- a/blog/bringing-computer-use-to-the-web.md
+++ b/blog/bringing-computer-use-to-the-web.md
@@ -341,7 +341,6 @@ while (true) {
}
```
-You can find the full example on [GitHub](https://github.com/trycua/cua/tree/main/examples/computer-example-ts).
## What's Next?
diff --git a/blog/build-your-own-operator-on-macos-1.md b/blog/build-your-own-operator-on-macos-1.md
index 93f6e63b5f..21b7f7b75b 100644
--- a/blog/build-your-own-operator-on-macos-1.md
+++ b/blog/build-your-own-operator-on-macos-1.md
@@ -532,7 +532,6 @@ if __name__ == "__main__":
asyncio.run(cua_openai_loop())
```
-You can find the full code in our [notebook](https://github.com/trycua/cua/blob/main/notebooks/blog/build-your-own-operator-on-macos-1.ipynb).
#### Request Handling Differences
diff --git a/blog/build-your-own-operator-on-macos-2.md b/blog/build-your-own-operator-on-macos-2.md
index 75fabff7a0..9aa0b4fd1e 100644
--- a/blog/build-your-own-operator-on-macos-2.md
+++ b/blog/build-your-own-operator-on-macos-2.md
@@ -248,7 +248,6 @@ You can also run this in a VS Code notebook:
2. Copy the code into a cell (without the `if __name__ == "__main__":` part)
3. Run the cell to execute the code
-You can find the full code in our [notebook](https://github.com/trycua/cua/blob/main/notebooks/blog/build-your-own-operator-on-macos-2.ipynb).
Compare this to the manual implementation from Part 1 - we've reduced dozens of lines of code to just a few. The cua-agent framework handles all the complex logic internally, letting you focus on the overarching agentic system.
@@ -675,7 +674,6 @@ With the basics covered, you might want to explore:
### Resources
- [cua-agent GitHub repository](https://github.com/trycua/cua/tree/main/libs/python/agent)
-- [Agent Notebook Examples](https://github.com/trycua/cua/blob/main/notebooks/agent_nb.ipynb)
- [OpenAI Agent SDK Specification](https://platform.openai.com/docs/api-reference/responses)
- [Anthropic API Documentation](https://platform.claude.com/docs/en/api/overview)
- [UI-TARS GitHub](https://github.com/ByteDance/UI-TARS)
diff --git a/blog/composite-agents.md b/blog/composite-agents.md
index 813047e994..e4314fad8b 100644
--- a/blog/composite-agents.md
+++ b/blog/composite-agents.md
@@ -55,7 +55,6 @@ agent = ComputerAgent(
For a full, ready-to-run demo (install deps, local computer using Docker, and a composed agent example), see the notebook:
-- https://github.com/trycua/cua/blob/models/opencua/notebooks/composite_agents_docker_nb.ipynb
## What's next
diff --git a/blog/hack-the-north.md b/blog/hack-the-north.md
index 6a78b5bdb8..8253a7e2a4 100644
--- a/blog/hack-the-north.md
+++ b/blog/hack-the-north.md
@@ -63,7 +63,6 @@ Our slot landed at **2:30 a.m.** (_perks of the cheapest sponsor tier_). Thirty
- **Leave something tangible.** We provided a Jupyter Notebook teams could run immediately.
- **Narrow scope, strong starts.** The more focused the challenge, the more **robust starting points** you should provide.
-- **Want the details?** [Here’s the notebook we left participants](https://github.com/trycua/cua/blob/main/notebooks/sota_hackathon.ipynb).
![hack-booth](./assets/hack-workshop.jpeg)
diff --git a/blog/hud-agent-evals.md b/blog/hud-agent-evals.md
index 1c7e31ec8a..1dfdbe39c6 100644
--- a/blog/hud-agent-evals.md
+++ b/blog/hud-agent-evals.md
@@ -88,6 +88,5 @@ Customize your evaluation with these options:
## Learn more
-- Notebook with end‑to‑end examples: https://github.com/trycua/cua/blob/main/notebooks/eval_osworld.ipynb
- Docs: https://cua.ai/docs/cua/guide/integrations/hud
- Live traces: https://app.hud.ai
diff --git a/blog/sandboxed-python-execution.md b/blog/sandboxed-python-execution.md
index b45a0ab5d4..15245fb623 100644
--- a/blog/sandboxed-python-execution.md
+++ b/blog/sandboxed-python-execution.md
@@ -378,4 +378,4 @@ Happy coding (safely)!
---
-_Want to dive deeper? Check out our [sandboxed functions examples](https://github.com/trycua/cua/blob/main/examples/sandboxed_functions_examples.py) and [virtual environment tests](https://github.com/trycua/cua/blob/main/tests/test_venv.py) on GitHub. Questions? Come chat with us on Discord!_
+_Want to dive deeper? Check out our [virtual environment tests](https://github.com/trycua/cua/blob/main/tests/test_venv.py) on GitHub. Questions? Come chat with us on Discord!_
diff --git a/examples/agents/test_linux_agent.py b/examples/agents/test_linux_agent.py
deleted file mode 100644
index 64b82d6fb4..0000000000
--- a/examples/agents/test_linux_agent.py
+++ /dev/null
@@ -1,83 +0,0 @@
-"""Run a ComputerAgent on a local Linux container using Sandbox.ephemeral.
-
- async with Sandbox.ephemeral(Image.linux(), local=True) as sb:
- agent = ComputerAgent(model="anthropic/claude-sonnet-4-5-20250929", tools=[sb])
- async for chunk in agent.run("What OS is this?"):
- for item in chunk.get("output", []):
- if item.get("type") == "message":
- for block in item.get("content", []):
- print(block.get("text", ""), end="")
-
-The Sandbox is passed directly as a tool — no separate Computer wrapper needed.
-Requires Docker and ANTHROPIC_API_KEY.
-"""
-
-from __future__ import annotations
-
-import asyncio
-import os
-import subprocess
-
-import pytest
-from cua_agent import ComputerAgent
-from cua_sandbox import Image, Sandbox
-
-pytestmark = pytest.mark.asyncio
-
-
-def _has_docker() -> bool:
- try:
- subprocess.run(["docker", "info"], capture_output=True, check=True, timeout=10)
- return True
- except (subprocess.SubprocessError, FileNotFoundError):
- return False
-
-
[email protected](not _has_docker(), reason="Docker not available")
[email protected](not os.getenv("ANTHROPIC_API_KEY"), reason="ANTHROPIC_API_KEY not set")
-async def test_linux_agent():
- async with Sandbox.ephemeral(
- Image.linux("ubuntu", "24.04"),
- local=True,
- name="example-linux-agent",
- ) as sb:
- agent = ComputerAgent(
- model="anthropic/claude-sonnet-4-5-20250929",
- tools=[sb],
- )
-
- chunks = []
- async for chunk in agent.run(
- "Run the command 'echo hello' in the terminal and tell me the output."
- ):
- chunks.append(chunk)
-
- assert chunks, "Agent produced no output"
- output_items = [item for chunk in chunks for item in chunk.get("output", [])]
- assert output_items, "Agent produced no output items"
-
-
-async def main():
- async with Sandbox.ephemeral(
- Image.linux("ubuntu", "24.04"),
- local=True,
- name="example-linux-agent",
- ) as sb:
- agent = ComputerAgent(
- model="anthropic/claude-sonnet-4-5-20250929",
- tools=[sb],
- )
-
- print("Agent running...")
- async for chunk in agent.run(
- "Run the command 'echo hello' in the terminal and tell me the output."
- ):
- for item in chunk.get("output", []):
- if item.get("type") == "message":
- for block in item.get("content", []):
- print(block.get("text", ""), end="", flush=True)
- print()
-
-
-if __name__ == "__main__":
- asyncio.run(main())
diff --git a/examples/computer-example-ts/.env.example b/examples/computer-example-ts/.env.example
deleted file mode 100644
index 260259a384..0000000000
--- a/examples/computer-example-ts/.env.example
+++ /dev/null
@@ -1,3 +0,0 @@
-OPENAI_API_KEY=
-CUA_API_KEY=
-CUA_CONTAINER_NAME=
\ No newline at end of file
diff --git a/examples/computer-example-ts/.gitignore b/examples/computer-example-ts/.gitignore
deleted file mode 100644
index 9bdf35599b..0000000000
--- a/examples/computer-example-ts/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-node_modules
-.DS_Store
-.env
\ No newline at end of file
diff --git a/examples/computer-example-ts/README.md b/examples/computer-example-ts/README.md
deleted file mode 100644
index b83838ce6a..0000000000
--- a/examples/computer-example-ts/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# cua-cloud-openai Example
-
-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 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 sandbox
-- Designed for Linux sandboxes, but can be adapted for other OS types
-
-## Getting Started
-
-1. **Install dependencies:**
-
- ```bash
- npm install
- ```
-
-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 sandbox
-
-3. **Run the example:**
-
- ```bash
- npx tsx src/index.ts
- ```
-
-## Files
-
-- `src/index.ts` — Main example script
-- `src/helpers.ts` — Helper for executing actions on the container
-
----
-
-If you have questions or issues, please open an issue or contact the maintainers.
diff --git a/examples/computer-example-ts/package-lock.json b/examples/computer-example-ts/package-lock.json
deleted file mode 100644
index ae0ad35640..0000000000
--- a/examples/computer-example-ts/package-lock.json
+++ /dev/null
@@ -1,818 +0,0 @@
-{
- "name": "computer-example-ts",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "computer-example-ts",
- "version": "1.0.0",
- "license": "MIT",
- "dependencies": {
- "@trycua/computer": "^0.1.6",
- "dotenv": "^16.6.1",
- "openai": "^5.23.2"
- },
- "devDependencies": {
- "@types/node": "^22.20.0",
- "tsx": "^4.22.4",
- "typescript": "^5.9.3"
- }
- },
- "node_modules/@esbuild/aix-ppc64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
- "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "aix"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-arm": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
- "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
- "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
- "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/darwin-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
- "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/darwin-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
- "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/freebsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
- "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/freebsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
- "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-arm": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
- "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
- "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-ia32": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
- "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-loong64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
- "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
- "cpu": [
- "loong64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-mips64el": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
- "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
- "cpu": [
- "mips64el"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-ppc64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
- "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-riscv64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
- "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-s390x": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
- "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
- "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/netbsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
- "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/netbsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
- "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openbsd-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
- "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openbsd-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
- "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openharmony-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
- "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openharmony"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/sunos-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
- "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "sunos"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-arm64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
- "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-ia32": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
- "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-x64": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
- "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@posthog/core": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.0.0.tgz",
- "integrity": "sha512-gquQld+duT9DdzLIFoHZkUMW0DZOTSLCtSjuuC/zKFz65Qecbz9p37DHBJMkw0dCuB8Mgh2GtH8Ag3PznJrP3g==",
- "license": "MIT"
- },
- "node_modules/@trycua/computer": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/@trycua/computer/-/computer-0.1.6.tgz",
- "integrity": "sha512-C17zUmDSoQsYTxUQVf6jLlQxZ33qNj8D7l2FkAsQsQNECnE1n3c/nKc7i4NSPD71BJDyHUlKeKSd2LrPLIqc/A==",
- "license": "MIT",
- "dependencies": {
- "@trycua/core": "^0.1.2",
- "pino": "^9.7.0",
- "uuid": "^11.0.0",
- "ws": "^8.18.0"
- }
- },
- "node_modules/@trycua/core": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/@trycua/core/-/core-0.1.3.tgz",
- "integrity": "sha512-sv7BEajJyZ+JNxrOdhao4qCOtRrh+S0XYf64ehAT4UAhLC73Kep06bGa/Uel0Ow5xGXXrg0aiVBL7zO9+/w4/Q==",
- "license": "MIT",
- "dependencies": {
- "@types/uuid": "^10.0.0",
- "pino": "^9.7.0",
- "posthog-node": "^5.1.1",
- "uuid": "^11.1.0"
- }
- },
- "node_modules/@types/node": {
- "version": "22.20.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.0.tgz",
- "integrity": "sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "undici-types": "~6.21.0"
- }
- },
- "node_modules/@types/uuid": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
- "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
- "license": "MIT"
- },
- "node_modules/atomic-sleep": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
- "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
- "license": "MIT",
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/dotenv": {
- "version": "16.6.1",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
- "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
- "license": "BSD-2-Clause",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://dotenvx.com"
- }
- },
- "node_modules/esbuild": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
- "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=18"
- },
- "optionalDependencies": {
- "@esbuild/aix-ppc64": "0.28.1",
- "@esbuild/android-arm": "0.28.1",
- "@esbuild/android-arm64": "0.28.1",
- "@esbuild/android-x64": "0.28.1",
- "@esbuild/darwin-arm64": "0.28.1",
- "@esbuild/darwin-x64": "0.28.1",
- "@esbuild/freebsd-arm64": "0.28.1",
- "@esbuild/freebsd-x64": "0.28.1",
- "@esbuild/linux-arm": "0.28.1",
- "@esbuild/linux-arm64": "0.28.1",
- "@esbuild/linux-ia32": "0.28.1",
- "@esbuild/linux-loong64": "0.28.1",
- "@esbuild/linux-mips64el": "0.28.1",
- "@esbuild/linux-ppc64": "0.28.1",
- "@esbuild/linux-riscv64": "0.28.1",
- "@esbuild/linux-s390x": "0.28.1",
- "@esbuild/linux-x64": "0.28.1",
- "@esbuild/netbsd-arm64": "0.28.1",
- "@esbuild/netbsd-x64": "0.28.1",
- "@esbuild/openbsd-arm64": "0.28.1",
- "@esbuild/openbsd-x64": "0.28.1",
- "@esbuild/openharmony-arm64": "0.28.1",
- "@esbuild/sunos-x64": "0.28.1",
- "@esbuild/win32-arm64": "0.28.1",
- "@esbuild/win32-ia32": "0.28.1",
- "@esbuild/win32-x64": "0.28.1"
- }
- },
- "node_modules/fast-redact": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz",
- "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/fsevents": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
- "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
- }
- },
- "node_modules/on-exit-leak-free": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
- "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==",
- "license": "MIT",
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/openai": {
- "version": "5.23.2",
- "resolved": "https://registry.npmjs.org/openai/-/openai-5.23.2.tgz",
- "integrity": "sha512-MQBzmTulj+MM5O8SKEk/gL8a7s5mktS9zUtAkU257WjvobGc9nKcBuVwjyEEcb9SI8a8Y2G/mzn3vm9n1Jlleg==",
- "license": "Apache-2.0",
- "bin": {
- "openai": "bin/cli"
- },
- "peerDependencies": {
- "ws": "^8.18.0",
- "zod": "^3.23.8"
- },
- "peerDependenciesMeta": {
- "ws": {
- "optional": true
- },
- "zod": {
- "optional": true
- }
- }
- },
- "node_modules/pino": {
- "version": "9.9.0",
- "resolved": "https://registry.npmjs.org/pino/-/pino-9.9.0.tgz",
- "integrity": "sha512-zxsRIQG9HzG+jEljmvmZupOMDUQ0Jpj0yAgE28jQvvrdYTlEaiGwelJpdndMl/MBuRr70heIj83QyqJUWaU8mQ==",
- "license": "MIT",
- "dependencies": {
- "atomic-sleep": "^1.0.0",
- "fast-redact": "^3.1.1",
- "on-exit-leak-free": "^2.1.0",
- "pino-abstract-transport": "^2.0.0",
- "pino-std-serializers": "^7.0.0",
- "process-warning": "^5.0.0",
- "quick-format-unescaped": "^4.0.3",
- "real-require": "^0.2.0",
- "safe-stable-stringify": "^2.3.1",
- "sonic-boom": "^4.0.1",
- "thread-stream": "^3.0.0"
- },
- "bin": {
- "pino": "bin.js"
- }
- },
- "node_modules/pino-abstract-transport": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz",
- "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==",
- "license": "MIT",
- "dependencies": {
- "split2": "^4.0.0"
- }
- },
- "node_modules/pino-std-serializers": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz",
- "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==",
- "license": "MIT"
- },
- "node_modules/posthog-node": {
- "version": "5.7.0",
- "resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-5.7.0.tgz",
- "integrity": "sha512-6J1AIZWtbr2lEbZOO2AzO/h1FPJjUZM4KWcdaL2UQw7FY8J7VNaH3NiaRockASFmglpID7zEY25gV/YwCtuXjg==",
- "license": "MIT",
- "dependencies": {
- "@posthog/core": "1.0.0"
- },
- "engines": {
- "node": ">=20"
- }
- },
- "node_modules/process-warning": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz",
- "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/fastify"
- },
- {
- "type": "opencollective",
- "url": "https://opencollective.com/fastify"
- }
- ],
- "license": "MIT"
- },
- "node_modules/quick-format-unescaped": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
- "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==",
- "license": "MIT"
- },
- "node_modules/real-require": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
- "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==",
- "license": "MIT",
- "engines": {
- "node": ">= 12.13.0"
- }
- },
- "node_modules/safe-stable-stringify": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
- "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/sonic-boom": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz",
- "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==",
- "license": "MIT",
- "dependencies": {
- "atomic-sleep": "^1.0.0"
- }
- },
- "node_modules/split2": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
- "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
- "license": "ISC",
- "engines": {
- "node": ">= 10.x"
- }
- },
- "node_modules/thread-stream": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz",
- "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==",
- "license": "MIT",
- "dependencies": {
- "real-require": "^0.2.0"
- }
- },
- "node_modules/tsx": {
- "version": "4.22.4",
- "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz",
- "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "esbuild": "~0.28.0"
- },
- "bin": {
- "tsx": "dist/cli.mjs"
- },
- "engines": {
- "node": ">=18.0.0"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.3"
- }
- },
- "node_modules/typescript": {
- "version": "5.9.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
- "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
- "dev": true,
- "license": "Apache-2.0",
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
- "node_modules/undici-types": {
- "version": "6.21.0",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
- "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/uuid": {
- "version": "11.1.1",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz",
- "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==",
- "funding": [
- "https://github.com/sponsors/broofa",
- "https://github.com/sponsors/ctavan"
- ],
- "license": "MIT",
- "bin": {
- "uuid": "dist/esm/bin/uuid"
- }
- },
- "node_modules/ws": {
- "version": "8.21.0",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
- "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
- "license": "MIT",
- "engines": {
- "node": ">=10.0.0"
- },
- "peerDependencies": {
- "bufferutil": "^4.0.1",
- "utf-8-validate": ">=5.0.2"
- },
- "peerDependenciesMeta": {
- "bufferutil": {
- "optional": true
- },
- "utf-8-validate": {
- "optional": true
- }
- }
- }
- }
-}
diff --git a/examples/computer-example-ts/package.json b/examples/computer-example-ts/package.json
deleted file mode 100644
index 6b3d91623b..0000000000
--- a/examples/computer-example-ts/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "computer-example-ts",
- "version": "1.0.0",
- "description": "",
- "type": "module",
- "main": "index.js",
- "scripts": {
- "dev": "tsx watch src/index.ts",
- "start": "tsx src/index.ts",
- "format": "prettier --write .",
- "format:check": "prettier --check ."
- },
- "keywords": [],
- "author": "",
- "license": "MIT",
- "packageManager": "[email protected]",
- "dependencies": {
- "@trycua/computer": "^0.1.6",
- "dotenv": "^16.6.1",
- "openai": "^5.23.2"
- },
- "devDependencies": {
- "@types/node": "^22.20.0",
- "tsx": "^4.22.4",
- "typescript": "^5.9.3"
- }
-}
diff --git a/examples/computer-example-ts/pnpm-lock.yaml b/examples/computer-example-ts/pnpm-lock.yaml
deleted file mode 100644
index 1bdd3fe607..0000000000
--- a/examples/computer-example-ts/pnpm-lock.yaml
+++ /dev/null
@@ -1,526 +0,0 @@
-lockfileVersion: '9.0'
-
-settings:
- autoInstallPeers: true
- excludeLinksFromLockfile: false
-
-importers:
-
- .:
- dependencies:
- '@trycua/computer':
- specifier: ^0.1.6
- version: 0.1.6
- dotenv:
- specifier: ^16.6.1
- version: 16.6.1
- openai:
- specifier: ^5.23.2
- version: 5.23.2([email protected])
- devDependencies:
- '@types/node':
- specifier: ^22.20.0
- version: 22.20.0
- tsx:
- specifier: ^4.22.4
- version: 4.22.4
- typescript:
- specifier: ^5.9.3
- version: 5.9.3
-
-packages:
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
- engines: {node: '>=18'}
- cpu: [ppc64]
- os: [aix]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [android]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
- engines: {node: '>=18'}
- cpu: [arm]
- os: [android]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [android]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [darwin]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [darwin]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [freebsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [freebsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
- engines: {node: '>=18'}
- cpu: [arm]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
- engines: {node: '>=18'}
- cpu: [ia32]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
- engines: {node: '>=18'}
- cpu: [loong64]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
- engines: {node: '>=18'}
- cpu: [mips64el]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
- engines: {node: '>=18'}
- cpu: [ppc64]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
- engines: {node: '>=18'}
- cpu: [riscv64]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
- engines: {node: '>=18'}
- cpu: [s390x]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [linux]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [netbsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [netbsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [openbsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [openbsd]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [openharmony]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [sunos]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
- engines: {node: '>=18'}
- cpu: [arm64]
- os: [win32]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
- engines: {node: '>=18'}
- cpu: [ia32]
- os: [win32]
-
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
- engines: {node: '>=18'}
- cpu: [x64]
- os: [win32]
-
- '@pinojs/[email protected]':
- resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==}
-
- '@posthog/[email protected]':
- resolution: {integrity: sha512-DowOjN83tGtg4NPv0tmExjXiIWapHDDTv0ZZHg70XBjH5o/AB3DkMVMvj5ODIi1Y5bw7eMETidGvRwWH0/g3wA==}
-
- '@posthog/[email protected]':
- resolution: {integrity: sha512-WcfKz2GNn2vfDX8vXmJYbKxegPxVWHuDQ/pHdAn0HoZDXDFnEp/+x3qBQA+fEvtbPjjtjgAt2wIgJMlM7asx7g==}
-
- '@trycua/[email protected]':
- resolution: {integrity: sha512-C17zUmDSoQsYTxUQVf6jLlQxZ33qNj8D7l2FkAsQsQNECnE1n3c/nKc7i4NSPD71BJDyHUlKeKSd2LrPLIqc/A==}
-
- '@trycua/[email protected]':
- resolution: {integrity: sha512-ZRO0VmzHpvkUkGKTk8AZTlHqWqOSlURcW/ckqraPOtGZev0Pe1mCiPEhY2c/xZ4zye6y7Ut7fqGTwRuKOJ3Q7A==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==}
-
- '@types/[email protected]':
- resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==}
-
- resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
- engines: {node: '>=8.0.0'}
-
- resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
- engines: {node: '>=12'}
-
- resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==}
- engines: {node: '>=18'}
- hasBin: true
-
- resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
- os: [darwin]
-
- resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
- engines: {node: '>=14.0.0'}
-
- resolution: {integrity: sha512-MQBzmTulj+MM5O8SKEk/gL8a7s5mktS9zUtAkU257WjvobGc9nKcBuVwjyEEcb9SI8a8Y2G/mzn3vm9n1Jlleg==}
- hasBin: true
- peerDependencies:
- ws: ^8.18.0
- zod: ^3.23.8
- peerDependenciesMeta:
- ws:
- optional: true
- zod:
- optional: true
-
- resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==}
-
- resolution: {integrity: sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==}
-
- resolution: {integrity: sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w==}
- hasBin: true
-
- resolution: {integrity: sha512-eiKpU+vX4hVuHbO/EosvPHsmh2AVIdoVmWss/uUOs1t4b0ViCblw2o8OIFqHxKj3mYRnSOBlX0Dw3wBvcCaYpA==}
- engines: {node: ^20.20.0 || >=22.22.0}
- peerDependencies:
- rxjs: ^7.0.0
- peerDependenciesMeta:
- rxjs:
- optional: true
-
- resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==}
-
- resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
-
- resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
- engines: {node: '>= 12.13.0'}
-
- resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==}
- engines: {node: '>=10'}
-
- resolution: {integrity: sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==}
-
- resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
- engines: {node: '>= 10.x'}
-
- resolution: {integrity: sha512-zLBvqpwr4Esa0kRjcrzGU6zL25lePWaCLMx0RQFrmteozIfeNdaMLpG5U7PeHzvlFkAWaRKA9/KVW4F60iB+qw==}
-
- resolution: {integrity: sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==}
- engines: {node: '>=18.0.0'}
- hasBin: true
-
- resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
- engines: {node: '>=14.17'}
- hasBin: true
-
- resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
-
- resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==}
- hasBin: true
-
- resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==}
- engines: {node: '>=10.0.0'}
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: '>=5.0.2'
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
-
-snapshots:
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@esbuild/[email protected]':
- optional: true
-
- '@pinojs/[email protected]': {}
-
- '@posthog/[email protected]':
- dependencies:
- '@posthog/types': 1.390.2
-
- '@posthog/[email protected]': {}
-
- '@trycua/[email protected]':
- dependencies:
- '@trycua/core': 0.1.4
- pino: 9.14.0
- uuid: 11.1.1
- ws: 8.21.0
- transitivePeerDependencies:
- - bufferutil
- - rxjs
- - utf-8-validate
-
- '@trycua/[email protected]':
- dependencies:
- '@types/uuid': 10.0.0
- pino: 9.14.0
- posthog-node: 5.38.2
- uuid: 11.1.1
- transitivePeerDependencies:
- - rxjs
-
- '@types/[email protected]':
- dependencies:
- undici-types: 6.21.0
-
- '@types/[email protected]': {}
-
-
-
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.28.1
- '@esbuild/android-arm': 0.28.1
- '@esbuild/android-arm64': 0.28.1
- '@esbuild/android-x64': 0.28.1
- '@esbuild/darwin-arm64': 0.28.1
- '@esbuild/darwin-x64': 0.28.1
- '@esbuild/freebsd-arm64': 0.28.1
- '@esbuild/freebsd-x64': 0.28.1
- '@esbuild/linux-arm': 0.28.1
- '@esbuild/linux-arm64': 0.28.1
- '@esbuild/linux-ia32': 0.28.1
- '@esbuild/linux-loong64': 0.28.1
- '@esbuild/linux-mips64el': 0.28.1
- '@esbuild/linux-ppc64': 0.28.1
- '@esbuild/linux-riscv64': 0.28.1
- '@esbuild/linux-s390x': 0.28.1
- '@esbuild/linux-x64': 0.28.1
- '@esbuild/netbsd-arm64': 0.28.1
- '@esbuild/netbsd-x64': 0.28.1
- '@esbuild/openbsd-arm64': 0.28.1
- '@esbuild/openbsd-x64': 0.28.1
- '@esbuild/openharmony-arm64': 0.28.1
- '@esbuild/sunos-x64': 0.28.1
- '@esbuild/win32-arm64': 0.28.1
- '@esbuild/win32-ia32': 0.28.1
- '@esbuild/win32-x64': 0.28.1
-
- optional: true
-
-
- optionalDependencies:
- ws: 8.21.0
-
- dependencies:
- split2: 4.2.0
-
-
- dependencies:
- '@pinojs/redact': 0.4.0
- atomic-sleep: 1.0.0
- on-exit-leak-free: 2.1.2
- pino-abstract-transport: 2.0.0
- pino-std-serializers: 7.1.0
- process-warning: 5.0.0
- quick-format-unescaped: 4.0.4
- real-require: 0.2.0
- safe-stable-stringify: 2.5.0
- sonic-boom: 4.2.1
- thread-stream: 3.2.0
-
- dependencies:
- '@posthog/core': 1.35.4
-
-
-
-
-
- dependencies:
- atomic-sleep: 1.0.0
-
-
- dependencies:
- real-require: 0.2.0
-
- dependencies:
- esbuild: 0.28.1
- optionalDependencies:
- fsevents: 2.3.3
-
-
-
-
diff --git a/examples/computer-example-ts/src/helpers.ts b/examples/computer-example-ts/src/helpers.ts
deleted file mode 100644
index 4f273cacac..0000000000
--- a/examples/computer-example-ts/src/helpers.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import type { Computer } from '@trycua/computer';
-import type OpenAI from 'openai';
-
-export async function executeAction(
- computer: Computer,
- action: OpenAI.Responses.ResponseComputerToolCall['action']
-) {
- switch (action.type) {
- case 'click': {
- const { x, y, button } = action;
- console.log(`Executing click at (${x}, ${y}) with button '${button}'.`);
- await computer.interface.moveCursor(x, y);
- if (button === 'right') await computer.interface.rightClick();
- else await computer.interface.leftClick();
- break;
- }
- case 'type':
- {
- const { text } = action;
- console.log(`Typing text: ${text}`);
- await computer.interface.typeText(text);
- }
- break;
- case 'scroll': {
- const { x: locX, y: locY, scroll_x, scroll_y } = action;
- console.log(
- `Scrolling at (${locX}, ${locY}) with offsets (scroll_x=${scroll_x}, scroll_y=${scroll_y}).`
- );
- await computer.interface.moveCursor(locX, locY);
- await computer.interface.scroll(scroll_x, scroll_y);
- break;
- }
- case 'keypress': {
- const { keys } = action;
- for (const key of keys) {
- console.log(`Pressing key: ${key}.`);
- // Map common key names to Cua equivalents
- if (key.toLowerCase() === 'enter') {
- await computer.interface.pressKey('return');
- } else if (key.toLowerCase() === 'space') {
- await computer.interface.pressKey('space');
- } else {
- await computer.interface.pressKey(key);
- }
- }
- break;
- }
- case 'wait': {
- console.log(`Waiting for 3 seconds.`);
- await new Promise((resolve) => setTimeout(resolve, 3 * 1000));
- break;
- }
- case 'screenshot': {
- console.log('Taking screenshot.');
- // This is handled automatically in the main loop, but we can take an extra one if requested
- const screenshot = await computer.interface.screenshot();
- return screenshot;
- }
- default:
- console.log(`Unrecognized action: ${action.type}`);
- break;
- }
-}
diff --git a/examples/computer-example-ts/src/index.ts b/examples/computer-example-ts/src/index.ts
deleted file mode 100644
index 119c8555b9..0000000000
--- a/examples/computer-example-ts/src/index.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import { Computer, OSType } from '@trycua/computer';
-import OpenAI from 'openai';
-import { executeAction } from './helpers';
-
-import 'dotenv/config';
-
-const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
-
-const COMPUTER_USE_PROMPT = 'Open firefox and go to cua.ai';
-
-// Initialize the Computer Connection
-const computer = new Computer({
- apiKey: process.env.CUA_API_KEY!,
- name: process.env.CUA_CONTAINER_NAME!,
- osType: OSType.LINUX,
-});
-
-await computer.run();
-// Take the initial screenshot
-const screenshot = await computer.interface.screenshot();
-const screenshotBase64 = screenshot.toString('base64');
-
-// Setup openai config for computer use
-const computerUseConfig: OpenAI.Responses.ResponseCreateParamsNonStreaming = {
- model: 'computer-use-preview',
- tools: [
- {
- type: 'computer_use_preview',
- display_width: 1024,
- display_height: 768,
- environment: 'linux', // we're using a linux vm
- },
- ],
- truncation: 'auto',
-};
-
-// Send initial screenshot to the openai computer use model
-let res = await openai.responses.create({
- ...computerUseConfig,
- input: [
- {
- role: 'user',
- content: [
- // what we want the ai to do
- { type: 'input_text', text: COMPUTER_USE_PROMPT },
- // current screenshot of the vm
- {
- type: 'input_image',
- image_url: `data:image/png;base64,${screenshotBase64}`,
- detail: 'auto',
- },
- ],
- },
- ],
-});
-
-// Loop until there are no more computer use actions.
-while (true) {
- const computerCalls = res.output.filter((o) => o.type === 'computer_call');
- if (computerCalls.length < 1) {
- console.log('No more computer calls. Loop complete.');
- break;
- }
- // Get the first call
- const call = computerCalls[0];
- const action = call.action;
- console.log('Received action from OpenAI Responses API:', action);
- let ackChecks: OpenAI.Responses.ResponseComputerToolCall.PendingSafetyCheck[] = [];
- if (call.pending_safety_checks.length > 0) {
- console.log('Safety checks pending:', call.pending_safety_checks);
- // In a real implementation, you would want to get user confirmation here
- ackChecks = call.pending_safety_checks;
- }
-
- // Execute the action in the container
- await executeAction(computer, action);
- // Wait for changes to process within the container (1sec)
- await new Promise((resolve) => setTimeout(resolve, 1000));
-
- // Capture new screenshot
- const newScreenshot = await computer.interface.screenshot();
- const newScreenshotBase64 = newScreenshot.toString('base64');
-
- // Screenshot back as computer_call_output
-
- res = await openai.responses.create({
- ...computerUseConfig,
- previous_response_id: res.id,
- input: [
- {
- type: 'computer_call_output',
- call_id: call.call_id,
- acknowledged_safety_checks: ackChecks,
- output: {
- type: 'computer_screenshot',
- image_url: `data:image/png;base64,${newScreenshotBase64}`,
- },
- },
- ],
- });
-}
-
-process.exit();
diff --git a/examples/computer-example-ts/tsconfig.json b/examples/computer-example-ts/tsconfig.json
deleted file mode 100644
index 9d3e969add..0000000000
--- a/examples/computer-example-ts/tsconfig.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "compilerOptions": {
- "target": "esnext",
- "lib": ["es2023"],
- "moduleDetection": "force",
- "module": "preserve",
- "moduleResolution": "bundler",
- "allowImportingTsExtensions": true,
- "resolveJsonModule": true,
- "types": ["node"],
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "noUnusedLocals": true,
- "declaration": true,
- "emitDeclarationOnly": true,
- "esModuleInterop": true,
- "isolatedModules": true,
- "verbatimModuleSyntax": true,
- "skipLibCheck": true,
- "outDir": "build"
- },
- "include": ["src"]
-}
diff --git a/examples/utils.py b/examples/utils.py
deleted file mode 100644
index 7ad94e5cd1..0000000000
--- a/examples/utils.py
+++ /dev/null
@@ -1,55 +0,0 @@
-"""Utility functions for example scripts."""
-
-import os
-import signal
-import sys
-from pathlib import Path
-from typing import Optional
-
-
-def load_env_file(path: Path) -> bool:
- """Load environment variables from a file.
-
- Args:
- path: Path to the .env file
-
- Returns:
- True if file was loaded successfully, False otherwise
- """
- if not path.exists():
- return False
-
- print(f"Loading environment from {path}")
- with open(path, "r") as f:
- for line in f:
- line = line.strip()
- if not line or line.startswith("#"):
- continue
-
- key, value = line.split("=", 1)
- os.environ[key] = value
-
- return True
-
-
-def load_dotenv_files():
- """Load environment variables from .env files.
-
- Tries to load from .env.local first, then .env if .env.local doesn't exist.
- """
- # Get the project root directory (parent of the examples directory)
- project_root = Path(__file__).parent.parent
-
- # Try loading .env.local first, then .env if .env.local doesn't exist
- env_local_path = project_root / ".env.local"
- env_path = project_root / ".env"
-
- # Load .env.local if it exists, otherwise try .env
- if not load_env_file(env_local_path):
- load_env_file(env_path)
-
-
-def handle_sigint(signum, frame):
- """Handle SIGINT (Ctrl+C) gracefully."""
- print("\nExiting gracefully...")
- sys.exit(0)
diff --git a/libs/python/agent/cua_agent/loops/uitars2.py b/libs/python/agent/cua_agent/loops/uitars2.py
index 4ecb3b04da..ffa36ad6d0 100644
--- a/libs/python/agent/cua_agent/loops/uitars2.py
+++ b/libs/python/agent/cua_agent/loops/uitars2.py
@@ -1,6 +1,6 @@
"""
UITARS-2 agent loop implementation using LiteLLM.
-- Prepends a system prompt modeled after the training prompts in examples/seed_16_gui.ipynb
+- Prepends a system prompt modeled after the UI-TARS training prompts
- Converts Responses items -> completion messages
- Calls litellm.acompletion
- Parses <seed:tool_call> ... </seed:tool_call> outputs back into Responses items (computer actions)
diff --git a/libs/python/computer/computer/ui/gradio/app.py b/libs/python/computer/computer/ui/gradio/app.py
index 3c737b637a..813adc5a97 100644
--- a/libs/python/computer/computer/ui/gradio/app.py
+++ b/libs/python/computer/computer/ui/gradio/app.py
@@ -182,7 +182,7 @@ last_screenshot_before = None # Store the most [-2]th recent screenshot
screenshot_images = [] # Array to store all screenshot images
# Define a constant for the output directory
-OUTPUT_DIR = "examples/output"
+OUTPUT_DIR = "output"
SESSION_DIR = os.path.join(OUTPUT_DIR, "sessions")
diff --git a/libs/python/cua-sandbox/pyproject.toml b/libs/python/cua-sandbox/pyproject.toml
index 6b4fa91815..27c5e2b6b0 100644
--- a/libs/python/cua-sandbox/pyproject.toml
+++ b/libs/python/cua-sandbox/pyproject.toml
@@ -83,8 +83,8 @@ ignore = ["E501"]
asyncio_mode = "auto"
testpaths = [
"tests",
- "../../../examples/sandboxes",
- "../../../examples/agents",
+ "../../../tests/integration/sandbox_sdk",
+ "../../../tests/integration/sandbox_cli",
]
[dependency-groups]
diff --git a/libs/python/som/README.md b/libs/python/som/README.md
index cb53e9c1c7..183f62799c 100644
--- a/libs/python/som/README.md
+++ b/libs/python/som/README.md
@@ -79,24 +79,6 @@ for elem in result.elements:
- [Configuration](http://localhost:8090/docs/libraries/som/configuration)
-## Development
-
-### Test Data
-
-- Place test screenshots in `examples/test_data/`
-- Not tracked in git to keep repository size manageable
-- Default test image: `test_screen.png` (1920x1080)
-
-### Running Tests
-
-```bash
-# Run benchmark with no OCR
-python examples/omniparser_examples.py examples/test_data/test_screen.png --runs 5 --ocr none
-
-# Run benchmark with OCR
-python examples/omniparser_examples.py examples/test_data/test_screen.png --runs 5 --ocr easyocr
-```
-
## License
MIT License - See LICENSE file for details.
diff --git a/notebooks/README.md b/notebooks/README.md
deleted file mode 100644
index 9c51f9a948..0000000000
--- a/notebooks/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Cua Notebooks
-
-This folder contains Jupyter notebooks that demonstrate the core functionality of the Cua (Computer Use Automation) system. These notebooks serve as interactive examples and quickstart guides for different components of the Cua platform.
-
-> **For development setup and contributing**, see the [Development Guide](../Development.md).
-
-## Available Notebooks
-
-### Core Components
-
-- **`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)
-- **`computer_server_nb.ipynb`** - Demonstrates how to host and configure the Computer server that powers the Computer API
-
-### Evaluation & Benchmarking
-
-- **`eval_osworld.ipynb`** - Shows ComputerAgent integration with HUD for OSWorld benchmarking, supporting both Claude and OpenAI models
-
-### Tutorials
-
-- **`blog/`** - Tutorial notebooks from blog posts:
- - `build-your-own-operator-on-macos-1.ipynb` - Part 1: Building a Cua operator using OpenAI's computer-use-preview model
- - `build-your-own-operator-on-macos-2.ipynb` - Part 2: Using the cua-agent package for more advanced automation
diff --git a/notebooks/agent_nb.ipynb b/notebooks/agent_nb.ipynb
deleted file mode 100644
index 18bc7df717..0000000000
--- a/notebooks/agent_nb.ipynb
+++ /dev/null
@@ -1,548 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "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 Sandbox or local VMs on Apple Silicon Macs."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Installation"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-agent[all]\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Initialize a Computer Agent"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "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",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer, VMProviderType\n",
- "from agent import ComputerAgent"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import os\n",
- "\n",
- "# Get API keys from environment or prompt user\n",
- "anthropic_key = os.getenv(\"ANTHROPIC_API_KEY\") or input(\"Enter your Anthropic API key: \")\n",
- "openai_key = os.getenv(\"OPENAI_API_KEY\") or input(\"Enter your OpenAI API key: \")\n",
- "\n",
- "os.environ[\"ANTHROPIC_API_KEY\"] = anthropic_key\n",
- "os.environ[\"OPENAI_API_KEY\"] = openai_key"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 1: Agent with Cua Cloud Sandbox\n",
- "\n",
- "Use Cloud Sandbox for running agents from any system without local setup."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Prerequisites for Cloud Sandbox\n",
- "\n",
- "To use Cua Cloud Sandbox, you need to:\n",
- "1. Sign up at https://cua.ai\n",
- "2. Create a Cloud Sandbox\n",
- "3. Generate an API Key\n",
- "\n",
- "Once 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 sandbox details"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "cua_api_key = os.getenv(\"CUA_API_KEY\") or input(\"Enter your Cua API Key: \")\n",
- "container_name = os.getenv(\"CONTAINER_NAME\") or input(\"Enter your Cloud Container name: \")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Choose the OS type for your sandbox (linux or macos)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "os_type = (\n",
- " input(\"Enter the OS type of your sandbox (linux/macos) [default: linux]: \").lower() or \"linux\"\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "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 Sandbox\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",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Run tasks on Cloud Sandbox"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "tasks = [\n",
- " \"Open a web browser and navigate to GitHub\",\n",
- " \"Search for the trycua/cua repository\",\n",
- " \"Take a screenshot of the repository page\",\n",
- "]\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i+1}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " # print(result)\n",
- " pass\n",
- " print(f\"✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 2: KASM Local Docker Containers (cross-platform)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Before we can create an agent, we need to initialize a local computer with Docker provider."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "\n",
- "computer = Computer(\n",
- " os_type=\"linux\",\n",
- " provider_type=\"docker\",\n",
- " image=\"trycua/cua-ubuntu:latest\",\n",
- " name=\"my-cua-container\",\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 3: Agent with Local VMs (Lume daemon)\n",
- "\n",
- "For Apple Silicon Macs, run agents on local VMs with near-native performance."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Before we can create an agent, we need to initialize a local computer with Lume."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "\n",
- "\n",
- "computer = Computer(\n",
- " verbosity=logging.INFO,\n",
- " provider_type=VMProviderType.LUME,\n",
- " display=\"1024x768\",\n",
- " memory=\"8GB\",\n",
- " cpu=\"4\",\n",
- " os_type=\"macos\",\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Create an agent"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Let's start by creating an agent that relies on the OpenAI API computer-use-preview model."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create agent with Anthropic loop and provider\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",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Run tasks on a computer:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "tasks = [\n",
- " \"Look for a repository named trycua/cua on GitHub.\",\n",
- " \"Check the open issues, open the most recent one and read it.\",\n",
- " \"Clone the repository in users/lume/projects if it doesn't exist yet.\",\n",
- " \"Open the repository with an app named Cursor (on the dock, black background and white cube icon).\",\n",
- " \"From Cursor, open Composer if not already open.\",\n",
- " \"Focus on the Composer text area, then write and submit a task to help resolve the GitHub issue.\",\n",
- "]\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " # print(result)\n",
- " pass\n",
- "\n",
- " print(f\"\\n✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Or using the Omni Agent Loop:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "from agent import ComputerAgent\n",
- "\n",
- "computer = Computer(verbosity=logging.INFO)\n",
- "\n",
- "# Create agent with Anthropic loop and provider\n",
- "agent = ComputerAgent(\n",
- " model=\"omniparser+ollama_chat/gemma3:12b-it-q4_K_M\",\n",
- " # model=\"omniparser+openai/gpt-4o-mini\",\n",
- " # model=\"omniparser+anthropic/claude-3-7-sonnet-20250219\",\n",
- " tools=[computer],\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " only_n_most_recent_images=3,\n",
- " verbosity=logging.INFO,\n",
- ")\n",
- "\n",
- "tasks = [\n",
- " \"Look for a repository named trycua/cua on GitHub.\",\n",
- " \"Check the open issues, open the most recent one and read it.\",\n",
- " \"Clone the repository in users/lume/projects if it doesn't exist yet.\",\n",
- " \"Open the repository with an app named Cursor (on the dock, black background and white cube icon).\",\n",
- " \"From Cursor, open Composer if not already open.\",\n",
- " \"Focus on the Composer text area, then write and submit a task to help resolve the GitHub issue.\",\n",
- "]\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " # print(result)\n",
- " pass\n",
- "\n",
- " print(f\"\\n✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Using the Gradio UI\n",
- "\n",
- "The agent includes a Gradio-based user interface for easy interaction. To use it:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from agent.ui.gradio.ui_components import create_gradio_ui\n",
- "\n",
- "app = create_gradio_ui()\n",
- "app.launch(share=False)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Advanced Agent Configurations"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Using different agent loops"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can use different agent loops depending on your needs:"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "1. OpenAI Agent Loop"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "openai_agent = ComputerAgent(\n",
- " tools=[computer], # Can be cloud or local\n",
- " model=\"openai/computer-use-preview\",\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " verbosity=logging.INFO,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "2. Anthropic Agent Loop"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "anthropic_agent = ComputerAgent(\n",
- " tools=[computer],\n",
- " model=\"anthropic/claude-sonnet-4-5-20250929\",\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " verbosity=logging.INFO,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "3. Omni Agent Loop (supports multiple providers)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "omni_agent = ComputerAgent(\n",
- " tools=[computer],\n",
- " model=\"omniparser+anthropic/claude-3-7-sonnet-20250219\",\n",
- " # model=\"omniparser+openai/gpt-4o-mini\",\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " only_n_most_recent_images=3,\n",
- " verbosity=logging.INFO,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "4. UITARS Agent Loop (for local inference on Apple Silicon)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "uitars_agent = ComputerAgent(\n",
- " tools=[computer],\n",
- " model=\"mlx/mlx-community/UI-TARS-1.5-7B-6bit\", # local MLX\n",
- " # model=\"huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B\", # local Huggingface (transformers)\n",
- " # model=\"huggingface/ByteDance-Seed/UI-TARS-1.5-7B\", # remote Huggingface (TGI)\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " verbosity=logging.INFO,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Trajectory viewing"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "All agent runs save trajectories that can be viewed at https://cua.ai/trajectory-viewer"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "print(f\"Trajectories saved to: {Path('trajectories').absolute()}\")\n",
- "print(\"Upload trajectory files to https://cua.ai/trajectory-viewer to visualize agent actions\")"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.13.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/blog/build-your-own-operator-on-macos-1.ipynb b/notebooks/blog/build-your-own-operator-on-macos-1.ipynb
deleted file mode 100644
index 1fad90f84a..0000000000
--- a/notebooks/blog/build-your-own-operator-on-macos-1.ipynb
+++ /dev/null
@@ -1,321 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Build Your Own Operator on macOS - Part 1"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Welcome to Part 1 of our tutorial series on building a Computer Use Automation (Cua) operator using OpenAI. For the complete guide, check out our [full blog post](https://cua.ai/blog/build-your-own-operator-on-macos-1)."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "We'll learn how to combine the OpenAI Responses API (using the `computer-use-preview` model) with the Cua macOS interface to automate tasks. Instead of using Playwright like in the original [OpenAI Cua docs](https://platform.openai.com/docs/guides/tools-computer-use), we use the Cua computer to control a macOS sandbox (via the Lume CLI) and execute actions such as clicking and typing. The loop is as follows:\n",
- "\n",
- "1. **Initialize the Cua sandbox** using the `cua-computer` py package.\n",
- "2. **Capture an initial screenshot** of the sandbox.\n",
- "3. **Send the screenshot and a user prompt** to the OpenAI Responses API.\n",
- "4. **Receive a `computer_call` action** from the API.\n",
- "5. **Map and execute the action** on the Cua interface (e.g. move the cursor and click, type text, etc.).\n",
- "6. **Capture a new screenshot** and repeat the loop as needed.\n",
- "\n",
- "Note: For this example, you must have your OpenAI API key set up and the Lume daemon running with a downloaded macOS VM image (see installation instructions in the Cua documentation)."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Prerequisites\n",
- "\n",
- "- Install the `cua-computer` package and set up the Lume daemon as described in its documentation.\n",
- "- Ensure you have an OpenAI API key (set as an environment variable or in your OpenAI configuration).\n",
- "- This notebook uses asynchronous Python (async/await)."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Install the required packages"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-computer[all]\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Import required modules"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "import asyncio\n",
- "import base64\n",
- "import openai\n",
- "\n",
- "from computer import Computer\n",
- "\n",
- "# Ensure your OpenAI API key is set\n",
- "openai.api_key = input(\"Enter your OpenAI API key: \")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Mapping OpenAI Actions to Cua Methods\n",
- "\n",
- "The following helper function converts a `computer_call` action from the OpenAI Responses API into corresponding commands on the Cua interface. For example, if the API instructs a `click` action, we move the cursor and perform a left click on the Cua Sandbox. We will use the computer interface to execute the actions."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [],
- "source": [
- "async def execute_action(computer, action):\n",
- " action_type = action.type\n",
- "\n",
- " if action_type == \"click\":\n",
- " x = action.x\n",
- " y = action.y\n",
- " button = action.button\n",
- " print(f\"Executing click at ({x}, {y}) with button '{button}'\")\n",
- " await computer.interface.move_cursor(x, y)\n",
- " if button == \"right\":\n",
- " await computer.interface.right_click()\n",
- " else:\n",
- " await computer.interface.left_click()\n",
- "\n",
- " elif action_type == \"type\":\n",
- " text = action.text\n",
- " print(f\"Typing text: {text}\")\n",
- " await computer.interface.type_text(text)\n",
- "\n",
- " elif action_type == \"scroll\":\n",
- " x = action.x\n",
- " y = action.y\n",
- " scroll_x = action.scroll_x\n",
- " scroll_y = action.scroll_y\n",
- " print(f\"Scrolling at ({x}, {y}) with offsets (scroll_x={scroll_x}, scroll_y={scroll_y})\")\n",
- " await computer.interface.move_cursor(x, y)\n",
- " await computer.interface.scroll(scroll_y) # Assuming Cua provides a scroll method\n",
- "\n",
- " elif action_type == \"keypress\":\n",
- " keys = action.keys\n",
- " for key in keys:\n",
- " print(f\"Pressing key: {key}\")\n",
- " # Map common key names to Cua equivalents\n",
- " if key.lower() == \"enter\":\n",
- " await computer.interface.press_key(\"return\")\n",
- " elif key.lower() == \"space\":\n",
- " await computer.interface.press_key(\"space\")\n",
- " else:\n",
- " await computer.interface.press_key(key)\n",
- "\n",
- " elif action_type == \"wait\":\n",
- " print(\"Waiting for 2 seconds\")\n",
- " await asyncio.sleep(2)\n",
- "\n",
- " elif action_type == \"screenshot\":\n",
- " print(\"Taking screenshot\")\n",
- " # This is handled automatically in the main loop, but we can take an extra one if requested\n",
- " screenshot = await computer.interface.screenshot()\n",
- " return screenshot\n",
- "\n",
- " else:\n",
- " print(f\"Unrecognized action: {action_type}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## The Cua/OpenAI Loop\n",
- "\n",
- "This cell defines a loop that:\n",
- "\n",
- "1. Initializes the Cua computer instance (connecting to a macOS sandbox).\n",
- "2. Captures a screenshot of the current state.\n",
- "3. Sends the screenshot (with a user prompt) to the OpenAI Responses API using the `computer-use-preview` tool.\n",
- "4. Processes the returned `computer_call` action and executes it using our helper function.\n",
- "5. Captures an updated screenshot after the action (this example runs one iteration, but you can wrap it in a loop).\n",
- "\n",
- "For a full loop, you would repeat these steps until no further actions are returned."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "async def cua_openai_loop():\n",
- " # Initialize the Cua computer instance (macOS sandbox)\n",
- " async with Computer(display=\"1024x768\", memory=\"4GB\", cpu=\"2\", os_type=\"macos\") as computer:\n",
- " await computer.run()\n",
- "\n",
- " # Capture the initial screenshot\n",
- " screenshot = await computer.interface.screenshot()\n",
- " screenshot_base64 = base64.b64encode(screenshot).decode(\"utf-8\")\n",
- "\n",
- " # Initial request to start the loop\n",
- " response = openai.responses.create(\n",
- " model=\"computer-use-preview\",\n",
- " tools=[\n",
- " {\n",
- " \"type\": \"computer_use_preview\",\n",
- " \"display_width\": 1024,\n",
- " \"display_height\": 768,\n",
- " \"environment\": \"mac\",\n",
- " }\n",
- " ],\n",
- " input=[\n",
- " { # type: ignore\n",
- " \"role\": \"user\",\n",
- " \"content\": [\n",
- " {\"type\": \"input_text\", \"text\": \"Open Safari, download and install Cursor.\"},\n",
- " {\n",
- " \"type\": \"input_image\",\n",
- " \"image_url\": f\"data:image/png;base64,{screenshot_base64}\",\n",
- " },\n",
- " ],\n",
- " }\n",
- " ],\n",
- " truncation=\"auto\",\n",
- " )\n",
- "\n",
- " # Continue the loop until no more computer_call actions\n",
- " while True:\n",
- " # Check for computer_call actions\n",
- " computer_calls = [\n",
- " item for item in response.output if item and item.type == \"computer_call\"\n",
- " ]\n",
- " if not computer_calls:\n",
- " print(\"No more computer calls. Loop complete.\")\n",
- " break\n",
- "\n",
- " # Get the first computer call\n",
- " call = computer_calls[0]\n",
- " last_call_id = call.call_id\n",
- " action = call.action\n",
- " print(\"Received action from OpenAI Responses API:\", action)\n",
- "\n",
- " # Handle any pending safety checks\n",
- " if call.pending_safety_checks:\n",
- " print(\"Safety checks pending:\", call.pending_safety_checks)\n",
- " # In a real implementation, you would want to get user confirmation here\n",
- " acknowledged_checks = call.pending_safety_checks\n",
- " else:\n",
- " acknowledged_checks = []\n",
- "\n",
- " # Execute the action\n",
- " await execute_action(computer, action)\n",
- " await asyncio.sleep(1) # Allow time for changes to take effect\n",
- "\n",
- " # Capture new screenshot after action\n",
- " new_screenshot = await computer.interface.screenshot()\n",
- " new_screenshot_base64 = base64.b64encode(new_screenshot).decode(\"utf-8\")\n",
- "\n",
- " # Send the screenshot back as computer_call_output\n",
- " response = openai.responses.create(\n",
- " model=\"computer-use-preview\",\n",
- " previous_response_id=response.id, # Link to previous response\n",
- " tools=[\n",
- " {\n",
- " \"type\": \"computer_use_preview\",\n",
- " \"display_width\": 1024,\n",
- " \"display_height\": 768,\n",
- " \"environment\": \"mac\",\n",
- " }\n",
- " ],\n",
- " input=[\n",
- " { # type: ignore\n",
- " \"type\": \"computer_call_output\",\n",
- " \"call_id\": last_call_id,\n",
- " \"acknowledged_safety_checks\": acknowledged_checks,\n",
- " \"output\": {\n",
- " \"type\": \"input_image\",\n",
- " \"image_url\": f\"data:image/png;base64,{new_screenshot_base64}\",\n",
- " },\n",
- " }\n",
- " ],\n",
- " truncation=\"auto\",\n",
- " )\n",
- "\n",
- " # End the session\n",
- " await computer.stop()\n",
- "\n",
- "\n",
- "# Run the loop\n",
- "await cua_openai_loop()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Final Remarks\n",
- "\n",
- "This notebook demonstrates a single iteration of a Cua/OpenAI loop where:\n",
- "\n",
- "- A macOS sandbox is controlled using the Cua interface.\n",
- "- A screenshot and prompt are sent to the OpenAI Responses API.\n",
- "- The returned action (e.g. a click or type command) is executed via the Cua interface.\n",
- "\n",
- "In a production setting, you would wrap the action-response cycle in a loop, handling multiple actions and safety checks as needed."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "cua",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.11.11"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
\ No newline at end of file
diff --git a/notebooks/blog/build-your-own-operator-on-macos-2.ipynb b/notebooks/blog/build-your-own-operator-on-macos-2.ipynb
deleted file mode 100644
index d029ea59e5..0000000000
--- a/notebooks/blog/build-your-own-operator-on-macos-2.ipynb
+++ /dev/null
@@ -1,186 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Build Your Own Operator on macOS - Part 2"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Welcome to Part 2 of our tutorial series on building a Computer Use Automation (Cua) operator, this time using the `cua-agent` package. For the complete guide, check out our [full blog post](https://cua.ai/blog/build-your-own-operator-on-macos-2)."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Prerequisites\n",
- "\n",
- "- Install the `cua-agent` package and set up the Lume daemon as described in its documentation. The `cua-computer` package used in the previous part is already installed as a dependency of `cua-agent`.\n",
- "- Ensure you have an OpenAI, or Claude API key (set as an environment variable or in your OpenAI configuration).\n",
- "- This notebook uses asynchronous Python (async/await)."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Install the required packages"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-agent[all]\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Prompt for any API keys\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import os\n",
- "\n",
- "# Get API keys from environment or prompt user\n",
- "anthropic_key = os.getenv(\"ANTHROPIC_API_KEY\") or input(\"Enter your Anthropic API key: \")\n",
- "openai_key = os.getenv(\"OPENAI_API_KEY\") or input(\"Enter your OpenAI API key: \")\n",
- "\n",
- "os.environ[\"ANTHROPIC_API_KEY\"] = anthropic_key\n",
- "os.environ[\"OPENAI_API_KEY\"] = openai_key"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Import required modules"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer\n",
- "from agent import ComputerAgent"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Running a cua Agent"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Let's start by creating an agent that relies on the OpenAI API computer-use-preview model."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "\n",
- "computer = Computer(verbosity=logging.INFO)\n",
- "\n",
- "tasks = [\n",
- " \"Look for a repository named trycua/cua on GitHub.\",\n",
- " \"Check the open issues, open the most recent one and read it.\",\n",
- " \"Clone the repository in users/lume/projects if it doesn't exist yet.\",\n",
- " \"Open the repository with an app named Cursor (on the dock, black background and white cube icon).\",\n",
- " \"From Cursor, open Composer if not already open.\",\n",
- " \"Focus on the Composer text area, then write and submit a task to help resolve the GitHub issue.\",\n",
- "]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can either provide a list of tasks or a single task as a string."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "agent = ComputerAgent(\n",
- " tools=[computer],\n",
- " model=\"openai/computer-use-preview\",\n",
- " save_trajectory=True,\n",
- " only_n_most_recent_images=3,\n",
- " verbosity=logging.INFO,\n",
- ")\n",
- "\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " # print(result)\n",
- " pass\n",
- "\n",
- " print(f\"\\n✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "For each task, the agent.run() method returns a generator of results indicating the progress of the task, and any reasoning or actions taken by the agent, conforming to the OpenAI Responses API format."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "cua",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.12.11"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/composite_agents_docker_nb.ipynb b/notebooks/composite_agents_docker_nb.ipynb
deleted file mode 100644
index 1fb877b045..0000000000
--- a/notebooks/composite_agents_docker_nb.ipynb
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Composite Agents with Docker Container Computer\n",
- "\n",
- "This notebook walks you through running a composed GUI agent using a Docker-based Computer and OpenRouter for the grounding model, paired with a planning model.\n",
- "\n",
- "We'll use the model string:\n",
- "\n",
- "- `\"openrouter/z-ai/glm-4.5v+openai/gpt-5-nano\"` (grounding + planning)\n",
- "\n",
- "Grounding (left) generates actionable UI coordinates; planning (right) reasons and drives steps."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Prerequisites\n",
- "\n",
- "- Docker Desktop or Engine installed and running\n",
- "- An OpenRouter account and API key (https://openrouter.ai/)\n",
- "- (Optional) An OpenAI API key if using `openai/gpt-5-nano` for planning\n",
- "- Python 3.12 environment with `cua-agent` installed"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-agent[all]\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Prepare a Docker Computer\n",
- "\n",
- "We'll follow the documented Docker provider flow (see `docs/content/docs/computer-sdk/computers.mdx`).\n",
- "\n",
- "If you don't have the image yet, either pull or build it locally. Run these in a terminal, not inside the notebook:\n",
- "\n",
- "```bash\n",
- "# Option 1: Pull from Docker Hub\n",
- "docker pull trycua/cua-ubuntu:latest\n",
- "\n",
- "# Option 2: Build locally (from repo root)\n",
- "cd libs/kasm\n",
- "docker build -t cua-ubuntu:latest .\n",
- "```"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Set environment keys\n",
- "\n",
- "- Get an OpenRouter API key at https://openrouter.ai/\n",
- "- If using OpenAI for planning, set your OpenAI key as well\n",
- "- You can input them here to set for this notebook session"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import os\n",
- "\n",
- "OPENROUTER_API_KEY = (\n",
- " os.getenv(\"OPENROUTER_API_KEY\") or input(\"Enter your OPENROUTER_API_KEY: \").strip()\n",
- ")\n",
- "os.environ[\"OPENROUTER_API_KEY\"] = OPENROUTER_API_KEY\n",
- "\n",
- "# Optional: if planning model uses OpenAI provider\n",
- "OPENAI_API_KEY = (\n",
- " os.getenv(\"OPENAI_API_KEY\")\n",
- " or input(\"(Optional) Enter your OPENAI_API_KEY (press Enter to skip): \").strip()\n",
- ")\n",
- "if OPENAI_API_KEY:\n",
- " os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Create a Docker Computer and a composed agent\n",
- "\n",
- "This uses the documented Docker provider parameters: `os_type=\"linux\"`, `provider_type=\"docker\"`, plus `image` and `name`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import asyncio\n",
- "from computer import Computer\n",
- "from agent import ComputerAgent\n",
- "\n",
- "\n",
- "async def main():\n",
- " # Launch & connect to a Docker container running the Computer Server\n",
- " async with Computer(\n",
- " os_type=\"linux\",\n",
- " provider_type=\"docker\",\n",
- " image=\"trycua/cua-ubuntu:latest\",\n",
- " name=\"my-cua-container\",\n",
- " ) as computer:\n",
- " agent = ComputerAgent(\n",
- " model=\"openrouter/z-ai/glm-4.5v+openai/gpt-5-nano\",\n",
- " tools=[computer],\n",
- " trajectory_dir=\"trajectories\", # Save agent trajectory (screenshots, api calls)\n",
- " )\n",
- "\n",
- " # Simple task to verify end-to-end\n",
- " async for _ in agent.run(\"Open a browser and go to example.com\"):\n",
- " pass\n",
- "\n",
- "\n",
- "asyncio.run(main())"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Notes\n",
- "\n",
- "- Grounding (OpenRouter `z-ai/glm-4.5v`) + Planning (OpenAI `gpt-5-nano`) can be swapped for other providers/models.\n",
- "- If you prefer to avoid OpenAI, choose a planning model on OpenRouter and update the model string accordingly.\n",
- "- Be sure the planning model supports `vision` input and the `tools` parameter.\n",
- "- The agent emits normalized Agent Responses across providers."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.12"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/computer_nb.ipynb b/notebooks/computer_nb.ipynb
deleted file mode 100644
index 9dd8eaf1ae..0000000000
--- a/notebooks/computer_nb.ipynb
+++ /dev/null
@@ -1,618 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Computer\n",
- "\n",
- "This 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",
- "metadata": {},
- "source": [
- "### Installation"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-computer[all]\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 1: Cua Cloud Sandbox\n",
- "\n",
- "Cua Cloud Sandbox provides remote VMs that can be accessed from any system without local setup."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Prerequisites for Cloud Sandbox\n",
- "\n",
- "To use Cua Cloud Sandbox, you need to:\n",
- "1. Sign up at https://cua.ai\n",
- "2. Create a Cloud Sandbox\n",
- "3. Generate an API Key\n",
- "\n",
- "Once you have these, you can connect to your Cloud Sandbox using its name."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Get API key and container name from environment or prompt user\n",
- "import os\n",
- "\n",
- "cua_api_key = os.getenv(\"CUA_API_KEY\") or input(\"Enter your Cua API Key: \")\n",
- "container_name = os.getenv(\"CONTAINER_NAME\") or input(\"Enter your Cloud Container name: \")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Choose the OS type for your sandbox (linux or macos)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "os_type = (\n",
- " input(\"Enter the OS type of your sandbox (linux/macos) [default: linux]: \").lower() or \"linux\"\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Connect to your Cloud Sandbox"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer, VMProviderType"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "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 Sandbox\n",
- " api_key=cua_api_key,\n",
- " name=container_name,\n",
- " provider_type=VMProviderType.CLOUD,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Take a screenshot"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "await computer.run() # Initialize the computer first\n",
- "\n",
- "screenshot = await computer.interface.screenshot()\n",
- "\n",
- "with open(\"screenshot.png\", \"wb\") as f:\n",
- " f.write(screenshot)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 2: KASM Local Docker Containers (cross-platform)\n",
- "\n",
- "### Pull from Docker Hub\n",
- "```bash\n",
- "docker pull --platform=linux/amd64 trycua/cua-ubuntu:latest\n",
- "```\n",
- "\n",
- "### Or build locally\n",
- "```bash\n",
- "cd libs/kasm\n",
- "docker build -t cua-ubuntu:latest .\n",
- "```"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer\n",
- "\n",
- "computer = Computer(\n",
- " os_type=\"linux\",\n",
- " provider_type=\"docker\",\n",
- " image=\"trycua/cua-ubuntu:latest\",\n",
- " name=\"my-cua-container\",\n",
- ")\n",
- "\n",
- "await computer.run() # Launch & connect to Docker container"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Option 3: Local VMs (Lume daemon)\n",
- "\n",
- "For Apple Silicon Macs, you can run VMs locally using the Lume daemon."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Lume daemon setup\n",
- "\n",
- "Refer to [../libs/lume/README.md](../libs/lume/README.md) for more details on the lume cli."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "For installing the standalone lume binary, run the following command from a terminal:\n",
- "\n",
- "```bash\n",
- "/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)\"\n",
- "```"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Pull the latest pre-built macos-sequoia-cua image. This image, based on macOS Sequoia, contains all dependencies needed to be controlled from the cua-computer interface."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "!lume pull macos-sequoia-cua:latest"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "VMs are stored in `~/.lume`, and locally cached images are stored in `~/.lume/cache`."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can always see the list of downloaded VM images with:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "name os cpu memory disk display status storage shared_dirs ip vnc \n",
- "macos-sequoia-cua_latest macOS 4 8.00G 25.9GB/80.0GB 1024x768 stopped default - - - \n"
- ]
- }
- ],
- "source": [
- "!lume ls"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Testing the sandbox\n",
- "\n",
- "Once downloaded, you can run the sandbox to test everything is working:\n",
- "\n",
- "```bash\n",
- "lume run macos-sequoia-cua:latest\n",
- "```"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can add additional software and tools to the sandbox - these changes will be saved in the VM disk."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Initialize a Local Computer instance"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Computer allows you to create and control a virtual sandbox instances from your host on Apple Silicon. Here's a basic example:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 23,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer, VMProviderType"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can either use the async context manager or initialize the Computer instance directly."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "With the async context manager:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "async with Computer(\n",
- " # name=\"my_vm\", # optional, in case you want to use any other VM created using lume\n",
- " display=\"1024x768\",\n",
- " memory=\"8GB\",\n",
- " cpu=\"4\",\n",
- " os_type=\"macos\",\n",
- " provider_type=VMProviderType.LUME,\n",
- ") as computer:\n",
- " pass\n",
- " # ... do something with the computer interface"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Direct initialization:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "computer = Computer(display=\"1024x768\", memory=\"8GB\", cpu=\"4\", os_type=\"macos\")\n",
- "\n",
- "await computer.run()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Computer Interface\n",
- "\n",
- "Both cloud and local computers provide the same interface for interaction."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "In order to execute commands targeting the sandbox, the Computer interface communicates through websockets to a Fast API server running on the sandbox."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Cursor"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Move and click\n",
- "await computer.interface.move_cursor(100, 100)\n",
- "await computer.interface.left_click()\n",
- "await computer.interface.right_click(300, 300)\n",
- "await computer.interface.double_click(400, 400)\n",
- "\n",
- "# Drag operations\n",
- "await computer.interface.drag_to(500, 500, duration=1.0)\n",
- "\n",
- "# Get cursor position\n",
- "cursor_pos = await computer.interface.get_cursor_position()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Keyboard"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Type text\n",
- "await computer.interface.type_text(\"Hello, World!\")\n",
- "\n",
- "# Press individual keys\n",
- "await computer.interface.press_key(\"enter\")\n",
- "await computer.interface.press_key(\"escape\")\n",
- "\n",
- "# Use hotkeys\n",
- "await computer.interface.hotkey(\"command\", \"c\") # Command+C on macOS"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Screen"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Get screen dimensions\n",
- "screen_size = await computer.interface.get_screen_size()\n",
- "\n",
- "# Take basic screenshot\n",
- "screenshot = await computer.interface.screenshot()\n",
- "with open(\"screenshot.png\", \"wb\") as f:\n",
- " f.write(screenshot)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Clipboard"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Set clipboard content\n",
- "await computer.interface.set_clipboard(\"Text to copy\")\n",
- "\n",
- "# Get clipboard content\n",
- "clipboard_content = await computer.interface.copy_to_clipboard()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### File System Operations"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Check file/directory existence\n",
- "file_exists = await computer.interface.file_exists(\"/path/to/file.txt\")\n",
- "dir_exists = await computer.interface.directory_exists(\"/path/to/directory\")\n",
- "\n",
- "# Run shell commands\n",
- "result = await computer.interface.run_command(\"ls -la\")\n",
- "stdout, stderr, returncode = result.stdout, result.stderr, result.returncode"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Accessibility"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Get accessibility tree\n",
- "accessibility_tree = await computer.interface.get_accessibility_tree()\n",
- "print(accessibility_tree)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Sharing a directory with the sandbox"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You can share a directory with the sandbox by passing a list of absolute paths to the `shared_directories` argument when initializing the Computer instance."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "computer = Computer(\n",
- " display=\"1024x768\",\n",
- " memory=\"4GB\",\n",
- " cpu=\"2\",\n",
- " os_type=\"macos\",\n",
- " shared_directories=[\"/absolute/path/to/directory\"],\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Using Host Computer\n",
- "\n",
- "For local development and testing purposes, you can run the Computer API server on the same host machine and target it instead:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "computer = Computer(\n",
- " display=\"1024x768\", memory=\"4GB\", cpu=\"2\", os_type=\"macos\", use_host_computer_server=True\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Examples"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer.computer import Computer"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "async with Computer(display=\"1024x768\", memory=\"4GB\", cpu=\"2\", os_type=\"macos\") as computer:\n",
- " await computer.run()\n",
- " res = await computer.interface.run_command(\"ls -a\")\n",
- "\n",
- " # Get screen dimensions\n",
- " screen_size = await computer.interface.get_screen_size()\n",
- "\n",
- " # Move and click\n",
- " await computer.interface.move_cursor(100, 100)\n",
- " await computer.interface.left_click()\n",
- " await computer.interface.right_click(300, 300)\n",
- " await computer.interface.double_click(400, 400)\n",
- "\n",
- " # Drag operations\n",
- " await computer.interface.drag_to(500, 500, duration=1.0)\n",
- "\n",
- " # Get cursor position\n",
- " cursor_pos = await computer.interface.get_cursor_position()\n",
- "\n",
- " # Your automation code here\n",
- " await computer.stop()"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.13.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/computer_server_nb.ipynb b/notebooks/computer_server_nb.ipynb
deleted file mode 100644
index 6c8bd67930..0000000000
--- a/notebooks/computer_server_nb.ipynb
+++ /dev/null
@@ -1,78 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Computer Server\n",
- "\n",
- "This notebook demonstrates how to host the server used by Computer."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Installation"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# If running outside of the monorepo:\n",
- "# %pip install \"cua-computer-server\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Start the Computer server"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# Synchronous usage\n",
- "from computer_server import Server\n",
- "\n",
- "server = Server(port=8000)\n",
- "server.start() # Blocks until stopped"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.13.5"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/notebooks/customizing_computeragent.ipynb b/notebooks/customizing_computeragent.ipynb
deleted file mode 100644
index f77e2c4a4d..0000000000
--- a/notebooks/customizing_computeragent.ipynb
+++ /dev/null
@@ -1,211 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "00bf368c",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Customizing Your ComputerAgent\n",
- "\n",
- "This notebook demonstrates four practical ways to increase the capabilities and success rate of your `ComputerAgent` in the Agent SDK:\n",
- "\n",
- "1. Simple: Prompt engineering (via optional `instructions`)\n",
- "2. Easy: Tools (function tools and custom computer tools)\n",
- "3. Intermediate: Callbacks\n",
- "4. Expert: Custom `@register_agent` loops\n",
- "\n",
- "> Tip: The same patterns work in scripts and services — the notebook just makes it easy to iterate."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Setup\n",
- "\n",
- "We'll import `ComputerAgent`, a simple Docker-based computer, and some utilities."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from agent.agent import ComputerAgent\n",
- "from agent.callbacks import LoggingCallback\n",
- "from computer import Computer\n",
- "\n",
- "computer = Computer(\n",
- " os_type=\"linux\",\n",
- " provider_type=\"docker\",\n",
- " image=\"trycua/cua-ubuntu:latest\",\n",
- " name=\"my-cua-container\",\n",
- ")\n",
- "\n",
- "await computer.run() # Launch & connect to Docker container"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 1) Simple: Prompt engineering\n",
- "\n",
- "You can guide your agent with system-like `instructions`.\n",
- "\n",
- "Under the hood, `ComputerAgent(instructions=...)` adds a `PromptInstructionsCallback` that prepends a user message before each LLM call.\n",
- "\n",
- "This mirrors the recommended snippet in code:\n",
- "\n",
- "```python\n",
- "effective_input = full_input\n",
- "if instructions:\n",
- " effective_input = [{\"role\": \"user\", \"content\": instructions}] + full_input\n",
- "```"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "instructions = (\n",
- " \"You are a meticulous software operator. Prefer safe, deterministic actions. \"\n",
- " \"Always confirm via on-screen text before proceeding.\"\n",
- ")\n",
- "agent = ComputerAgent(\n",
- " model=\"openai/computer-use-preview\",\n",
- " tools=[computer],\n",
- " instructions=instructions,\n",
- " callbacks=[LoggingCallback(level=logging.INFO)],\n",
- ")\n",
- "messages = [{\"role\": \"user\", \"content\": \"Open the settings and turn on dark mode.\"}]\n",
- "\n",
- "# In notebooks, you may want to consume the async generator\n",
- "import asyncio\n",
- "\n",
- "\n",
- "async def run_once():\n",
- " async for chunk in agent.run(messages):\n",
- " # Print any assistant text outputs\n",
- " for item in chunk.get(\"output\", []):\n",
- " if item.get(\"type\") == \"message\":\n",
- " for c in item.get(\"content\", []):\n",
- " if c.get(\"text\"):\n",
- " print(c.get(\"text\"))\n",
- "\n",
- "\n",
- "await run_once()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 2) Easy: Tools\n",
- "\n",
- "Add function tools to expose deterministic capabilities. Tools are auto-extracted to schemas and callable by the agent."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "def calculate_percentage(numerator: float, denominator: float) -> str:\n",
- " \"\"\"Calculate a percentage string.\n",
- "\n",
- " Args:\n",
- " numerator: Numerator value\n",
- " denominator: Denominator value\n",
- " Returns:\n",
- " A formatted percentage string (e.g., '75.00%').\n",
- " \"\"\"\n",
- " if denominator == 0:\n",
- " return \"0.00%\"\n",
- " return f\"{(numerator/denominator)*100:.2f}%\"\n",
- "\n",
- "\n",
- "agent_with_tool = ComputerAgent(\n",
- " model=\"openai/computer-use-preview\",\n",
- " tools=[computer, calculate_percentage],\n",
- " instructions=\"When doing math, prefer the `calculate_percentage` tool when relevant.\",\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 3) Intermediate: Callbacks\n",
- "\n",
- "Callbacks offer lifecycle hooks. For example, limit recent images or record trajectories."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from agent.callbacks import ImageRetentionCallback, TrajectorySaverCallback\n",
- "\n",
- "agent_with_callbacks = ComputerAgent(\n",
- " model=\"anthropic/claude-sonnet-4-5-20250929\",\n",
- " tools=[computer],\n",
- " callbacks=[\n",
- " ImageRetentionCallback(only_n_most_recent_images=3),\n",
- " TrajectorySaverCallback(\"./trajectories\"),\n",
- " ],\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## 4) Expert: Custom `@register_agent`\n",
- "\n",
- "Register custom agent configs that implement `predict_step` (and optionally `predict_click`). This gives you full control over prompting, message shaping, and tool wiring.\n",
- "\n",
- "See: `libs/python/agent/agent/loops/` for concrete examples."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Next steps\n",
- "\n",
- "- Start with `instructions` for fast wins.\n",
- "- Add function tools for determinism and reliability.\n",
- "- Use callbacks to manage cost, logs, and safety.\n",
- "- Build custom loops for specialized domains."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "name": "python",
- "version": "3.10"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/notebooks/eval_osworld.ipynb b/notebooks/eval_osworld.ipynb
deleted file mode 100644
index beea5b3ef6..0000000000
--- a/notebooks/eval_osworld.ipynb
+++ /dev/null
@@ -1,187 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# ComputerAgent HUD Integration for OSWorld\n",
- "\n",
- "This notebook demonstrates how to use the ComputerAgent with HUD for OSWorld benchmarking.\n",
- "The ComputerAgent integration provides the same interface as OperatorAgent but works with both Claude and OpenAI models."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# # Install dependencies if needed\n",
- "# !uv venv\n",
- "# !source .venv/bin/activate\n",
- "# !uv sync"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "%load_ext autoreload\n",
- "%autoreload 2"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from dotenv import load_dotenv\n",
- "import os\n",
- "\n",
- "# Load environment variables from ../.env\n",
- "load_dotenv(dotenv_path=\"../.env\")\n",
- "\n",
- "# Required environment variables:\n",
- "# - HUD_API_KEY (for HUD access)\n",
- "# - ANTHROPIC_API_KEY (for Claude models)\n",
- "# - OPENAI_API_KEY (for OpenAI models)\n",
- "assert os.getenv(\"HUD_API_KEY\") is not None\n",
- "assert os.getenv(\"ANTHROPIC_API_KEY\") is not None or os.getenv(\"OPENAI_API_KEY\") is not None\n",
- "\n",
- "from pprint import pprint"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Quick single-task smoke test on OSWorld-Verified\n",
- "\n",
- "The ComputerAgent integration can use Claude, OpenAI, UI-TARS, or composed models just like the original ComputerAgent:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from agent.integrations.hud import run_single_task\n",
- "\n",
- "# Quick single-task smoke test on OSWorld-Verified\n",
- "# You can swap \"hud-evals/OSWorld-Verified\" -> \"hud-evals/SheetBench-V2\" to test SheetBench.\n",
- "await run_single_task(\n",
- " dataset=\"hud-evals/OSWorld-Verified\",\n",
- " model=\"openai/computer-use-preview+openai/gpt-5\", # or any supported model string\n",
- " task_id=155, # open last tab task (easy)\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Run OSWorld-Verified in parallel"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import uuid\n",
- "from agent.integrations.hud import run_full_dataset\n",
- "\n",
- "# Full dataset evaluation (runs via HUD's run_dataset under the hood)\n",
- "job_name = f\"osworld-test-{str(uuid.uuid4())[:4]}\"\n",
- "\n",
- "results = await run_full_dataset(\n",
- " dataset=\"hud-evals/OSWorld-Verified\", # You can also pass a Dataset or a list[dict]\n",
- " job_name=job_name, # Optional; defaults to a timestamp for custom datasets\n",
- " model=\"openai/computer-use-preview\", # Or any supported model string\n",
- " max_concurrent=20, # Tune to your infra\n",
- " max_steps=50, # Safety cap per task\n",
- " split=\"train[:3]\", # Limit to just 3 tasks\n",
- ")\n",
- "\n",
- "# results is a list from hud.datasets.run_dataset; inspect/aggregate as needed\n",
- "print(f\"Job: {job_name}\")\n",
- "print(f\"Total results: {len(results)}\")\n",
- "pprint(results[:3]) # preview"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Benchmark Composed Agents"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "import uuid\n",
- "from agent.integrations.hud import run_full_dataset\n",
- "\n",
- "models_to_test = [\n",
- " \"openai/computer-use-preview+anthropic/claude-opus-4-20250514\",\n",
- "]\n",
- "\n",
- "\n",
- "for model in models_to_test:\n",
- " # Full dataset evaluation (runs via HUD's run_dataset under the hood)\n",
- " job_uuid = str(uuid.uuid4())[:6]\n",
- " job_name = f\"osworld {job_uuid} {model}\"\n",
- "\n",
- " results = await run_full_dataset(\n",
- " dataset=\"hud-evals/OSWorld-Verified\",\n",
- " job_name=job_name,\n",
- " model=model,\n",
- " max_concurrent=20,\n",
- " max_steps=75,\n",
- " trajectory_dir=f\"trajectories/osworld_{job_uuid}\",\n",
- " only_n_most_recent_images=3,\n",
- " )\n",
- "\n",
- " # results is a list from hud.datasets.run_dataset; inspect/aggregate as needed\n",
- " print(f\"Job: {job_name}\")\n",
- " print(f\"Total results: {len(results)}\")"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.13.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/notebooks/ollama_nb.ipynb b/notebooks/ollama_nb.ipynb
deleted file mode 100644
index ade2d1535d..0000000000
--- a/notebooks/ollama_nb.ipynb
+++ /dev/null
@@ -1,298 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "d703f36d",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "title-intro",
- "metadata": {},
- "source": [
- "# Using Ollama with Cua (Docker Edition)\n",
- "\n",
- "This notebook demonstrates multiple ways to use Ollama with the Cua ComputerAgent, mirroring the structure of `notebooks/sota_hackathon.ipynb` while running the computer inside Docker.\n",
- "\n",
- "We'll cover three patterns:\n",
- "\n",
- "1. Use an all-in-one Cua model served by Ollama (e.g. `model=\"ollama/blaifa/InternVL3_5:8b\"`).\n",
- "2. Use a strong Cua grounding model composed with an Ollama VLM (e.g. `model=\"openai/computer-use-preview+ollama/gemma3:4b\"`).\n",
- "3. Conceptual: different ways to customize/extend your agent (link + outline only).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "prereq",
- "metadata": {},
- "source": [
- "## 💻 Prerequisites\n",
- "\n",
- "The easiest way to get started is by getting set up with the Cua development repository.\n",
- "\n",
- "Install [Docker](https://www.docker.com/products/docker-desktop/) and [pdm](https://pdm-project.org/en/latest/#recommended-installation-method)\n",
- "\n",
- "Clone the Cua repository:\n",
- "\n",
- "`git clone https://github.com/trycua/cua`\n",
- "\n",
- "Install the project dependencies:\n",
- "\n",
- "`cd cua && uv sync`\n",
- "\n",
- "Now, you should be able to run the `notebooks/hud_hackathon.ipynb` notebook in VS Code with the `.venv` virtual environment selected."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "env-setup",
- "metadata": {},
- "source": [
- "## 🔑 Environment Setup (.env)\n",
- "\n",
- "Create a `.env` file with your API keys. You can use any provider keys that you plan to compose. For example, if composing with OpenAI or Anthropic, add those keys too.\n",
- "\n",
- "Add these entries as needed (empty values are fine if not used):\n",
- "\n",
- "- `OPENAI_API_KEY` (if composing with OpenAI)\n",
- "- `ANTHROPIC_API_KEY` (if composing with Anthropic)\n",
- "- `OLLAMA_API_BASE` (defaults to `http://localhost:11434`)\n",
- "\n",
- "Note: For Cua Cloud computers, you would also set `CUA_API_KEY` and `CUA_CONTAINER_NAME`, but this notebook uses Docker for the computer.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "create-env",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create a .env template if it doesn't exist\n",
- "ENV_TEMPLATE = \"\"\"# Optional environment variables for composition:\n",
- "OPENAI_API_KEY=\n",
- "ANTHROPIC_API_KEY=\n",
- "\n",
- "# Ollama endpoint (default shown)\n",
- "OLLAMA_API_BASE=http://localhost:11434\n",
- "\"\"\"\n",
- "\n",
- "from pathlib import Path\n",
- "\n",
- "if not Path(\".env\").exists():\n",
- " Path(\".env\").write_text(ENV_TEMPLATE)\n",
- " print(\"A .env file was created! Fill in the empty values you need.\")\n",
- "else:\n",
- " print(\".env already exists\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "load-env",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Load .env into environment\n",
- "import os\n",
- "from dotenv import load_dotenv\n",
- "\n",
- "load_dotenv(dotenv_path=\".env\", override=True)\n",
- "print(\"OPENAI_API_KEY set:\", bool(os.getenv(\"OPENAI_API_KEY\")))\n",
- "print(\"ANTHROPIC_API_KEY set:\", bool(os.getenv(\"ANTHROPIC_API_KEY\")))\n",
- "print(\"OLLAMA_API_BASE:\", os.getenv(\"OLLAMA_API_BASE\", \"http://localhost:11434\"))"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "ollama-docker",
- "metadata": {},
- "source": [
- "## 🐳 Run Ollama via Docker (recommended)\n",
- "\n",
- "If you don't already have Ollama running locally, you can run it with Docker. \n",
- "Run the following command in your terminal (outside the notebook):\n",
- "\n",
- "```bash\n",
- "docker run -d --name ollama -p 11434:11434 -v ollama:/root/.ollama \\\n",
- " ollama/ollama:latest\n",
- "```\n",
- "\n",
- "Then pull any models you need, for example (terminal):\n",
- "\n",
- "```bash\n",
- "docker exec -it ollama ollama pull gemma3:4b\n",
- "docker exec -it ollama ollama pull blaifa/InternVL3_5:8b\n",
- "```\n",
- "\n",
- "Make sure your `OLLAMA_HOST` points to `http://localhost:11434`.\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "computer-docker",
- "metadata": {},
- "source": [
- "## 🖥️ Launch a Docker Computer\n",
- "\n",
- "We'll run the computer using the Cua Docker provider.\n",
- "You can watch the live VNC stream at `http://localhost:8006/`.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "launch-computer",
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from computer import Computer, VMProviderType\n",
- "import webbrowser\n",
- "\n",
- "computer = Computer(os_type=\"linux\", provider_type=VMProviderType.DOCKER, verbosity=logging.INFO)\n",
- "await computer.run()\n",
- "\n",
- "# Optional: open the VNC page in your browser\n",
- "webbrowser.open(\"http://localhost:8006/\", new=0, autoraise=True)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "section-1",
- "metadata": {},
- "source": [
- "## 1) All-in-one Cua model via Ollama\n",
- "\n",
- "Some community models on Ollama are trained for computer use end-to-end.\n",
- "Point the agent's model to an Ollama-served model using the `ollama/` prefix.\n",
- "\n",
- "Example: `model=\"ollama/blaifa/InternVL3_5:8b\"`.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "run-allinone",
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "from agent import ComputerAgent\n",
- "\n",
- "agent_all_in_one = ComputerAgent(\n",
- " model=\"ollama/blaifa/InternVL3_5:8b\",\n",
- " tools=[computer],\n",
- " trajectory_dir=str(Path(\"trajectories\")),\n",
- " only_n_most_recent_images=3,\n",
- " verbosity=logging.INFO,\n",
- " # instructions=\"You are a helpful assistant.\" # Editable instructions for prompt engineering\n",
- ")\n",
- "\n",
- "print(\"Running all-in-one Ollama Cua model...\")\n",
- "async for _ in agent_all_in_one.run(\"Open the web browser and go to example.com\"):\n",
- " pass\n",
- "print(\"✅ Done\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "section-2",
- "metadata": {},
- "source": [
- "## 2) Compose a strong Cua UI grounding model with an Ollama VLM\n",
- "\n",
- "You can compose a UI grounding (element localization) model with a local Ollama VLM (reasoning + tool-use) for planning.\n",
- "Use a `+ollama/<model>` suffix to compose.\n",
- "\n",
- "Examples:\n",
- "- `openai/computer-use-preview+ollama/gemma3:4b`\n",
- "- `anthropic/claude-sonnet-4-5-20250929+ollama/gemma3:4b`\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "run-composed",
- "metadata": {},
- "outputs": [],
- "source": [
- "from agent import ComputerAgent\n",
- "import logging\n",
- "\n",
- "agent_composed = ComputerAgent(\n",
- " model=\"anthropic/claude-sonnet-4-5-20250929+ollama/gemma3:4b\",\n",
- " tools=[computer],\n",
- " trajectory_dir=\"trajectories\",\n",
- " only_n_most_recent_images=3,\n",
- " verbosity=logging.INFO,\n",
- ")\n",
- "\n",
- "print(\"Running composed agent (OpenAI grounding + Ollama VLM)...\")\n",
- "async for _ in agent_composed.run(\"Open a text editor and type: Hello from composed model!\"):\n",
- " pass\n",
- "print(\"✅ Done\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "section-3-conceptual",
- "metadata": {},
- "source": [
- "## 3) Customize your agent 🛠️\n",
- "\n",
- "For a few customization options, see: https://cua.ai/docs/agent-sdk/customizing-computeragent\n",
- "\n",
- "Levels of customization you can explore:\n",
- "\n",
- "1) Simple — Prompt engineering\n",
- "2) Easy — Tools\n",
- "3) Intermediate — Callbacks\n",
- "4) Expert — Custom agent via `register_agent` (see `libs/python/agent/agent/decorators.py` → `register_agent`)\n",
- "\n",
- "or, incorporate the ComputerAgent into your own agent framework!"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "wrapup",
- "metadata": {},
- "source": [
- "## ✅ Summary\n",
- "\n",
- "- You ran the computer in Docker via the Cua Docker provider and viewed it at `http://localhost:8006/`.\n",
- "- You tried two runnable ways to leverage Ollama and reviewed a conceptual path to go further:\n",
- " - All-in-one computer-use model served by Ollama.\n",
- " - A composed agent using a strong grounding model + an Ollama VLM.\n",
- " - A link + outline for further customization paths (prompting, tools, callbacks, custom agent via `register_agent`).\n",
- "\n",
- "Explore more configurations and models in the Cua docs.\n"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "cua",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.12.11"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
\ No newline at end of file
diff --git a/notebooks/sota_hackathon.ipynb b/notebooks/sota_hackathon.ipynb
deleted file mode 100644
index 889bbb57c4..0000000000
--- a/notebooks/sota_hackathon.ipynb
+++ /dev/null
@@ -1,290 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "ebcbc0ad",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a5d6b2ed",
- "metadata": {},
- "source": [
- "# Computer-Use Agents SOTA Challenge\n",
- "\n",
- "Congrats on joining the Cua + HUD hackathon at Hack The North 2025!\n",
- "\n",
- "This notebook will show you how to create a computer use agent with Cua and evaluate it using HUD."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "cebe8572",
- "metadata": {},
- "source": [
- "## 💻 Prequisites\n",
- "\n",
- "Clone the Cua repository and install project dependencies."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "3d7c38f9",
- "metadata": {},
- "source": [
- "The easiest way to get started is by getting set up with the Cua development repository.\n",
- "\n",
- "Install [Docker](https://www.docker.com/products/docker-desktop/) and [pdm](https://pdm-project.org/en/latest/#recommended-installation-method).\n",
- "\n",
- "Clone the Cua repository:\n",
- "\n",
- "`git clone https://github.com/trycua/cua`\n",
- "\n",
- "Install the project dependencies:\n",
- "\n",
- "`cd cua && uv sync`\n",
- "\n",
- "Now, you should be able to run the `notebooks/hud_hackathon.ipynb` notebook in VS Code with the `.venv` virtual environment selected."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "19f92431",
- "metadata": {},
- "source": [
- "## ☁️ Connect to cloud services\n",
- "\n",
- "Create a free HUD accounts and load your API keys. "
- ]
- },
- {
- "cell_type": "markdown",
- "id": "47171dc3",
- "metadata": {},
- "source": [
- "1. Create a HUD account at https://www.hud.so/\n",
- "4. Create a .env file:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "1757f145",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create a .env file if it doesn't exist\n",
- "\n",
- "ENV_TEMPLATE = \"\"\"# Required environment variables:\n",
- "HUD_API_KEY=\n",
- "\n",
- "# Any LLM provider will work:\n",
- "ANTHROPIC_API_KEY=\n",
- "OPENAI_API_KEY=\n",
- "\"\"\"\n",
- "\n",
- "import os\n",
- "\n",
- "if not os.path.exists(\".env\"):\n",
- " open(\".env\", \"w\").write(ENV_TEMPLATE)\n",
- " print(\"A .env file was created! Fill in the empty values.\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "0949908d",
- "metadata": {},
- "source": [
- "5. Fill in all missing values in the .env file"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "2f23828d",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Read the .env file\n",
- "# HUD requires the .env file to be in the same directory\n",
- "\n",
- "from dotenv import load_dotenv\n",
- "\n",
- "load_dotenv(dotenv_path=\".env\", override=True)\n",
- "\n",
- "assert os.getenv(\"HUD_API_KEY\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "5c8bef64",
- "metadata": {},
- "source": [
- "## 🤖 Create a computer use agent\n",
- "\n",
- "Create and a computer use agent using the Cua SDK."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "cd4393b0",
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "from agent import ComputerAgent\n",
- "\n",
- "# Here you can set the model and tools for your agent.\n",
- "# Computer use models: https://cua.ai/docs/agent-sdk/supported-agents/computer-use-agents\n",
- "# Composed agent models: https://cua.ai/docs/agent-sdk/supported-agents/composed-agents\n",
- "# Custom tools: https://cua.ai/docs/agent-sdk/custom-tools\n",
- "agent_config = {\n",
- " \"model\": \"openai/computer-use-preview\",\n",
- " \"trajectory_dir\": str(Path(\"trajectories\")),\n",
- " \"only_n_most_recent_images\": 3,\n",
- " \"verbosity\": logging.INFO,\n",
- "}"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a07b09ee",
- "metadata": {},
- "source": [
- "## 🖱️ Test your agent\n",
- "\n",
- "Run your agent on a test scenario in a Docker container."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "12b9c22c",
- "metadata": {},
- "source": [
- "Make sure Docker is running to launch the computer.\n",
- "\n",
- "You can view the live VNC stream from the Docker container at `http://localhost:8006/`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "a210e959",
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer, VMProviderType\n",
- "import webbrowser\n",
- "\n",
- "# Connect to your existing cloud container\n",
- "computer = Computer(os_type=\"linux\", provider_type=VMProviderType.DOCKER, verbosity=logging.INFO)\n",
- "await computer.run()\n",
- "\n",
- "agent_config[\"tools\"] = [computer]\n",
- "\n",
- "webbrowser.open(\"http://localhost:8006/\", new=0, autoraise=True)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "87a307e3",
- "metadata": {},
- "source": [
- "Try running the computer use agent on a simple task.\n",
- "\n",
- "Trajectories are saved in the format: `trajectories/YYYY-MM-DD_computer-use-pre_XXX`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "f3a32ea8",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create agent\n",
- "agent = ComputerAgent(**agent_config)\n",
- "\n",
- "tasks = [\"Open the web browser and search for a repository named trycua/cua on GitHub.\"]\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " print(result)\n",
- " pass\n",
- "\n",
- " print(f\"\\n✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "eb4edbb5",
- "metadata": {},
- "source": [
- "## 🧐 Benchmark your agent\n",
- "\n",
- "Test your agent's performance on a selection of tasks from the OSWorld benchmark."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "6bf0887e",
- "metadata": {},
- "outputs": [],
- "source": [
- "import uuid\n",
- "from pprint import pprint\n",
- "from agent.integrations.hud import run_full_dataset\n",
- "\n",
- "job_name = f\"osworld-test-{str(uuid.uuid4())[:4]}\"\n",
- "\n",
- "# Full dataset evaluation (runs via HUD's run_dataset under the hood)\n",
- "# See the documentation here: https://cua.ai/docs/agent-sdk/integrations/hud#running-a-full-dataset\n",
- "results = await run_full_dataset(\n",
- " dataset=\"ddupont/OSWorld-Tiny-Public\",\n",
- " job_name=job_name,\n",
- " **agent_config,\n",
- " max_concurrent=20,\n",
- " max_steps=50,\n",
- " # split=\"train[:5]\"\n",
- ")\n",
- "\n",
- "# results is a list from hud.datasets.run_dataset; inspect/aggregate as needed\n",
- "print(f\"Job: {job_name}\")\n",
- "print(f\"Total results: {len(results)}\")\n",
- "pprint(results[:3])"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "5b89a103",
- "metadata": {},
- "source": [
- "## 🦾 Improve your agent\n",
- "\n",
- "To improve your agent for OSWorld-Verified, experiment with different models and add custom tools that fit your use case. You can also dive into the ComputerAgent source code to design an improved version or subclass tailored to your needs.\n",
- "\n",
- "Learn more about [Customizing Your ComputerAgent](https://cua.ai/docs/agent-sdk/customizing-computeragent) in the docs."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "name": "python",
- "version": "3.13.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/notebooks/sota_hackathon_cloud.ipynb b/notebooks/sota_hackathon_cloud.ipynb
deleted file mode 100644
index de4c92ecd4..0000000000
--- a/notebooks/sota_hackathon_cloud.ipynb
+++ /dev/null
@@ -1,300 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "5a127c81",
- "metadata": {},
- "source": [
- "> **Development Setup**: For setting up the development environment, see the [Development Guide](../Development.md).\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a5d6b2ed",
- "metadata": {},
- "source": [
- "# Computer-Use Agents SOTA Challenge\n",
- "\n",
- "Congrats on joining the Cua + HUD hackathon at Hack The North 2025!\n",
- "\n",
- "This notebook will show you how to create a computer use agent with Cua and evaluate it using HUD."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "cebe8572",
- "metadata": {},
- "source": [
- "## 💻 Prequisites\n",
- "\n",
- "Clone the Cua repository and install project dependencies."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "3d7c38f9",
- "metadata": {},
- "source": [
- "The easiest way to get started is by getting set up with the Cua development repository.\n",
- "\n",
- "First, clone the Cua repository:\n",
- "\n",
- "`git clone https://github.com/trycua/cua`\n",
- "\n",
- "Install [pdm](https://pdm-project.org/en/latest/#recommended-installation-method).\n",
- "\n",
- "Install the project dependencies:\n",
- "\n",
- "`cd cua && uv sync`\n",
- "\n",
- "Now, you should be able to run the `notebooks/hud_hackathon.ipynb` notebook in VS Code with the `.venv` virtual environment selected."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "19f92431",
- "metadata": {},
- "source": [
- "## ☁️ Connect to cloud services\n",
- "\n",
- "Create Cua and HUD accounts and load your API keys. "
- ]
- },
- {
- "cell_type": "markdown",
- "id": "47171dc3",
- "metadata": {},
- "source": [
- "1. Create a Cua account at https://cua.ai/\n",
- "2. Start a small Cua sandbox at https://cua.ai/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:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "1757f145",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create a .env file if it doesn't exist\n",
- "\n",
- "ENV_TEMPLATE = \"\"\"# Required environment variables:\n",
- "CUA_API_KEY=\n",
- "CUA_CONTAINER_NAME=\n",
- "HUD_API_KEY=\n",
- "\n",
- "# Any LLM provider will work:\n",
- "ANTHROPIC_API_KEY=\n",
- "OPENAI_API_KEY=\n",
- "\"\"\"\n",
- "\n",
- "import os\n",
- "\n",
- "if not os.path.exists(\".env\"):\n",
- " open(\".env\", \"w\").write(ENV_TEMPLATE)\n",
- " print(\"A .env file was created! Fill in the empty values.\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "0949908d",
- "metadata": {},
- "source": [
- "5. Fill in all missing values in the .env file"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "2f23828d",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Read the .env file\n",
- "# HUD requires the .env file to be in the same directory\n",
- "\n",
- "from dotenv import load_dotenv\n",
- "\n",
- "load_dotenv(dotenv_path=\".env\", override=True)\n",
- "\n",
- "assert os.getenv(\"CUA_API_KEY\")\n",
- "assert os.getenv(\"CUA_CONTAINER_NAME\")\n",
- "assert os.getenv(\"HUD_API_KEY\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "5c8bef64",
- "metadata": {},
- "source": [
- "## 🤖 Create a computer use agent\n",
- "\n",
- "Create and a computer use agent using the Cua SDK."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "cd4393b0",
- "metadata": {},
- "outputs": [],
- "source": [
- "import logging\n",
- "from pathlib import Path\n",
- "from agent import ComputerAgent\n",
- "\n",
- "# Here you can set the model and tools for your agent.\n",
- "# Computer use models: https://cua.ai/docs/agent-sdk/supported-agents/computer-use-agents\n",
- "# Composed agent models: https://cua.ai/docs/agent-sdk/supported-agents/composed-agents\n",
- "# Custom tools: https://cua.ai/docs/agent-sdk/custom-tools\n",
- "agent_config = {\n",
- " \"model\": \"openai/computer-use-preview\",\n",
- " \"trajectory_dir\": str(Path(\"trajectories\")),\n",
- " \"only_n_most_recent_images\": 3,\n",
- " \"verbosity\": logging.INFO,\n",
- "}"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a07b09ee",
- "metadata": {},
- "source": [
- "## 🖱️ Test your agent\n",
- "\n",
- "Run your agent on a test scenario in a Cua Cloud Sandbox."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "12b9c22c",
- "metadata": {},
- "source": [
- "Connect to an existing Cloud Sandbox through the Cua SDK.\n",
- "\n",
- "You can access the computer through VNC on the [Cua Dashboard](https://cua.ai/dashboard)."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "a210e959",
- "metadata": {},
- "outputs": [],
- "source": [
- "from computer import Computer, VMProviderType\n",
- "\n",
- "# Connect to your existing Cloud Sandbox\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]"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "87a307e3",
- "metadata": {},
- "source": [
- "Try running the computer use agent on a simple task.\n",
- "\n",
- "To view a replay of the agent's actions, upload the trajectory to the [trajectory viewer](https://cua.ai/trajectory-viewer).\n",
- "\n",
- "Trajectories are saved in the format: `trajectories/YYYY-MM-DD_computer-use-pre_XXX`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "f3a32ea8",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create agent\n",
- "agent = ComputerAgent(**agent_config)\n",
- "\n",
- "tasks = [\"Open the web browser and search for a repository named trycua/cua on GitHub.\"]\n",
- "\n",
- "for i, task in enumerate(tasks):\n",
- " print(f\"\\nExecuting task {i}/{len(tasks)}: {task}\")\n",
- " async for result in agent.run(task):\n",
- " print(result)\n",
- " pass\n",
- "\n",
- " print(f\"\\n✅ Task {i+1}/{len(tasks)} completed: {task}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "eb4edbb5",
- "metadata": {},
- "source": [
- "## 🧐 Benchmark your agent\n",
- "\n",
- "Test your agent's performance on a selection of tasks from the OSWorld benchmark."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "6bf0887e",
- "metadata": {},
- "outputs": [],
- "source": [
- "import uuid\n",
- "from pprint import pprint\n",
- "from agent.integrations.hud import run_full_dataset\n",
- "\n",
- "job_name = f\"osworld-test-{str(uuid.uuid4())[:4]}\"\n",
- "\n",
- "# Full dataset evaluation (runs via HUD's run_dataset under the hood)\n",
- "# See the documentation here: https://cua.ai/docs/agent-sdk/integrations/hud#running-a-full-dataset\n",
- "results = await run_full_dataset(\n",
- " dataset=\"ddupont/OSWorld-Tiny-Public\",\n",
- " job_name=job_name,\n",
- " **agent_config,\n",
- " max_concurrent=20,\n",
- " max_steps=50,\n",
- " # split=\"train[:5]\"\n",
- ")\n",
- "\n",
- "# results is a list from hud.datasets.run_dataset; inspect/aggregate as needed\n",
- "print(f\"Job: {job_name}\")\n",
- "print(f\"Total results: {len(results)}\")\n",
- "pprint(results[:3])"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "5b89a103",
- "metadata": {},
- "source": [
- "## 🦾 Improve your agent\n",
- "\n",
- "To improve your agent for OSWorld-Verified, experiment with different models and add custom tools that fit your use case. You can also dive into the ComputerAgent source code to design an improved version or subclass tailored to your needs.\n",
- "\n",
- "Learn more about [Customizing Your ComputerAgent](https://cua.ai/docs/agent-sdk/customizing-computeragent) in the docs."
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": ".venv",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "name": "python",
- "version": "3.13.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/pyproject.toml b/pyproject.toml
index 754237a84e..57bd39f18a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -57,8 +57,6 @@ test = [
"pytest-xdist>=3.6.1",
"pytest>=8.0.0",
]
-examples = []
-
[tool.uv]
package = false
constraint-dependencies = [
diff --git a/pyrightconfig.json b/pyrightconfig.json
index 382f4b60e6..6130d72532 100644
--- a/pyrightconfig.json
+++ b/pyrightconfig.json
@@ -10,8 +10,6 @@
"**/build/**",
".pdm-build/**",
"**/.git/**",
- "examples/**",
- "notebooks/**",
"logs/**",
"screenshots/**"
],
diff --git a/demo/jukebox/Cargo.lock b/samples/driver/jukebox/Cargo.lock
similarity index 100%
rename from demo/jukebox/Cargo.lock
rename to samples/driver/jukebox/Cargo.lock
diff --git a/demo/jukebox/Cargo.toml b/samples/driver/jukebox/Cargo.toml
similarity index 100%
rename from demo/jukebox/Cargo.toml
rename to samples/driver/jukebox/Cargo.toml
diff --git a/demo/jukebox/README.md b/samples/driver/jukebox/README.md
similarity index 100%
rename from demo/jukebox/README.md
rename to samples/driver/jukebox/README.md
diff --git a/demo/jukebox/app/Cargo.toml b/samples/driver/jukebox/app/Cargo.toml
similarity index 100%
rename from demo/jukebox/app/Cargo.toml
rename to samples/driver/jukebox/app/Cargo.toml
diff --git a/demo/jukebox/app/src/main.rs b/samples/driver/jukebox/app/src/main.rs
similarity index 100%
rename from demo/jukebox/app/src/main.rs
rename to samples/driver/jukebox/app/src/main.rs
diff --git a/demo/jukebox/orchestrator/Cargo.toml b/samples/driver/jukebox/orchestrator/Cargo.toml
similarity index 100%
rename from demo/jukebox/orchestrator/Cargo.toml
rename to samples/driver/jukebox/orchestrator/Cargo.toml
diff --git a/demo/jukebox/orchestrator/src/main.rs b/samples/driver/jukebox/orchestrator/src/main.rs
similarity index 100%
rename from demo/jukebox/orchestrator/src/main.rs
rename to samples/driver/jukebox/orchestrator/src/main.rs
diff --git a/demo/multi-cursor/.gitignore b/samples/driver/multi-cursor/.gitignore
similarity index 100%
rename from demo/multi-cursor/.gitignore
rename to samples/driver/multi-cursor/.gitignore
diff --git a/demo/multi-cursor/Cargo.lock b/samples/driver/multi-cursor/Cargo.lock
similarity index 100%
rename from demo/multi-cursor/Cargo.lock
rename to samples/driver/multi-cursor/Cargo.lock
diff --git a/demo/multi-cursor/Cargo.toml b/samples/driver/multi-cursor/Cargo.toml
similarity index 100%
rename from demo/multi-cursor/Cargo.toml
rename to samples/driver/multi-cursor/Cargo.toml
diff --git a/demo/multi-cursor/README.md b/samples/driver/multi-cursor/README.md
similarity index 100%
rename from demo/multi-cursor/README.md
rename to samples/driver/multi-cursor/README.md
diff --git a/demo/multi-cursor/dotnet/winforms/Program.cs b/samples/driver/multi-cursor/dotnet/winforms/Program.cs
similarity index 100%
rename from demo/multi-cursor/dotnet/winforms/Program.cs
rename to samples/driver/multi-cursor/dotnet/winforms/Program.cs
diff --git a/demo/multi-cursor/dotnet/winforms/winforms.csproj b/samples/driver/multi-cursor/dotnet/winforms/winforms.csproj
similarity index 100%
rename from demo/multi-cursor/dotnet/winforms/winforms.csproj
rename to samples/driver/multi-cursor/dotnet/winforms/winforms.csproj
diff --git a/demo/multi-cursor/dotnet/wpf/Program.cs b/samples/driver/multi-cursor/dotnet/wpf/Program.cs
similarity index 100%
rename from demo/multi-cursor/dotnet/wpf/Program.cs
rename to samples/driver/multi-cursor/dotnet/wpf/Program.cs
diff --git a/demo/multi-cursor/dotnet/wpf/wpf.csproj b/samples/driver/multi-cursor/dotnet/wpf/wpf.csproj
similarity index 100%
rename from demo/multi-cursor/dotnet/wpf/wpf.csproj
rename to samples/driver/multi-cursor/dotnet/wpf/wpf.csproj
diff --git a/demo/multi-cursor/electron/index.html b/samples/driver/multi-cursor/electron/index.html
similarity index 100%
rename from demo/multi-cursor/electron/index.html
rename to samples/driver/multi-cursor/electron/index.html
diff --git a/demo/multi-cursor/electron/main.js b/samples/driver/multi-cursor/electron/main.js
similarity index 100%
rename from demo/multi-cursor/electron/main.js
rename to samples/driver/multi-cursor/electron/main.js
diff --git a/demo/multi-cursor/electron/package.json b/samples/driver/multi-cursor/electron/package.json
similarity index 100%
rename from demo/multi-cursor/electron/package.json
rename to samples/driver/multi-cursor/electron/package.json
diff --git a/demo/multi-cursor/legacy-app/Cargo.toml b/samples/driver/multi-cursor/legacy-app/Cargo.toml
similarity index 100%
rename from demo/multi-cursor/legacy-app/Cargo.toml
rename to samples/driver/multi-cursor/legacy-app/Cargo.toml
diff --git a/demo/multi-cursor/legacy-app/src/main.rs b/samples/driver/multi-cursor/legacy-app/src/main.rs
similarity index 100%
rename from demo/multi-cursor/legacy-app/src/main.rs
rename to samples/driver/multi-cursor/legacy-app/src/main.rs
diff --git a/demo/multi-cursor/orchestrator/Cargo.toml b/samples/driver/multi-cursor/orchestrator/Cargo.toml
similarity index 100%
rename from demo/multi-cursor/orchestrator/Cargo.toml
rename to samples/driver/multi-cursor/orchestrator/Cargo.toml
diff --git a/demo/multi-cursor/orchestrator/src/main.rs b/samples/driver/multi-cursor/orchestrator/src/main.rs
similarity index 100%
rename from demo/multi-cursor/orchestrator/src/main.rs
rename to samples/driver/multi-cursor/orchestrator/src/main.rs
diff --git a/demo/1_fleet_throughput.py b/samples/python/1_fleet_throughput.py
similarity index 98%
rename from demo/1_fleet_throughput.py
rename to samples/python/1_fleet_throughput.py
index 23ec00df33..7490269041 100644
--- a/demo/1_fleet_throughput.py
+++ b/samples/python/1_fleet_throughput.py
@@ -4,7 +4,7 @@ Connect to 99 cloud VMs sequentially, then send tap+screenshot concurrently.
Reports total throughput as steps/hour at the end.
Usage:
- CUA_API_KEY=sk_... python demo/1_fleet_throughput.py
+ CUA_API_KEY=sk_... python samples/python/1_fleet_throughput.py
"""
import argparse
diff --git a/demo/2_ephemeral_fdroid.py b/samples/python/2_ephemeral_fdroid.py
similarity index 97%
rename from demo/2_ephemeral_fdroid.py
rename to samples/python/2_ephemeral_fdroid.py
index 0bd7769da1..7a239489be 100644
--- a/demo/2_ephemeral_fdroid.py
+++ b/samples/python/2_ephemeral_fdroid.py
@@ -4,7 +4,7 @@ Spins up a local Android VM, installs F-Droid, takes a screenshot.
Sandbox is automatically destroyed on exit.
Usage:
- python demo/2_ephemeral_fdroid.py
+ python samples/python/2_ephemeral_fdroid.py
"""
import asyncio
diff --git a/scripts/playground-docker.sh b/scripts/playground-docker.sh
deleted file mode 100644
index 31f3dbc3ed..0000000000
--- a/scripts/playground-docker.sh
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Colors for output
-GREEN='\033[0;32m'
-BLUE='\033[0;34m'
-RED='\033[0;31m'
-YELLOW='\033[1;33m'
-NC='\033[0m' # No Color
-
-# Print with color
-print_info() {
- echo -e "${BLUE}==> $1${NC}"
-}
-
-print_success() {
- echo -e "${GREEN}==> $1${NC}"
-}
-
-print_error() {
- echo -e "${RED}==> $1${NC}"
-}
-
-print_warning() {
- echo -e "${YELLOW}==> $1${NC}"
-}
-
-echo "🚀 Launching Cua Computer-Use Agent UI..."
-
-# Check if Docker is installed
-if ! command -v docker &> /dev/null; then
- print_error "Docker is not installed!"
- echo ""
- echo "To use Cua with Docker containers, you need to install Docker first:"
- echo ""
- echo "📦 Install Docker:"
- echo " • macOS: Download Docker Desktop from https://docker.com/products/docker-desktop"
- echo " • Windows: Download Docker Desktop from https://docker.com/products/docker-desktop"
- echo " • Linux: Follow instructions at https://docs.docker.com/engine/install/"
- echo ""
- echo "After installing Docker, run this script again."
- exit 1
-fi
-
-# Check if Docker daemon is running
-if ! docker info &> /dev/null; then
- print_error "Docker is installed but not running!"
- echo ""
- echo "Please start Docker Desktop and try again."
- exit 1
-fi
-
-print_success "Docker is installed and running!"
-
-# Save the original working directory
-ORIGINAL_DIR="$(pwd)"
-
-DEMO_DIR="$HOME/.cua"
-mkdir -p "$DEMO_DIR"
-
-
-# Check if we're already in the Cua repository
-# Look for the specific trycua identifier in pyproject.toml
-if [[ -f "pyproject.toml" ]] && grep -q "[email protected]" "pyproject.toml"; then
- print_success "Already in Cua repository - using current directory"
- REPO_DIR="$ORIGINAL_DIR"
- USE_EXISTING_REPO=true
-else
- # Directories used by the script when not in repo
- REPO_DIR="$DEMO_DIR/cua"
- USE_EXISTING_REPO=false
-fi
-
-# Function to clean up on exit
-cleanup() {
- cd "$ORIGINAL_DIR" 2>/dev/null || true
-}
-trap cleanup EXIT
-
-echo ""
-echo "Choose your Cua setup:"
-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 Sandbox setup
- echo ""
- print_info "Setting up Cua Cloud Sandbox..."
- echo ""
-
- # Check if existing .env.local already has CUA_API_KEY
- REPO_ENV_FILE="$REPO_DIR/.env.local"
- CURRENT_ENV_FILE="$ORIGINAL_DIR/.env.local"
-
- CUA_API_KEY=""
-
- # First check current directory
- if [[ -f "$CURRENT_ENV_FILE" ]] && grep -q "CUA_API_KEY=" "$CURRENT_ENV_FILE"; then
- EXISTING_CUA_KEY=$(grep "CUA_API_KEY=" "$CURRENT_ENV_FILE" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | xargs)
- if [[ -n "$EXISTING_CUA_KEY" && "$EXISTING_CUA_KEY" != "your_cua_api_key_here" && "$EXISTING_CUA_KEY" != "" ]]; then
- CUA_API_KEY="$EXISTING_CUA_KEY"
- fi
- fi
-
- # Then check repo directory if not found in current dir
- if [[ -z "$CUA_API_KEY" ]] && [[ -f "$REPO_ENV_FILE" ]] && grep -q "CUA_API_KEY=" "$REPO_ENV_FILE"; then
- EXISTING_CUA_KEY=$(grep "CUA_API_KEY=" "$REPO_ENV_FILE" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | xargs)
- if [[ -n "$EXISTING_CUA_KEY" && "$EXISTING_CUA_KEY" != "your_cua_api_key_here" && "$EXISTING_CUA_KEY" != "" ]]; then
- CUA_API_KEY="$EXISTING_CUA_KEY"
- fi
- fi
-
- # If no valid API key found, prompt for one
- if [[ -z "$CUA_API_KEY" ]]; then
- echo "To use Cua Cloud Sandbox, you need to:"
- echo "1. Sign up at https://cua.ai"
- 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 Sandbox."
- exit 1
- fi
- else
- print_success "Found existing Cua API key"
- fi
-
- USE_CLOUD=true
- COMPUTER_TYPE="cloud"
-
-elif [[ "$CHOICE" == "2" ]]; then
- # Local macOS VM setup
- echo ""
- print_info "Setting up local macOS VMs..."
-
- # 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 Sandbox instead (option 1)."
- exit 1
- fi
-
- # Check for macOS 15 (Sequoia) or newer
- 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 Sandbox instead (option 1)."
- exit 1
- fi
-
- USE_CLOUD=false
- COMPUTER_TYPE="macos"
-
-elif [[ "$CHOICE" == "3" ]]; then
- # Local Windows VM setup
- echo ""
- print_info "Setting up local Windows VMs..."
-
- # 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 Sandbox instead (option 1)."
- echo ""
- echo "🔗 If you are using WSL, refer to the blog post to get started: https://cua.ai/blog/windows-sandbox"
- exit 1
- fi
-
- USE_CLOUD=false
- COMPUTER_TYPE="windows"
-
-else
- print_error "Invalid choice. Please run the script again and choose 1, 2, or 3."
- exit 1
-fi
-
-print_success "All checks passed! 🎉"
-
-# Create demo directory and handle repository
-if [[ "$USE_EXISTING_REPO" == "true" ]]; then
- print_info "Using existing repository in current directory"
- cd "$REPO_DIR"
-else
- # Clone or update the repository
- if [[ ! -d "$REPO_DIR" ]]; then
- print_info "Cloning Cua repository..."
- cd "$DEMO_DIR"
- git clone https://github.com/trycua/cua.git
- else
- print_info "Updating Cua repository..."
- cd "$REPO_DIR"
- git pull origin main
- fi
-
- cd "$REPO_DIR"
-fi
-
-# Create .env.local file with API keys
-ENV_FILE="$REPO_DIR/.env.local"
-if [[ ! -f "$ENV_FILE" ]]; then
- cat > "$ENV_FILE" << EOF
-# Uncomment and add your API keys here
-# OPENAI_API_KEY=your_openai_api_key_here
-# ANTHROPIC_API_KEY=your_anthropic_api_key_here
-CUA_API_KEY=your_cua_api_key_here
-EOF
- print_success "Created .env.local file with API key placeholders"
-else
- print_success "Found existing .env.local file - keeping your current settings"
-fi
-
-if [[ "$USE_CLOUD" == "true" ]]; then
- # Add Cua API key to .env.local if not already present
- if ! grep -q "CUA_API_KEY" "$ENV_FILE"; then
- echo "CUA_API_KEY=$CUA_API_KEY" >> "$ENV_FILE"
- print_success "Added CUA_API_KEY to .env.local"
- elif grep -q "CUA_API_KEY=your_cua_api_key_here" "$ENV_FILE"; then
- # Update placeholder with actual key
- sed -i.bak "s/CUA_API_KEY=your_cua_api_key_here/CUA_API_KEY=$CUA_API_KEY/" "$ENV_FILE"
- print_success "Updated CUA_API_KEY in .env.local"
- fi
-fi
-
-# Build the Docker image if it doesn't exist
-print_info "Checking Docker image..."
-if ! docker image inspect cua-dev-image &> /dev/null; then
- print_info "Building Docker image (this may take a while)..."
- ./scripts/run-docker-dev.sh build
-else
- print_success "Docker image already exists"
-fi
-
-# Install Lume if needed for local VMs
-if [[ "$USE_CLOUD" == "false" && "$COMPUTER_TYPE" == "macos" ]]; then
- if ! command -v lume &> /dev/null; then
- print_info "Installing Lume CLI..."
- curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh | bash
-
- # Add lume to PATH for this session if it's not already there
- if ! command -v lume &> /dev/null; then
- export PATH="$PATH:$HOME/.local/bin"
- fi
- fi
-
- # Pull the macOS Cua image if not already present
- if ! lume ls | grep -q "macos-sequoia-cua"; then
- # Check available disk space
- IMAGE_SIZE_GB=30
- AVAILABLE_SPACE_KB=$(df -k $HOME | tail -1 | awk '{print $4}')
- AVAILABLE_SPACE_GB=$(($AVAILABLE_SPACE_KB / 1024 / 1024))
-
- echo "📊 The macOS Cua image will use approximately ${IMAGE_SIZE_GB}GB of disk space."
- echo " You currently have ${AVAILABLE_SPACE_GB}GB available on your system."
-
- # Prompt for confirmation
- read -p " Continue? [y]/n: " CONTINUE
- CONTINUE=${CONTINUE:-y}
-
- if [[ $CONTINUE =~ ^[Yy]$ ]]; then
- print_info "Pulling macOS Cua image (this may take a while)..."
-
- # Use caffeinate on macOS to prevent system sleep during the pull
- if command -v caffeinate &> /dev/null; then
- print_info "Using caffeinate to prevent system sleep during download..."
- caffeinate -i lume pull macos-sequoia-cua:latest
- else
- lume pull macos-sequoia-cua:latest
- fi
- else
- print_error "Installation cancelled."
- exit 1
- fi
- fi
-
- # Check if the VM is running
- print_info "Checking if the macOS Cua VM is running..."
- VM_RUNNING=$(lume ls | grep "macos-sequoia-cua" | grep "running" || echo "")
-
- if [ -z "$VM_RUNNING" ]; then
- print_info "Starting the macOS Cua VM in the background..."
- lume run macos-sequoia-cua:latest &
- # Wait a moment for the VM to initialize
- sleep 5
- print_success "VM started successfully."
- else
- print_success "macOS Cua VM is already running."
- fi
-fi
-
-# Create a convenience script to run the demo
-cat > "$DEMO_DIR/start_ui.sh" << EOF
-#!/bin/bash
-cd "$REPO_DIR"
-./scripts/run-docker-dev.sh run agent_ui_examples.py
-EOF
-chmod +x "$DEMO_DIR/start_ui.sh"
-
-print_success "Setup complete!"
-
-if [[ "$USE_CLOUD" == "true" ]]; then
- echo "☁️ Cua Cloud Sandbox setup complete!"
-else
- echo "🖥️ Cua Local VM setup complete!"
-fi
-
-echo "📝 Edit $ENV_FILE to update your API keys"
-echo "🖥️ Start the playground by running: $DEMO_DIR/start_ui.sh"
-
-# Start the demo automatically
-echo
-print_info "Starting the Cua Computer-Use Agent UI..."
-echo ""
-
-print_success "Cua Computer-Use Agent UI is now running at http://localhost:7860/"
-echo
-echo "🌐 Open your browser and go to: http://localhost:7860/"
-echo
-"$DEMO_DIR/start_ui.sh"
diff --git a/scripts/playground.sh b/scripts/playground.sh
deleted file mode 100755
index 811d6d9eb0..0000000000
--- a/scripts/playground.sh
+++ /dev/null
@@ -1,345 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "🚀 Launching Cua Computer-Use Agent UI..."
-
-# Save the original working directory
-ORIGINAL_DIR="$(pwd)"
-
-# Directories used by the script
-DEMO_DIR="$HOME/.cua-demo"
-VENV_DIR="$DEMO_DIR/venv"
-
-# Function to clean up on exit
-cleanup() {
- cd ~
- rm -rf "$TMP_DIR" 2>/dev/null || true
-}
-
-# Create a temporary directory for our work
-TMP_DIR=$(mktemp -d)
-cd "$TMP_DIR"
-trap cleanup EXIT
-
-# Ask user to choose between local macOS VMs or Cua Cloud Sandbox
-echo ""
-echo "Choose your Cua setup:"
-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 Sandbox setup
- echo ""
- echo "☁️ Setting up Cua Cloud Sandbox..."
- echo ""
-
- # Check if existing .env.local already has CUA_API_KEY (check current dir and demo dir)
- # Look for .env.local in the original working directory (before cd to temp dir)
- CURRENT_ENV_FILE="$ORIGINAL_DIR/.env.local"
- DEMO_ENV_FILE="$DEMO_DIR/.env.local"
-
- CUA_API_KEY=""
-
- # First check current directory
- if [[ -f "$CURRENT_ENV_FILE" ]] && grep -q "CUA_API_KEY=" "$CURRENT_ENV_FILE"; then
- EXISTING_CUA_KEY=$(grep "CUA_API_KEY=" "$CURRENT_ENV_FILE" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | xargs)
- if [[ -n "$EXISTING_CUA_KEY" && "$EXISTING_CUA_KEY" != "your_cua_api_key_here" && "$EXISTING_CUA_KEY" != "" ]]; then
- CUA_API_KEY="$EXISTING_CUA_KEY"
- fi
- fi
-
- # Then check demo directory if not found in current dir
- if [[ -z "$CUA_API_KEY" ]] && [[ -f "$DEMO_ENV_FILE" ]] && grep -q "CUA_API_KEY=" "$DEMO_ENV_FILE"; then
- EXISTING_CUA_KEY=$(grep "CUA_API_KEY=" "$DEMO_ENV_FILE" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | xargs)
- if [[ -n "$EXISTING_CUA_KEY" && "$EXISTING_CUA_KEY" != "your_cua_api_key_here" && "$EXISTING_CUA_KEY" != "" ]]; then
- CUA_API_KEY="$EXISTING_CUA_KEY"
- fi
- fi
-
- # If no valid API key found, prompt for one
- if [[ -z "$CUA_API_KEY" ]]; then
- echo "To use Cua Cloud Sandbox, you need to:"
- echo "1. Sign up at https://cua.ai"
- 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 Sandbox."
- exit 1
- fi
- fi
-
- USE_CLOUD=true
-
-elif [[ "$CHOICE" == "2" ]]; then
- # Local macOS VM setup
- echo ""
- echo "🖥️ Setting up local macOS VMs..."
-
- # 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 Sandbox instead (option 1)."
- exit 1
- fi
-
- # Check for macOS 15 (Sequoia) or newer
- 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 Sandbox instead (option 1)."
- exit 1
- fi
-
- USE_CLOUD=false
-
-else
- echo "❌ Invalid choice. Please run the script again and choose 1 or 2."
- exit 1
-fi
-
-# Install Lume if not already installed (only for local VMs)
-if [[ "$USE_CLOUD" == "false" ]]; then
- if ! command -v lume &> /dev/null; then
- echo "📦 Installing Lume CLI..."
- curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh | bash
-
- # Add lume to PATH for this session if it's not already there
- if ! command -v lume &> /dev/null; then
- export PATH="$PATH:$HOME/.local/bin"
- fi
- fi
-
- # Pull the macOS Cua image if not already present
- if ! lume ls | grep -q "macos-sequoia-cua"; then
- # Check available disk space
- IMAGE_SIZE_GB=30
- AVAILABLE_SPACE_KB=$(df -k $HOME | tail -1 | awk '{print $4}')
- AVAILABLE_SPACE_GB=$(($AVAILABLE_SPACE_KB / 1024 / 1024))
-
- echo "📊 The macOS Cua image will use approximately ${IMAGE_SIZE_GB}GB of disk space."
- echo " You currently have ${AVAILABLE_SPACE_GB}GB available on your system."
-
- # Prompt for confirmation
- read -p " Continue? [y]/n: " CONTINUE
- CONTINUE=${CONTINUE:-y}
-
- if [[ $CONTINUE =~ ^[Yy]$ ]]; then
- echo "📥 Pulling macOS Cua image (this may take a while)..."
- lume pull macos-sequoia-cua:latest
- else
- echo "❌ Installation cancelled."
- exit 1
- fi
- fi
-fi
-
-# Create a Python virtual environment
-echo "🐍 Setting up Python environment..."
-
-# Try different Python commands in order of preference
-PYTHON_CMD=""
-for cmd in python3.11 python3 python; do
- if command -v $cmd &> /dev/null; then
- # Check this Python version
- PYTHON_VERSION=$($cmd --version 2>&1 | cut -d" " -f2)
- PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
- PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
-
- if [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -eq 11 ]; then
- PYTHON_CMD=$cmd
- echo "✅ Found suitable Python: $cmd (version $PYTHON_VERSION)"
- break
- elif [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -gt 11 ]; then
- PYTHON_CMD=$cmd
- PYTHON_TOO_NEW=true
- echo "⚠️ Found $cmd (version $PYTHON_VERSION) but only Python 3.11.x is supported."
- break
- else
- echo "⚠️ Found $cmd (version $PYTHON_VERSION) but it's too old, trying next..."
- fi
- fi
-done
-
-# If no suitable Python was found, or if Python is too new, offer to exit or continue
-if [ -z "$PYTHON_CMD" ] || [ "$PYTHON_TOO_NEW" = true ]; then
- OS_TYPE=$(uname -s)
- if [ "$PYTHON_TOO_NEW" = true ]; then
- echo -e "\n❌ Python version $PYTHON_VERSION detected. Only Python 3.11.x is supported. Newer versions (e.g., 3.12+) are not yet supported."
- else
- if [[ "$OS_TYPE" == "Darwin" ]]; then
- echo -e "\n❌ python3.11 not found. To continue, we recommend running this:\n\n $ brew install [email protected]\n"
- elif [[ "$OS_TYPE" == "MINGW"* || "$OS_TYPE" == "CYGWIN"* || "$OS_TYPE" == "MSYS"* ]]; then
- echo -e "\n❌ python3.11 not found. Please install Python 3.11 from https://www.python.org/downloads/\n"
- else
- echo -e "\n❌ python3.11 not found. Please install Python 3.11 from your package manager or https://www.python.org/downloads/\n"
- fi
- fi
- while true; do
- echo "Would you like to exit so you can install Python 3.11, or continue anyway? (e = exit, c = continue): "
- read -n 1 -r PYTHON_CONT_CHOICE
- echo
- if [[ "$PYTHON_CONT_CHOICE" =~ ^[Ee]$ ]]; then
- echo "Exiting so you can install Python 3.11."
- exit 1
- elif [[ "$PYTHON_CONT_CHOICE" =~ ^[Cc]$ ]]; then
- echo "⚠️ Continuing without Python 3.11. Some features may not work as expected."
- break
- else
- echo "Please enter 'e' to exit or 'c' to continue."
- fi
- done
-fi
-
-# Create a virtual environment
-if [ ! -d "$VENV_DIR" ]; then
- $PYTHON_CMD -m venv "$VENV_DIR"
-fi
-
-# Activate the virtual environment
-source "$VENV_DIR/bin/activate"
-
-# Install required packages
-echo "📦 Updating Cua packages..."
-pip install -U pip setuptools wheel Cmake
-pip install -U cua-computer "cua-agent[all]"
-
-# Create a simple demo script
-mkdir -p "$DEMO_DIR"
-
-# Create .env.local file with API keys (only if it doesn't exist)
-if [[ ! -f "$DEMO_DIR/.env.local" ]]; then
- cat > "$DEMO_DIR/.env.local" << EOF
-# Uncomment and add your API keys here
-# OPENAI_API_KEY=your_openai_api_key_here
-# ANTHROPIC_API_KEY=your_anthropic_api_key_here
-CUA_API_KEY=your_cua_api_key_here
-EOF
- echo "📝 Created .env.local file with API key placeholders"
-else
- echo "📝 Found existing .env.local file - keeping your current settings"
-fi
-
-if [[ "$USE_CLOUD" == "true" ]]; then
- # Add Cua API key to .env.local if not already present
- if ! grep -q "CUA_API_KEY" "$DEMO_DIR/.env.local"; then
- echo "CUA_API_KEY=$CUA_API_KEY" >> "$DEMO_DIR/.env.local"
- echo "🔑 Added CUA_API_KEY to .env.local"
- elif grep -q "CUA_API_KEY=your_cua_api_key_here" "$DEMO_DIR/.env.local"; then
- # Update placeholder with actual key
- sed -i.bak "s/CUA_API_KEY=your_cua_api_key_here/CUA_API_KEY=$CUA_API_KEY/" "$DEMO_DIR/.env.local"
- echo "🔑 Updated CUA_API_KEY in .env.local"
- fi
-fi
-
-# Create a convenience script to run the demo
-cat > "$DEMO_DIR/start_ui.sh" << EOF
-#!/bin/bash
-source "$VENV_DIR/bin/activate"
-cd "$DEMO_DIR"
-python run_demo.py
-EOF
-chmod +x "$DEMO_DIR/start_ui.sh"
-
-echo "✅ Setup complete!"
-
-if [[ "$USE_CLOUD" == "true" ]]; then
- # Create run_demo.py for cloud sandbox
- cat > "$DEMO_DIR/run_demo.py" << 'EOF'
-import asyncio
-import os
-from pathlib import Path
-from dotenv import load_dotenv
-from computer import Computer
-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")
-
-# Check for required API keys
-cua_api_key = os.environ.get("CUA_API_KEY", "")
-if not cua_api_key:
- print("\n❌ CUA_API_KEY not found in .env.local file.")
- print("Please add your Cua API key to the .env.local file.")
- exit(1)
-
-openai_key = os.environ.get("OPENAI_API_KEY", "")
-anthropic_key = os.environ.get("ANTHROPIC_API_KEY", "")
-
-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 Sandbox...")
-print("📝 Edit .env.local to update your API keys")
-
-# Launch the Gradio UI and open it in the browser
-app = create_gradio_ui()
-app.launch(share=False, inbrowser=True)
-EOF
-else
- # Create run_demo.py for local macOS VMs
- cat > "$DEMO_DIR/run_demo.py" << 'EOF'
-import asyncio
-import os
-from pathlib import Path
-from dotenv import load_dotenv
-from computer import Computer
-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")
-
-# Try to load API keys from environment
-openai_key = os.environ.get("OPENAI_API_KEY", "")
-anthropic_key = os.environ.get("ANTHROPIC_API_KEY", "")
-
-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 local macOS VMs...")
-print("📝 Edit .env.local to update your API keys")
-
-# Launch the Gradio UI and open it in the browser
-app = create_gradio_ui()
-app.launch(share=False, inbrowser=True)
-EOF
-fi
-
-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"
-
-# Check if the VM is running (only for local setup)
-if [[ "$USE_CLOUD" == "false" ]]; then
- echo "🔍 Checking if the macOS Cua VM is running..."
- VM_RUNNING=$(lume ls | grep "macos-sequoia-cua" | grep "running" || echo "")
-
- if [ -z "$VM_RUNNING" ]; then
- echo "🚀 Starting the macOS Cua VM in the background..."
- lume run macos-sequoia-cua:latest &
- # Wait a moment for the VM to initialize
- sleep 5
- echo "✅ VM started successfully."
- else
- echo "✅ macOS Cua VM is already running."
- fi
-fi
-
-# Ask if the user wants to start the demo now
-echo
-read -p "Would you like to start the Cua Computer-Use Agent UI now? (y/n) " -n 1 -r
-echo
-if [[ $REPLY =~ ^[Yy]$ ]]; then
- echo "🚀 Starting the Cua Computer-Use Agent UI..."
- echo ""
- "$DEMO_DIR/start_ui.sh"
-fi
diff --git a/scripts/run-docker-dev.sh b/scripts/run-docker-dev.sh
deleted file mode 100755
index 63ba3238d9..0000000000
--- a/scripts/run-docker-dev.sh
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-
-# Colors for output
-GREEN='\033[0;32m'
-BLUE='\033[0;34m'
-RED='\033[0;31m'
-NC='\033[0m' # No Color
-
-# Print with color
-print_info() {
- echo -e "${BLUE}==> $1${NC}"
-}
-
-print_success() {
- echo -e "${GREEN}==> $1${NC}"
-}
-
-print_error() {
- echo -e "${RED}==> $1${NC}"
-}
-
-# Docker image name
-IMAGE_NAME="cua-dev-image"
-CONTAINER_NAME="cua-dev-container"
-PLATFORM="linux/arm64"
-
-# Detect platform based on architecture
-arch=$(uname -m)
-
-if [[ $arch == x86_64* ]]; then
- PLATFORM="linux/amd64"
- print_info "X64 Architecture detected, using platform: ${PLATFORM}"
-elif [[ $arch == i*86 ]]; then
- PLATFORM="linux/386"
- print_info "X32 Architecture detected, using platform: ${PLATFORM}"
-elif [[ $arch == arm* ]] || [[ $arch == aarch64 ]]; then
- PLATFORM="linux/arm64"
- print_info "ARM Architecture detected, using platform: ${PLATFORM}"
-else
- # Fallback to amd64 for unknown architectures
- PLATFORM="linux/amd64"
- print_info "Unknown architecture ($arch), defaulting to platform: ${PLATFORM}"
-fi
-
-# Environment variables
-PYTHONPATH="/app/libs/python/core:/app/libs/python/computer:/app/libs/python/agent:/app/libs/python/som:/app/libs/python/computer-server:/app/libs/python/mcp-server"
-
-# Check if Docker is installed
-if ! command -v docker &> /dev/null; then
- print_error "Docker is not installed. Please install Docker first."
- exit 1
-fi
-
-# Command options
-case "$1" in
- build)
- print_info "Building the development Docker image..."
- print_info "This will install all dependencies but won't include source code"
- docker build -f Dockerfile --platform=${PLATFORM} -t ${IMAGE_NAME} .
- print_success "Development Docker image built successfully!"
- ;;
-
- run)
- # Check for interactive flag
- if [ "$2" == "--interactive" ]; then
- print_info "Running the development Docker container with interactive shell..."
- print_info "Mounting source code from host"
- print_info "Connecting to host.docker.internal:7777"
-
- docker run -it --rm \
- --platform=${PLATFORM} \
- --name ${CONTAINER_NAME} \
- -v "$(pwd):/app" \
- -e PYTHONPATH=${PYTHONPATH} \
- -e DISPLAY=${DISPLAY:-:0} \
- -p 7860:7860 \
- ${IMAGE_NAME} bash
- else
- # Run the specified example
- if [ -z "$2" ]; then
- print_error "Please specify an example file, e.g., ./run-docker-dev.sh run computer_examples.py"
- exit 1
- fi
- print_info "Running example: $2"
- print_info "Connecting to host.docker.internal:7777"
-
- docker run -it --rm \
- --platform=${PLATFORM} \
- --name ${CONTAINER_NAME} \
- -v "$(pwd):/app" \
- -e PYTHONPATH=${PYTHONPATH} \
- -e DISPLAY=${DISPLAY:-:0} \
- -p 7860:7860 \
- ${IMAGE_NAME} python "/app/examples/$2"
- fi
- ;;
-
- stop)
- print_info "Stopping any running containers..."
- docker stop ${CONTAINER_NAME} 2>/dev/null || true
- print_success "Done!"
- ;;
-
- *)
- echo "Usage: $0 {build|run [--interactive] [filename]|stop}"
- echo ""
- echo "Commands:"
- echo " build Build the development Docker image with dependencies"
- echo " run [example_filename] Run the specified example file in the container"
- echo " run --interactive Run the container with mounted code and get an interactive shell"
- echo " stop Stop the container"
- exit 1
-esac
-
-exit 0
\ No newline at end of file
diff --git a/scripts/typescript-typecheck.js b/scripts/typescript-typecheck.js
deleted file mode 100644
index 76b7a27158..0000000000
--- a/scripts/typescript-typecheck.js
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env node
-const { execSync } = require('child_process');
-const { readFileSync, writeFileSync, existsSync } = require('fs');
-const { join } = require('path');
-
-// Allow pnpm version mismatch (root uses 9.x, workspace packages declare 10.x)
-const env = { ...process.env, COREPACK_ENABLE_STRICT: '0' };
-
-// Save lockfile before install so we can restore it after — pnpm install
-// may rewrite the lockfile format when the pnpm version differs, which
-// causes pre-commit to report "files were modified by this hook".
-const lockfilePath = join(__dirname, '..', 'libs', 'typescript', 'pnpm-lock.yaml');
-const lockfileBefore = existsSync(lockfilePath) ? readFileSync(lockfilePath) : null;
-
-try {
- execSync('pnpm -C libs/typescript install', { stdio: 'inherit', env });
- // Build core first so its type declarations (dist/) are available
- // for dependent packages like @trycua/computer and @trycua/agent
- execSync('pnpm -C libs/typescript/core run build', { stdio: 'inherit', env });
- execSync('pnpm -C libs/typescript -r run typecheck', { stdio: 'inherit', env });
-} catch (err) {
- process.exit(1);
-} finally {
- // Restore lockfile to avoid pre-commit "files were modified" failure
- if (lockfileBefore !== null) {
- writeFileSync(lockfilePath, lockfileBefore);
- }
-}
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py
new file mode 100644
index 0000000000..c210facce6
--- /dev/null
+++ b/tests/integration/__init__.py
@@ -0,0 +1 @@
+"""Integration tests."""
diff --git a/tests/integration/sandbox_cli/__init__.py b/tests/integration/sandbox_cli/__init__.py
new file mode 100644
index 0000000000..cc198f5e21
--- /dev/null
+++ b/tests/integration/sandbox_cli/__init__.py
@@ -0,0 +1 @@
+"""Sandbox CLI integration tests."""
diff --git a/examples/sandboxes-cli/conftest.py b/tests/integration/sandbox_cli/conftest.py
similarity index 100%
rename from examples/sandboxes-cli/conftest.py
rename to tests/integration/sandbox_cli/conftest.py
diff --git a/examples/sandboxes-cli/test_android_cloud_vm.py b/tests/integration/sandbox_cli/test_android_cloud_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_android_cloud_vm.py
rename to tests/integration/sandbox_cli/test_android_cloud_vm.py
index 73b827bbf8..fae7750ae5 100644
--- a/examples/sandboxes-cli/test_android_cloud_vm.py
+++ b/tests/integration/sandbox_cli/test_android_cloud_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name>
-Mirrors examples/sandboxes/test_android_cloud_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_android_cloud_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires CUA_API_KEY. No Android SDK or emulator needed.
"""
diff --git a/examples/sandboxes-cli/test_android_local_cdp.py b/tests/integration/sandbox_cli/test_android_local_cdp.py
similarity index 100%
rename from examples/sandboxes-cli/test_android_local_cdp.py
rename to tests/integration/sandbox_cli/test_android_local_cdp.py
diff --git a/examples/sandboxes-cli/test_android_local_vm.py b/tests/integration/sandbox_cli/test_android_local_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_android_local_vm.py
rename to tests/integration/sandbox_cli/test_android_local_vm.py
index 3b652faccf..f2386cdd59 100644
--- a/examples/sandboxes-cli/test_android_local_vm.py
+++ b/tests/integration/sandbox_cli/test_android_local_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_android_local_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_android_local_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires Android SDK (emulator + adb) to be installed.
"""
diff --git a/examples/sandboxes-cli/test_linux_cloud_container.py b/tests/integration/sandbox_cli/test_linux_cloud_container.py
similarity index 95%
rename from examples/sandboxes-cli/test_linux_cloud_container.py
rename to tests/integration/sandbox_cli/test_linux_cloud_container.py
index 4773f13233..40c686ffd6 100644
--- a/examples/sandboxes-cli/test_linux_cloud_container.py
+++ b/tests/integration/sandbox_cli/test_linux_cloud_container.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name>
-Mirrors examples/sandboxes/test_linux_cloud_container.py but exercises the
+Mirrors tests/integration/sandbox_sdk/test_linux_cloud_container.py but exercises the
CLI launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires CUA_API_KEY environment variable.
"""
diff --git a/examples/sandboxes-cli/test_linux_cloud_vm.py b/tests/integration/sandbox_cli/test_linux_cloud_vm.py
similarity index 95%
rename from examples/sandboxes-cli/test_linux_cloud_vm.py
rename to tests/integration/sandbox_cli/test_linux_cloud_vm.py
index ef5d15476a..2217bf54fe 100644
--- a/examples/sandboxes-cli/test_linux_cloud_vm.py
+++ b/tests/integration/sandbox_cli/test_linux_cloud_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name>
-Mirrors examples/sandboxes/test_linux_cloud_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_linux_cloud_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires CUA_API_KEY environment variable.
"""
diff --git a/examples/sandboxes-cli/test_linux_local_container.py b/tests/integration/sandbox_cli/test_linux_local_container.py
similarity index 96%
rename from examples/sandboxes-cli/test_linux_local_container.py
rename to tests/integration/sandbox_cli/test_linux_local_container.py
index c484f9adb9..dfab8052e1 100644
--- a/examples/sandboxes-cli/test_linux_local_container.py
+++ b/tests/integration/sandbox_cli/test_linux_local_container.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_linux_local_container.py but exercises the
+Mirrors tests/integration/sandbox_sdk/test_linux_local_container.py but exercises the
CLI launch path and persistent state tracking instead of Sandbox.ephemeral().
"""
diff --git a/examples/sandboxes-cli/test_linux_local_registry_vm.py b/tests/integration/sandbox_cli/test_linux_local_registry_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_linux_local_registry_vm.py
rename to tests/integration/sandbox_cli/test_linux_local_registry_vm.py
index ac50a22595..fc9cca7782 100644
--- a/examples/sandboxes-cli/test_linux_local_registry_vm.py
+++ b/tests/integration/sandbox_cli/test_linux_local_registry_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_linux_local_registry_vm.py but exercises the
+Mirrors tests/integration/sandbox_sdk/test_linux_local_registry_vm.py but exercises the
CLI launch path. Note: the SDK example uses explicit TartRuntime(); the CLI
auto-selects the runtime from the OCI manifest. On macOS with Tart installed,
pass --runtime tart to use TartRuntime instead of QEMU.
diff --git a/examples/sandboxes-cli/test_linux_local_vm.py b/tests/integration/sandbox_cli/test_linux_local_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_linux_local_vm.py
rename to tests/integration/sandbox_cli/test_linux_local_vm.py
index 655139d872..1ab5831e39 100644
--- a/examples/sandboxes-cli/test_linux_local_vm.py
+++ b/tests/integration/sandbox_cli/test_linux_local_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_linux_local_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_linux_local_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
"""
diff --git a/examples/sandboxes-cli/test_macos_cloud_vm.py b/tests/integration/sandbox_cli/test_macos_cloud_vm.py
similarity index 95%
rename from examples/sandboxes-cli/test_macos_cloud_vm.py
rename to tests/integration/sandbox_cli/test_macos_cloud_vm.py
index ada27958a8..a67592e2b8 100644
--- a/examples/sandboxes-cli/test_macos_cloud_vm.py
+++ b/tests/integration/sandbox_cli/test_macos_cloud_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name>
-Mirrors examples/sandboxes/test_macos_cloud_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_macos_cloud_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires CUA_API_KEY. Works on any host OS — no Mac needed.
"""
diff --git a/examples/sandboxes-cli/test_macos_local_registry_vm.py b/tests/integration/sandbox_cli/test_macos_local_registry_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_macos_local_registry_vm.py
rename to tests/integration/sandbox_cli/test_macos_local_registry_vm.py
index 6249f71e4b..c0354c8f2a 100644
--- a/examples/sandboxes-cli/test_macos_local_registry_vm.py
+++ b/tests/integration/sandbox_cli/test_macos_local_registry_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_macos_local_registry_vm.py but exercises the
+Mirrors tests/integration/sandbox_sdk/test_macos_local_registry_vm.py but exercises the
CLI launch path. The registry ref is passed to Image.from_registry(), which
fetches the OCI manifest to auto-infer os_type=macos and selects LumeRuntime.
"""
diff --git a/examples/sandboxes-cli/test_macos_local_vm.py b/tests/integration/sandbox_cli/test_macos_local_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_macos_local_vm.py
rename to tests/integration/sandbox_cli/test_macos_local_vm.py
index 40d71a157e..186385564a 100644
--- a/examples/sandboxes-cli/test_macos_local_vm.py
+++ b/tests/integration/sandbox_cli/test_macos_local_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_macos_local_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_macos_local_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires the Lume CLI on a macOS host.
"""
diff --git a/examples/sandboxes-cli/test_windows_cloud_vm.py b/tests/integration/sandbox_cli/test_windows_cloud_vm.py
similarity index 95%
rename from examples/sandboxes-cli/test_windows_cloud_vm.py
rename to tests/integration/sandbox_cli/test_windows_cloud_vm.py
index e8e67f011a..f1b3a501bf 100644
--- a/examples/sandboxes-cli/test_windows_cloud_vm.py
+++ b/tests/integration/sandbox_cli/test_windows_cloud_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name>
-Mirrors examples/sandboxes/test_windows_cloud_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_windows_cloud_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires CUA_API_KEY. Works on any host OS — no Windows needed.
"""
diff --git a/examples/sandboxes-cli/test_windows_local_vm.py b/tests/integration/sandbox_cli/test_windows_local_vm.py
similarity index 96%
rename from examples/sandboxes-cli/test_windows_local_vm.py
rename to tests/integration/sandbox_cli/test_windows_local_vm.py
index 2d63d73167..e78d643f87 100644
--- a/examples/sandboxes-cli/test_windows_local_vm.py
+++ b/tests/integration/sandbox_cli/test_windows_local_vm.py
@@ -4,7 +4,7 @@
# parse name from JSON output, connect with SDK, run assertions
cua sb delete <name> --local
-Mirrors examples/sandboxes/test_windows_local_vm.py but exercises the CLI
+Mirrors tests/integration/sandbox_sdk/test_windows_local_vm.py but exercises the CLI
launch path and persistent state tracking instead of Sandbox.ephemeral().
Requires a Windows host or QEMU with a Windows image.
"""
diff --git a/tests/integration/sandbox_sdk/__init__.py b/tests/integration/sandbox_sdk/__init__.py
new file mode 100644
index 0000000000..d6d9f6a199
--- /dev/null
+++ b/tests/integration/sandbox_sdk/__init__.py
@@ -0,0 +1 @@
+"""Sandbox SDK integration tests."""
diff --git a/examples/sandboxes/test_android_cloud_vm.py b/tests/integration/sandbox_sdk/test_android_cloud_vm.py
similarity index 100%
rename from examples/sandboxes/test_android_cloud_vm.py
rename to tests/integration/sandbox_sdk/test_android_cloud_vm.py
diff --git a/examples/sandboxes/test_android_local_gym_pwa.py b/tests/integration/sandbox_sdk/test_android_local_gym_pwa.py
similarity index 100%
rename from examples/sandboxes/test_android_local_gym_pwa.py
rename to tests/integration/sandbox_sdk/test_android_local_gym_pwa.py
diff --git a/examples/sandboxes/test_android_local_vm.py b/tests/integration/sandbox_sdk/test_android_local_vm.py
similarity index 100%
rename from examples/sandboxes/test_android_local_vm.py
rename to tests/integration/sandbox_sdk/test_android_local_vm.py
diff --git a/examples/sandboxes/test_linux_cloud_container.py b/tests/integration/sandbox_sdk/test_linux_cloud_container.py
similarity index 100%
rename from examples/sandboxes/test_linux_cloud_container.py
rename to tests/integration/sandbox_sdk/test_linux_cloud_container.py
diff --git a/examples/sandboxes/test_linux_cloud_vm.py b/tests/integration/sandbox_sdk/test_linux_cloud_vm.py
similarity index 100%
rename from examples/sandboxes/test_linux_cloud_vm.py
rename to tests/integration/sandbox_sdk/test_linux_cloud_vm.py
diff --git a/examples/sandboxes/test_linux_local_container.py b/tests/integration/sandbox_sdk/test_linux_local_container.py
similarity index 100%
rename from examples/sandboxes/test_linux_local_container.py
rename to tests/integration/sandbox_sdk/test_linux_local_container.py
diff --git a/examples/sandboxes/test_linux_local_osworld_vm.py b/tests/integration/sandbox_sdk/test_linux_local_osworld_vm.py
similarity index 100%
rename from examples/sandboxes/test_linux_local_osworld_vm.py
rename to tests/integration/sandbox_sdk/test_linux_local_osworld_vm.py
diff --git a/examples/sandboxes/test_linux_local_registry_vm.py b/tests/integration/sandbox_sdk/test_linux_local_registry_vm.py
similarity index 100%
rename from examples/sandboxes/test_linux_local_registry_vm.py
rename to tests/integration/sandbox_sdk/test_linux_local_registry_vm.py
diff --git a/examples/sandboxes/test_linux_local_vm.py b/tests/integration/sandbox_sdk/test_linux_local_vm.py
similarity index 100%
rename from examples/sandboxes/test_linux_local_vm.py
rename to tests/integration/sandbox_sdk/test_linux_local_vm.py
diff --git a/examples/sandboxes/test_macos_cloud_vm.py b/tests/integration/sandbox_sdk/test_macos_cloud_vm.py
similarity index 100%
rename from examples/sandboxes/test_macos_cloud_vm.py
rename to tests/integration/sandbox_sdk/test_macos_cloud_vm.py
diff --git a/examples/sandboxes/test_macos_local_registry_vm.py b/tests/integration/sandbox_sdk/test_macos_local_registry_vm.py
similarity index 100%
rename from examples/sandboxes/test_macos_local_registry_vm.py
rename to tests/integration/sandbox_sdk/test_macos_local_registry_vm.py
diff --git a/examples/sandboxes/test_macos_local_vm.py b/tests/integration/sandbox_sdk/test_macos_local_vm.py
similarity index 100%
rename from examples/sandboxes/test_macos_local_vm.py
rename to tests/integration/sandbox_sdk/test_macos_local_vm.py
diff --git a/examples/sandboxes/test_windows_cloud_vm.py b/tests/integration/sandbox_sdk/test_windows_cloud_vm.py
similarity index 100%
rename from examples/sandboxes/test_windows_cloud_vm.py
rename to tests/integration/sandbox_sdk/test_windows_cloud_vm.py
diff --git a/examples/sandboxes/test_windows_local_vm.py b/tests/integration/sandbox_sdk/test_windows_local_vm.py
similarity index 100%
rename from examples/sandboxes/test_windows_local_vm.py
rename to tests/integration/sandbox_sdk/test_windows_local_vm.py
diff --git a/uv.lock b/uv.lock
index 7a2506e3d5..adc9d53a88 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1340,7 +1340,6 @@ docs-scripts = [
{ name = "pydantic", specifier = ">=2.0.0" },
{ name = "sentence-transformers", specifier = ">=2.2.0" },
]
-examples = []
test = [
{ name = "aioresponses", specifier = ">=0.7.4" },
{ name = "pytest", specifier = ">=8.0.0" },